]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
selftest: test x2apic basic initialisation as well if possible
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 22 Feb 2018 17:21:34 +0000 (17:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Feb 2018 17:12:38 +0000 (17:12 +0000)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/selftest/main.c

index 5bff02be40be8e62a2050f20a683a8973f754dc8..f9bf4f4ada93c23ddfcf839872a323bda891161a 100644 (file)
@@ -309,8 +309,19 @@ static void test_driver_init(void)
         rc = apic_init(APIC_MODE_XAPIC);
 
         /* Cope with guests which have LAPIC emulation disabled. */
-        if ( rc && rc != -ENODEV )
-            xtf_failure("Fail: apic_init() returned %d\n", rc);
+        if ( rc != -ENODEV )
+        {
+            if ( rc )
+                xtf_failure("Fail: apic_init(XAPIC) returned %d\n", rc);
+
+            if ( cpu_has_x2apic )
+            {
+                rc = apic_init(APIC_MODE_X2APIC);
+
+                if ( rc )
+                    xtf_failure("Fail: apic_init(X2APIC) returned %d\n", rc);
+            }
+        }
     }
 
     rc = xenstore_init();