x86/apic: Handle XAPIC remap mode proper.
authorJiang Liu <[email protected]>
Wed, 7 Jan 2015 07:31:34 +0000 (15:31 +0800)
committerThomas Gleixner <[email protected]>
Thu, 15 Jan 2015 10:24:23 +0000 (11:24 +0100)
If remapping is in XAPIC mode, the setup code just skips X2APIC
initialization without checking max CPU APIC ID in system, which may
cause problem if system has a CPU with APIC ID bigger than 255.

Handle IR in XAPIC mode the same way as if remapping is disabled.

[ tglx: Split out from previous patch ]

Signed-off-by: Jiang Liu <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: [email protected]
Cc: H. Peter Anvin <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: HATAYAMA Daisuke <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Oren Twaig <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
arch/x86/kernel/apic/apic.c

index fa77be8d0b1715b46c310400e00d0982c589fb7e..04aec6bc7481d791ce7d8b1160887463925eef5c 100644 (file)
@@ -1596,7 +1596,7 @@ static __init void try_to_enable_x2apic(int ir_stat)
        if (!x2apic_supported())
                return;
 
-       if (ir_stat < 0) {
+       if (ir_stat != IRQ_REMAP_X2APIC_MODE) {
                /* IR is required if there is APIC ID > 255 even when running
                 * under KVM
                 */
@@ -1613,10 +1613,6 @@ static __init void try_to_enable_x2apic(int ir_stat)
                 * only in physical mode
                 */
                x2apic_force_phys();
-
-       } else if (ir_stat == IRQ_REMAP_XAPIC_MODE) {
-               pr_info("x2apic not enabled, IRQ remapping is in xapic mode\n");
-               return;
        }
 
        if (!x2apic_mode) {