All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH PPC] correctly check gfn_to_pfn() return value
@ 2010-07-07 10:34 Gleb Natapov
       [not found] ` <20100707103412.GB4689-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Gleb Natapov @ 2010-07-07 10:34 UTC (permalink / raw)
  To: agraf; +Cc: kvm, avi

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

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/arch/powerpc/kvm/book3s_32_mmu_host.c b/arch/powerpc/kvm/book3s_32_mmu_host.c
index 0b51ef8..2e3a63d 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 = gfn_to_pfn(vcpu->kvm, 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 384179a..1380f6e 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 = gfn_to_pfn(vcpu->kvm, 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;
 	}
--
			Gleb.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH PPC] correctly check gfn_to_pfn() return value
       [not found] ` <20100707103412.GB4689-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2010-07-07 22:51     ` Alexander Graf
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2010-07-07 22:51 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: KVM list, Avi Kivity, kvm-ppc-u79uwXL29TY76Z2rM5mHXA


On 07.07.2010, at 12:34, Gleb Natapov wrote:

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

Very good catch. I'll include it in my MMU patch set once I got it properly RCU'ified.

Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH PPC] correctly check gfn_to_pfn() return value
@ 2010-07-07 22:51     ` Alexander Graf
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2010-07-07 22:51 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: KVM list, Avi Kivity, kvm-ppc-u79uwXL29TY76Z2rM5mHXA


On 07.07.2010, at 12:34, Gleb Natapov wrote:

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

Very good catch. I'll include it in my MMU patch set once I got it properly RCU'ified.

Alex


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-07 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07 10:34 [PATCH PPC] correctly check gfn_to_pfn() return value Gleb Natapov
     [not found] ` <20100707103412.GB4689-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-07-07 22:51   ` Alexander Graf
2010-07-07 22:51     ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.