diff options
| -rw-r--r-- | arch/x86/kvm/vmx.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index aa66ccd6ed6c..c7668806163f 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -4544,12 +4544,6 @@ static void vmx_flush_tlb(struct kvm_vcpu *vcpu, bool invalidate_gpa) | |||
| 4544 | __vmx_flush_tlb(vcpu, to_vmx(vcpu)->vpid, invalidate_gpa); | 4544 | __vmx_flush_tlb(vcpu, to_vmx(vcpu)->vpid, invalidate_gpa); |
| 4545 | } | 4545 | } |
| 4546 | 4546 | ||
| 4547 | static void vmx_flush_tlb_ept_only(struct kvm_vcpu *vcpu) | ||
| 4548 | { | ||
| 4549 | if (enable_ept) | ||
| 4550 | vmx_flush_tlb(vcpu, true); | ||
| 4551 | } | ||
| 4552 | |||
| 4553 | static void vmx_decache_cr0_guest_bits(struct kvm_vcpu *vcpu) | 4547 | static void vmx_decache_cr0_guest_bits(struct kvm_vcpu *vcpu) |
| 4554 | { | 4548 | { |
| 4555 | ulong cr0_guest_owned_bits = vcpu->arch.cr0_guest_owned_bits; | 4549 | ulong cr0_guest_owned_bits = vcpu->arch.cr0_guest_owned_bits; |
| @@ -9278,7 +9272,7 @@ static void vmx_set_virtual_x2apic_mode(struct kvm_vcpu *vcpu, bool set) | |||
| 9278 | } else { | 9272 | } else { |
| 9279 | sec_exec_control &= ~SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE; | 9273 | sec_exec_control &= ~SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE; |
| 9280 | sec_exec_control |= SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; | 9274 | sec_exec_control |= SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; |
| 9281 | vmx_flush_tlb_ept_only(vcpu); | 9275 | vmx_flush_tlb(vcpu, true); |
| 9282 | } | 9276 | } |
| 9283 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, sec_exec_control); | 9277 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, sec_exec_control); |
| 9284 | 9278 | ||
| @@ -9306,7 +9300,7 @@ static void vmx_set_apic_access_page_addr(struct kvm_vcpu *vcpu, hpa_t hpa) | |||
| 9306 | !nested_cpu_has2(get_vmcs12(&vmx->vcpu), | 9300 | !nested_cpu_has2(get_vmcs12(&vmx->vcpu), |
| 9307 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { | 9301 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { |
| 9308 | vmcs_write64(APIC_ACCESS_ADDR, hpa); | 9302 | vmcs_write64(APIC_ACCESS_ADDR, hpa); |
| 9309 | vmx_flush_tlb_ept_only(vcpu); | 9303 | vmx_flush_tlb(vcpu, true); |
| 9310 | } | 9304 | } |
| 9311 | } | 9305 | } |
| 9312 | 9306 | ||
| @@ -11220,7 +11214,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, | |||
| 11220 | } | 11214 | } |
| 11221 | } else if (nested_cpu_has2(vmcs12, | 11215 | } else if (nested_cpu_has2(vmcs12, |
| 11222 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { | 11216 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { |
| 11223 | vmx_flush_tlb_ept_only(vcpu); | 11217 | vmx_flush_tlb(vcpu, true); |
| 11224 | } | 11218 | } |
| 11225 | 11219 | ||
| 11226 | /* | 11220 | /* |
| @@ -12073,7 +12067,7 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, | |||
| 12073 | } else if (!nested_cpu_has_ept(vmcs12) && | 12067 | } else if (!nested_cpu_has_ept(vmcs12) && |
| 12074 | nested_cpu_has2(vmcs12, | 12068 | nested_cpu_has2(vmcs12, |
| 12075 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { | 12069 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) { |
| 12076 | vmx_flush_tlb_ept_only(vcpu); | 12070 | vmx_flush_tlb(vcpu, true); |
| 12077 | } | 12071 | } |
| 12078 | 12072 | ||
| 12079 | /* This is needed for same reason as it was needed in prepare_vmcs02 */ | 12073 | /* This is needed for same reason as it was needed in prepare_vmcs02 */ |
