summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/proto.h
diff options
context:
space:
mode:
authorLai Jiangshan <jiangshan.ljs@antgroup.com>2022-03-16 12:16:12 +0800
committerBorislav Petkov <bp@suse.de>2022-05-18 20:36:03 +0200
commitc42b145181aafd59ed31ccd879493389e3ea5a08 (patch)
tree9c3304c863529c380066dbc055fb69a139b0247d /arch/x86/include/asm/proto.h
parent0621210ab7693e6d50585ca689d95d57df617455 (diff)
downloadlwn-c42b145181aafd59ed31ccd879493389e3ea5a08.tar.gz
lwn-c42b145181aafd59ed31ccd879493389e3ea5a08.zip
x86/sev: Annotate stack change in the #VC handler
In idtentry_vc(), vc_switch_off_ist() determines a safe stack to switch to, off of the IST stack. Annotate the new stack switch with ENCODE_FRAME_POINTER in case UNWINDER_FRAME_POINTER is used. A stack walk before looks like this: CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: <TASK> dump_stack_lvl dump_stack kernel_exc_vmm_communication asm_exc_vmm_communication ? native_read_msr ? __x2apic_disable.part.0 ? x2apic_setup ? cpu_init ? trap_init ? start_kernel ? x86_64_start_reservations ? x86_64_start_kernel ? secondary_startup_64_no_verify </TASK> and with the fix, the stack dump is exact: CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0-rc7+ #3 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: <TASK> dump_stack_lvl dump_stack kernel_exc_vmm_communication asm_exc_vmm_communication RIP: 0010:native_read_msr Code: ... < snipped regs > ? __x2apic_disable.part.0 x2apic_setup cpu_init trap_init start_kernel x86_64_start_reservations x86_64_start_kernel secondary_startup_64_no_verify </TASK> [ bp: Test in a SEV-ES guest and rewrite the commit message to explain what exactly this does. ] Fixes: a13644f3a53d ("x86/entry/64: Add entry code for #VC handler") Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: https://lore.kernel.org/r/20220316041612.71357-1-jiangshanlai@gmail.com
Diffstat (limited to 'arch/x86/include/asm/proto.h')
0 files changed, 0 insertions, 0 deletions