]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
x86/pv: allow reading APIC_BASE MSR
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 17 Aug 2020 15:57:54 +0000 (17:57 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 18 Aug 2020 16:34:50 +0000 (17:34 +0100)
Linux PV guests will attempt to read the APIC_BASE MSR, so just report
a default value to make Linux happy.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/pv/emul-priv-op.c

index 971ba9e58c2f6befaac8f9d2b149f7be1548d3c0..bcc1188f6a164d7effdb290ea7cb9c8bbad8d568 100644 (file)
@@ -872,6 +872,13 @@ static int read_msr(unsigned int reg, uint64_t *val,
 
     switch ( reg )
     {
+    case MSR_APIC_BASE:
+        /* Linux PV guests will attempt to read APIC_BASE. */
+        *val = APIC_BASE_ENABLE | APIC_DEFAULT_PHYS_BASE;
+        if ( !curr->vcpu_id )
+            *val |= APIC_BASE_BSP;
+        return X86EMUL_OKAY;
+
     case MSR_FS_BASE:
         if ( is_pv_32bit_domain(currd) )
             break;