aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm/svm.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-11-09 09:07:55 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2022-11-09 12:23:59 -0500
commit73412dfeea724e6bd775ba64d21157ff322eac9a (patch)
tree01f3ddc76e9b45d534d0da9fceb16c6135510d76 /arch/x86/kvm/svm/svm.h
parentKVM: SVM: remove dead field from struct svm_cpu_data (diff)
downloadlinux-dev-73412dfeea724e6bd775ba64d21157ff322eac9a.tar.xz
linux-dev-73412dfeea724e6bd775ba64d21157ff322eac9a.zip
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 '')
-rw-r--r--arch/x86/kvm/svm/svm.h2
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);