Re: [RFC PATCH 08/11] KVM: x86: Let moving encryption context be configurable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/8/23 01:01, Ackerley Tng wrote:
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 75d48379d94d..a1a28dd77b94 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6351,7 +6351,14 @@ static int kvm_vm_move_enc_context_from(struct kvm *kvm, unsigned int source_fd)
  	if (r)
  		goto out_mark_migration_done;
- r = static_call(kvm_x86_vm_move_enc_context_from)(kvm, source_kvm);
+	/*
+	 * Different types of VMs will allow userspace to define if moving
+	 * encryption context should be supported.
+	 */
+	if (kvm->arch.vm_move_enc_ctxt_supported &&
+	    kvm_x86_ops.vm_move_enc_context_from) {
+		r = static_call(kvm_x86_vm_move_enc_context_from)(kvm, source_kvm);
+	}

Rather than "supported" this is more "required". So perhaps kvm->arch.use_vm_enc_ctxt_op?

Paolo




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux