Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull KVM fixes from Paolo Bonzini:
"Two vmx bugfixes"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
kvm: x86: vmx: fix vpid leak
KVM: vmx: use local variable for current_vmptr when emulating VMPTRST

+10 -12
+10 -12
arch/x86/kvm/vmx.c
··· 7893 7893 HRTIMER_MODE_REL_PINNED); 7894 7894 vmx->nested.preemption_timer.function = vmx_preemption_timer_fn; 7895 7895 7896 + vmx->nested.vpid02 = allocate_vpid(); 7897 + 7896 7898 vmx->nested.vmxon = true; 7897 7899 return 0; 7898 7900 ··· 8482 8480 /* Emulate the VMPTRST instruction */ 8483 8481 static int handle_vmptrst(struct kvm_vcpu *vcpu) 8484 8482 { 8485 - unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 8486 - u32 vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO); 8487 - gva_t vmcs_gva; 8483 + unsigned long exit_qual = vmcs_readl(EXIT_QUALIFICATION); 8484 + u32 instr_info = vmcs_read32(VMX_INSTRUCTION_INFO); 8485 + gpa_t current_vmptr = to_vmx(vcpu)->nested.current_vmptr; 8488 8486 struct x86_exception e; 8487 + gva_t gva; 8489 8488 8490 8489 if (!nested_vmx_check_permission(vcpu)) 8491 8490 return 1; 8492 8491 8493 - if (get_vmx_mem_address(vcpu, exit_qualification, 8494 - vmx_instruction_info, true, &vmcs_gva)) 8492 + if (get_vmx_mem_address(vcpu, exit_qual, instr_info, true, &gva)) 8495 8493 return 1; 8496 8494 /* *_system ok, nested_vmx_check_permission has verified cpl=0 */ 8497 - if (kvm_write_guest_virt_system(vcpu, vmcs_gva, 8498 - (void *)&to_vmx(vcpu)->nested.current_vmptr, 8499 - sizeof(u64), &e)) { 8495 + if (kvm_write_guest_virt_system(vcpu, gva, (void *)&current_vmptr, 8496 + sizeof(gpa_t), &e)) { 8500 8497 kvm_inject_page_fault(vcpu, &e); 8501 8498 return 1; 8502 8499 } ··· 10371 10370 goto free_vmcs; 10372 10371 } 10373 10372 10374 - if (nested) { 10373 + if (nested) 10375 10374 nested_vmx_setup_ctls_msrs(&vmx->nested.msrs, 10376 10375 kvm_vcpu_apicv_active(&vmx->vcpu)); 10377 - vmx->nested.vpid02 = allocate_vpid(); 10378 - } 10379 10376 10380 10377 vmx->nested.posted_intr_nv = -1; 10381 10378 vmx->nested.current_vmptr = -1ull; ··· 10390 10391 return &vmx->vcpu; 10391 10392 10392 10393 free_vmcs: 10393 - free_vpid(vmx->nested.vpid02); 10394 10394 free_loaded_vmcs(vmx->loaded_vmcs); 10395 10395 free_msrs: 10396 10396 kfree(vmx->guest_msrs);