hw/mips: Add API to convert KVM guest KSEG0 <-> GPA
commit253fffe725e8ecc0147a4c6f0893493c1393f0f7
authorSanjay Lal <sanjayl@kymasys.com>
Tue, 17 Jun 2014 22:10:28 +0000 (17 23:10 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 18 Jun 2014 14:58:10 +0000 (18 16:58 +0200)
treebd4f5a7e321bafe71e9d5020bfda73c12ce2b937
parent353a243e22fae2b993ab7f2d123c2b81013b3c5d
hw/mips: Add API to convert KVM guest KSEG0 <-> GPA

Add API for converting physical addresses to KVM guest KSEG0 addresses,
and fix the existing API for converting KSEG0 addresses to physical
addresses to work in the KVM case. Both have the same sized KSEG0, so
it's just a case of fixing the mask.

In KVM trap and emulate mode both the guest kernel and guest userspace
execute in useg:
    Guest User address space:   0x00000000..0x3fffffff
    Guest Kernel Unmapped:      0x40000000..0x5fffffff
    Guest Kernel Mapped:        0x60000000..0x7fffffff

Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/mips/addr.c
include/hw/mips/cpudevs.h