KVM: PPC: Book3S HV: Handle guest-caused machine checks without panicking
Subsystems (3)
PATCH 1/1 KVM: PPC: Book3S HV: Handle guest-caused machine checks without panicking
Currently, if a machine check interrupt happens while we are in the guest, we exit the guest and call the host's machine check handler, which tends to cause the host to panic. Some machine checks can be triggered by the guest; for example, if the guest creates two entries in the SLB that map the same effective address, and then accesses that effective address, the CPU will take a machine check interrupt.
To handle this better, we firstly don't call the host's machine check handler for machine checks that happen inside the guest. Instead we call a new function, kvmppc_realmode_machine_check(), while still in real mode before exiting the guest. On POWER7, it handles the cases that the guest can trigger, either by flushing and reloading the SLB, or by flushing the TLB, and then it delivers the machine check interrupt to the guest. (On PPC970 we currently just exit the guest and leave it up to kvmppc_handle_exit() to handle the condition, which it doesn't, so the situation is no better -- but no worse -- on PPC970 now.)
---
This patch is against the kvm tree's next branch.
arch/powerpc/kvm/Makefile | 1 + arch/powerpc/kvm/book3s_hv_ras.c | 115 +++++++++++++++++++++++++++++++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 61 +++++++++------- 3 files changed, 153 insertions(+), 24 deletions(-) create mode 100644 arch/powerpc/kvm/book3s_hv_ras.c
arch/powerpc/kvm/Makefile +1 -0
@@ -72,6 +72,7 @@ kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HV) := \ book3s_hv_rmhandlers.o \ book3s_hv_rm_mmu.o \ book3s_64_vio_hv.o \ + book3s_hv_ras.o \ book3s_hv_builtin.o kvm-book3s_64-module-objs := \
arch/powerpc/kvm/book3s_hv_ras.c new file +115 -0
115 lines not on this page · raw message
arch/powerpc/kvm/book3s_hv_rmhandlers.S +37 -24
150 lines not on this page · raw message
Signature · 1 line
1.7.10.4