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)
commit73412dfeea724e6bd775ba64d21157ff322eac9a
tree01f3ddc76e9b45d534d0da9fceb16c6135510d76
parent181d0fb0bb023e8996b1cf7970e3708d72442b0b
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