linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Gleb Natapov <gleb@redhat.com>, KVM list <kvm@vger.kernel.org>
Subject: [PATCH 3/7] KVM: PPC: correctly check gfn_to_pfn() return value
Date: Thu, 29 Jul 2010 15:04:18 +0200	[thread overview]
Message-ID: <1280408662-10328-4-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1280408662-10328-1-git-send-email-agraf@suse.de>

From: Gleb Natapov <gleb@redhat.com>

On failure gfn_to_pfn returns bad_page so use correct function to check
for that.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/book3s_32_mmu_host.c |    2 +-
 arch/powerpc/kvm/book3s_64_mmu_host.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_32_mmu_host.c b/arch/powerpc/kvm/book3s_32_mmu_host.c
index 05e8c9e..343452c 100644
--- a/arch/powerpc/kvm/book3s_32_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_32_mmu_host.c
@@ -148,7 +148,7 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_pte)
 
 	/* Get host physical address for gpa */
 	hpaddr = kvmppc_gfn_to_pfn(vcpu, orig_pte->raddr >> PAGE_SHIFT);
-	if (kvm_is_error_hva(hpaddr)) {
+	if (is_error_pfn(hpaddr)) {
 		printk(KERN_INFO "Couldn't get guest page for gfn %lx!\n",
 				 orig_pte->eaddr);
 		return -EINVAL;
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c
index 6cdd19a..672b149 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -102,7 +102,7 @@ int kvmppc_mmu_map_page(struct kvm_vcpu *vcpu, struct kvmppc_pte *orig_pte)
 
 	/* Get host physical address for gpa */
 	hpaddr = kvmppc_gfn_to_pfn(vcpu, orig_pte->raddr >> PAGE_SHIFT);
-	if (kvm_is_error_hva(hpaddr)) {
+	if (is_error_pfn(hpaddr)) {
 		printk(KERN_INFO "Couldn't get guest page for gfn %lx!\n", orig_pte->eaddr);
 		return -EINVAL;
 	}
-- 
1.6.0.2

  parent reply	other threads:[~2010-07-29 13:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 13:04 [PATCH 0/7] Rest of my KVM-PPC patch queue Alexander Graf
2010-07-29 13:04 ` [PATCH 1/7] KVM: PPC: Book3S_32 MMU debug compile fixes Alexander Graf
2010-07-29 13:04 ` [PATCH 2/7] KVM: PPC: RCU'ify the Book3s MMU Alexander Graf
2010-07-29 13:04 ` Alexander Graf [this message]
2010-07-29 13:04 ` [PATCH 4/7] KVM: PPC: Add book3s_32 tlbie flush acceleration Alexander Graf
2010-08-01 14:08   ` Avi Kivity
2010-08-01 20:20     ` Alexander Graf
2010-07-29 13:04 ` [PATCH 5/7] KVM: PPC: Use MSR_DR for external load_up Alexander Graf
2010-07-29 13:04 ` [PATCH 6/7] KVM: PPC: Make long relocations be ulong Alexander Graf
2010-07-29 13:04 ` [PATCH 7/7] KVM: PPC: Move KVM trampolines before __end_interrupts Alexander Graf
2010-08-01 14:09 ` [PATCH 0/7] Rest of my KVM-PPC patch queue Avi Kivity

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=1280408662-10328-4-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=gleb@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).