From: Paul Mackerras Date: Thu, 20 Sep 2012 19:39:21 +0000 (+0000) Subject: KVM: PPC: Book3S HV: Fix calculation of guest phys address for MMIO emulation X-Git-Tag: omap-for-v3.8/fixes-for-merge-window-v4-signed~27^2~56^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70bddfefbdcdbfdebd81d8b59ff8a7fa5d450ccc;p=pandora-kernel.git KVM: PPC: Book3S HV: Fix calculation of guest phys address for MMIO emulation In the case where the host kernel is using a 64kB base page size and the guest uses a 4k HPTE (hashed page table entry) to map an emulated MMIO device, we were calculating the guest physical address wrongly. We were calculating a gfn as the guest physical address shifted right 16 bits (PAGE_SHIFT) but then only adding back in 12 bits from the effective address, since the HPTE had a 4k page size. Thus the gpa reported to userspace was missing 4 bits. Instead, we now compute the guest physical address from the HPTE without reference to the host page size, and then compute the gfn by shifting the gpa right PAGE_SHIFT bits. Reported-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras Signed-off-by: Alexander Graf --- Reading git-diff-tree failed