Re: [PATCH v1] x86/apic: Fix kernel panic when "intremap=off" and "x2apic_phys" are set

From: Cyrill Gorcunov
Date: Sun Jun 18 2023 - 18:24:31 EST


On Sat, Jun 17, 2023 at 02:52:36AM +0530, Dheeraj Kumar Srivastava wrote:
> x2APIC mode requires "Interrupt Remapping" to be enabled and the
> "physical x2apic" driver can be used only when x2APIC mode is enabled.
> However when "intremap=off" and "x2apic_phys" kernel command line
> parameters are passed, "physical x2apic" driver is being used even when
> x2APIC mode is disabled ("intremap=off" disables x2APIC mode).
> This results in the below kernel panic:
...

Hi! Good catch! In long term I think we could switch to use x2apic_state variable
instead since at the moment the code is somehow hard to read and remember which exactly
deps are to be satisfied to enable x2apic mode.

Reviewed-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>