Thread (14 messages) 14 messages, 4 authors, 2016-06-21

Re: [PATCH v3 1/2] KVM: PPC: New capability to control MCE behaviour

From: Paul Mackerras <hidden>
Date: 2016-01-23 10:28:57
Also in: kvm

On Wed, Jan 13, 2016 at 12:37:59PM +0530, Aravinda Prasad wrote:
This patch introduces a new KVM capability to control
how KVM behaves on machine check exception (MCE).
Without this capability, KVM redirects machine check
exceptions to guest's 0x200 vector if the address in
error belongs to the guest. With this capability KVM
causes a guest exit with NMI exit reason.

This is required to avoid problems if a new kernel/KVM
is used with an old QEMU for guests that don'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.
[snip]
quoted hunk ↗ jump to hunk
@@ -1132,6 +1135,10 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
 		break;
 	}
 #endif /* CONFIG_KVM_XICS */
+	case KVM_CAP_PPC_FWNMI:
+		r = 0;
+		vcpu->kvm->arch.fwnmi_enabled = true;
+		break;
Might we ever want to set this flag back to false after setting it to
true?  If so perhaps we should do vcpu->kvm->arch.fwnmi_enabled =
!!cap->args[0].  However, I admit I can't actually think of a
situation where we would need to reset it. :)

Paul.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help