Skip to contentSkip to conversation

x86, mptable: Remove update mptable support

PATCH New Yinghai Lu 1 participant 1 message Jul 16, 2014

Subsystems (2)
lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86, mptable: Remove update mptable support

It was used to boot first kernel with acpi support kexec second kernel without acpi support.

As BIOS may have other acpi problem but irq routing is right, and same time mptable is totally broken.

Other use case is that linuxbios was not using acpi, and we need dump correct mptable from legacy bios when we don't have idea about hw irq routing.

Assume new systems will only work with acpi enabled kernel and well tested on linux, and even system with coreboot and linuxbios support acpi properly so remove this workaround from the kernel.

---
 arch/x86/include/asm/e820.h   |    1 
 arch/x86/include/asm/mpspec.h |    4 
 arch/x86/kernel/acpi/boot.c   |   39 -----
 arch/x86/kernel/e820.c        |   32 ----
 arch/x86/kernel/mpparse.c     |  277 ------------------------------------------
 arch/x86/kernel/setup.c       |    3 
 6 files changed, 356 deletions(-)
arch/x86/include/asm/mpspec.h +0 -4
Index: linux-2.6/arch/x86/include/asm/mpspec.h
===================================================================
@@ -64,8 +64,6 @@ static inline void find_smp_config(void)
 }
 
 #ifdef CONFIG_X86_MPPARSE
-extern void early_reserve_e820_mpc_new(void);
-extern int enable_update_mptable;
 extern int default_mpc_apic_id(struct mpc_cpu *m);
 extern void default_smp_read_mpc_oem(struct mpc_table *mpc);
 # ifdef CONFIG_X86_IO_APIC
@@ -76,8 +74,6 @@ extern void default_mpc_oem_bus_info(str
 extern void default_find_smp_config(void);
 extern void default_get_smp_config(unsigned int early);
 #else
-static inline void early_reserve_e820_mpc_new(void) { }
-#define enable_update_mptable 0
 #define default_mpc_apic_id NULL
 #define default_smp_read_mpc_oem NULL
 #define default_mpc_oem_bus_info NULL
arch/x86/kernel/mpparse.c +0 -277

280 lines not on this page · raw message

arch/x86/kernel/e820.c +0 -32
Index: linux-2.6/arch/x86/kernel/e820.c
===================================================================
@@ -491,13 +491,6 @@ u64 __init e820_update_range(u64 start,
 	return __e820_update_range(&e820, start, size, old_type, new_type);
 }
 
-static u64 __init e820_update_range_saved(u64 start, u64 size,
-					  unsigned old_type, unsigned new_type)
-{
-	return __e820_update_range(&e820_saved, start, size, old_type,
-				     new_type);
-}
-
 /* make e820 not cover the range */
 u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
 			     int checktype)
@@ -570,15 +563,7 @@ void __init update_e820(void)
 	printk(KERN_INFO "e820: modified physical RAM map:\n");
 	e820_print_map("modified");
 }
-static void __init update_e820_saved(void)
-{
-	u32 nr_map;
 
-	nr_map = e820_saved.nr_map;
-	if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map))
-		return;
-	e820_saved.nr_map = nr_map;
-}
 #define MAX_GAP_END 0x100000000ull
 /*
  * Search for a gap in the e820 memory space from start_addr to end_addr.
@@ -727,23 +712,6 @@ static int __init e820_mark_nvs_memory(v
 core_initcall(e820_mark_nvs_memory);
 #endif
 
-/*
- * pre allocated 4k and reserved it in memblock and e820_saved
- */
-u64 __init early_reserve_e820(u64 size, u64 align)
-{
-	u64 addr;
-
-	addr = __memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
-	if (addr) {
-		e820_update_range_saved(addr, size, E820_RAM, E820_RESERVED);
-		printk(KERN_INFO "e820: update e820_saved for early_reserve_e820\n");
-		update_e820_saved();
-	}
-
-	return addr;
-}
-
 #ifdef CONFIG_X86_32
 # ifdef CONFIG_X86_PAE
 #  define MAX_ARCH_PFN		(1ULL<<(36-PAGE_SHIFT))
arch/x86/kernel/setup.c +0 -3
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
@@ -1095,9 +1095,6 @@ void __init setup_arch(char **cmdline_p)
 	if (efi_enabled(EFI_MEMMAP))
 		efi_reserve_boot_services();
 
-	/* preallocate 4k for mptable mpc */
-	early_reserve_e820_mpc_new();
-
 #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
 	setup_bios_corruption_check();
 #endif
arch/x86/kernel/acpi/boot.c +0 -39
Index: linux-2.6/arch/x86/kernel/acpi/boot.c
===================================================================
@@ -351,42 +351,6 @@ static void __init mp_override_legacy_ir
 	isa_irq_to_gsi[bus_irq] = gsi;
 }
 
-static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger,
-			int polarity)
-{
-#ifdef CONFIG_X86_MPPARSE
-	struct mpc_intsrc mp_irq;
-	struct pci_dev *pdev;
-	unsigned char number;
-	unsigned int devfn;
-	int ioapic;
-	u8 pin;
-
-	if (!acpi_ioapic)
-		return 0;
-	if (!dev || !dev_is_pci(dev))
-		return 0;
-
-	pdev = to_pci_dev(dev);
-	number = pdev->bus->number;
-	devfn = pdev->devfn;
-	pin = pdev->pin;
-	/* print the entry should happen on mptable identically */
-	mp_irq.type = MP_INTSRC;
-	mp_irq.irqtype = mp_INT;
-	mp_irq.irqflag = (trigger == ACPI_EDGE_SENSITIVE ? 4 : 0x0c) |
-				(polarity == ACPI_ACTIVE_HIGH ? 1 : 3);
-	mp_irq.srcbus = number;
-	mp_irq.srcbusirq = (((devfn >> 3) & 0x1f) << 2) | ((pin - 1) & 3);
-	ioapic = mp_find_ioapic(gsi);
-	mp_irq.dstapic = mpc_ioapic_id(ioapic);
-	mp_irq.dstirq = mp_find_ioapic_pin(ioapic, gsi);
-
-	mp_save_irq(&mp_irq);
-#endif
-	return 0;
-}
-
 static int mp_register_gsi(struct device *dev, u32 gsi, int trigger,
 			   int polarity)
 {
@@ -411,9 +375,6 @@ static int mp_register_gsi(struct device
 	if (irq < 0)
 		return irq;
 
-	if (enable_update_mptable)
-		mp_config_acpi_gsi(dev, gsi, trigger, polarity);
-
 	return irq;
 }
 
arch/x86/include/asm/e820.h +0 -1
Index: linux-2.6/arch/x86/include/asm/e820.h
===================================================================
@@ -50,7 +50,6 @@ static inline void early_memtest(unsigne
 
 extern unsigned long e820_end_of_ram_pfn(void);
 extern unsigned long e820_end_of_low_ram_pfn(void);
-extern u64 early_reserve_e820(u64 sizet, u64 align);
 
 void memblock_x86_fill(void);
 void memblock_find_dma_reserve(void);