From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7999E43712B for ; Fri, 31 Jul 2026 15:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785510613; cv=none; b=e9uxla6fddvndGDJM8rlqEg/6h7oyrdPdqvzhKjBI6OGVvn593HwrfhhM7EMGsruT2Ur9knauVSsA/mjhJHslszkUA/8POfx6dI/HqcbmL9+n4qgHCcCb2piMh6LJSwGp//Up2wHtCK3EAmbJrBUawA/oZSu/kfueLDjalaTqCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785510613; c=relaxed/simple; bh=HF+AjM5zJSAIuX42rULgNkuabEEwbuxykG2+lHC77U0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EObuhJ7aKflXnfqHaNTtKg8ht54KTZLVgW4+LgwK0HvnxZa3godXrZVYHYTgKd0YhjStsd5QUYn5DxbGH0eqyfPEBAT3bdZ1h5kI5g+SSaPbuAaGN6/yde7GzbXT2LbTYHC3Bm+TByP78aMn2IGJuEfqkkkDhWeGMKnfMLfdCWg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TEhWy6lR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TEhWy6lR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA5271F000E9; Fri, 31 Jul 2026 15:10:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785510608; bh=vRB6H1gCepGHckPzvKjsxfuEiZldwtlECVNiwH1edRg=; h=From:To:Cc:Subject:Date; b=TEhWy6lRUoDATpm8NNABL6SXaWCGobsUUPzYzyEBJe6Fu2JzQi7WCcLzSIGex3jz9 k/rfzM8l32sy1PRwrTmqjjbJyTfeQ+ftrUOujoXcBjkfUxAq/RKyWKag18xYH3F9+T IAzp7aHAUgMQXMby7Rk33wDyQH5fTKBVFOahvsRPkEMhL07aPcLw3XgRg5Cau14FJ0 qD597Vz4sspfPg42wM9Tb9Z/XLoP/j8bgfTMQuFL+L/2VFrE/xCMq8WTsmSKuKcntX aPbR6DzoIy3UScVHPLhpLsE5I6w06tOSj5kOdjCdQsYctDIIsUnOhnAJ18l9VdpkJZ /E3IwMI12TzaQ== From: Helge Deller To: Christoph Hellwig , 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 Message-ID: <20260731150949.5536-1-deller@kernel.org> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Helge Deller 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 --- 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