Messages in this thread | | | From | "Huang, Kai" <> | Subject | Re: [PATCH v2] KVM: x86/mmu: Add sanity check that MMIO SPTE mask doesn't overlap gen | Date | Sat, 6 Aug 2022 00:49:54 +0000 |
| |
On Fri, 2022-08-05 at 19:41 +0000, Sean Christopherson wrote: > Add compile-time and init-time sanity checks to ensure that the MMIO SPTE > mask doesn't overlap the MMIO SPTE generation or the MMU-present bit. > The generation currently avoids using bit 63, but that's as much > coincidence as it is strictly necessarly. That will change in the future, > as TDX support will require setting bit 63 (SUPPRESS_VE) in the mask. > > Explicitly carve out the bits that are allowed in the mask so that any > future shuffling of SPTE bits doesn't silently break MMIO caching (KVM > has broken MMIO caching more than once due to overlapping the generation > with other things). > > Suggested-by: Kai Huang <kai.huang@intel.com> > Signed-off-by: Sean Christopherson <seanjc@google.com> > --- > > Kai, I didn't included your review since I pretty much rewrote the entire > comment. > > v2: Prevent overlap with SPTE_MMU_PRESENT_MASK > v1: https://lore.kernel.org/all/20220803213354.951376-1-seanjc@google.com
Reviewed-by: Kai Huang <kai.huang@intel.com>
-- Thanks, -Kai
| |