|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] nested vmx: enable VMX-preemption timer for L1 VMM
# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
# Date 1354267457 0
# Node ID 110201bfc39e0a98cf2533265cc2c5b3327a5cdc
# Parent 8f2c5313298fe6eaf5e2038d0271af8b2e1958af
nested vmx: enable VMX-preemption timer for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
Acked-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---
diff -r 8f2c5313298f -r 110201bfc39e xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c Fri Nov 30 09:23:57 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vvmx.c Fri Nov 30 09:24:17 2012 +0000
@@ -237,6 +237,13 @@ static void reg_write(struct cpu_user_re
*pval = value;
}
+static inline u32 __n2_pin_exec_control(struct vcpu *v)
+{
+ struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
+
+ return __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
+}
+
static inline u32 __n2_exec_control(struct vcpu *v)
{
struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
@@ -511,7 +518,6 @@ static void nvmx_update_pin_control(stru
struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
shadow_cntrl = __get_vvmcs(nvcpu->nv_vvmcx, PIN_BASED_VM_EXEC_CONTROL);
- shadow_cntrl &= ~PIN_BASED_PREEMPT_TIMER;
shadow_cntrl |= host_cntrl;
__vmwrite(PIN_BASED_VM_EXEC_CONTROL, shadow_cntrl);
}
@@ -641,6 +647,7 @@ static const u16 vmcs_gstate_field[] = {
GUEST_INTERRUPTIBILITY_INFO,
GUEST_ACTIVITY_STATE,
GUEST_SYSENTER_CS,
+ GUEST_PREEMPTION_TIMER,
/* natural */
GUEST_ES_BASE,
GUEST_CS_BASE,
@@ -1269,7 +1276,9 @@ int nvmx_msr_read_intercept(unsigned int
break;
case MSR_IA32_VMX_PINBASED_CTLS:
/* 1-seetings */
- data = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING;
+ data = PIN_BASED_EXT_INTR_MASK |
+ PIN_BASED_NMI_EXITING |
+ PIN_BASED_PREEMPT_TIMER;
data <<= 32;
/* 0-settings */
data |= 0;
@@ -1513,6 +1522,11 @@ int nvmx_n2_vmexit_handler(struct cpu_us
if ( ctrl & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITING )
nvcpu->nv_vmexit_pending = 1;
break;
+ case EXIT_REASON_VMX_PREEMPTION_TIMER_EXPIRED:
+ ctrl = __n2_pin_exec_control(v);
+ if ( ctrl & PIN_BASED_PREEMPT_TIMER )
+ nvcpu->nv_vmexit_pending = 1;
+ break;
/* L1 has priority handling several other types of exits */
case EXIT_REASON_HLT:
ctrl = __n2_exec_control(v);
diff -r 8f2c5313298f -r 110201bfc39e xen/include/asm-x86/hvm/vmx/vmcs.h
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h Fri Nov 30 09:23:57 2012 +0000
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h Fri Nov 30 09:24:17 2012 +0000
@@ -357,6 +357,7 @@ enum vmcs_field {
GUEST_INTERRUPTIBILITY_INFO = 0x00004824,
GUEST_ACTIVITY_STATE = 0x00004826,
GUEST_SYSENTER_CS = 0x0000482A,
+ GUEST_PREEMPTION_TIMER = 0x0000482e,
HOST_SYSENTER_CS = 0x00004c00,
CR0_GUEST_HOST_MASK = 0x00006000,
CR4_GUEST_HOST_MASK = 0x00006002,
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |