public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
To: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>, KVM <kvm@vger.kernel.org>
Subject: [PATCH 3/3] KVM: MMU: remove unnecessary check
Date: Fri, 07 Sep 2012 14:15:03 +0800	[thread overview]
Message-ID: <504990E7.6040604@linux.vnet.ibm.com> (raw)
In-Reply-To: <5049908A.7070501@linux.vnet.ibm.com>

Checking the return of kvm_mmu_get_page is unnecessary since it is
guaranteed by memory cache

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
---
 arch/x86/kvm/mmu.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 3c10bca..98cf4bf 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2625,11 +2625,6 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
 			sp = kvm_mmu_get_page(vcpu, pseudo_gfn, iterator.addr,
 					      iterator.level - 1,
 					      1, ACC_ALL, iterator.sptep);
-			if (!sp) {
-				pgprintk("nonpaging_map: ENOMEM\n");
-				mmu_release_pfn_clean(pfn);
-				return -ENOMEM;
-			}

 			mmu_spte_set(iterator.sptep,
 				     __pa(sp->spt)
-- 
1.7.7.6

  parent reply	other threads:[~2012-09-07  6:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  6:13 [PATCH 1/3] KVM: MMU: release noslot pfn on the fail path properly Xiao Guangrong
2012-09-07  6:14 ` [PATCH 2/3] KVM: fix release error page Xiao Guangrong
2012-09-10  8:35   ` Avi Kivity
2012-09-07  6:15 ` Xiao Guangrong [this message]
2012-09-10  8:26   ` [PATCH 3/3] KVM: MMU: remove unnecessary check Avi Kivity
2012-09-10  8:22 ` [PATCH 1/3] KVM: MMU: release noslot pfn on the fail path properly Avi Kivity
2012-09-10  8:37   ` Xiao Guangrong
2012-09-10  9:02     ` Avi Kivity
2012-09-10  9:10       ` Xiao Guangrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=504990E7.6040604@linux.vnet.ibm.com \
    --to=xiaoguangrong@linux.vnet.ibm.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox