KVM: x86: Shrink struct kvm_pmu
authorMathias Krause <minipli@grsecurity.net>
Fri, 17 Feb 2023 19:33:35 +0000 (20:33 +0100)
committerSean Christopherson <seanjc@google.com>
Thu, 23 Mar 2023 23:10:01 +0000 (16:10 -0700)
Move the 'version' member to the beginning of the structure to reuse an
existing hole instead of introducing another one.

This allows us to save 8 bytes for 64 bit builds.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Link: https://lore.kernel.org/r/20230217193336.15278-2-minipli@grsecurity.net
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/kvm_host.h

index a45de1118a42d6976d659055363c3de86e5c4630..a440ceae06fb2ebd0b792560a7af3ee146057d08 100644 (file)
@@ -515,6 +515,7 @@ struct kvm_pmc {
 #define MSR_ARCH_PERFMON_FIXED_CTR_MAX (MSR_ARCH_PERFMON_FIXED_CTR0 + KVM_PMC_MAX_FIXED - 1)
 #define KVM_AMD_PMC_MAX_GENERIC        6
 struct kvm_pmu {
+       u8 version;
        unsigned nr_arch_gp_counters;
        unsigned nr_arch_fixed_counters;
        unsigned available_event_types;
@@ -527,7 +528,6 @@ struct kvm_pmu {
        u64 global_ovf_ctrl_mask;
        u64 reserved_bits;
        u64 raw_event_mask;
-       u8 version;
        struct kvm_pmc gp_counters[KVM_INTEL_PMC_MAX_GENERIC];
        struct kvm_pmc fixed_counters[KVM_PMC_MAX_FIXED];
        struct irq_work irq_work;