Skip to contentSkip to conversation

VMX: replace some plain numbers

PATCH Superseded Liang Li 2 participants 4 messages Apr 16, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw
In reply to Liang Li

Sorry, invalid patch, Please ignore this.

Quoted 38 lines
 xen/arch/x86/hvm/vmx/vmx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
xen/arch/x86/hvm/vmx/vmx.c +0 -1
index 6c4f78c..5e90027 100644
@@ -2628,8 +2628,9 @@ static void vmx_idtv_reinject(unsigned long
 idtv_info)
          * Clear NMI-blocking interruptibility info if an NMI delivery faulted.
          * Re-delivery will re-set it (see SDM 3B 25.7.1.2).
          */
-        if ( cpu_has_vmx_vnmi && ((idtv_info & INTR_INFO_INTR_TYPE_MASK)

==

xen/arch/x86/hvm/vmx/vmx.c +7 -5
-                                 (X86_EVENTTYPE_NMI<<8)) )
+        if ( cpu_has_vmx_vnmi &&
+             ((idtv_info & INTR_INFO_INTR_TYPE_MASK) ==
+              MASK_INSR(X86_EVENTTYPE_NMI, INTR_INFO_INTR_TYPE_MASK)) )
         {
             unsigned long intr_info;
@@ -2705,9 +2706,9 @@ void vmx_vmexit_handler(struct cpu_user_regs
 *regs)
         vector = intr_info & INTR_INFO_VECTOR_MASK;
         if ( vector == TRAP_machine_check )
             do_machine_check(regs);
-        if ( vector == TRAP_nmi
-             && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
-                 (X86_EVENTTYPE_NMI << 8)) )
+        if ( (vector == TRAP_nmi) &&
+             ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
+              MASK_INSR(X86_EVENTTYPE_EXT_INTR,
+ INTR_INFO_INTR_TYPE_MASK)) )
         {
             exception_table[TRAP_nmi](regs);
             enable_nmis();
--

1.9.1

#3 lore raw
Quoted 4 lines

Much appreciated, thanks!

Jan

I just sent the wrong patch , sorry! I will send the right one.

Liang

Liang Li

author
#0 lore raw

PATCH 1/1 VMX: replace some plain numbers

... making the code better document itself. No functional change intended.

---
 xen/arch/x86/hvm/vmx/vmx.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
xen/arch/x86/hvm/vmx/vmx.c +6 -5
index 6c4f78c..5e90027 100644
@@ -2628,8 +2628,9 @@ static void vmx_idtv_reinject(unsigned long idtv_info)
          * Clear NMI-blocking interruptibility info if an NMI delivery faulted.
          * Re-delivery will re-set it (see SDM 3B 25.7.1.2).
          */
-        if ( cpu_has_vmx_vnmi && ((idtv_info & INTR_INFO_INTR_TYPE_MASK) ==
-                                 (X86_EVENTTYPE_NMI<<8)) )
+        if ( cpu_has_vmx_vnmi &&
+             ((idtv_info & INTR_INFO_INTR_TYPE_MASK) ==
+              MASK_INSR(X86_EVENTTYPE_NMI, INTR_INFO_INTR_TYPE_MASK)) )
         {
             unsigned long intr_info;
 
@@ -2705,9 +2706,9 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         vector = intr_info & INTR_INFO_VECTOR_MASK;
         if ( vector == TRAP_machine_check )
             do_machine_check(regs);
-        if ( vector == TRAP_nmi
-             && ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
-                 (X86_EVENTTYPE_NMI << 8)) )
+        if ( (vector == TRAP_nmi) &&
+             ((intr_info & INTR_INFO_INTR_TYPE_MASK) ==
+              MASK_INSR(X86_EVENTTYPE_EXT_INTR, INTR_INFO_INTR_TYPE_MASK)) )
         {
             exception_table[TRAP_nmi](regs);
             enable_nmis();
Signature · 1 line
1.9.1