diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9270e0d93c31..34da43086952 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -3551,7 +3551,7 @@ static u64 mmu_pte_write_fetch_gpte(struct kvm_vcpu *vcpu, gpa_t *gpa, | |||
3551 | * If we're seeing too many writes to a page, it may no longer be a page table, | 3551 | * If we're seeing too many writes to a page, it may no longer be a page table, |
3552 | * or we may be forking, in which case it is better to unmap the page. | 3552 | * or we may be forking, in which case it is better to unmap the page. |
3553 | */ | 3553 | */ |
3554 | static bool detect_write_flooding(struct kvm_mmu_page *sp, u64 *spte) | 3554 | static bool detect_write_flooding(struct kvm_mmu_page *sp) |
3555 | { | 3555 | { |
3556 | /* | 3556 | /* |
3557 | * Skip write-flooding detected for the sp whose level is 1, because | 3557 | * Skip write-flooding detected for the sp whose level is 1, because |
@@ -3660,10 +3660,8 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, | |||
3660 | 3660 | ||
3661 | mask.cr0_wp = mask.cr4_pae = mask.nxe = 1; | 3661 | mask.cr0_wp = mask.cr4_pae = mask.nxe = 1; |
3662 | for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn, node) { | 3662 | for_each_gfn_indirect_valid_sp(vcpu->kvm, sp, gfn, node) { |
3663 | spte = get_written_sptes(sp, gpa, &npte); | ||
3664 | |||
3665 | if (detect_write_misaligned(sp, gpa, bytes) || | 3663 | if (detect_write_misaligned(sp, gpa, bytes) || |
3666 | detect_write_flooding(sp, spte)) { | 3664 | detect_write_flooding(sp)) { |
3667 | zap_page |= !!kvm_mmu_prepare_zap_page(vcpu->kvm, sp, | 3665 | zap_page |= !!kvm_mmu_prepare_zap_page(vcpu->kvm, sp, |
3668 | &invalid_list); | 3666 | &invalid_list); |
3669 | ++vcpu->kvm->stat.mmu_flooded; | 3667 | ++vcpu->kvm->stat.mmu_flooded; |