aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2009-11-16 10:14:26 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-16 10:37:10 -0500
commite79c65a97c01d5da4317f44f9f98b3814e091a43 (patch)
treece3ec55f23a5984a6b0bb399ac7ca139cd61c0bb
parent200a9ae2801bc725f2c41ab13f6e0fb1610d2fb6 (diff)
x86: io-apic: IO-APIC MMIO should not fail on resource insertion
If IO-APIC base address is 1K aligned we should not fail on resourse insertion procedure. For this sake we define IO_APIC_SLOT_SIZE constant which should cover all IO-APIC direct accessible registers. An example of a such configuration is there http://marc.info/?l=linux-kernel&m=118114792006520 | | Quoting the message | | IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23 | IOAPIC[1]: apic_id 3, version 32, address 0xfec80000, GSI 24-47 | IOAPIC[2]: apic_id 4, version 32, address 0xfec80400, GSI 48-71 | IOAPIC[3]: apic_id 5, version 32, address 0xfec84000, GSI 72-95 | IOAPIC[4]: apic_id 8, version 32, address 0xfec84400, GSI 96-119 | Reported-by: "Maciej W. Rozycki" <macro@linux-mips.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <20091116151426.GC5653@lenovo> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/include/asm/apicdef.h6
-rw-r--r--arch/x86/kernel/apic/io_apic.c11
2 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86/include/asm/apicdef.h b/arch/x86/include/asm/apicdef.h
index 3b62da926de9..7fe3b3060f08 100644
--- a/arch/x86/include/asm/apicdef.h
+++ b/arch/x86/include/asm/apicdef.h
@@ -11,6 +11,12 @@
11#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000 11#define IO_APIC_DEFAULT_PHYS_BASE 0xfec00000
12#define APIC_DEFAULT_PHYS_BASE 0xfee00000 12#define APIC_DEFAULT_PHYS_BASE 0xfee00000
13 13
14/*
15 * This is the IO-APIC register space as specified
16 * by Intel docs:
17 */
18#define IO_APIC_SLOT_SIZE 1024
19
14#define APIC_ID 0x20 20#define APIC_ID 0x20
15 21
16#define APIC_LVR 0x30 22#define APIC_LVR 0x30
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 20ea8392bc57..ff237199fa23 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -4100,18 +4100,17 @@ void __init ioapic_init_mappings(void)
4100#ifdef CONFIG_X86_32 4100#ifdef CONFIG_X86_32
4101fake_ioapic_page: 4101fake_ioapic_page:
4102#endif 4102#endif
4103 ioapic_phys = (unsigned long) 4103 ioapic_phys = (unsigned long)alloc_bootmem_pages(PAGE_SIZE);
4104 alloc_bootmem_pages(PAGE_SIZE);
4105 ioapic_phys = __pa(ioapic_phys); 4104 ioapic_phys = __pa(ioapic_phys);
4106 } 4105 }
4107 set_fixmap_nocache(idx, ioapic_phys); 4106 set_fixmap_nocache(idx, ioapic_phys);
4108 apic_printk(APIC_VERBOSE, 4107 apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n",
4109 "mapped IOAPIC to %08lx (%08lx)\n", 4108 __fix_to_virt(idx) + (ioapic_phys & ~PAGE_MASK),
4110 __fix_to_virt(idx), ioapic_phys); 4109 ioapic_phys);
4111 idx++; 4110 idx++;
4112 4111
4113 ioapic_res->start = ioapic_phys; 4112 ioapic_res->start = ioapic_phys;
4114 ioapic_res->end = ioapic_phys + PAGE_SIZE-1; 4113 ioapic_res->end = ioapic_phys + IO_APIC_SLOT_SIZE - 1;
4115 ioapic_res++; 4114 ioapic_res++;
4116 } 4115 }
4117} 4116}