Re: [PATCH] x86/apic: Fix the issues in x2apic_disable()
From: Thomas Gleixner
Date: Mon Aug 12 2024 - 10:49:05 EST
On Mon, Aug 12 2024 at 18:08, Yuntao Wang wrote:
> static __init void x2apic_disable(void)
> {
> - u32 x2apic_id, state = x2apic_state;
> + u32 x2apic_id;
>
> - x2apic_mode = 0;
> - x2apic_state = X2APIC_DISABLED;
> -
> - if (state != X2APIC_ON)
> - return;
> + if (x2apic_state < X2APIC_ON)
> + goto out;
There is no point in overwriting the state in case it is < ON, no?
Thanks,
tglx