]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MIPS/T&E: Handle read only GPA in TLB mod
authorJames Hogan <james.hogan@imgtec.com>
Tue, 13 Dec 2016 13:02:36 +0000 (13:02 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 3 Feb 2017 15:21:22 +0000 (15:21 +0000)
commit8dd4800d6156554ca5dca6ebad0c50f543ab209f
treede5b3352cfc7ad32122b62b2ab961cc8acd6440f
parentdd14b2023edd57e273a9bce6d3fdc67a850f1d03
KVM: MIPS/T&E: Handle read only GPA in TLB mod

Rewrite TLB modified exception handling to handle read only GPA memory
regions, instead of unconditionally passing the exception to the guest.

If the guest TLB is not the cause of the exception we call into the
normal TLB fault handling depending on the memory segment, which will
soon attempt to remap the physical page to be writable (handling dirty
page tracking or copy on write in the process).

Failing that we fall back to treating it as MMIO, due to a read only
memory region. Once the capability is enabled, this will allow read only
memory regions (such as the Malta boot flash as emulated by QEMU) to
have writes treated as MMIO, while still allowing reads to run
untrapped.

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
arch/mips/include/asm/kvm_host.h
arch/mips/kvm/emulate.c
arch/mips/kvm/trap_emul.c