]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: do not allocate struct svm_cpu_data dynamically
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Nov 2022 14:07:55 +0000 (09:07 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Nov 2022 17:23:59 +0000 (12:23 -0500)
commita087b04221e9371d1d9a851c83cdbc05d1d035e3
tree01f3ddc76e9b45d534d0da9fceb16c6135510d76
parentd24a32c9504df56b70ff19443f280546380fc7c5
KVM: SVM: do not allocate struct svm_cpu_data dynamically

The svm_data percpu variable is a pointer, but it is allocated via
svm_hardware_setup() when KVM is loaded.  Unlike hardware_enable()
this means that it is never NULL for the whole lifetime of KVM, and
static allocation does not waste any memory compared to the status quo.
It is also more efficient and more easily handled from assembly code,
so do it and don't look back.

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