diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/vmx.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 32eb58866292..18590e003bd2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -71,6 +71,9 @@ static bool __read_mostly enable_unrestricted_guest = 1; | |||
71 | module_param_named(unrestricted_guest, | 71 | module_param_named(unrestricted_guest, |
72 | enable_unrestricted_guest, bool, S_IRUGO); | 72 | enable_unrestricted_guest, bool, S_IRUGO); |
73 | 73 | ||
74 | static bool __read_mostly enable_ept_ad_bits = 1; | ||
75 | module_param_named(eptad, enable_ept_ad_bits, bool, S_IRUGO); | ||
76 | |||
74 | static bool __read_mostly emulate_invalid_guest_state = 0; | 77 | static bool __read_mostly emulate_invalid_guest_state = 0; |
75 | module_param(emulate_invalid_guest_state, bool, S_IRUGO); | 78 | module_param(emulate_invalid_guest_state, bool, S_IRUGO); |
76 | 79 | ||
@@ -789,6 +792,11 @@ static inline bool cpu_has_vmx_ept_4levels(void) | |||
789 | return vmx_capability.ept & VMX_EPT_PAGE_WALK_4_BIT; | 792 | return vmx_capability.ept & VMX_EPT_PAGE_WALK_4_BIT; |
790 | } | 793 | } |
791 | 794 | ||
795 | static inline bool cpu_has_vmx_ept_ad_bits(void) | ||
796 | { | ||
797 | return vmx_capability.ept & VMX_EPT_AD_BIT; | ||
798 | } | ||
799 | |||
792 | static inline bool cpu_has_vmx_invept_individual_addr(void) | 800 | static inline bool cpu_has_vmx_invept_individual_addr(void) |
793 | { | 801 | { |
794 | return vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT; | 802 | return vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT; |
@@ -2645,8 +2653,12 @@ static __init int hardware_setup(void) | |||
2645 | !cpu_has_vmx_ept_4levels()) { | 2653 | !cpu_has_vmx_ept_4levels()) { |
2646 | enable_ept = 0; | 2654 | enable_ept = 0; |
2647 | enable_unrestricted_guest = 0; | 2655 | enable_unrestricted_guest = 0; |
2656 | enable_ept_ad_bits = 0; | ||
2648 | } | 2657 | } |
2649 | 2658 | ||
2659 | if (!cpu_has_vmx_ept_ad_bits()) | ||
2660 | enable_ept_ad_bits = 0; | ||
2661 | |||
2650 | if (!cpu_has_vmx_unrestricted_guest()) | 2662 | if (!cpu_has_vmx_unrestricted_guest()) |
2651 | enable_unrestricted_guest = 0; | 2663 | enable_unrestricted_guest = 0; |
2652 | 2664 | ||