On 28.08.2025 17:03, Andrew Cooper wrote: > FRED and IDT differ by a Supervisor Token on the base of the shstk. This > means that switch_stack_and_jump() needs to discard one extra word when FRED > is active. > > Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]> However, I'd much prefer if ... > --- a/xen/arch/x86/include/asm/current.h > +++ b/xen/arch/x86/include/asm/current.h > @@ -154,7 +154,9 @@ unsigned long get_stack_dump_bottom (unsigned long sp); > "rdsspd %[ssp];" \ > "cmp $1, %[ssp];" \ > "je .L_shstk_done.%=;" /* CET not active? Skip. */ \ > - "mov $%c[skstk_base], %[val];" \ > + ALTERNATIVE("mov $%c[skstk_base], %[val];", \ > + "mov $%c[skstk_base] + 8, %[val];", \ ... the unnecessarily complicated $%c here could be replaced by plain %. Jan > + X86_FEATURE_XEN_FRED) \ > "and $%c[stack_mask], %[ssp];" \ > "sub %[ssp], %[val];" \ > "shr $3, %[val];" \
