[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kvm
Subject:    [PATCH kvm-unit-tests] x86: Test physical x2apic broadcast ICR
From:       Nadav Amit <namit () cs ! technion ! ac ! il>
Date:       2014-09-29 18:19:16
Message-ID: 1412014756-17083-1-git-send-email-namit () cs ! technion ! ac ! il
[Download RAW message or body]

Previously KVM did not deliver x2apic broadcast IPI (dest-id==0xFFFFFFFF) with
physical delivery mode. This test checks the fix.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
---
 x86/apic.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/x86/apic.c b/x86/apic.c
index 2619d85..373f6e0 100644
--- a/x86/apic.c
+++ b/x86/apic.c
@@ -372,6 +372,24 @@ static void test_multiple_nmi(void)
     report("multiple nmi", ok);
 }
 
+static void test_x2apic_broadcast(void)
+{
+	int i = 0;
+	u32 old_received = nmi_received;
+
+	if (!enable_x2apic())
+		return;
+
+	handle_irq(2, multiple_nmi_handler);
+
+	apic_icr_write(APIC_DEST_PHYSICAL | APIC_DM_NMI | APIC_INT_ASSERT,
+			(u32)-1);
+	while (nmi_received == old_received && i++ < 10000)
+		pause();
+
+	report("x2apic broadcast", nmi_received != old_received);
+}
+
 int main()
 {
     setup_vm();
@@ -392,6 +410,7 @@ int main()
     test_multiple_nmi();
 
     test_tsc_deadline_timer();
+    test_x2apic_broadcast();
 
     return report_summary();
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic