RE: [PATCH v6 2/5] x86/kexec: do unconditional WBINVD for bare-metal in relocate_kernel()
From: Huang, Kai
Date: Thu Sep 12 2024 - 06:39:07 EST
> > How about below?
> >
> > --- a/arch/x86/kernel/machine_kexec_64.c
> > +++ b/arch/x86/kernel/machine_kexec_64.c
> > @@ -351,6 +351,11 @@ void machine_kexec(struct kimage *image)
> > *
> > * I take advantage of this here by force loading the
> > * segments, before I zap the gdt with an invalid value.
> > + *
> > + * Note this resets GS to 0. Don't make any function call after
> > + * here since call depth tracking uses per-cpu variables to
> > + * operate (relocate_kernel is explicitly ignored by call depth
> > + * tracking).
> > */
>
> Looks good, thanks!
>
> >
> > Btw, it would be very helpful if you can help to verify this patch
> > doesn't break call depth tracking in your environment. Thanks!
>
> Tested it and it seemed fine (kexec worked and disassembly did not show any
> calls after GS is cleared, as expected).
>
Thanks! Should I add your Tested-by?