Commit bb7ba806 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull KVM fixes from Paolo Bonzini:
 "A couple bugfixes, and mostly selftests changes"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  selftests/kvm: make platform_info_test pass on AMD
  Revert "KVM: x86/mmu: Zap only the relevant pages when removing a memslot"
  selftests: kvm: fix state save/load on processors without XSAVE
  selftests: kvm: fix vmx_set_nested_state_test
  selftests: kvm: provide common function to enable eVMCS
  selftests: kvm: do not try running the VM in vmx_set_nested_state_test
  KVM: x86: svm: remove redundant assignment of var new_entry
  MAINTAINERS: add KVM x86 reviewers
  MAINTAINERS: change list for KVM/s390
  kvm: x86: skip populating logical dest map if apic is not sw enabled
parents 2babd34d e4427372
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -8832,14 +8832,6 @@ F: virt/kvm/*
F:	tools/kvm/
F:	tools/testing/selftests/kvm/

KERNEL VIRTUAL MACHINE FOR AMD-V (KVM/amd)
M:	Joerg Roedel <joro@8bytes.org>
L:	kvm@vger.kernel.org
W:	http://www.linux-kvm.org/
S:	Maintained
F:	arch/x86/include/asm/svm.h
F:	arch/x86/kvm/svm.c

KERNEL VIRTUAL MACHINE FOR ARM/ARM64 (KVM/arm, KVM/arm64)
M:	Marc Zyngier <maz@kernel.org>
R:	James Morse <james.morse@arm.com>
@@ -8882,7 +8874,7 @@ M: Christian Borntraeger <borntraeger@de.ibm.com>
M:	Janosch Frank <frankja@linux.ibm.com>
R:	David Hildenbrand <david@redhat.com>
R:	Cornelia Huck <cohuck@redhat.com>
L:	linux-s390@vger.kernel.org
L:	kvm@vger.kernel.org
W:	http://www.ibm.com/developerworks/linux/linux390/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git
S:	Supported
@@ -8897,6 +8889,11 @@ F: tools/testing/selftests/kvm/*/s390x/
KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
M:	Paolo Bonzini <pbonzini@redhat.com>
M:	Radim Krčmář <rkrcmar@redhat.com>
R:	Sean Christopherson <sean.j.christopherson@intel.com>
R:	Vitaly Kuznetsov <vkuznets@redhat.com>
R:	Wanpeng Li <wanpengli@tencent.com>
R:	Jim Mattson <jmattson@google.com>
R:	Joerg Roedel <joro@8bytes.org>
L:	kvm@vger.kernel.org
W:	http://www.linux-kvm.org
T:	git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
@@ -8904,8 +8901,12 @@ S: Supported
F:	arch/x86/kvm/
F:	arch/x86/kvm/*/
F:	arch/x86/include/uapi/asm/kvm*
F:	arch/x86/include/uapi/asm/vmx.h
F:	arch/x86/include/uapi/asm/svm.h
F:	arch/x86/include/asm/kvm*
F:	arch/x86/include/asm/pvclock-abi.h
F:	arch/x86/include/asm/svm.h
F:	arch/x86/include/asm/vmx.h
F:	arch/x86/kernel/kvm.c
F:	arch/x86/kernel/kvmclock.c

+5 −0
Original line number Diff line number Diff line
@@ -216,6 +216,9 @@ static void recalculate_apic_map(struct kvm *kvm)
		if (!apic_x2apic_mode(apic) && !new->phys_map[xapic_id])
			new->phys_map[xapic_id] = apic;

		if (!kvm_apic_sw_enabled(apic))
			continue;

		ldr = kvm_lapic_get_reg(apic, APIC_LDR);

		if (apic_x2apic_mode(apic)) {
@@ -258,6 +261,8 @@ static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val)
			static_key_slow_dec_deferred(&apic_sw_disabled);
		else
			static_key_slow_inc(&apic_sw_disabled.key);

		recalculate_apic_map(apic->vcpu->kvm);
	}
}

+1 −32
Original line number Diff line number Diff line
@@ -5653,38 +5653,7 @@ static void kvm_mmu_invalidate_zap_pages_in_memslot(struct kvm *kvm,
			struct kvm_memory_slot *slot,
			struct kvm_page_track_notifier_node *node)
{
	struct kvm_mmu_page *sp;
	LIST_HEAD(invalid_list);
	unsigned long i;
	bool flush;
	gfn_t gfn;

	spin_lock(&kvm->mmu_lock);

	if (list_empty(&kvm->arch.active_mmu_pages))
		goto out_unlock;

	flush = slot_handle_all_level(kvm, slot, kvm_zap_rmapp, false);

	for (i = 0; i < slot->npages; i++) {
		gfn = slot->base_gfn + i;

		for_each_valid_sp(kvm, sp, gfn) {
			if (sp->gfn != gfn)
				continue;

			kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list);
		}
		if (need_resched() || spin_needbreak(&kvm->mmu_lock)) {
			kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, flush);
			flush = false;
			cond_resched_lock(&kvm->mmu_lock);
		}
	}
	kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, flush);

out_unlock:
	spin_unlock(&kvm->mmu_lock);
	kvm_mmu_zap_all(kvm);
}

void kvm_mmu_init_vm(struct kvm *kvm)
+0 −1
Original line number Diff line number Diff line
@@ -1714,7 +1714,6 @@ static int avic_init_backing_page(struct kvm_vcpu *vcpu)
	if (!entry)
		return -EINVAL;

	new_entry = READ_ONCE(*entry);
	new_entry = __sme_set((page_to_phys(svm->avic_backing_page) &
			      AVIC_PHYSICAL_ID_ENTRY_BACKING_PAGE_MASK) |
			      AVIC_PHYSICAL_ID_ENTRY_VALID_MASK);
+2 −0
Original line number Diff line number Diff line
@@ -220,6 +220,8 @@ struct hv_enlightened_vmcs {
struct hv_enlightened_vmcs *current_evmcs;
struct hv_vp_assist_page *current_vp_assist;

int vcpu_enable_evmcs(struct kvm_vm *vm, int vcpu_id);

static inline int enable_vp_assist(uint64_t vp_assist_pa, void *vp_assist)
{
	u64 val = (vp_assist_pa & HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_MASK) |
Loading