diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-06-11 11:07:40 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:32:55 -0400 |
commit | e799794e02a368f79c3fae26aabaaadd0b7466ce (patch) | |
tree | f76f49415559a8c81f8bc98566d4e9f0f2856b91 /arch | |
parent | 71db602322b1197e7951655c46339324b6208bf9 (diff) |
KVM: VMX: more MSR_IA32_VMX_EPT_VPID_CAP capability bits
Required for EPT misconfiguration handler.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/vmx.h | 7 | ||||
-rw-r--r-- | arch/x86/kvm/vmx.c | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index e7927a639d69..272514c2d456 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h | |||
@@ -352,9 +352,16 @@ enum vmcs_field { | |||
352 | #define VMX_EPT_EXTENT_INDIVIDUAL_ADDR 0 | 352 | #define VMX_EPT_EXTENT_INDIVIDUAL_ADDR 0 |
353 | #define VMX_EPT_EXTENT_CONTEXT 1 | 353 | #define VMX_EPT_EXTENT_CONTEXT 1 |
354 | #define VMX_EPT_EXTENT_GLOBAL 2 | 354 | #define VMX_EPT_EXTENT_GLOBAL 2 |
355 | |||
356 | #define VMX_EPT_EXECUTE_ONLY_BIT (1ull) | ||
357 | #define VMX_EPT_PAGE_WALK_4_BIT (1ull << 6) | ||
358 | #define VMX_EPTP_UC_BIT (1ull << 8) | ||
359 | #define VMX_EPTP_WB_BIT (1ull << 14) | ||
360 | #define VMX_EPT_2MB_PAGE_BIT (1ull << 16) | ||
355 | #define VMX_EPT_EXTENT_INDIVIDUAL_BIT (1ull << 24) | 361 | #define VMX_EPT_EXTENT_INDIVIDUAL_BIT (1ull << 24) |
356 | #define VMX_EPT_EXTENT_CONTEXT_BIT (1ull << 25) | 362 | #define VMX_EPT_EXTENT_CONTEXT_BIT (1ull << 25) |
357 | #define VMX_EPT_EXTENT_GLOBAL_BIT (1ull << 26) | 363 | #define VMX_EPT_EXTENT_GLOBAL_BIT (1ull << 26) |
364 | |||
358 | #define VMX_EPT_DEFAULT_GAW 3 | 365 | #define VMX_EPT_DEFAULT_GAW 3 |
359 | #define VMX_EPT_MAX_GAW 0x4 | 366 | #define VMX_EPT_MAX_GAW 0x4 |
360 | #define VMX_EPT_MT_EPTE_SHIFT 3 | 367 | #define VMX_EPT_MT_EPTE_SHIFT 3 |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6ee929255a3d..6610181267b1 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -270,6 +270,26 @@ static inline bool cpu_has_vmx_flexpriority(void) | |||
270 | cpu_has_vmx_virtualize_apic_accesses(); | 270 | cpu_has_vmx_virtualize_apic_accesses(); |
271 | } | 271 | } |
272 | 272 | ||
273 | static inline bool cpu_has_vmx_ept_execute_only(void) | ||
274 | { | ||
275 | return !!(vmx_capability.ept & VMX_EPT_EXECUTE_ONLY_BIT); | ||
276 | } | ||
277 | |||
278 | static inline bool cpu_has_vmx_eptp_uncacheable(void) | ||
279 | { | ||
280 | return !!(vmx_capability.ept & VMX_EPTP_UC_BIT); | ||
281 | } | ||
282 | |||
283 | static inline bool cpu_has_vmx_eptp_writeback(void) | ||
284 | { | ||
285 | return !!(vmx_capability.ept & VMX_EPTP_WB_BIT); | ||
286 | } | ||
287 | |||
288 | static inline bool cpu_has_vmx_ept_2m_page(void) | ||
289 | { | ||
290 | return !!(vmx_capability.ept & VMX_EPT_2MB_PAGE_BIT); | ||
291 | } | ||
292 | |||
273 | static inline int cpu_has_vmx_invept_individual_addr(void) | 293 | static inline int cpu_has_vmx_invept_individual_addr(void) |
274 | { | 294 | { |
275 | return !!(vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT); | 295 | return !!(vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT); |