From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D7706C79FA1 for ; Tue, 8 Sep 2026 14:41:38 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4hfRTY0Zbyz2y8p; Wed, 09 Sep 2026 00:41:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2600:3c0a:e001:78e:0:1991:8:25" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788878496; cv=none; b=KZHHcb1hDDPbvV4nLw0u1K8ndca5ZFZJG5fzXOD1Mrr67MYTgOY4QnWmHaPmoc8+nFNTYv89iIy5mm64wLT+GY3eUR6cSIDkhYoAFQEzDBJcpSptJNk4TdmRRPtfocr/N6M8eiT8Ra77UyDra4h8bPmnfNqIjUTNrLPyGMjDqFWod6m8it1knZkhaasAYEi4KrDgwguuuPLeRu98zNbP154Oy5ThU8EogNSUPoXUgrA2e/HqPgm7fdb4cX+mb43ej1vqHD+vsoLZKXN/mZprlubLu12NMExaOd7ZC33hEEzRetZLXqo+4NjiBBLe/PHAQGT7aXNBQ3MDPLfIVwY/og== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1788878496; c=relaxed/relaxed; bh=UDv2ulwj8noxjdMQEqKxpUauXEITpLasbQE7qAV2OQU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kLg3R6mkoPBc/AcEqtOUcOaXAyFjTGIv1NeCFLRegDjF8EmjDQmQgLyG6e1t1+cH29L0IjHXotpIimuW//2p5ttcOGv1JorxhHvvjVRkr5QZ5W4X5bVe4Ff2t1aMNyiE3cG9Z4vihY3XnsPzyhR3Fh8QVwfW/H28QS1pcB15nmXVWqciUWrGS9HTTg6dc9jWLkjRa+oMsqh8qjd0Q3eD9s3vXgDtA2qN+YIY2+EBQ/A0UH6FKlB8TOFRemsFSr1DNL75Gmzd4LZINIV1ztANHOvWsqu7r7Mo6cWMnhsBM0HEXqGQJ2Ko95MGqniiQntRQddtSi506mLiGFxCuOZ9UQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; spf=pass (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=chleroy@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org; envelope-from=chleroy@kernel.org; receiver=lists.ozlabs.org) Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4hfRTW51hqz2xYh for ; Wed, 09 Sep 2026 00:41:35 +1000 (AEST) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4A81C4360A; Tue, 8 Sep 2026 14:41:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A83611F00A3A; Tue, 8 Sep 2026 14:41:14 +0000 (UTC) Message-ID: <7c9f6ec3-5886-41ea-8803-d81019321d29@kernel.org> Date: Tue, 8 Sep 2026 16:41:09 +0200 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 17/24] powerpc/vdso: Enable the vdsocheck tool To: =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andy Lutomirski , Vincenzo Frascino , Kees Cook , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Richard Weinberger , Anton Ivanov , Johannes Berg , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Huacai Chen , WANG Xuerui , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Bogendoerfer , Miguel Ojeda , Alex Gaynor , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Thomas Gleixner , Boqun Feng , Nicolas Schier Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-mm@kvack.org, linux-um@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, linux-s390@vger.kernel.org, linux-mips@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Jan Stancek , Arnaldo Carvalho de Melo , Alexandre Ghiti References: <20260908-vdso-absolute-reloc-v5-0-3a93791af1cf@linutronix.de> <20260908-vdso-absolute-reloc-v5-17-3a93791af1cf@linutronix.de> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20260908-vdso-absolute-reloc-v5-17-3a93791af1cf@linutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 08/09/2026 à 08:33, Thomas Weißschuh a écrit : > The vdsocheck tool validates the object files and final .so library. > It can detect if the compiler created relocations which are incompatible > with the vDSO which need to be worked around. > > Wire it up for the architecture. > > Signed-off-by: Thomas Weißschuh > --- > arch/powerpc/Kconfig | 1 + > arch/powerpc/kernel/vdso/Makefile | 4 ++-- > lib/vdso/check/vdsocheck.rs | 27 +++++++++++++++++++++++++++ > 3 files changed, 30 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index 2580e27e4328..f19e225cfc5c 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -330,6 +330,7 @@ config PPC > select SYSCTL_EXCEPTION_TRACE > select THREAD_INFO_IN_TASK > select TRACE_IRQFLAGS_SUPPORT > + select VDSO_CHECK > select VDSO_DATASTORE > select VDSO_GETRANDOM > # > diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile > index 368759f81708..ca20b91b4373 100644 > --- a/arch/powerpc/kernel/vdso/Makefile > +++ b/arch/powerpc/kernel/vdso/Makefile > @@ -81,9 +81,9 @@ targets += vdso64.lds > CPPFLAGS_vdso64.lds += -P -C > > # link rule for the .so file, .lds has to be first > -$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/vgetrandom-32.o $(obj)/crtsavres-32.o FORCE > +$(obj)/vdso32.so.dbg: $(obj)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday-32.o $(obj)/vgetrandom-32.o $(obj)/crtsavres-32.o $(vdsocheck) FORCE > $(call if_changed,vdso32ld_and_check) > -$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o $(obj)/vgetrandom-64.o FORCE > +$(obj)/vdso64.so.dbg: $(obj)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday-64.o $(obj)/vgetrandom-64.o $(vdsocheck) FORCE > $(call if_changed,vdso64ld_and_check) > > # assembly rules for the .S files > diff --git a/lib/vdso/check/vdsocheck.rs b/lib/vdso/check/vdsocheck.rs > index e45a1fbc6829..429bdcd65818 100644 > --- a/lib/vdso/check/vdsocheck.rs > +++ b/lib/vdso/check/vdsocheck.rs > @@ -69,6 +69,33 @@ fn allowed_relocations_for_machine(machine: u16) -> Option ..Default::default() > } > .into(), > + bindings::EM_PPC => AllowedRelocations { > + in_object_file: &[ > + bindings::R_PPC_REL24, Not sure this is correct, see commit 42ed6d56ade2 ("powerpc/vdso: Block R_PPC_REL24 relocations") > + bindings::R_PPC_REL14, > + bindings::R_PPC_REL32, > + bindings::R_PPC_REL16, > + bindings::R_PPC_REL16_LO, > + bindings::R_PPC_REL16_HI, > + bindings::R_PPC_REL16_HA, > + ], > + ..Default::default() > + } > + .into(), > + bindings::EM_PPC64 => AllowedRelocations { > + in_object_file: &[ > + bindings::R_PPC64_REL24, Not sure this is correct, see commit 42ed6d56ade2 ("powerpc/vdso: Block R_PPC_REL24 relocations") > + bindings::R_PPC64_REL14, > + bindings::R_PPC64_REL32, > + bindings::R_PPC64_REL64, > + bindings::R_PPC64_REL16, > + bindings::R_PPC64_REL16_LO, > + bindings::R_PPC64_REL16_HI, > + bindings::R_PPC64_REL16_HA, > + ], > + ..Default::default() > + } > + .into(), > _ => None, > } > } >