summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Stecklina <js@alien8.de>2012-01-16 14:02:20 +0100
committerAvi Kivity <avi@redhat.com>2012-03-05 13:52:43 +0100
commita52315e1d549dad80ff443151927226c11fd8c2b (patch)
tree8b23219f2e916c53941994bbcba756aee8c4bf46
parentKVM: fix error handling for out of range irq (diff)
downloadlinux-a52315e1d549dad80ff443151927226c11fd8c2b.tar.xz
linux-a52315e1d549dad80ff443151927226c11fd8c2b.zip
KVM: Don't mistreat edge-triggered INIT IPI as INIT de-assert. (LAPIC)
If the guest programs an IPI with level=0 (de-assert) and trig_mode=0 (edge), it is erroneously treated as INIT de-assert and ignored, but to quote the spec: "For this delivery mode [INIT de-assert], the level flag must be set to 0 and trigger mode flag to 1." Signed-off-by: Julian Stecklina <js@alien8.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kvm/lapic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index cfdc6e0ef002..3ee1d83c695d 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -433,7 +433,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
break;
case APIC_DM_INIT:
- if (level) {
+ if (!trig_mode || level) {
result = 1;
vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
kvm_make_request(KVM_REQ_EVENT, vcpu);