]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr
authorSean Christopherson <seanjc@google.com>
Thu, 27 Jan 2022 15:31:53 +0000 (07:31 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 28 Jan 2022 12:32:00 +0000 (07:32 -0500)
commit6fb7483c91516b8d70f8532133e04a3a34db755f
tree537c43ada4cd41712fc147053ac6ac178611ee66
parent559838c5ad1923c70a0d8de988b25a0f1f6099c0
KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr

Add a helper to handle converting the u64 userspace address embedded in
struct kvm_device_attr into a userspace pointer, it's all too easy to
forget the intermediate "unsigned long" cast as well as the truncation
check.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c