intr_remapping_enabled get assigned later, so need to check that
in setup_apic_routing
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
 #include <linux/ctype.h>
 #include <linux/init.h>
 #include <linux/hardirq.h>
+#include <linux/dmar.h>
 
 #include <asm/smp.h>
 #include <asm/ipi.h>
  */
 void __init setup_apic_routing(void)
 {
+       if (genapic == &apic_x2apic_phys || genapic == &apic_x2apic_cluster) {
+               if (!intr_remapping_enabled)
+                       genapic = &apic_flat;
+       }
+
        if (genapic == &apic_flat) {
                if (max_physical_apicid >= 8)
                        genapic = &apic_physflat;
 
 
 static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
-       if (cpu_has_x2apic && intr_remapping_enabled)
+       if (cpu_has_x2apic)
                return 1;
 
        return 0;
 
 
 static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
-       if (cpu_has_x2apic && intr_remapping_enabled && x2apic_phys)
+       if (cpu_has_x2apic && x2apic_phys)
                return 1;
 
        return 0;