summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/ia32.h
diff options
context:
space:
mode:
authorBorislav Petkov (AMD) <bp@alien8.de>2023-11-30 16:39:33 +0100
committerBorislav Petkov (AMD) <bp@alien8.de>2023-12-11 10:14:28 +0100
commitf789383fa34a266d0c1a76f272043a15a8edf733 (patch)
treed0e586941169d155434a5405d1eb8b76bd9f7f67 /arch/x86/include/asm/ia32.h
parent79c603ee43b2674fba0257803bab265147821955 (diff)
downloadlwn-f789383fa34a266d0c1a76f272043a15a8edf733.tar.gz
lwn-f789383fa34a266d0c1a76f272043a15a8edf733.zip
x86/ia32: State that IA32 emulation is disabled
Issue a short message once, on the first try to load a 32-bit process to save people time when wondering why it won't load and trying to execute it, would say: -bash: ./strsep32: cannot execute binary file: Exec format error Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Nikolay Borisov <nik.borisov@suse.com> Link: https://lore.kernel.org/r/20231130155213.1407-1-bp@alien8.de
Diffstat (limited to 'arch/x86/include/asm/ia32.h')
-rw-r--r--arch/x86/include/asm/ia32.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/include/asm/ia32.h b/arch/x86/include/asm/ia32.h
index 5a2ae24b1204..094886a8717e 100644
--- a/arch/x86/include/asm/ia32.h
+++ b/arch/x86/include/asm/ia32.h
@@ -2,7 +2,6 @@
#ifndef _ASM_X86_IA32_H
#define _ASM_X86_IA32_H
-
#ifdef CONFIG_IA32_EMULATION
#include <linux/compat.h>
@@ -84,4 +83,14 @@ static inline bool ia32_enabled(void)
#endif
+static inline bool ia32_enabled_verbose(void)
+{
+ bool enabled = ia32_enabled();
+
+ if (IS_ENABLED(CONFIG_IA32_EMULATION) && !enabled)
+ pr_notice_once("32-bit emulation disabled. You can reenable with ia32_emulation=on\n");
+
+ return enabled;
+}
+
#endif /* _ASM_X86_IA32_H */