Skip to content

Commit 6b995d0

Browse files
ardbiesheuvelbp3tk0v
authored andcommitted
x86/sev: Work around broken noinstr on GCC
Forcibly disable KCSAN for the sev-nmi.c source file, which only contains functions annotated as 'noinstr' but is emitted with calls to KCSAN instrumentation nonetheless. E.g., vmlinux.o: error: objtool: __sev_es_nmi_complete+0x58: call to __kcsan_check_access() leaves .noinstr.text section make[2]: *** [/usr/local/google/home/ardb/linux/scripts/Makefile.vmlinux_o:72: vmlinux.o] Error 1 Fixes: a3cbbb4 ("x86/boot: Move SEV startup code into startup/") Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent 347e9f5 commit 6b995d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/coco/sev/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ obj-y += core.o sev-nmi.o vc-handle.o
55
# Clang 14 and older may fail to respect __no_sanitize_undefined when inlining
66
UBSAN_SANITIZE_sev-nmi.o := n
77

8-
# GCC may fail to respect __no_sanitize_address when inlining
8+
# GCC may fail to respect __no_sanitize_address or __no_kcsan when inlining
99
KASAN_SANITIZE_sev-nmi.o := n
10+
KCSAN_SANITIZE_sev-nmi.o := n

0 commit comments

Comments
 (0)