aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r--arch/x86/kernel/apic/apic.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index de039fcdd053..3fc3a6c428da 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1365,14 +1365,6 @@ void enable_x2apic(void)
1365int __init enable_IR(void) 1365int __init enable_IR(void)
1366{ 1366{
1367#ifdef CONFIG_INTR_REMAP 1367#ifdef CONFIG_INTR_REMAP
1368 int ret;
1369
1370 ret = dmar_table_init();
1371 if (ret) {
1372 pr_debug("dmar_table_init() failed with %d:\n", ret);
1373 return 0;
1374 }
1375
1376 if (!intr_remapping_supported()) { 1368 if (!intr_remapping_supported()) {
1377 pr_debug("intr-remapping not supported\n"); 1369 pr_debug("intr-remapping not supported\n");
1378 return 0; 1370 return 0;
@@ -1400,6 +1392,14 @@ void __init enable_IR_x2apic(void)
1400 unsigned long flags; 1392 unsigned long flags;
1401 struct IO_APIC_route_entry **ioapic_entries = NULL; 1393 struct IO_APIC_route_entry **ioapic_entries = NULL;
1402 int ret, x2apic_enabled = 0; 1394 int ret, x2apic_enabled = 0;
1395 int dmar_table_init_ret = 0;
1396
1397#ifdef CONFIG_INTR_REMAP
1398 dmar_table_init_ret = dmar_table_init();
1399 if (dmar_table_init_ret)
1400 pr_debug("dmar_table_init() failed with %d:\n",
1401 dmar_table_init_ret);
1402#endif
1403 1403
1404 ioapic_entries = alloc_ioapic_entries(); 1404 ioapic_entries = alloc_ioapic_entries();
1405 if (!ioapic_entries) { 1405 if (!ioapic_entries) {
@@ -1417,7 +1417,11 @@ void __init enable_IR_x2apic(void)
1417 mask_8259A(); 1417 mask_8259A();
1418 mask_IO_APIC_setup(ioapic_entries); 1418 mask_IO_APIC_setup(ioapic_entries);
1419 1419
1420 ret = enable_IR(); 1420 if (dmar_table_init_ret)
1421 ret = 0;
1422 else
1423 ret = enable_IR();
1424
1421 if (!ret) { 1425 if (!ret) {
1422 /* IR is required if there is APIC ID > 255 even when running 1426 /* IR is required if there is APIC ID > 255 even when running
1423 * under KVM 1427 * under KVM