Re: [PATCH v2 6/9] x86/kexec: set_[gi]dt() -> native_[gi]dt_invalidate() in machine_kexec_*.c

From: Andy Lutomirski
Date: Sat May 15 2021 - 11:30:38 EST


On 5/14/21 6:43 PM, H. Peter Anvin wrote:
> From: "H. Peter Anvin (Intel)" <hpa@xxxxxxxxx>
>
> These files contain private set_gdt() functions which are only used to
> invalid the gdt; machine_kexec_64.c also contains a set_idt()
> function to invalidate the idt.
>
> phys_to_virt(0) *really* doesn't make any sense for creating an
> invalid GDT. A NULL pointer (virtual 0) makes a lot more sense;
> although neither will allow any actual memory reference, a NULL
> pointer stands out more.
>
> Replace these calls with native_[gi]dt_invalidate().
>
> Signed-off-by: H. Peter Anvin (Intel) <hpa@xxxxxxxxx>

Acked-by: Andy Lutomirski <luto@xxxxxxxxxx>