diff options
author | 2025-03-18 09:33:10 +0800 | |
---|---|---|
committer | 2025-04-28 11:03:06 -0700 | |
commit | 11d45175111d933c5175acc28e56af2213dd5cd6 (patch) | |
tree | 954b17d4c3727c8b2a8fe35e44f69837c22e2ca7 /tools/perf/scripts/python | |
parent | KVM: x86/tdp_mmu: WARN if PFN changes for spurious faults (diff) | |
download | wireguard-linux-11d45175111d933c5175acc28e56af2213dd5cd6.tar.xz wireguard-linux-11d45175111d933c5175acc28e56af2213dd5cd6.zip |
KVM: x86/mmu: Warn if PFN changes on shadow-present SPTE in shadow MMU
Warn if PFN changes on shadow-present SPTE in mmu_set_spte().
KVM should _never_ change the PFN of a shadow-present SPTE. In
mmu_set_spte(), there is a WARN_ON_ONCE() on pfn changes on shadow-present
SPTE in mmu_spte_update() to detect this condition. However, that
WARN_ON_ONCE() is not hittable since mmu_set_spte() invokes drop_spte()
earlier before mmu_spte_update(), which clears SPTE to a !shadow-present
state. So, before invoking drop_spte(), add a WARN_ON_ONCE() in
mmu_set_spte() to warn PFN change of a shadow-present SPTE.
For the spurious prefetch fault, only return RET_PF_SPURIOUS directly when
PFN is not changed. When PFN changes, fall through to follow the sequence
of drop_spte(), warn of PFN change, make_spte(), flush tlb, rmap_add().
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
Link: https://lore.kernel.org/r/20250318013310.5781-1-yan.y.zhao@intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions