Skip to contentSkip to conversation

Delivery Status Notification (Failure)

PATCH [email protected] 1 participant 1 message Jun 10, 2017

lore
Share & tools
lore
#0 lore raw

** Message not delivered **

There was a problem delivering your message to [email protected]. See the technical details below.

The response was:

Receive rate too high

-------------------------Blur-------------------------
This email is forwarded from a MASKED EMAIL you created using Blur. (https://dnt.abine.com/#help/faq/faq-whataremaskedemails).
IF THIS IS SPAM, CLICK HERE TO BLOCK:
https://dnt.abine.com/#/block_email/[email protected]/FWD-737QHYSMHVAYQAUCAOIQBDAAGAQLMA2YAMHECCJDLIBAYAWYAKIAZAQHSMCCWMBLIA4UANQUEIGCIMBKMAZUZ4AAEAACA===@opayq.com

Want to shop safely and privately online? Go Premium: https://dnt.abine.com/?pk_campaign=maskHeader#premium
-------------------------by Abine-------------------------

commit 4f35cb80e8813053d1cec9dc1654ceb6dd7575a0

Author:     Chao Gao <[email protected]>
AuthorDate: Tue Jun 6 14:34:30 2017 +0200
Commit:     Jan Beulich <[email protected]>
CommitDate: Tue Jun 6 14:34:30 2017 +0200

x86/vlapic: fix two flaws in emulating MSR_IA32_APICBASE

According to SDM Chapter ADVANCED PROGRAMMABLE INTERRUPT CONTROLLER (APIC) -> Extended XAPIC (x2APIC) -> x2APIC State Transitions, The existing code to handle guest's writing MSR_IA32_APICBASE has two flaws:
1. Transition from x2APIC Mode to Disabled Mode is allowed but wrongly disabled currently. Fix it by removing the related check.
2. Transition from x2APIC Mode to xAPIC Mode is illegal but wrongly allowed currently. Considering changing ENABLE bit of the MSR has been handled, it can be fixed by only allowing transition from xAPIC Mode to x2APIC Mode (the other two transitions: from x2APIC mode to xAPIC Mode, from disabled mode to invalid state (EN=0, EXTD=1) are disabled).

---
 xen/arch/x86/hvm/vlapic.c        | 6 ++----
 xen/include/asm-x86/hvm/vlapic.h | 4 ++++
 2 files changed, 6 insertions(+), 4 deletions(-)
xen/arch/x86/hvm/vlapic.c +2 -4
index cf8ee50..4320c6e 100644
@@ -1003,14 +1003,12 @@ bool_t vlapic_msr_set(struct vlapic *vlapic, uint64_t value)
         }
         else
         {
-            if ( unlikely(vlapic_x2apic_mode(vlapic)) )
-                return 0;
             vlapic->hw.disabled |= VLAPIC_HW_DISABLED;
             pt_may_unmask_irq(vlapic_domain(vlapic), NULL);
         }
     }
-    else if ( !(value & MSR_IA32_APICBASE_ENABLE) &&
-              unlikely(value & MSR_IA32_APICBASE_EXTD) )
+    else if ( ((vlapic->hw.apic_base_msr ^ value) & MSR_IA32_APICBASE_EXTD) &&
+              unlikely(!vlapic_xapic_mode(vlapic)) )
         return 0;
 
     vlapic->hw.apic_base_msr = value;
xen/include/asm-x86/hvm/vlapic.h +4 -0
index 4656293..a63fcd5 100644
@@ -51,8 +51,12 @@
 
 #define vlapic_base_address(vlapic)                             \
     ((vlapic)->hw.apic_base_msr & MSR_IA32_APICBASE_BASE)
+/* Only check EXTD bit as EXTD can't be set if it is disabled by hardware */
 #define vlapic_x2apic_mode(vlapic)                              \
     ((vlapic)->hw.apic_base_msr & MSR_IA32_APICBASE_EXTD)
+#define vlapic_xapic_mode(vlapic)                               \
+    (!vlapic_hw_disabled(vlapic) && \
+     !((vlapic)->hw.apic_base_msr & MSR_IA32_APICBASE_EXTD))
 
 /*
  * Generic APIC bitmap vector update & search routines.

--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[email protected]
https://lists.xenproject.org/xen-changelog

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel