Re: [PATCH v7 033/102] KVM: x86/mmu: Add address conversion functions for TDX shared bits

Kai Huang
2022-07-13T10:41:39Z

> >
> > And by applying this patch, nothing will prevent you to turn on INTEL_TDX_HOST
> > and KVM_INTEL, which also turns on KVM_MMU_PRIVATE.
> >
> > So 'kvm_arch::gfn_shared_mask' is guaranteed to be 0? If not, can legal
> > (shared) GFN for normal VM be potentially treated as private?
> >
> > If yes, perhaps explicitly call out in changelog so people don't need to worry
> > about?
>
> struct kvm that includes struct kvm_arch is guaranteed to be zero.
>
> Here is the updated commit message.
>
> Author: Isaku Yamahata <isaku.yamahata@intel.com>
> Date: Tue Jul 12 00:10:13 2022 -0700
>
> KVM: x86/mmu: Add address conversion functions for TDX shared bit of GPA
>
> TDX repurposes one GPA bit (51 bit or 47 bit based on configuration) to
> indicate the GPA is private(if cleared) or shared (if set) with VMM. If
> GPA.shared is set, GPA is converted existing conventional EPT pointed by
> EPTP. If GPA.shared bit is cleared, GPA is converted by TDX module.
> VMM has to issue SEAMCALLs to operate.

Sorry what does "GPA is converted ..." mean?

--
Thanks,
-Kai