Re: [PATCH 07/18] KVM: TDX: Implement callbacks for MSR operations
From: Huang, Kai
Date: Wed Jan 15 2025 - 06:26:55 EST
On Tue, 2024-12-10 at 08:49 +0800, Binbin Wu wrote:
> From: Isaku Yamahata <isaku.yamahata@xxxxxxxxx>
>
> Add functions to implement MSR related callbacks, .set_msr(), .get_msr(),
> and .has_emulated_msr(), for preparation of handling hypercalls from TDX
> guest for para-virtualized RDMSR and WRMSR. Ignore KVM_REQ_MSR_FILTER_CHANGED
> for TDX.
>
> There are three classes of MSRs virtualization for TDX.
^
MSR
> - Non-configurable: TDX module directly virtualizes it. VMM can't configure
> it, the value set by KVM_SET_MSRS is ignored.
> - Configurable: TDX module directly virtualizes it. VMM can configure at the
> VM creation time. The value set by KVM_SET_MSRS is used.
> - #VE case: TDX guest would issue TDG.VP.VMCALL<INSTRUCTION.{WRMSR,RDMSR}>
> and VMM handles the MSR hypercall. The value set by KVM_SET_MSRS is used.
>
> For the MSRs belonging to the #VE case, the TDX module injects #VE to the
> TDX guest upon RDMSR or WRMSR. The exact list of such MSRs are defined in
^
is
> TDX Module ABI Spec.
>