diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2021-11-13 10:01:10 -0800 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-11-13 10:01:10 -0800 | 
| commit | 4d6fe79fdeccb8f3968d71bc633e622d43f1309c (patch) | |
| tree | 7b28ad235cb023b464d9e21b3a5465c17ff7003b /arch/x86/kvm/svm/svm.c | |
| parent | d4fa09e514cdb51fc7a2289c445c44ba0c87117b (diff) | |
| parent | 84886c262ebcfa40751ed508268457af8a20c1aa (diff) | |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull more kvm updates from Paolo Bonzini:
 "New x86 features:
   - Guest API and guest kernel support for SEV live migration
   - SEV and SEV-ES intra-host migration
  Bugfixes and cleanups for x86:
   - Fix misuse of gfn-to-pfn cache when recording guest steal time /
     preempted status
   - Fix selftests on APICv machines
   - Fix sparse warnings
   - Fix detection of KVM features in CPUID
   - Cleanups for bogus writes to MSR_KVM_PV_EOI_EN
   - Fixes and cleanups for MSR bitmap handling
   - Cleanups for INVPCID
   - Make x86 KVM_SOFT_MAX_VCPUS consistent with other architectures
  Bugfixes for ARM:
   - Fix finalization of host stage2 mappings
   - Tighten the return value of kvm_vcpu_preferred_target()
   - Make sure the extraction of ESR_ELx.EC is limited to architected
     bits"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (34 commits)
  KVM: SEV: unify cgroup cleanup code for svm_vm_migrate_from
  KVM: x86: move guest_pv_has out of user_access section
  KVM: x86: Drop arbitrary KVM_SOFT_MAX_VCPUS
  KVM: Move INVPCID type check from vmx and svm to the common kvm_handle_invpcid()
  KVM: VMX: Add a helper function to retrieve the GPR index for INVPCID, INVVPID, and INVEPT
  KVM: nVMX: Clean up x2APIC MSR handling for L2
  KVM: VMX: Macrofy the MSR bitmap getters and setters
  KVM: nVMX: Handle dynamic MSR intercept toggling
  KVM: nVMX: Query current VMCS when determining if MSR bitmaps are in use
  KVM: x86: Don't update vcpu->arch.pv_eoi.msr_val when a bogus value was written to MSR_KVM_PV_EOI_EN
  KVM: x86: Rename kvm_lapic_enable_pv_eoi()
  KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES
  KVM: x86: Add helper to consolidate core logic of SET_CPUID{2} flows
  kvm: mmu: Use fast PF path for access tracking of huge pages when possible
  KVM: x86/mmu: Properly dereference rcu-protected TDP MMU sptep iterator
  KVM: x86: inhibit APICv when KVM_GUESTDBG_BLOCKIRQ active
  kvm: x86: Convert return type of *is_valid_rdpmc_ecx() to bool
  KVM: x86: Fix recording of guest steal time / preempted status
  selftest: KVM: Add intra host migration tests
  selftest: KVM: Add open sev dev helper
  ...
Diffstat (limited to 'arch/x86/kvm/svm/svm.c')
| -rw-r--r-- | arch/x86/kvm/svm/svm.c | 14 | 
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index b36ca4e476c2..5630c241d5f6 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1452,7 +1452,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)  	svm_switch_vmcb(svm, &svm->vmcb01);  	if (vmsa_page) -		svm->vmsa = page_address(vmsa_page); +		svm->sev_es.vmsa = page_address(vmsa_page);  	svm->guest_state_loaded = false; @@ -2835,11 +2835,11 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)  static int svm_complete_emulated_msr(struct kvm_vcpu *vcpu, int err)  {  	struct vcpu_svm *svm = to_svm(vcpu); -	if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->ghcb)) +	if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb))  		return kvm_complete_insn_gp(vcpu, err); -	ghcb_set_sw_exit_info_1(svm->ghcb, 1); -	ghcb_set_sw_exit_info_2(svm->ghcb, +	ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, 1); +	ghcb_set_sw_exit_info_2(svm->sev_es.ghcb,  				X86_TRAP_GP |  				SVM_EVTINJ_TYPE_EXEPT |  				SVM_EVTINJ_VALID); @@ -3121,11 +3121,6 @@ static int invpcid_interception(struct kvm_vcpu *vcpu)  	type = svm->vmcb->control.exit_info_2;  	gva = svm->vmcb->control.exit_info_1; -	if (type > 3) { -		kvm_inject_gp(vcpu, 0); -		return 1; -	} -  	return kvm_handle_invpcid(vcpu, type, gva);  } @@ -4701,6 +4696,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {  	.mem_enc_unreg_region = svm_unregister_enc_region,  	.vm_copy_enc_context_from = svm_vm_copy_asid_from, +	.vm_move_enc_context_from = svm_vm_migrate_from,  	.can_emulate_instruction = svm_can_emulate_instruction,  | 
