diff options
-rw-r--r-- | xen/arch/x86/hvm/hvm.c | 6 | ||||
-rw-r--r-- | xen/arch/x86/hvm/vmx/vmcs.c | 2 | ||||
-rw-r--r-- | xen/arch/x86/hvm/vmx/vmx.c | 13 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/support.h | 1 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vmx/vmcs.h | 1 |
5 files changed, 11 insertions, 12 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 60b415ea15..552caca822 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -59,9 +59,6 @@ struct hvm_function_table hvm_funcs __read_mostly; /* I/O permission bitmap is globally shared by all HVM guests. */ char __attribute__ ((__section__ (".bss.page_aligned"))) hvm_io_bitmap[3*PAGE_SIZE]; -/* MSR permission bitmap is globally shared by all HVM guests. */ -char __attribute__ ((__section__ (".bss.page_aligned"))) - hvm_msr_bitmap[PAGE_SIZE]; void hvm_enable(struct hvm_function_table *fns) { @@ -75,9 +72,6 @@ void hvm_enable(struct hvm_function_table *fns) memset(hvm_io_bitmap, ~0, sizeof(hvm_io_bitmap)); clear_bit(0x80, hvm_io_bitmap); - /* All MSR accesses are intercepted by default. */ - memset(hvm_msr_bitmap, ~0, sizeof(hvm_msr_bitmap)); - hvm_funcs = *fns; hvm_enabled = 1; } diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index beed602f9b..977a98ce3c 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -289,7 +289,7 @@ static void construct_vmcs(struct vcpu *v) v->arch.hvm_vcpu.u.vmx.exec_control = vmx_cpu_based_exec_control; if ( cpu_has_vmx_msr_bitmap ) - __vmwrite(MSR_BITMAP, virt_to_maddr(hvm_msr_bitmap)); + __vmwrite(MSR_BITMAP, virt_to_maddr(vmx_msr_bitmap)); /* I/O access bitmap. */ __vmwrite(IO_BITMAP_A, virt_to_maddr(hvm_io_bitmap)); diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 368733c1a6..e1fe8290e5 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -51,6 +51,8 @@ #include <public/hvm/save.h> #include <asm/hvm/trace.h> +char *vmx_msr_bitmap; + static void vmx_ctxt_switch_from(struct vcpu *v); static void vmx_ctxt_switch_to(struct vcpu *v); @@ -1005,14 +1007,14 @@ static void disable_intercept_for_msr(u32 msr) */ if ( msr <= 0x1fff ) { - __clear_bit(msr, hvm_msr_bitmap + 0x000); /* read-low */ - __clear_bit(msr, hvm_msr_bitmap + 0x800); /* write-low */ + __clear_bit(msr, vmx_msr_bitmap + 0x000); /* read-low */ + __clear_bit(msr, vmx_msr_bitmap + 0x800); /* write-low */ } else if ( (msr >= 0xc0000000) && (msr <= 0xc0001fff) ) { msr &= 0x1fff; - __clear_bit(msr, hvm_msr_bitmap + 0x400); /* read-high */ - __clear_bit(msr, hvm_msr_bitmap + 0xc00); /* write-high */ + __clear_bit(msr, vmx_msr_bitmap + 0x400); /* read-high */ + __clear_bit(msr, vmx_msr_bitmap + 0xc00); /* write-high */ } } @@ -1105,6 +1107,9 @@ int start_vmx(void) if ( cpu_has_vmx_msr_bitmap ) { printk("VMX: MSR intercept bitmap enabled\n"); + vmx_msr_bitmap = alloc_xenheap_page(); + BUG_ON(vmx_msr_bitmap == NULL); + memset(vmx_msr_bitmap, ~0, PAGE_SIZE); disable_intercept_for_msr(MSR_FS_BASE); disable_intercept_for_msr(MSR_GS_BASE); } diff --git a/xen/include/asm-x86/hvm/support.h b/xen/include/asm-x86/hvm/support.h index fea8611bf8..3d7b3a43bb 100644 --- a/xen/include/asm-x86/hvm/support.h +++ b/xen/include/asm-x86/hvm/support.h @@ -215,7 +215,6 @@ int hvm_load(struct domain *d, hvm_domain_context_t *h); /* End of save/restore */ extern char hvm_io_bitmap[]; -extern char hvm_msr_bitmap[]; extern int hvm_enabled; void hvm_enable(struct hvm_function_table *); diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h index 23a0b71be0..1391941ab5 100644 --- a/xen/include/asm-x86/hvm/vmx/vmcs.h +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h @@ -121,6 +121,7 @@ extern u32 vmx_vmentry_control; #define cpu_has_vmx_msr_bitmap \ (vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_MSR_BITMAP) +extern char *vmx_msr_bitmap; /* VMCS Encordings */ enum vmcs_field { |