linux/arch/x86/kvm/mmu
Sean Christopherson c3e0c8c2e8 KVM: x86/mmu: Fully re-evaluate MMIO caching when SPTE masks change
Fully re-evaluate whether or not MMIO caching can be enabled when SPTE
masks change; simply clearing enable_mmio_caching when a configuration
isn't compatible with caching fails to handle the scenario where the
masks are updated, e.g. by VMX for EPT or by SVM to account for the C-bit
location, and toggle compatibility from false=>true.

Snapshot the original module param so that re-evaluating MMIO caching
preserves userspace's desire to allow caching.  Use a snapshot approach
so that enable_mmio_caching still reflects KVM's actual behavior.

Fixes: 8b9e74bfbf ("KVM: x86/mmu: Use enable_mmio_caching to track if MMIO caching is enabled")
Reported-by: Michael Roth <michael.roth@amd.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: stable@vger.kernel.org
Tested-by: Michael Roth <michael.roth@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Message-Id: <20220803224957.1285926-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-08-10 15:08:24 -04:00
..
mmu_internal.h KVM: x86/mmu: Don't require refcounted "struct page" to create huge SPTEs 2022-07-28 13:22:22 -04:00
mmu.c KVM: x86/mmu: Fully re-evaluate MMIO caching when SPTE masks change 2022-08-10 15:08:24 -04:00
mmutrace.h KVM: x86/mmu: Add RET_PF_CONTINUE to eliminate bool+int* "returns" 2022-05-12 09:51:42 -04:00
page_track.c KVM: use __vcalloc for very large allocations 2022-03-08 09:30:57 -05:00
paging_tmpl.h KVM: x86/mmu: Add optimized helper to retrieve an SPTE's index 2022-07-14 11:31:23 -04:00
spte.c KVM: x86/mmu: Fully re-evaluate MMIO caching when SPTE masks change 2022-08-10 15:08:24 -04:00
spte.h KVM: x86/mmu: Fully re-evaluate MMIO caching when SPTE masks change 2022-08-10 15:08:24 -04:00
tdp_iter.c KVM: x86/mmu: Don't bottom out on leafs when zapping collapsible SPTEs 2022-07-28 13:22:24 -04:00
tdp_iter.h KVM: x86/mmu: Don't bottom out on leafs when zapping collapsible SPTEs 2022-07-28 13:22:24 -04:00
tdp_mmu.c KVM, x86/mmu: Fix the comment around kvm_tdp_mmu_zap_leafs() 2022-07-28 14:02:07 -04:00
tdp_mmu.h KVM: x86/mmu: Zap only TDP MMU leafs in zap range and mmu_notifier unmap 2022-04-02 05:34:39 -04:00