[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators



Most of them have been unused since the dropping of 32-bit support, and
the few remaining cases are more efficiently dealt with using a generic
macro (and probably things should have been done that way from the
beginning).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
As already mentioned in
http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg01580.html,
looking at the changes to vvmx.c here emphasizes the question about the
inconsistency between nvmx_vcpu_initialise() and nvmx_handle_vmwrite()
wrt the MSR bitmap handling.

--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -98,9 +98,9 @@ int nvmx_vcpu_initialise(struct vcpu *v)
          * Let them vmexit as usual.
          */
         set_bit(IO_BITMAP_A, vw);
-        set_bit(IO_BITMAP_A_HIGH, vw);
+        set_bit(VMCS_HIGH(IO_BITMAP_A), vw);
         set_bit(IO_BITMAP_B, vw);
-        set_bit(IO_BITMAP_B_HIGH, vw);
+        set_bit(VMCS_HIGH(IO_BITMAP_B), vw);
 
         unmap_domain_page(vr);
         unmap_domain_page(vw);
@@ -1761,15 +1761,15 @@ int nvmx_handle_vmwrite(struct cpu_user_
     vmcs_encoding = reg_read(regs, decode.reg2);
     __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand);
 
-    switch ( vmcs_encoding )
+    switch ( vmcs_encoding & ~VMCS_HIGH(0) )
     {
-    case IO_BITMAP_A: case IO_BITMAP_A_HIGH:
+    case IO_BITMAP_A:
         okay = _map_io_bitmap(v, IO_BITMAP_A);
         break;
-    case IO_BITMAP_B: case IO_BITMAP_B_HIGH:
+    case IO_BITMAP_B:
         okay = _map_io_bitmap(v, IO_BITMAP_B);
         break;
-    case MSR_BITMAP: case MSR_BITMAP_HIGH:
+    case MSR_BITMAP:
         okay = _map_msr_bitmap(v);
         break;
     }
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -304,6 +304,7 @@ extern u64 vmx_basic_msr;
 #define VMX_GUEST_INTR_STATUS_SVI_OFFSET        8
 
 /* VMCS field encodings. */
+#define VMCS_HIGH(x) ((x) | 1)
 enum vmcs_field {
     VIRTUAL_PROCESSOR_ID            = 0x00000000,
     POSTED_INTR_NOTIFICATION_VECTOR = 0x00000002,
@@ -325,56 +326,33 @@ enum vmcs_field {
     HOST_GS_SELECTOR                = 0x00000c0a,
     HOST_TR_SELECTOR                = 0x00000c0c,
     IO_BITMAP_A                     = 0x00002000,
-    IO_BITMAP_A_HIGH                = 0x00002001,
     IO_BITMAP_B                     = 0x00002002,
-    IO_BITMAP_B_HIGH                = 0x00002003,
     MSR_BITMAP                      = 0x00002004,
-    MSR_BITMAP_HIGH                 = 0x00002005,
     VM_EXIT_MSR_STORE_ADDR          = 0x00002006,
-    VM_EXIT_MSR_STORE_ADDR_HIGH     = 0x00002007,
     VM_EXIT_MSR_LOAD_ADDR           = 0x00002008,
-    VM_EXIT_MSR_LOAD_ADDR_HIGH      = 0x00002009,
     VM_ENTRY_MSR_LOAD_ADDR          = 0x0000200a,
-    VM_ENTRY_MSR_LOAD_ADDR_HIGH     = 0x0000200b,
     TSC_OFFSET                      = 0x00002010,
-    TSC_OFFSET_HIGH                 = 0x00002011,
     VIRTUAL_APIC_PAGE_ADDR          = 0x00002012,
-    VIRTUAL_APIC_PAGE_ADDR_HIGH     = 0x00002013,
     APIC_ACCESS_ADDR                = 0x00002014,
-    APIC_ACCESS_ADDR_HIGH           = 0x00002015,
     PI_DESC_ADDR                    = 0x00002016,
-    PI_DESC_ADDR_HIGH               = 0x00002017,
     VMFUNC_CONTROL                  = 0x00002018,
     EPT_POINTER                     = 0x0000201a,
-    EPT_POINTER_HIGH                = 0x0000201b,
     EOI_EXIT_BITMAP0                = 0x0000201c,
 #define EOI_EXIT_BITMAP(n) (EOI_EXIT_BITMAP0 + (n) * 2) /* n = 0...3 */
     VMREAD_BITMAP                   = 0x00002026,
-    VMREAD_BITMAP_HIGH              = 0x00002027,
     VMWRITE_BITMAP                  = 0x00002028,
-    VMWRITE_BITMAP_HIGH             = 0x00002029,
     GUEST_PHYSICAL_ADDRESS          = 0x00002400,
-    GUEST_PHYSICAL_ADDRESS_HIGH     = 0x00002401,
     VMCS_LINK_POINTER               = 0x00002800,
-    VMCS_LINK_POINTER_HIGH          = 0x00002801,
     GUEST_IA32_DEBUGCTL             = 0x00002802,
-    GUEST_IA32_DEBUGCTL_HIGH        = 0x00002803,
     GUEST_PAT                       = 0x00002804,
-    GUEST_PAT_HIGH                  = 0x00002805,
     GUEST_EFER                      = 0x00002806,
-    GUEST_EFER_HIGH                 = 0x00002807,
     GUEST_PERF_GLOBAL_CTRL          = 0x00002808,
-    GUEST_PERF_GLOBAL_CTRL_HIGH     = 0x00002809,
     GUEST_PDPTE0                    = 0x0000280a,
 #define GUEST_PDPTE(n) (GUEST_PDPTE0 + (n) * 2) /* n = 0...3 */
     GUEST_BNDCFGS                   = 0x00002812,
-    GUEST_BNDCFGS_HIGH              = 0x00002813,
     HOST_PAT                        = 0x00002c00,
-    HOST_PAT_HIGH                   = 0x00002c01,
     HOST_EFER                       = 0x00002c02,
-    HOST_EFER_HIGH                  = 0x00002c03,
     HOST_PERF_GLOBAL_CTRL           = 0x00002c04,
-    HOST_PERF_GLOBAL_CTRL_HIGH      = 0x00002c05,
     PIN_BASED_VM_EXEC_CONTROL       = 0x00004000,
     CPU_BASED_VM_EXEC_CONTROL       = 0x00004002,
     EXCEPTION_BITMAP                = 0x00004004,


Attachment: VMX-drop-VMCS-high-enums.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.