From 631947366fec03402eef9dd3434a6488eb40d7c4 Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Thu, 16 Apr 2015 22:44:51 +0000 Subject: [PATCH] Relax the check on which vectors can be delivered through the APIC. According to the Intel SDM vectors 16 through 255 are allowed to be delivered via the local APIC. Reported by: Leon Dang (ldang@nahannisys.com) MFC after: 2 weeks --- sys/amd64/vmm/vmm_lapic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/vmm_lapic.c b/sys/amd64/vmm/vmm_lapic.c index 15a995e9823d..6bccd32f7576 100644 --- a/sys/amd64/vmm/vmm_lapic.c +++ b/sys/amd64/vmm/vmm_lapic.c @@ -57,7 +57,11 @@ lapic_set_intr(struct vm *vm, int cpu, int vector, bool level) if (cpu < 0 || cpu >= VM_MAXCPU) return (EINVAL); - if (vector < 32 || vector > 255) + /* + * According to section "Maskable Hardware Interrupts" in Intel SDM + * vectors 16 through 255 can be delivered through the local APIC. + */ + if (vector < 16 || vector > 255) return (EINVAL); vlapic = vm_lapic(vm, cpu);