diff options
author | Juergen Gross <jgross@suse.com> | 2023-03-17 07:33:25 +0100 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2023-03-17 13:29:47 +0100 |
commit | 11af36cb898123fd4e0034f1bc6550aedcc87800 (patch) | |
tree | 2ba443a53de4bc0321c2aa19e824660c1e5e7c16 /arch/x86/include/asm/sgx.h | |
parent | c9ae1b10d9561012a222e05f0d3ab4e93d301f06 (diff) |
x86/paravirt: Convert simple paravirt functions to asm
All functions referenced via __PV_IS_CALLEE_SAVE() need to be assembler
functions, as those functions calls are hidden from the compiler.
In case the kernel is compiled with "-fzero-call-used-regs" the compiler
will clobber caller-saved registers at the end of C functions, which
will result in unexpectedly zeroed registers at the call site of the
related paravirt functions.
Replace the C functions with DEFINE_PARAVIRT_ASM() constructs using
the same instructions as the related paravirt calls in the
PVOP_ALT_[V]CALLEE*() macros. And since they're not C functions visible
to the compiler anymore, latter won't do the callee-clobbered zeroing
invoked by -fzero-call-used-regs and thus won't corrupt registers.
[ bp: Extend commit message. ]
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230317063325.361-1-jgross@suse.com
Diffstat (limited to 'arch/x86/include/asm/sgx.h')
0 files changed, 0 insertions, 0 deletions