kvm: x86/mmu: Don't clear write flooding for direct SP
PATCH 1/1 kvm: x86/mmu: Don't clear write flooding for direct SP
From: Lai Jiangshan <[email protected]>
Although there is no harm, but there is no point to clear write flooding for direct SP.
Signed-off-by Lai Jiangshan <[email protected]>
--- arch/x86/kvm/mmu/paging_tmpl.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
arch/x86/kvm/mmu/paging_tmpl.h +3 -5
@@ -649,12 +649,12 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,if (WARN_ON (!VALID_PAGE (vcpu->arch.mmu->root.hpa))) goto out_gpte_changed; -for (shadow_walk_init (&it, vcpu, fault->addr); -shadow_walk_okay (&it) && it.level > gw->level; -shadow_walk_next (&it)) { +for_each_shadow_entry (vcpu, fault->addr, it) {gfn_t table_gfn;clear_sp_write_flooding_count (it.sptep); +if (it.level == gw->level) +break ; table_gfn = gw->table_gfn[it.level -2 ]; access = gw->pt_access[it.level -2 ];
@@ -706,8 +706,6 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,trace_kvm_mmu_spte_requested (fault);for (;shadow_walk_okay (&it);shadow_walk_next (&it)) { -clear_sp_write_flooding_count (it.sptep); -/* * We cannot overwrite existing page tables with an NX * large page, as the leaf could be executable.
Signature · 1 line
2.19.1.6.gb485710b
Quoted 4 lines · Lai Jiangshan
Although there is no harm, but there is no point to clear write flooding for direct SP.
Applied to kvm-x86 mmu, thanks!
[1/1] kvm: x86/mmu: Don't clear write flooding for direct SP
https://github.com/kvm-x86/linux/commit/5ee0c3718540
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes