Re: [PATCH v4 21/30] KVM: x86: Move LLDT assembly wrappers into VMX
From: Binbin Wu
Date: Tue Jun 16 2026 - 02:40:37 EST
On 6/13/2026 8:03 AM, Sean Christopherson wrote:
> Move kvm_{load,read}_ldt() into vmx.c, as vmx_{load,store}_ldt(), as they
> are exclusively used by VMX to save/restore host state, and have no
> business being globally visible.
>
> Ideally, KVM-specific helpers wouldn't exist at all, as they are nothing
> more than assembly wrappers for SLDT and LLDT, i.e. should be provided by
> the kernel, not by KVM. Punt that cleanup to the future, as
> arch/x86/include/asm/desc.h _does_ provide helpers, but load_ldt() is only
> available for CONFIG_PARAVIRT_XXL=n builds, and both {load,store}_ldt()
> unnecessarily constrain the operands to memory.
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>