]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: x86: Use LVT_TIMER instead of an open coded literal
authorLiam Ni <zhiguangni01@gmail.com>
Wed, 8 Jan 2025 22:05:19 +0000 (14:05 -0800)
committerSean Christopherson <seanjc@google.com>
Wed, 8 Jan 2025 22:05:19 +0000 (14:05 -0800)
Use LVT_TIMER instead of the literal '0' to clean up the apic_lvt_mask
lookup when emulating handling writes to APIC_LVTT.

No functional change intended.

Signed-off-by: Liam Ni <zhiguangni01@gmail.com>
[sean: manually regenerate patch (whitespace damaged), massage changelog]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/lapic.c

index ae81ae27d53409a01cf559ac78d49599307fae23..b93df220d50b909f0f7a6d198f066c1ac7b07908 100644 (file)
@@ -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;