mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
KVM: x86: Use file_to_kvm_x86() in SEV
Use the new arch-namespaced helper instead of open-coding the file check and private_data cast separately. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by: Janosch Frank <frankja@linux.ibm.com> Acked-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
This commit is contained in:
parent
8b5cb9769c
commit
77037cf77a
|
|
@ -2145,10 +2145,10 @@ int sev_vm_move_enc_context_from(struct kvm *kvm, unsigned int source_fd)
|
|||
if (fd_empty(f))
|
||||
return -EBADF;
|
||||
|
||||
if (!file_is_kvm(fd_file(f)))
|
||||
source_kvm = file_to_kvm_x86(fd_file(f));
|
||||
if (!source_kvm)
|
||||
return -EBADF;
|
||||
|
||||
source_kvm = fd_file(f)->private_data;
|
||||
ret = sev_lock_two_vms(kvm, source_kvm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -2866,10 +2866,10 @@ int sev_vm_copy_enc_context_from(struct kvm *kvm, unsigned int source_fd)
|
|||
if (fd_empty(f))
|
||||
return -EBADF;
|
||||
|
||||
if (!file_is_kvm(fd_file(f)))
|
||||
source_kvm = file_to_kvm_x86(fd_file(f));
|
||||
if (!source_kvm)
|
||||
return -EBADF;
|
||||
|
||||
source_kvm = fd_file(f)->private_data;
|
||||
ret = sev_lock_two_vms(kvm, source_kvm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user