Add basic MIPS KVM support for 64-bit host kernels, primarily to prepare for VZ support on MIPS64 processors. Note, this does not allow 64-bit guests to be supported. This patchset is based on my recent r6 support patchset. Patches 1-11 fix various distinct parts of KVM MIPS that aren't portable to a 64-bit host kernel, and patch 12 allows KVM to be enabled on such kernels. Only patches 1 & 12 touch anything outside of MIPS KVM. Patch 1 in particular needs some imput from general MIPS folk. James Hogan (12): MIPS: Fix definition of KSEGX() for 64-bit MIPS: KVM: Use virt_to_phys() to get commpage PFN MIPS: KVM: Use kmap instead of CKSEG0ADDR() MIPS: KVM: Make entry code MIPS64 friendly MIPS: KVM: Set CP0_Status.KX on MIPS64 MIPS: KVM: Use 64-bit CP0_EBase when appropriate MIPS: KVM: Fail if ebase doesn't fit in CP0_EBase MIPS: KVM: Fix 64-bit big endian dynamic translation MIPS: KVM: Sign extend MFC0/RDHWR results MIPS: KVM: Fix ptr->int cast via KVM_GUEST_KSEGX() MIPS: KVM: Reset CP0_PageMask during host TLB flush MIPS: Select HAVE_KVM for MIPS64_R{2,6} arch/mips/Kconfig | 2 + arch/mips/include/asm/addrspace.h | 2 +- arch/mips/kvm/dyntrans.c | 27 +++++++++---- arch/mips/kvm/emulate.c | 7 ++-- arch/mips/kvm/entry.c | 83 +++++++++++++++++++++++++-------------- arch/mips/kvm/mips.c | 12 ++++++ arch/mips/kvm/mmu.c | 7 +++- arch/mips/kvm/tlb.c | 4 +- 8 files changed, 102 insertions(+), 42 deletions(-) Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx> Cc: "Radim Krčmář" <rkrcmar@xxxxxxxxxx> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Cc: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx> Cc: linux-mips@xxxxxxxxxxxxxx Cc: kvm@xxxxxxxxxxxxxxx -- 2.4.10