From: Sean Christopherson <seanjc@google.com>
To: Aqib Faruqui <aqibaf@amazon.com>
Cc: Kees Cook <kees@kernel.org>,
Andy Lutomirski <luto@amacapital.net>,
Will Drewry <wad@chromium.org>, Shuah Khan <shuah@kernel.org>,
Christian Brauner <brauner@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
nh-open-source@amazon.com
Subject: Re: [PATCH 1/9] KVM: selftests: Add pidfd_open syscall number fallback
Date: Fri, 29 Aug 2025 15:52:15 -0700 [thread overview]
Message-ID: <aLIvH06e1XDFz9lh@google.com> (raw)
In-Reply-To: <20250829142556.72577-2-aqibaf@amazon.com>
Subject says KVM, but I don't see anything KVM related in here. I don't think
any of the KVM selftests even use pidfd_open() directly.
On Fri, Aug 29, 2025, Aqib Faruqui wrote:
> The kselftest-harness uses pidfd_open() for test timeout handling, but
> non-glibc C library headers may not define this syscall number.
>
> Add architecture-specific fallback definitions to pidfd.h, including
> support for Alpha (544) and other architectures (434). Update
> kselftest_harness.h to include pidfd.h for the syscall definitions.
This should probably be split into two patches:
selftests: harness: Include pidfd.h to get syscall definitions from tools/
and
selftests/pidfd: Add architecture-specific fallback definitions for pidfd_open
as there are two distinct changes here. And kselftest_harness.h also tends to be
a finicky little bugger, isolating changes to that file is almost always a good
idea, no matter how trivial they might seem.
> Signed-off-by: Aqib Faruqui <aqibaf@amazon.com>
> ---
> tools/testing/selftests/kselftest_harness.h | 1 +
> tools/testing/selftests/pidfd/pidfd.h | 4 ++++
> 2 files changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 2925e47db..1dd3e5a1b 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -69,6 +69,7 @@
> #include <unistd.h>
>
> #include "kselftest.h"
> +#include "pidfd/pidfd.h"
>
> #define TEST_TIMEOUT_DEFAULT 30
>
> diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftests/pidfd/pidfd.h
> index f87993def..c373ff18e 100644
> --- a/tools/testing/selftests/pidfd/pidfd.h
> +++ b/tools/testing/selftests/pidfd/pidfd.h
> @@ -45,8 +45,12 @@
> #endif
>
> #ifndef __NR_pidfd_open
> +#ifdef __alpha__
> +#define __NR_pidfd_open 544
> +#else
> #define __NR_pidfd_open 434
> #endif
> +#endif
>
> #ifndef __NR_pidfd_send_signal
> #define __NR_pidfd_send_signal 424
> --
> 2.47.3
>
next prev parent reply other threads:[~2025-08-29 22:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 14:25 [PATCH 0/9] Add compatibility fixes for KVM selftests with non-glibc C libraries Aqib Faruqui
2025-08-29 14:25 ` [PATCH 1/9] KVM: selftests: Add pidfd_open syscall number fallback Aqib Faruqui
2025-08-29 22:52 ` Sean Christopherson [this message]
2025-08-29 14:25 ` [PATCH 2/9] KVM: selftests: Add __packed attribute fallback Aqib Faruqui
2025-08-29 22:46 ` Sean Christopherson
2025-09-01 15:08 ` Faruqui, Aqib
2025-08-29 14:25 ` [PATCH 3/9] KVM: selftests: Add pthread_attr_setaffinity_np fallback Aqib Faruqui
2025-08-29 22:37 ` Sean Christopherson
2025-08-29 14:25 ` [PATCH 4/9] selftests: kselftest: Add memfd_create syscall compatibility Aqib Faruqui
2025-08-29 14:25 ` [PATCH 5/9] KVM: selftests: Prevent PAGE_SIZE redefinition on x86 Aqib Faruqui
2025-08-29 20:38 ` Sean Christopherson
[not found] ` <33701547-13AA-467D-AC41-A1A05963B1DD@amazon.com>
2025-09-05 8:39 ` Sean Christopherson
2025-09-05 13:59 ` Aqib Faruqui
2025-09-08 18:22 ` Sean Christopherson
2025-08-29 14:25 ` [PATCH 6/9] KVM: selftests: Add backtrace fallback Aqib Faruqui
2025-08-29 14:25 ` [PATCH 7/9] rseq: selftests: Add non-glibc compatibility fixes Aqib Faruqui
2025-08-29 14:25 ` [PATCH 8/9] selftests: Fix stdbuf compatibility in mixed libc environments Aqib Faruqui
2025-08-29 14:25 ` [PATCH 9/9] selftests: kselftest: Add ulong typedef for non-glibc compatibility Aqib Faruqui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aLIvH06e1XDFz9lh@google.com \
--to=seanjc@google.com \
--cc=aqibaf@amazon.com \
--cc=brauner@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=nh-open-source@amazon.com \
--cc=shuah@kernel.org \
--cc=wad@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®