Subject: [PATCH] x86: kvmclock: Clean up the usage of the apic_lvt_mask array.
From: Liam Ni
Date: Mon Dec 30 2024 - 02:44:23 EST
Clean up the usage of the apic_lvt_mask array.
Use LVT_TIMER instead of the number 0.
Signed-off-by: liamni <zhiguangni01@xxxxxxxxx>
---
arch/x86/kvm/lapic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 3c83951c619e..949473e2cad8 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -2357,7 +2357,7 @@ static int kvm_lapic_reg_write(struct kvm_lapic
*apic, u32 reg, u32 val)
case APIC_LVTT:
if (!kvm_apic_sw_enabled(apic))
val |= APIC_LVT_MASKED;
- val &= (apic_lvt_mask[0] | apic->lapic_timer.timer_mode_mask);
+ val &= (apic_lvt_mask[LVT_TIMER] |
apic->lapic_timer.timer_mode_mask);
kvm_lapic_set_reg(apic, APIC_LVTT, val);
apic_update_lvtt(apic);
break;
--
2.34.1