[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e941369-4b78-4b7c-9ce1-00dffe4c10ca@infradead.org>
Date: Mon, 14 Jul 2025 20:07:54 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org
Cc: x86@...nel.org, Ard Biesheuvel <ardb@...nel.org>
Subject: Re: [PATCH] x86/sev: Work around broken noinstr on GCC
On 7/14/25 12:34 AM, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@...nel.org>
>
> 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
>
> Reported-by: Randy Dunlap <rdunlap@...radead.org>
Acked-by: Randy Dunlap <rdunlap@...radead.org>
Tested-by: Randy Dunlap <rdunlap@...radead.org>
Thanks.
> Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
> ---
> arch/x86/coco/sev/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/coco/sev/Makefile b/arch/x86/coco/sev/Makefile
> index db3255b979bd..342d79f0ab6a 100644
> --- a/arch/x86/coco/sev/Makefile
> +++ b/arch/x86/coco/sev/Makefile
> @@ -5,5 +5,6 @@ obj-y += core.o sev-nmi.o vc-handle.o
> # Clang 14 and older may fail to respect __no_sanitize_undefined when inlining
> UBSAN_SANITIZE_sev-nmi.o := n
>
> -# GCC may fail to respect __no_sanitize_address when inlining
> +# GCC may fail to respect __no_sanitize_address or __no_kcsan when inlining
> KASAN_SANITIZE_sev-nmi.o := n
> +KCSAN_SANITIZE_sev-nmi.o := n
--
~Randy
Powered by blists - more mailing lists