[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240129064521.5168-1-xin3.li@intel.com>
Date: Sun, 28 Jan 2024 22:45:21 -0800
From: Xin Li <xin3.li@...el.com>
To: linux-kernel@...r.kernel.org
Cc: tglx@...utronix.de,
mingo@...hat.com,
bp@...en8.de,
dave.hansen@...ux.intel.com,
x86@...nel.org,
hpa@...or.com,
luto@...nel.org,
ravi.v.shankar@...el.com,
andrew.cooper3@...rix.com
Subject: [PATCH v1A 1/2] x86/fred: Fix build with clang
Remove the .fill statement that referneces asm_fred_entrypoint_kernel()
before it's defined, which breaks clang build.
Use the .org directive instead to fill "int3" into the memory between
asm_fred_entrypoint_user() and asm_fred_entrypoint_kernel().
Fixes: 5e0636a41485 ("x86/fred: FRED entry/exit and dispatch code")
Reported-by: Borislav Petkov (AMD) <bp@...en8.de>
Link: https://lore.kernel.org/lkml/20240126100050.GAZbOC0g3Rlr6otZcT@fat_crate.local/
Signed-off-by: Xin Li <xin3.li@...el.com>
---
Change since v1:
* Use ".org ..., 0xcc" to fill "int3" into memory (H. Peter Anvin).
---
arch/x86/entry/entry_64_fred.S | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S
index eedf98de7538..a02bc6f3d2e6 100644
--- a/arch/x86/entry/entry_64_fred.S
+++ b/arch/x86/entry/entry_64_fred.S
@@ -43,14 +43,12 @@ SYM_INNER_LABEL(asm_fred_exit_user, SYM_L_GLOBAL)
_ASM_EXTABLE_TYPE(1b, asm_fred_entrypoint_user, EX_TYPE_ERETU)
SYM_CODE_END(asm_fred_entrypoint_user)
-.fill asm_fred_entrypoint_kernel - ., 1, 0xcc
-
/*
* The new RIP value that FRED event delivery establishes is
* (IA32_FRED_CONFIG & ~FFFH) + 256 for events that occur in
* ring 0, i.e., asm_fred_entrypoint_user + 256.
*/
- .org asm_fred_entrypoint_user + 256
+ .org asm_fred_entrypoint_user + 256, 0xcc
SYM_CODE_START_NOALIGN(asm_fred_entrypoint_kernel)
FRED_ENTER
call fred_entry_from_kernel
--
2.43.0
Powered by blists - more mailing lists