From: Helge Deller <deller@kernel.org>
To: Christoph Hellwig <hch@infradead.org>,
linux-abi-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, qemu-devel@nongnu.org
Cc: deller@gmx.de
Subject: [PATCH] [RFC] UAPI: Add QEMU linux-user emulation flag
Date: Fri, 31 Jul 2026 17:09:49 +0200 [thread overview]
Message-ID: <20260731150949.5536-1-deller@kernel.org> (raw)
From: Helge Deller <deller@gmx.de>
For some userspace applications it's useful to know if they currently
run on QEMU's linux-user emulation. Such programs are for example the
LTP testsuite, which could avoid testing specific testcases, or systemd
which should avoid use of specific syscalls.
This RFC is about adding a QEMU_LINUX_USER flag to the personality()
syscall which would be injected by qemu-user binary.
Applications may then call personality(-1), and check the
QEMU_LINUX_USER flag to determine if they are running on qemu-user.
Adding this flag seems for me to be the least invasive change. No
changes to uname strings which would need to be parsed or other
modifications to the emulation.
As this patch is just an RFC, maybe people come up with other ideas?
Signed-off-by: Helge Deller <deller@gmx.de>
---
include/uapi/linux/personality.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/personality.h b/include/uapi/linux/personality.h
index 243f5f80a7b8..ba6ddaef8954 100644
--- a/include/uapi/linux/personality.h
+++ b/include/uapi/linux/personality.h
@@ -9,6 +9,7 @@
* These occupy the top three bytes.
*/
enum {
+ QEMU_LINUX_USER = 0x0010000, /* Qemu linux-user emulation */
UNAME26 = 0x0020000,
ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
--
2.54.0
reply other threads:[~2026-07-31 15:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260731150949.5536-1-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=hch@infradead.org \
--cc=linux-abi-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=qemu-devel@nongnu.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