diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index d041cbd5f6..19ee857abf 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -908,6 +908,13 @@ static void __init noreturn reinit_bsp_stack(void) if ( cpu_has_xen_shstk ) { + /* + * Immediately after enabling CET, SSP is 0 and most interrupts and + * exceptions are fatal. Like the SYSCALL/SYSENTER gaps, IST vectors + * (including NMI and #MC) are safe owing to IST switching the shstk. + */ + local_irq_disable(); + wrmsrl(MSR_S_CET, xen_msr_s_cet_value()); /* @@ -932,6 +939,8 @@ static void __init noreturn reinit_bsp_stack(void) } else asm volatile ( "setssbsy" ::: "memory" ); + + local_irq_enable(); } reset_stack_and_jump(init_done);