mirror of
https://github.com/torvalds/linux.git
synced 2024-11-30 16:11:38 +00:00
kvm: x86/mmu: Don't clear write flooding for direct SP
Although there is no harm, but there is no point to clear write flooding for direct SP. Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com> Link: https://lore.kernel.org/r/20230105100310.6700-1-jiangshanlai@gmail.com Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
parent
dc1ae59fc4
commit
9e3fbdfd9b
@ -642,12 +642,12 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
|
|||||||
if (WARN_ON(!VALID_PAGE(vcpu->arch.mmu->root.hpa)))
|
if (WARN_ON(!VALID_PAGE(vcpu->arch.mmu->root.hpa)))
|
||||||
goto out_gpte_changed;
|
goto out_gpte_changed;
|
||||||
|
|
||||||
for (shadow_walk_init(&it, vcpu, fault->addr);
|
for_each_shadow_entry(vcpu, fault->addr, it) {
|
||||||
shadow_walk_okay(&it) && it.level > gw->level;
|
|
||||||
shadow_walk_next(&it)) {
|
|
||||||
gfn_t table_gfn;
|
gfn_t table_gfn;
|
||||||
|
|
||||||
clear_sp_write_flooding_count(it.sptep);
|
clear_sp_write_flooding_count(it.sptep);
|
||||||
|
if (it.level == gw->level)
|
||||||
|
break;
|
||||||
|
|
||||||
table_gfn = gw->table_gfn[it.level - 2];
|
table_gfn = gw->table_gfn[it.level - 2];
|
||||||
access = gw->pt_access[it.level - 2];
|
access = gw->pt_access[it.level - 2];
|
||||||
@ -692,8 +692,6 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
|
|||||||
trace_kvm_mmu_spte_requested(fault);
|
trace_kvm_mmu_spte_requested(fault);
|
||||||
|
|
||||||
for (; shadow_walk_okay(&it); shadow_walk_next(&it)) {
|
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
|
* We cannot overwrite existing page tables with an NX
|
||||||
* large page, as the leaf could be executable.
|
* large page, as the leaf could be executable.
|
||||||
|
Loading…
Reference in New Issue
Block a user