From: Andrew Cooper Date: Thu, 22 Feb 2018 17:21:34 +0000 (+0000) Subject: x86/apic: Set SPIV.EN in apic_init() so the device is ready for use X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e5a9c74084130f8e23bc457b98b4084d2dcacd58;p=people%2Fandrewcoop%2Fxen-test-framework.git x86/apic: Set SPIV.EN in apic_init() so the device is ready for use This is more useful behaviour than forcing all tests which call apic_init() to set up SPIV themselves to actually receive interrupts. Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/apic.c b/arch/x86/apic.c index 4e7b5b6..4bd8f94 100644 --- a/arch/x86/apic.c +++ b/arch/x86/apic.c @@ -88,6 +88,12 @@ int apic_init(enum apic_mode mode) cur_apic_mode = mode; } + /* + * Enable the APIC. Use 0xff for the spurious vector, not that we expect + * to see any. + */ + apic_write(APIC_SPIV, APIC_SPIV_APIC_ENABLED | 0xff); + return 0; } diff --git a/arch/x86/include/arch/apic.h b/arch/x86/include/arch/apic.h index 1389f70..9279e6c 100644 --- a/arch/x86/include/arch/apic.h +++ b/arch/x86/include/arch/apic.h @@ -18,6 +18,9 @@ /* Local APIC register definitions. */ #define APIC_ID 0x020 #define APIC_LVR 0x030 +#define APIC_SPIV 0x0f0 +#define APIC_SPIV_APIC_ENABLED 0x00100 + #define APIC_ICR 0x300 #define APIC_DM_NMI 0x00400 #define APIC_ICR_BUSY 0x01000