diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2013-03-13 06:31:24 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-03-14 04:01:21 -0400 |
commit | 0238ea913c21a89387f93097acfbdfeebc9c9257 (patch) | |
tree | 679e48065643a243ce9ee5ada932fd558ba39b40 /arch/x86/include | |
parent | c18911a23ce1dec27fa3325b50587de2569d26f8 (diff) |
KVM: nVMX: Add preemption timer support
Provided the host has this feature, it's straightforward to offer it to
the guest as well. We just need to load to timer value on L2 entry if
the feature was enabled by L1 and watch out for the corresponding exit
reason.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/vmx.h | 3 | ||||
-rw-r--r-- | arch/x86/include/uapi/asm/vmx.h | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 056bda586a45..fc1c3134473b 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h | |||
@@ -70,6 +70,7 @@ | |||
70 | #define PIN_BASED_EXT_INTR_MASK 0x00000001 | 70 | #define PIN_BASED_EXT_INTR_MASK 0x00000001 |
71 | #define PIN_BASED_NMI_EXITING 0x00000008 | 71 | #define PIN_BASED_NMI_EXITING 0x00000008 |
72 | #define PIN_BASED_VIRTUAL_NMIS 0x00000020 | 72 | #define PIN_BASED_VIRTUAL_NMIS 0x00000020 |
73 | #define PIN_BASED_VMX_PREEMPTION_TIMER 0x00000040 | ||
73 | 74 | ||
74 | #define PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR 0x00000016 | 75 | #define PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR 0x00000016 |
75 | 76 | ||
@@ -95,6 +96,7 @@ | |||
95 | 96 | ||
96 | #define VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR 0x000011ff | 97 | #define VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR 0x000011ff |
97 | 98 | ||
99 | #define VMX_MISC_PREEMPTION_TIMER_RATE_MASK 0x0000001f | ||
98 | #define VMX_MISC_SAVE_EFER_LMA 0x00000020 | 100 | #define VMX_MISC_SAVE_EFER_LMA 0x00000020 |
99 | 101 | ||
100 | /* VMCS Encodings */ | 102 | /* VMCS Encodings */ |
@@ -217,6 +219,7 @@ enum vmcs_field { | |||
217 | GUEST_INTERRUPTIBILITY_INFO = 0x00004824, | 219 | GUEST_INTERRUPTIBILITY_INFO = 0x00004824, |
218 | GUEST_ACTIVITY_STATE = 0X00004826, | 220 | GUEST_ACTIVITY_STATE = 0X00004826, |
219 | GUEST_SYSENTER_CS = 0x0000482A, | 221 | GUEST_SYSENTER_CS = 0x0000482A, |
222 | VMX_PREEMPTION_TIMER_VALUE = 0x0000482E, | ||
220 | HOST_IA32_SYSENTER_CS = 0x00004c00, | 223 | HOST_IA32_SYSENTER_CS = 0x00004c00, |
221 | CR0_GUEST_HOST_MASK = 0x00006000, | 224 | CR0_GUEST_HOST_MASK = 0x00006000, |
222 | CR4_GUEST_HOST_MASK = 0x00006002, | 225 | CR4_GUEST_HOST_MASK = 0x00006002, |
diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h index 2871fccfee68..d651082c7cf7 100644 --- a/arch/x86/include/uapi/asm/vmx.h +++ b/arch/x86/include/uapi/asm/vmx.h | |||
@@ -65,6 +65,7 @@ | |||
65 | #define EXIT_REASON_EOI_INDUCED 45 | 65 | #define EXIT_REASON_EOI_INDUCED 45 |
66 | #define EXIT_REASON_EPT_VIOLATION 48 | 66 | #define EXIT_REASON_EPT_VIOLATION 48 |
67 | #define EXIT_REASON_EPT_MISCONFIG 49 | 67 | #define EXIT_REASON_EPT_MISCONFIG 49 |
68 | #define EXIT_REASON_PREEMPTION_TIMER 52 | ||
68 | #define EXIT_REASON_WBINVD 54 | 69 | #define EXIT_REASON_WBINVD 54 |
69 | #define EXIT_REASON_XSETBV 55 | 70 | #define EXIT_REASON_XSETBV 55 |
70 | #define EXIT_REASON_APIC_WRITE 56 | 71 | #define EXIT_REASON_APIC_WRITE 56 |
@@ -110,7 +111,7 @@ | |||
110 | { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \ | 111 | { EXIT_REASON_EOI_INDUCED, "EOI_INDUCED" }, \ |
111 | { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \ | 112 | { EXIT_REASON_INVALID_STATE, "INVALID_STATE" }, \ |
112 | { EXIT_REASON_INVD, "INVD" }, \ | 113 | { EXIT_REASON_INVD, "INVD" }, \ |
113 | { EXIT_REASON_INVPCID, "INVPCID" } | 114 | { EXIT_REASON_INVPCID, "INVPCID" }, \ |
114 | 115 | { EXIT_REASON_PREEMPTION_TIMER, "PREEMPTION_TIMER" } | |
115 | 116 | ||
116 | #endif /* _UAPIVMX_H */ | 117 | #endif /* _UAPIVMX_H */ |