OSDN Git Service

KVM: PPC: Book3S HV: Add new capability to control MCE behaviour
authorAravinda Prasad <aravinda@linux.vnet.ibm.com>
Thu, 11 May 2017 11:02:48 +0000 (16:32 +0530)
committerPaul Mackerras <paulus@ozlabs.org>
Wed, 21 Jun 2017 03:37:08 +0000 (13:37 +1000)
commit134764ed6e12d9f99b3de68b8aaeae1ba842d91c
tree3cf9dad6e4bf242274a3a5913ec2110d62436074
parentee3308a254ec339b8d7c29e20274391685e58de1
KVM: PPC: Book3S HV: Add new capability to control MCE behaviour

This introduces a new KVM capability to control how KVM behaves
on machine check exception (MCE) in HV KVM guests.

If this capability has not been enabled, KVM redirects machine check
exceptions to guest's 0x200 vector, if the address in error belongs to
the guest. With this capability enabled, KVM will cause a guest exit
with the exit reason indicating an NMI.

The new capability is required to avoid problems if a new kernel/KVM
is used with an old QEMU, running a guest that doesn't issue
"ibm,nmi-register".  As old QEMU does not understand the NMI exit
type, it treats it as a fatal error.  However, the guest could have
handled the machine check error if the exception was delivered to
guest's 0x200 interrupt vector instead of NMI exit in case of old
QEMU.

[paulus@ozlabs.org - Reworded the commit message to be clearer,
 enable only on HV KVM.]

Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Documentation/virtual/kvm/api.txt
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kvm/powerpc.c
include/uapi/linux/kvm.h