Skip to content

Commit aac057d

Browse files
committed
KVM: x86: Move vector_hashing into lapic.c
Move the vector_hashing module param into lapic.c now that all usage is contained within the local APIC emulation code. Opportunistically drop the accessor and append "_enabled" to the variable to help capture that it's a boolean module param. No functional change intended. Link: https://lore.kernel.org/r/20250821214209.3463350-4-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 73473f3 commit aac057d

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

arch/x86/kvm/lapic.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ module_param(lapic_timer_advance, bool, 0444);
7474
#define LAPIC_TIMER_ADVANCE_NS_MAX 5000
7575
/* step-by-step approximation to mitigate fluctuation */
7676
#define LAPIC_TIMER_ADVANCE_ADJUST_STEP 8
77+
78+
static bool __read_mostly vector_hashing_enabled = true;
79+
module_param_named(vector_hashing, vector_hashing_enabled, bool, 0444);
80+
7781
static int kvm_lapic_msr_read(struct kvm_lapic *apic, u32 reg, u64 *data);
7882
static int kvm_lapic_msr_write(struct kvm_lapic *apic, u32 reg, u64 data);
7983

@@ -1150,7 +1154,7 @@ static inline bool kvm_apic_map_get_dest_lapic(struct kvm *kvm,
11501154
if (!kvm_lowest_prio_delivery(irq))
11511155
return true;
11521156

1153-
if (!kvm_vector_hashing_enabled()) {
1157+
if (!vector_hashing_enabled) {
11541158
lowest = -1;
11551159
for_each_set_bit(i, bitmap, 16) {
11561160
if (!(*dst)[i])
@@ -1291,7 +1295,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
12911295
r = 0;
12921296
r += kvm_apic_set_irq(vcpu, irq, dest_map);
12931297
} else if (kvm_apic_sw_enabled(vcpu->arch.apic)) {
1294-
if (!kvm_vector_hashing_enabled()) {
1298+
if (!vector_hashing_enabled) {
12951299
if (!lowest)
12961300
lowest = vcpu;
12971301
else if (kvm_apic_compare_prio(vcpu, lowest) < 0)

arch/x86/kvm/x86.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ module_param(kvmclock_periodic_sync, bool, 0444);
164164
static u32 __read_mostly tsc_tolerance_ppm = 250;
165165
module_param(tsc_tolerance_ppm, uint, 0644);
166166

167-
static bool __read_mostly vector_hashing = true;
168-
module_param(vector_hashing, bool, 0444);
169-
170167
bool __read_mostly enable_vmware_backdoor = false;
171168
module_param(enable_vmware_backdoor, bool, 0444);
172169
EXPORT_SYMBOL_GPL(enable_vmware_backdoor);
@@ -13549,11 +13546,6 @@ bool kvm_arch_has_noncoherent_dma(struct kvm *kvm)
1354913546
}
1355013547
EXPORT_SYMBOL_GPL(kvm_arch_has_noncoherent_dma);
1355113548

13552-
bool kvm_vector_hashing_enabled(void)
13553-
{
13554-
return vector_hashing;
13555-
}
13556-
1355713549
bool kvm_arch_no_poll(struct kvm_vcpu *vcpu)
1355813550
{
1355913551
return (vcpu->arch.msr_kvm_poll_control & 1) == 0;

arch/x86/kvm/x86.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ void kvm_deliver_exception_payload(struct kvm_vcpu *vcpu,
431431

432432
int kvm_mtrr_set_msr(struct kvm_vcpu *vcpu, u32 msr, u64 data);
433433
int kvm_mtrr_get_msr(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata);
434-
bool kvm_vector_hashing_enabled(void);
435434
void kvm_fixup_and_inject_pf_error(struct kvm_vcpu *vcpu, gva_t gva, u16 error_code);
436435
int x86_decode_emulated_instruction(struct kvm_vcpu *vcpu, int emulation_type,
437436
void *insn, int insn_len);

0 commit comments

Comments
 (0)