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 Radim Krčmář:
"MIPS:
- fix host kernel crashes when receiving a signal with 64-bit
userspace

- flush instruction cache on all vcpus after generating entry code

(both for stable)

x86:
- fix NULL dereference in MMU caused by SMM transitions (for stable)

- correct guest instruction pointer after emulating some VMX errors

- minor cleanup"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: VMX: remove duplicated declaration
KVM: MIPS: Flush KVM entry code from icache globally
KVM: MIPS: Don't clobber CP0_Status.UX
KVM: x86: reset MMU on KVM_SET_VCPU_EVENTS
KVM: nVMX: fix instruction skipping during emulated vm-entry

+17 -15
+4 -1
arch/mips/kvm/entry.c
··· 521 521 uasm_i_and(&p, V0, V0, AT); 522 522 uasm_i_lui(&p, AT, ST0_CU0 >> 16); 523 523 uasm_i_or(&p, V0, V0, AT); 524 + #ifdef CONFIG_64BIT 525 + uasm_i_ori(&p, V0, V0, ST0_SX | ST0_UX); 526 + #endif 524 527 uasm_i_mtc0(&p, V0, C0_STATUS); 525 528 uasm_i_ehb(&p); 526 529 ··· 646 643 647 644 /* Setup status register for running guest in UM */ 648 645 uasm_i_ori(&p, V1, V1, ST0_EXL | KSU_USER | ST0_IE); 649 - UASM_i_LA(&p, AT, ~(ST0_CU0 | ST0_MX)); 646 + UASM_i_LA(&p, AT, ~(ST0_CU0 | ST0_MX | ST0_SX | ST0_UX)); 650 647 uasm_i_and(&p, V1, V1, AT); 651 648 uasm_i_mtc0(&p, V1, C0_STATUS); 652 649 uasm_i_ehb(&p);
+2 -2
arch/mips/kvm/mips.c
··· 360 360 dump_handler("kvm_exit", gebase + 0x2000, vcpu->arch.vcpu_run); 361 361 362 362 /* Invalidate the icache for these ranges */ 363 - local_flush_icache_range((unsigned long)gebase, 364 - (unsigned long)gebase + ALIGN(size, PAGE_SIZE)); 363 + flush_icache_range((unsigned long)gebase, 364 + (unsigned long)gebase + ALIGN(size, PAGE_SIZE)); 365 365 366 366 /* 367 367 * Allocate comm page for guest kernel, a TLB will be reserved for
+4 -10
arch/x86/kvm/vmx.c
··· 132 132 133 133 #define VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE 5 134 134 135 - #define VMX_VPID_EXTENT_SUPPORTED_MASK \ 136 - (VMX_VPID_EXTENT_INDIVIDUAL_ADDR_BIT | \ 137 - VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT | \ 138 - VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT | \ 139 - VMX_VPID_EXTENT_SINGLE_NON_GLOBAL_BIT) 140 - 141 135 /* 142 136 * Hyper-V requires all of these, so mark them as supported even though 143 137 * they are just treated the same as all-context. ··· 10467 10473 !nested_guest_cr4_valid(vcpu, vmcs12->guest_cr4)) { 10468 10474 nested_vmx_entry_failure(vcpu, vmcs12, 10469 10475 EXIT_REASON_INVALID_STATE, ENTRY_FAIL_DEFAULT); 10470 - goto out; 10476 + return 1; 10471 10477 } 10472 10478 if (vmcs12->vmcs_link_pointer != -1ull) { 10473 10479 nested_vmx_entry_failure(vcpu, vmcs12, 10474 10480 EXIT_REASON_INVALID_STATE, ENTRY_FAIL_VMCS_LINK_PTR); 10475 - goto out; 10481 + return 1; 10476 10482 } 10477 10483 10478 10484 /* ··· 10492 10498 ia32e != !!(vmcs12->guest_ia32_efer & EFER_LME))) { 10493 10499 nested_vmx_entry_failure(vcpu, vmcs12, 10494 10500 EXIT_REASON_INVALID_STATE, ENTRY_FAIL_DEFAULT); 10495 - goto out; 10501 + return 1; 10496 10502 } 10497 10503 } 10498 10504 ··· 10510 10516 ia32e != !!(vmcs12->host_ia32_efer & EFER_LME)) { 10511 10517 nested_vmx_entry_failure(vcpu, vmcs12, 10512 10518 EXIT_REASON_INVALID_STATE, ENTRY_FAIL_DEFAULT); 10513 - goto out; 10519 + return 1; 10514 10520 } 10515 10521 } 10516 10522
+7 -2
arch/x86/kvm/x86.c
··· 3070 3070 memset(&events->reserved, 0, sizeof(events->reserved)); 3071 3071 } 3072 3072 3073 + static void kvm_set_hflags(struct kvm_vcpu *vcpu, unsigned emul_flags); 3074 + 3073 3075 static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, 3074 3076 struct kvm_vcpu_events *events) 3075 3077 { ··· 3108 3106 vcpu->arch.apic->sipi_vector = events->sipi_vector; 3109 3107 3110 3108 if (events->flags & KVM_VCPUEVENT_VALID_SMM) { 3109 + u32 hflags = vcpu->arch.hflags; 3111 3110 if (events->smi.smm) 3112 - vcpu->arch.hflags |= HF_SMM_MASK; 3111 + hflags |= HF_SMM_MASK; 3113 3112 else 3114 - vcpu->arch.hflags &= ~HF_SMM_MASK; 3113 + hflags &= ~HF_SMM_MASK; 3114 + kvm_set_hflags(vcpu, hflags); 3115 + 3115 3116 vcpu->arch.smi_pending = events->smi.pending; 3116 3117 if (events->smi.smm_inside_nmi) 3117 3118 vcpu->arch.hflags |= HF_SMM_INSIDE_NMI_MASK;