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

David Woodhouse dwmw2 at infradead.org
Tue Apr 1 02:53:16 PDT 2025


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 at amazon.co.uk>
> > 
> > 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 at amazon.co.uk>
> 
> Reviewed-by: Kai Huang <kai.huang at intel.com>

Thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5069 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20250401/e73e980a/attachment-0001.p7s>


More information about the kexec mailing list