public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: Book3S HV: Don't drop low-order page address bits
@ 2013-12-16  2:31 Paul Mackerras
  2013-12-18 10:31 ` Alexander Graf
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2013-12-16  2:31 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm-ppc, kvm

Commit caaa4c804fae ("KVM: PPC: Book3S HV: Fix physical address
calculations") unfortunately resulted in some low-order address bits
getting dropped in the case where the guest is creating a 4k HPTE
and the host page size is 64k.  By getting the low-order bits from
hva rather than gpa we miss out on bits 12 - 15 in this case, since
hva is at page granularity.  This puts the missing bits back in.

Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
Alex, please apply this to your for-3.13 branch.

Thanks,
Paul.

 arch/powerpc/kvm/book3s_hv_rm_mmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index 1931aa3..8689e2e 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -240,6 +240,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags,
 			is_io = hpte_cache_bits(pte_val(pte));
 			pa = pte_pfn(pte) << PAGE_SHIFT;
 			pa |= hva & (pte_size - 1);
+			pa |= gpa & ~PAGE_MASK;
 		}
 	}
 
-- 
1.8.4.2

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

* Re: [PATCH] KVM: PPC: Book3S HV: Don't drop low-order page address bits
  2013-12-16  2:31 [PATCH] KVM: PPC: Book3S HV: Don't drop low-order page address bits Paul Mackerras
@ 2013-12-18 10:31 ` Alexander Graf
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2013-12-18 10:31 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: kvm-ppc, kvm@vger.kernel.org mailing list


On 16.12.2013, at 03:31, Paul Mackerras <paulus@samba.org> wrote:

> Commit caaa4c804fae ("KVM: PPC: Book3S HV: Fix physical address
> calculations") unfortunately resulted in some low-order address bits
> getting dropped in the case where the guest is creating a 4k HPTE
> and the host page size is 64k.  By getting the low-order bits from
> hva rather than gpa we miss out on bits 12 - 15 in this case, since
> hva is at page granularity.  This puts the missing bits back in.
> 
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Paul Mackerras <paulus@samba.org>

Thanks, applied to for-3.13.


Alex

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

end of thread, other threads:[~2013-12-18 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-16  2:31 [PATCH] KVM: PPC: Book3S HV: Don't drop low-order page address bits Paul Mackerras
2013-12-18 10:31 ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox