On 28.02.2026 00:16, Andrew Cooper wrote:
> Commit 564d261687c0 ("x86/ctxt-switch: Document and improve GDT handling") put
> the initialisation of {,compat_}gdt_l1e into traps_init() but this wasn't a
> great choice. Instead, put it in smp_prepare_cpus() which performs the BSP
> preparation of variables normally set up by cpu_smpboot_alloc() for APs.
>
> This removes an implicit dependency that prevents traps_init() moving earlier
> than move_xen() in the boot sequence.
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
> I'm on the fence about the ASSERT(), but I'm getting rather tired of unstated
> dependencies. For a PV64 guest using SYSEXIT to enter the guest, it's the
> first interrupt/exception which references the GDT, which could be after the
> guest is running.
I think that's okay to have there. "Unstated dependencies" is of course a wide
field, and going too far with assertions is also a risk.
Jan