diff options
author | James Hogan <james.hogan@imgtec.com> | 2016-07-08 06:53:21 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-08-01 12:42:21 -0400 |
commit | cfacaced0cce20859de25b61d672edeb9789a1e9 (patch) | |
tree | 5270e1f9435c2b740c8b330514e36fb2e886e5e2 | |
parent | 6002bdd3e6688954f5f5c1d71b83862cfd7387d9 (diff) |
MIPS: KVM: Use virt_to_phys() to get commpage PFN
Calculate the PFN of the commpage using virt_to_phys() instead of
CPHYSADDR(). This is more portable as kzalloc() may allocate from XKPhys
instead of KSeg0 on 64-bit kernels, which CPHYSADDR() doesn't handle.
This is sufficient for highmem kernels too since kzalloc() will allocate
from lowmem in KSeg0.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/mips/kvm/tlb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kvm/tlb.c b/arch/mips/kvm/tlb.c index 9699352293e4..f5f8c2acae53 100644 --- a/arch/mips/kvm/tlb.c +++ b/arch/mips/kvm/tlb.c | |||
@@ -176,7 +176,7 @@ int kvm_mips_handle_commpage_tlb_fault(unsigned long badvaddr, | |||
176 | unsigned long entrylo[2] = { 0, 0 }; | 176 | unsigned long entrylo[2] = { 0, 0 }; |
177 | unsigned int pair_idx; | 177 | unsigned int pair_idx; |
178 | 178 | ||
179 | pfn = CPHYSADDR(vcpu->arch.kseg0_commpage) >> PAGE_SHIFT; | 179 | pfn = PFN_DOWN(virt_to_phys(vcpu->arch.kseg0_commpage)); |
180 | pair_idx = (badvaddr >> PAGE_SHIFT) & 1; | 180 | pair_idx = (badvaddr >> PAGE_SHIFT) & 1; |
181 | entrylo[pair_idx] = mips3_paddr_to_tlbpfn(pfn << PAGE_SHIFT) | | 181 | entrylo[pair_idx] = mips3_paddr_to_tlbpfn(pfn << PAGE_SHIFT) | |
182 | ((_page_cachable_default >> _CACHE_SHIFT) << ENTRYLO_C_SHIFT) | | 182 | ((_page_cachable_default >> _CACHE_SHIFT) << ENTRYLO_C_SHIFT) | |