* [PATCH] [RFC] UAPI: Add QEMU linux-user emulation flag
@ 2026-07-31 15:09 Helge Deller
0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2026-07-31 15:09 UTC (permalink / raw)
To: Christoph Hellwig, linux-abi-devel, linux-kernel, qemu-devel; +Cc: deller
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-31 15:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 15:09 [PATCH] [RFC] UAPI: Add QEMU linux-user emulation flag Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox