From: Jiang Liu Date: Wed, 7 Jan 2015 07:31:34 +0000 (+0800) Subject: x86/apic: Handle XAPIC remap mode proper. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ef1b2b8ad13858ab2f87c05261b8ce3253f90af9;p=deliverable%2Flinux.git x86/apic: Handle XAPIC remap mode proper. 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 Cc: Tony Luck Cc: iommu@lists.linux-foundation.org Cc: H. Peter Anvin Cc: Joerg Roedel Cc: Benjamin Herrenschmidt Cc: Yinghai Lu Cc: Borislav Petkov Cc: David Rientjes Cc: HATAYAMA Daisuke Cc: Jan Beulich Cc: Richard Weinberger Cc: Oren Twaig Link: http://lkml.kernel.org/r/1420615903-28253-8-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index fa77be8d0b17..04aec6bc7481 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -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) {