[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3feb8d35ff42814927a3c52935b97527ef827e9a.camel@intel.com>
Date: Wed, 9 Nov 2022 12:27:33 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Yamahata, Isaku" <isaku.yamahata@...el.com>
CC: "sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"Shahar, Sagi" <sagis@...gle.com>,
"Aktas, Erdem" <erdemaktas@...gle.com>,
"isaku.yamahata@...il.com" <isaku.yamahata@...il.com>,
"dmatlack@...gle.com" <dmatlack@...gle.com>,
"Christopherson,, Sean" <seanjc@...gle.com>
Subject: Re: [PATCH v10 035/108] KVM: x86/mmu: Track shadow MMIO value on a
per-VM basis
On Sat, 2022-10-29 at 23:22 -0700, isaku.yamahata@...el.com wrote:
> From: Isaku Yamahata <isaku.yamahata@...el.com>
>
> TDX will use a different shadow PTE entry value for MMIO from VMX. Add
> members to kvm_arch and track value for MMIO per-VM instead of global
> variables. By using the per-VM EPT entry value for MMIO, the existing VMX
> logic is kept working. To untangle the logic to initialize
> shadow_mmio_access_mask, introduce a separate setter function.
>
It's weird to mention "shadow_mmio_access_mask" here (and this doesn't stand
anymore anyway as we have changed to only make mmio_value per-vm). Just say
something like "introduce a setter function to set mmio_value for the given
guest so that TDX guest can override later".
Also, seems it's worth to mention the same mmio_mask is used for both TDX guest
and VMX guest so we can still use global shadow_mmio_mask.
[...]
> void kvm_mmu_set_mmio_spte_mask(u64 mmio_value, u64 mmio_mask, u64 access_mask)
> {
> BUG_ON((u64)(unsigned)access_mask != access_mask);
> +
> WARN_ON(mmio_value & shadow_nonpresent_or_rsvd_lower_gfn_mask);
Looks unnecessary change.
Powered by blists - more mailing lists