]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Test basic driver initialisation in the selftests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Jun 2017 10:24:55 +0000 (11:24 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Jun 2017 10:26:56 +0000 (11:26 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/selftest/main.c

index 8ff42b9079bf6899a841e47fd7e7ce0d7b45f8ac..402c3e3bc9fef501168cabdaa0aa7328ac8d7095 100644 (file)
@@ -11,6 +11,7 @@
  */
 #include <xtf.h>
 
+#include <arch/apic.h>
 #include <arch/idt.h>
 #include <arch/processor.h>
 #include <arch/segment.h>
@@ -283,6 +284,22 @@ static void test_custom_idte(void)
         xtf_failure("Fail: Unexpected result %#x\n", res);
 };
 
+static void test_driver_init(void)
+{
+    int rc;
+
+    printk("Test: Driver basic initialisation\n");
+
+    if ( IS_DEFINED(CONFIG_HVM) )
+    {
+        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);
+    }
+}
+
 void test_main(void)
 {
     /*
@@ -311,6 +328,7 @@ void test_main(void)
     test_unhandled_exception_hook();
     test_extable_handler();
     test_custom_idte();
+    test_driver_init();
 
     xtf_success(NULL);
 }