diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2011-07-11 15:28:04 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-24 04:50:33 -0400 |
commit | c37079586f317d7e7f1a70d36f0e5177691c89c2 (patch) | |
tree | 264c51d567d0a4bcb572f0c968096683d5913a84 /arch/x86/kvm/vmx.c | |
parent | bd4c86eaa6ff10abc4e00d0f45d2a28b10b09df4 (diff) |
KVM: MMU: remove bypass_guest_pf
The idea is from Avi:
| Maybe it's time to kill off bypass_guest_pf=1. It's not as effective as
| it used to be, since unsync pages always use shadow_trap_nonpresent_pte,
| and since we convert between the two nonpresent_ptes during sync and unsync.
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f5b49c7fc89d..a644acb6ed80 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -49,9 +49,6 @@ | |||
49 | MODULE_AUTHOR("Qumranet"); | 49 | MODULE_AUTHOR("Qumranet"); |
50 | MODULE_LICENSE("GPL"); | 50 | MODULE_LICENSE("GPL"); |
51 | 51 | ||
52 | static int __read_mostly bypass_guest_pf = 1; | ||
53 | module_param(bypass_guest_pf, bool, S_IRUGO); | ||
54 | |||
55 | static int __read_mostly enable_vpid = 1; | 52 | static int __read_mostly enable_vpid = 1; |
56 | module_param_named(vpid, enable_vpid, bool, 0444); | 53 | module_param_named(vpid, enable_vpid, bool, 0444); |
57 | 54 | ||
@@ -3632,8 +3629,8 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) | |||
3632 | vmcs_write32(PLE_WINDOW, ple_window); | 3629 | vmcs_write32(PLE_WINDOW, ple_window); |
3633 | } | 3630 | } |
3634 | 3631 | ||
3635 | vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, !!bypass_guest_pf); | 3632 | vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, 0); |
3636 | vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, !!bypass_guest_pf); | 3633 | vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, 0); |
3637 | vmcs_write32(CR3_TARGET_COUNT, 0); /* 22.2.1 */ | 3634 | vmcs_write32(CR3_TARGET_COUNT, 0); /* 22.2.1 */ |
3638 | 3635 | ||
3639 | vmcs_write16(HOST_FS_SELECTOR, 0); /* 22.2.4 */ | 3636 | vmcs_write16(HOST_FS_SELECTOR, 0); /* 22.2.4 */ |
@@ -7103,16 +7100,12 @@ static int __init vmx_init(void) | |||
7103 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false); | 7100 | vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false); |
7104 | 7101 | ||
7105 | if (enable_ept) { | 7102 | if (enable_ept) { |
7106 | bypass_guest_pf = 0; | ||
7107 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, | 7103 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, |
7108 | VMX_EPT_EXECUTABLE_MASK); | 7104 | VMX_EPT_EXECUTABLE_MASK); |
7109 | kvm_enable_tdp(); | 7105 | kvm_enable_tdp(); |
7110 | } else | 7106 | } else |
7111 | kvm_disable_tdp(); | 7107 | kvm_disable_tdp(); |
7112 | 7108 | ||
7113 | if (bypass_guest_pf) | ||
7114 | kvm_mmu_set_nonpresent_ptes(~0xffeull, 0ull); | ||
7115 | |||
7116 | return 0; | 7109 | return 0; |
7117 | 7110 | ||
7118 | out3: | 7111 | out3: |