From: Gleb Natapov Subject: [PATCH 2/6] KVM: MMU: drop unneeded checks. Date: Wed, 30 Jan 2013 16:45:01 +0200 Message-ID: <1359557105-30821-3-git-send-email-gleb@redhat.com> References: <1359557105-30821-1-git-send-email-gleb@redhat.com> Cc: mtosatti@redhat.com, xiaoguangrong@linux.vnet.ibm.com, yoshikawa_takuya_b1@lab.ntt.co.jp To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9370 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753513Ab3A3OpT (ORCPT ); Wed, 30 Jan 2013 09:45:19 -0500 In-Reply-To: <1359557105-30821-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Gleb Natapov --- arch/x86/kvm/mmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 2fa82b0..40737b3 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2328,9 +2328,8 @@ static int mmu_need_write_protect(struct kvm_vcpu *vcpu, gfn_t gfn, if (s->role.level != PT_PAGE_TABLE_LEVEL) return 1; - if (!need_unsync && !s->unsync) { + if (!s->unsync) need_unsync = true; - } } if (need_unsync) kvm_unsync_pages(vcpu, gfn); @@ -4008,7 +4007,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, !((sp->role.word ^ vcpu->arch.mmu.base_role.word) & mask.word) && rmap_can_add(vcpu)) mmu_pte_write_new_pte(vcpu, sp, spte, &gentry); - if (!remote_flush && need_remote_flush(entry, *spte)) + if (need_remote_flush(entry, *spte)) remote_flush = true; ++spte; } -- 1.7.10.4