Re: [PATCH v9 3/4] x86/kexec: Invalidate GDT/IDT from relocate_kernel() instead of earlier

From: David Woodhouse
Date: Tue Apr 01 2025 - 05:53:56 EST


On Tue, 2025-04-01 at 09:48 +0000, Huang, Kai wrote:
> On Wed, 2025-03-26 at 14:16 +0000, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@xxxxxxxxxxxx>
> >
> > Reduce the window during which exceptions are unhandled, by leaving
> > the
> > GDT/IDT in place all the way into the relocate_kernel() function,
> > until
> > the moment that %cr3 gets replaced.
>
> Seems the difference is only couple of instructions.  Anyway ...

It is, although that was important when I was trying to enable CET
because one of those instructions was the indirect call.

I've given up on CET now because it's largely pointless for that
particular call. But still, putting the GDT/IDT invalidation into
relocate_kernel.S means that we can further shrink the window if we
want to look at leaving MC enabled during the handover, etc.

> >
> > Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
>
> Reviewed-by: Kai Huang <kai.huang@xxxxxxxxx>

Thanks.

Attachment: smime.p7s
Description: S/MIME cryptographic signature