[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Implement the I/O bitmap vm execution control.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID cb0f79c9d3fc6b926835eb4ca801dbc289ee5fea # Parent edc6e8921dd1a7c539b1c340f83761ff40db4526 Implement the I/O bitmap vm execution control. With this patch, we should not bee seeing any vmexits for debug port accesses. Signed-off-by: Edwin Zhai <edwin.zhai@xxxxxxxxx> Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx> diff -r edc6e8921dd1 -r cb0f79c9d3fc xen/include/asm-x86/vmx.h --- a/xen/include/asm-x86/vmx.h Mon Jul 25 21:01:57 2005 +++ b/xen/include/asm-x86/vmx.h Mon Jul 25 21:02:09 2005 @@ -61,6 +61,7 @@ CPU_BASED_INVDPG_EXITING | \ CPU_BASED_MWAIT_EXITING | \ CPU_BASED_MOV_DR_EXITING | \ + CPU_BASED_ACTIVATE_IO_BITMAP | \ CPU_BASED_UNCOND_IO_EXITING \ ) diff -r edc6e8921dd1 -r cb0f79c9d3fc xen/arch/x86/vmx.c --- a/xen/arch/x86/vmx.c Mon Jul 25 21:01:57 2005 +++ b/xen/arch/x86/vmx.c Mon Jul 25 21:02:09 2005 @@ -608,11 +608,6 @@ addr = (exit_qualification >> 16) & (0xffff); else addr = regs->edx & 0xffff; - - if (addr == 0x80) { - __update_guest_eip(inst_len); - return; - } vio = get_vio(d->domain, d->vcpu_id); if (vio == 0) { diff -r edc6e8921dd1 -r cb0f79c9d3fc xen/arch/x86/vmx_vmcs.c --- a/xen/arch/x86/vmx_vmcs.c Mon Jul 25 21:01:57 2005 +++ b/xen/arch/x86/vmx_vmcs.c Mon Jul 25 21:02:09 2005 @@ -59,9 +59,11 @@ free_xenheap_pages(vmcs, order); } -static inline int construct_vmcs_controls(void) +static inline int construct_vmcs_controls(struct arch_vmx_struct *arch_vmx) { int error = 0; + void *io_bitmap_a; + void *io_bitmap_b; error |= __vmwrite(PIN_BASED_VM_EXEC_CONTROL, MONITOR_PIN_BASED_EXEC_CONTROLS); @@ -72,6 +74,20 @@ error |= __vmwrite(VM_EXIT_CONTROLS, MONITOR_VM_EXIT_CONTROLS); error |= __vmwrite(VM_ENTRY_CONTROLS, MONITOR_VM_ENTRY_CONTROLS); + + /* need to use 0x1000 instead of PAGE_SIZE */ + io_bitmap_a = (void*) alloc_xenheap_pages(get_order(0x1000)); + io_bitmap_b = (void*) alloc_xenheap_pages(get_order(0x1000)); + memset(io_bitmap_a, 0xff, 0x1000); + /* don't bother debug port access */ + clear_bit(PC_DEBUG_PORT, io_bitmap_a); + memset(io_bitmap_b, 0xff, 0x1000); + + error |= __vmwrite(IO_BITMAP_A, (u64) virt_to_phys(io_bitmap_a)); + error |= __vmwrite(IO_BITMAP_B, (u64) virt_to_phys(io_bitmap_b)); + + arch_vmx->io_bitmap_a = io_bitmap_a; + arch_vmx->io_bitmap_b = io_bitmap_b; return error; } @@ -432,7 +448,7 @@ (unsigned long) vmcs_phys_ptr); return -EINVAL; } - if ((error = construct_vmcs_controls())) { + if ((error = construct_vmcs_controls(arch_vmx))) { printk("construct_vmcs: construct_vmcs_controls failed\n"); return -EINVAL; } diff -r edc6e8921dd1 -r cb0f79c9d3fc xen/include/asm-x86/vmx_vmcs.h --- a/xen/include/asm-x86/vmx_vmcs.h Mon Jul 25 21:01:57 2005 +++ b/xen/include/asm-x86/vmx_vmcs.h Mon Jul 25 21:02:09 2005 @@ -69,6 +69,8 @@ unsigned long shadow_gs; }; +#define PC_DEBUG_PORT 0x80 + struct arch_vmx_struct { struct vmcs_struct *vmcs; /* VMCS pointer in virtual */ unsigned long flags; /* VMCS flags */ @@ -76,6 +78,7 @@ unsigned long cpu_cr3; unsigned long cpu_state; struct msr_state msr_content; + void *io_bitmap_a, *io_bitmap_b; }; #define vmx_schedule_tail(next) \ diff -r edc6e8921dd1 -r cb0f79c9d3fc xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c Mon Jul 25 21:01:57 2005 +++ b/xen/arch/x86/domain.c Mon Jul 25 21:02:09 2005 @@ -373,6 +373,14 @@ out: free_vmcs(vmcs); + if(v->arch.arch_vmx.io_bitmap_a != 0) { + free_xenheap_pages(v->arch.arch_vmx.io_bitmap_a, get_order(0x1000)); + v->arch.arch_vmx.io_bitmap_a = 0; + } + if(v->arch.arch_vmx.io_bitmap_b != 0) { + free_xenheap_pages(v->arch.arch_vmx.io_bitmap_b, get_order(0x1000)); + v->arch.arch_vmx.io_bitmap_b = 0; + } v->arch.arch_vmx.vmcs = 0; return error; } @@ -926,6 +934,14 @@ BUG_ON(v->arch.arch_vmx.vmcs == NULL); free_vmcs(v->arch.arch_vmx.vmcs); + if(v->arch.arch_vmx.io_bitmap_a != 0) { + free_xenheap_pages(v->arch.arch_vmx.io_bitmap_a, get_order(0x1000)); + v->arch.arch_vmx.io_bitmap_a = 0; + } + if(v->arch.arch_vmx.io_bitmap_b != 0) { + free_xenheap_pages(v->arch.arch_vmx.io_bitmap_b, get_order(0x1000)); + v->arch.arch_vmx.io_bitmap_b = 0; + } v->arch.arch_vmx.vmcs = 0; free_monitor_pagetable(v); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |