From: Andrew Cooper Date: Wed, 28 Jun 2017 10:24:55 +0000 (+0100) Subject: Test basic driver initialisation in the selftests X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=4aedda03ca7e1e237cf9b3de8473303aadb8d112;p=people%2Fandrewcoop%2Fxen-test-framework.git Test basic driver initialisation in the selftests Signed-off-by: Andrew Cooper --- diff --git a/tests/selftest/main.c b/tests/selftest/main.c index 8ff42b9..402c3e3 100644 --- a/tests/selftest/main.c +++ b/tests/selftest/main.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -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); }