]> xenbits.xensource.com Git - xtf.git/commitdiff
x86/apic: Set SPIV.EN in apic_init() so the device is ready for use
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:44 +0000 (17:12 +0000)
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 <andrew.cooper3@citrix.com>
arch/x86/apic.c
arch/x86/include/arch/apic.h

index 4e7b5b63df4a165c5239661ed780f5e7ac95e186..4bd8f941430ca7c6b2063cc5164178686ed8705a 100644 (file)
@@ -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;
 }
 
index 1389f70cb535834f7cb58e0f439432b48376a70f..9279e6c2dd1cbb20cf44ee46a5094fded5eb5a4c 100644 (file)
@@ -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