From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796120947; b=yuGVkB4ehmvJqjHwV2zTWMRUYzSc9kDrCUgcQxsk1iaGDgep0a9kM6N0j+cOOrZOz5Bn WxJ5sv/Oi7Tlu+Pf6K2GLqidwBAbH5D0wQbr6Jx4g/u06+2NnN/Jl5GKMxIo+w4+bTHOm VuAm8W0Li/uuBqlHMZ69EIKnqtPmzYLSm1AZSslL2XrwECqnRib0isJDL1ANdRpIK0OHG gW8vtfS4mZrn5ILfqp5IqLDloF1HTs3JOYHB6UXvIH0HYmHCY1sOCXis8DHXtsG6cYaMO 8blzXT4c+QvxAzt4uxJ0JikUbyzv9EhJyCjLIr/XQDXniEm+o5TNnPEmu5BZGgH1pVA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796120947; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=7ElPXH0mt2w+9chTTQZ0Yo/OXxZRdwjdAac6IWZZVL8=; b=xK3VXKS8a0omzUvx02wJaTdsh+7ccNdNvrxEdtqhl2jGXiqcgTgj9pdUaylDO9Q8p8kt m6FoKyMLsSqhoMJNIL5h/+n8wPILvY6lNSRE0sGlxoKGCbZ47L/tWRpYDiDo6KPsMVuXn fk7r9xnd6JUTVqfE8Xpr8O9Twy/5kA7p+Q83nQxvyexXYR/JM8OiKH5KYelNf8qSfWmsG bYLNepLaVJCc0QG1c9btHiqQNA1IXJIDv66q0u8Wg/R+LV+9r/qNfI1+ZNN8fTz8b35Pi i8lfNbzx+bAC3ecSreXevpEHniiNcVe/k8Hr44DnlH2svg3NIkd4telR1jE1eURpu2A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="SB/UXTHA"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42063606A31A; Tue, 1 Dec 2026 10:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SB/UXTHA Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91F861F000C1; Tue, 1 Dec 2026 10:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796120946; bh=7ElPXH0mt2w+9chTTQZ0Yo/OXxZRdwjdAac6IWZZVL8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=SB/UXTHA5uU3jTfTTaFd7bItmwYHSIGxXE7HCLI1EdCSNUoMA5Ygqn4SmsxJZ/Nif nuU896fALhj1YRSlAFAMu+d6qNDWNQD0GFqhqhyYPSkaTE1crpC2PskC4mC9Yx8GOB E/4at2yEVZGI6cYHjMQ8WwQkhFShj4tNzBTFV/WjaJKFAaYAn3a5cRkIvX9flkIii9 yy4ndHDCL2e0XVTlU6hPTl509S5yqBl9llc0A2Ppj5sp18DEBwujo4fOK7sHQjfBCv olLdwPKiuTPocCrZOYDwfTs8IKrgHxkiZV6/7qqKRSlt13j1j9KzWfeOiafKK6xSMw jvdRlLqsmZkGw== Message-ID: <45f32b99-e7ca-4cb6-bd43-677f1ab6c225@kernel.org> Date: Tue, 1 Dec 2026 11:29:01 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] selftests/bpf: Add callx tests for PPC64 To: Shivani Nittor , linuxppc-dev@lists.ozlabs.org Cc: maddy@linux.ibm.com, hbathini@linux.ibm.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, shuah@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <20261130070307.126765-1-shivani@linux.ibm.com> <20261130070307.126765-2-shivani@linux.ibm.com> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20261130070307.126765-2-shivani@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 30/11/2026 à 08:03, Shivani Nittor a écrit : > Extend the existing BPF CALLX selftests to support PPC64. > > Enable the callx_func_ptr_map and callx_rodata_lskel tests for PPC64 > by adding a PPC64 ELF ABI v2 condition to their architecture checks. > The gate uses (defined(__powerpc64__) && defined(_CALL_ELF) && > _CALL_ELF == 2) to ensure tests run only on ELF ABI v2 builds, > where JIT CALLX support is enabled, and skip cleanly on ELF ABI v1 > builds. But this check ensures only that the application is built with ELF ABI v2, not that kernel was built with ELF ABI v2. > > Also enable verifier_callx and verifier_callx_rodata for the PPC64 > BPF target by adding __TARGET_ARCH_powerpc to their architecture > checks. This allows the verifier tests to exercise indirect calls > through function pointers, including pointers stored in read-only > data, for the PPC64 BPF target. > > Signed-off-by: Shivani Nittor > --- > tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c | 3 ++- > tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c | 3 ++- > tools/testing/selftests/bpf/progs/verifier_callx.c | 3 ++- > tools/testing/selftests/bpf/progs/verifier_callx_rodata.c | 3 ++- > 4 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c b/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c > index cc63b84e4d94..ddb488708b94 100644 > --- a/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c > +++ b/tools/testing/selftests/bpf/prog_tests/callx_func_ptr_map.c > @@ -9,7 +9,8 @@ > #include > > #if defined(__x86_64__) || defined(__aarch64__) || \ > - (defined(__riscv) && __riscv_xlen == 64) > + (defined(__riscv) && __riscv_xlen == 64) || \ > + (defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2) > > #define CALLEE_INSN 6 > #define DATA 0x1234 > diff --git a/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c b/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c > index f6ef67c3141e..80f029f358e1 100644 > --- a/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c > +++ b/tools/testing/selftests/bpf/prog_tests/callx_rodata_lskel.c > @@ -4,7 +4,8 @@ > #include "callx_rodata.lskel.h" > > #if defined(__x86_64__) || defined(__aarch64__) || \ > - (defined(__riscv) && __riscv_xlen == 64) > + (defined(__riscv) && __riscv_xlen == 64) || \ > + (defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2) > > static void run(int prog_fd, int expected, const char *name) > { > diff --git a/tools/testing/selftests/bpf/progs/verifier_callx.c b/tools/testing/selftests/bpf/progs/verifier_callx.c > index a12bc421e75c..b99eab7b3725 100644 > --- a/tools/testing/selftests/bpf/progs/verifier_callx.c > +++ b/tools/testing/selftests/bpf/progs/verifier_callx.c > @@ -8,7 +8,8 @@ > > /* gcc doesn't support indirect calls */ > #if defined(__clang__) && (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \ > - (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) > + (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) || \ > + defined(__TARGET_ARCH_powerpc)) > > #define CALLX_INSN(DST, SRC, OFF, IMM) \ > BPF_RAW_INSN(BPF_JMP | BPF_CALL | BPF_X, DST, SRC, OFF, IMM) > diff --git a/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c b/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c > index 6cf58ca9ac5b..56be21e7bbcd 100644 > --- a/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c > +++ b/tools/testing/selftests/bpf/progs/verifier_callx_rodata.c > @@ -8,7 +8,8 @@ > > /* gcc doesn't support indirect calls */ > #if defined(__clang__) && (defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64) || \ > - (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64)) > + (defined(__TARGET_ARCH_riscv) && __riscv_xlen == 64) || \ > + defined(__TARGET_ARCH_powerpc)) > > /* > * Read-only data with pointers to functions, where the compiler puts tables