Skip to content

Commit 12aad91

Browse files
minipli-osssean-jc
authored andcommitted
KVM: x86: Shrink struct kvm_pmu
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>
1 parent d8708b8 commit 12aad91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/include/asm/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ struct kvm_pmc {
515515
#define MSR_ARCH_PERFMON_FIXED_CTR_MAX (MSR_ARCH_PERFMON_FIXED_CTR0 + KVM_PMC_MAX_FIXED - 1)
516516
#define KVM_AMD_PMC_MAX_GENERIC 6
517517
struct kvm_pmu {
518+
u8 version;
518519
unsigned nr_arch_gp_counters;
519520
unsigned nr_arch_fixed_counters;
520521
unsigned available_event_types;
@@ -527,7 +528,6 @@ struct kvm_pmu {
527528
u64 global_ovf_ctrl_mask;
528529
u64 reserved_bits;
529530
u64 raw_event_mask;
530-
u8 version;
531531
struct kvm_pmc gp_counters[KVM_INTEL_PMC_MAX_GENERIC];
532532
struct kvm_pmc fixed_counters[KVM_PMC_MAX_FIXED];
533533
struct irq_work irq_work;

0 commit comments

Comments
 (0)