diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-11-09 17:07:55 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-11-09 20:23:59 +0300 |
commit | 73412dfeea724e6bd775ba64d21157ff322eac9a (patch) | |
tree | 01f3ddc76e9b45d534d0da9fceb16c6135510d76 /arch/x86/kvm/svm/svm.h | |
parent | 181d0fb0bb023e8996b1cf7970e3708d72442b0b (diff) | |
download | linux-73412dfeea724e6bd775ba64d21157ff322eac9a.tar.xz |
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>
Diffstat (limited to 'arch/x86/kvm/svm/svm.h')
-rw-r--r-- | arch/x86/kvm/svm/svm.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index 7540db9902a6..2af6a71126c1 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -293,7 +293,7 @@ struct svm_cpu_data { struct vmcb **sev_vmcbs; }; -DECLARE_PER_CPU(struct svm_cpu_data *, svm_data); +DECLARE_PER_CPU(struct svm_cpu_data, svm_data); void recalc_intercepts(struct vcpu_svm *svm); |