aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kvm/hyperv.h
diff options
context:
space:
mode:
authorGravatar Sean Christopherson <seanjc@google.com> 2022-08-30 15:37:08 +0200
committerGravatar Paolo Bonzini <pbonzini@redhat.com> 2022-09-26 12:02:38 -0400
commit1cac8d9f6bd25df3713103e44e2d9ca0c2e03c33 (patch)
tree1484b38a98d17ba076c2ac413a4a411cd961f9e6 /arch/x86/kvm/hyperv.h
parentKVM: x86: Zero out entire Hyper-V CPUID cache before processing entries (diff)
downloadlinux-1cac8d9f6bd25df3713103e44e2d9ca0c2e03c33.tar.gz
linux-1cac8d9f6bd25df3713103e44e2d9ca0c2e03c33.tar.bz2
linux-1cac8d9f6bd25df3713103e44e2d9ca0c2e03c33.zip
KVM: x86: Check for existing Hyper-V vCPU in kvm_hv_vcpu_init()
When potentially allocating/initializing the Hyper-V vCPU struct, check for an existing instance in kvm_hv_vcpu_init() instead of requiring callers to perform the check. Relying on callers to do the check is risky as it's all too easy for KVM to overwrite vcpu->arch.hyperv and leak memory, and it adds additional burden on callers without much benefit. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Wei Liu <wei.liu@kernel.org> Link: https://lore.kernel.org/r/20220830133737.1539624-5-vkuznets@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/hyperv.h')
0 files changed, 0 insertions, 0 deletions