From e1054b39b275340f7ba0308eca83c127b36e936e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 26 Oct 2007 14:09:09 -0700 Subject: x86: additional CPUID strings; fix strings for AMD-ecx Additional CPUID strings (sse4_1, sse4_2, sse5, skinit, wdt); fix the positioning of the AMD ecx strings (cr8_legacy was duplicated under two different names, so the alignment of all the other strings were off by one.) Signed-off-by: H. Peter Anvin Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/cpu/proc.c | 10 +++++----- arch/x86/kernel/setup_64.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 2d42b414b77..066f8c6af4d 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c @@ -49,7 +49,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) /* Intel-defined (#2) */ "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est", "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL, - NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt", + NULL, NULL, "dca", "sse4_1", "sse4_2", NULL, NULL, "popcnt", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* VIA/Cyrix/Centaur-defined */ @@ -59,10 +59,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* AMD-defined (#2) */ - "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8_legacy", - "altmovcr8", "abm", "sse4a", - "misalignsse", "3dnowprefetch", - "osvw", "ibs", NULL, NULL, NULL, NULL, + "lahf_lm", "cmp_legacy", "svm", "extapic", + "cr8_legacy", "abm", "sse4a", "misalignsse", + "3dnowprefetch", "osvw", "ibs", "sse5", + "skinit", "wdt", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index e7a9e36bd52..238633d3d09 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c @@ -1040,7 +1040,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) /* Intel-defined (#2) */ "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est", "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL, - NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt", + NULL, NULL, "dca", "sse4_1", "sse4_2", NULL, NULL, "popcnt", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* VIA/Cyrix/Centaur-defined */ @@ -1050,10 +1050,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* AMD-defined (#2) */ - "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8_legacy", - "altmovcr8", "abm", "sse4a", - "misalignsse", "3dnowprefetch", - "osvw", "ibs", NULL, NULL, NULL, NULL, + "lahf_lm", "cmp_legacy", "svm", "extapic", + "cr8_legacy", "abm", "sse4a", "misalignsse", + "3dnowprefetch", "osvw", "ibs", "sse5", + "skinit", "wdt", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -- cgit v1.2.3 From 395624fcddd178de01a78aa88670a86ec919de77 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Wed, 24 Oct 2007 12:49:47 +0200 Subject: x86 gart: rename iommu.h to gart.h This patch renames the include file asm-x86/iommu.h to asm-x86/gart.h to make clear to which IOMMU implementation it belongs. The patch also adds "GART" to the Kconfig line. Signed-off-by: Joerg Roedel Acked-by: Muli Ben-Yehuda Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig.x86_64 | 2 +- arch/x86/kernel/aperture_64.c | 2 +- arch/x86/kernel/early-quirks.c | 2 +- arch/x86/kernel/pci-calgary_64.c | 2 +- arch/x86/kernel/pci-dma_64.c | 2 +- arch/x86/kernel/pci-gart_64.c | 2 +- arch/x86/kernel/pci-nommu_64.c | 2 +- arch/x86/kernel/pci-swiotlb_64.c | 2 +- arch/x86/kernel/reboot_64.c | 2 +- drivers/pci/intel-iommu.c | 2 +- include/asm-x86/gart.h | 29 +++++++++++++++++++++++++++++ include/asm-x86/iommu.h | 4 ++-- 12 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 include/asm-x86/gart.h diff --git a/arch/x86/Kconfig.x86_64 b/arch/x86/Kconfig.x86_64 index e2542e5b536..acb2949dbeb 100644 --- a/arch/x86/Kconfig.x86_64 +++ b/arch/x86/Kconfig.x86_64 @@ -480,7 +480,7 @@ config HPET_EMULATE_RTC # Mark as embedded because too many people got it wrong. # The code disables itself when not needed. config IOMMU - bool "IOMMU support" if EMBEDDED + bool "GART IOMMU support" if EMBEDDED default y select SWIOTLB select AGP diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 8f681cae7bf..70c854fdfb2 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 639e6320518..95e0de9a4e4 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -18,7 +18,7 @@ #include #ifdef CONFIG_IOMMU -#include +#include #endif static void __init via_bugs(void) diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 1a20fe31338..6bf1f716909 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 393e2725a6e..730339fc00d 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include int iommu_merge __read_mostly = 1; diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 79b514b381b..c9ba80bf26e 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/x86/kernel/pci-nommu_64.c b/arch/x86/kernel/pci-nommu_64.c index faf70bdca33..ab08e183222 100644 --- a/arch/x86/kernel/pci-nommu_64.c +++ b/arch/x86/kernel/pci-nommu_64.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c index b2f405ea7c8..102866d729a 100644 --- a/arch/x86/kernel/pci-swiotlb_64.c +++ b/arch/x86/kernel/pci-swiotlb_64.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include diff --git a/arch/x86/kernel/reboot_64.c b/arch/x86/kernel/reboot_64.c index 776eb06b651..71b13c5f581 100644 --- a/arch/x86/kernel/reboot_64.c +++ b/arch/x86/kernel/reboot_64.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include /* * Power off function, if any diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 9b35259eecf..8af1d9a261e 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -34,7 +34,7 @@ #include "intel-iommu.h" #include /* force_iommu in this header in x86-64*/ #include -#include +#include #include "pci.h" #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) diff --git a/include/asm-x86/gart.h b/include/asm-x86/gart.h new file mode 100644 index 00000000000..5af471f228e --- /dev/null +++ b/include/asm-x86/gart.h @@ -0,0 +1,29 @@ +#ifndef _ASM_X8664_IOMMU_H +#define _ASM_X8664_IOMMU_H 1 + +extern void pci_iommu_shutdown(void); +extern void no_iommu_init(void); +extern int force_iommu, no_iommu; +extern int iommu_detected; +#ifdef CONFIG_IOMMU +extern void gart_iommu_init(void); +extern void gart_iommu_shutdown(void); +extern void __init gart_parse_options(char *); +extern void iommu_hole_init(void); +extern int fallback_aper_order; +extern int fallback_aper_force; +extern int iommu_aperture; +extern int iommu_aperture_allowed; +extern int iommu_aperture_disabled; +extern int fix_aperture; +#else +#define iommu_aperture 0 +#define iommu_aperture_allowed 0 + +static inline void gart_iommu_shutdown(void) +{ +} + +#endif + +#endif diff --git a/include/asm-x86/iommu.h b/include/asm-x86/iommu.h index 5af471f228e..07862fdd23c 100644 --- a/include/asm-x86/iommu.h +++ b/include/asm-x86/iommu.h @@ -1,5 +1,5 @@ -#ifndef _ASM_X8664_IOMMU_H -#define _ASM_X8664_IOMMU_H 1 +#ifndef _ASM_X8664_GART_H +#define _ASM_X8664_GART_H 1 extern void pci_iommu_shutdown(void); extern void no_iommu_init(void); -- cgit v1.2.3 From 966396d3a05c8049fce5c81c49138e5ee1b05443 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Wed, 24 Oct 2007 12:49:48 +0200 Subject: x86 gart: rename CONFIG_IOMMU to CONFIG_GART_IOMMU This patch renames the IOMMU config option to GART_IOMMU because in fact it means the GART and not general support for an IOMMU on x86. Signed-off-by: Joerg Roedel Acked-by: Muli Ben-Yehuda Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/Kconfig.debug | 2 +- arch/x86/Kconfig.x86_64 | 4 ++-- arch/x86/configs/x86_64_defconfig | 2 +- arch/x86/kernel/Makefile_64 | 2 +- arch/x86/kernel/early-quirks.c | 4 ++-- arch/x86/kernel/pci-dma_64.c | 6 +++--- drivers/char/agp/Kconfig | 4 ++-- drivers/char/agp/amd64-agp.c | 2 +- drivers/usb/core/message.c | 2 +- include/asm-x86/gart.h | 2 +- include/asm-x86/pci_64.h | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 970b2defe7d..fbd77b7dfd7 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -91,7 +91,7 @@ config DOUBLEFAULT config IOMMU_DEBUG bool "Enable IOMMU debugging" - depends on IOMMU && DEBUG_KERNEL + depends on GART_IOMMU && DEBUG_KERNEL depends on X86_64 help Force the IOMMU to on even when you have less than 4GB of diff --git a/arch/x86/Kconfig.x86_64 b/arch/x86/Kconfig.x86_64 index acb2949dbeb..60ac22769a4 100644 --- a/arch/x86/Kconfig.x86_64 +++ b/arch/x86/Kconfig.x86_64 @@ -479,7 +479,7 @@ config HPET_EMULATE_RTC # Mark as embedded because too many people got it wrong. # The code disables itself when not needed. -config IOMMU +config GART_IOMMU bool "GART IOMMU support" if EMBEDDED default y select SWIOTLB @@ -687,7 +687,7 @@ source kernel/Kconfig.hz config K8_NB def_bool y - depends on AGP_AMD64 || IOMMU || (PCI && NUMA) + depends on AGP_AMD64 || GART_IOMMU || (PCI && NUMA) endmenu diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig index b091c5e3555..38a83f9c966 100644 --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig @@ -170,7 +170,7 @@ CONFIG_HOTPLUG_CPU=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y -CONFIG_IOMMU=y +CONFIG_GART_IOMMU=y # CONFIG_CALGARY_IOMMU is not set CONFIG_SWIOTLB=y CONFIG_X86_MCE=y diff --git a/arch/x86/kernel/Makefile_64 b/arch/x86/kernel/Makefile_64 index 466337ae9a1..24671c3838b 100644 --- a/arch/x86/kernel/Makefile_64 +++ b/arch/x86/kernel/Makefile_64 @@ -25,7 +25,7 @@ obj-$(CONFIG_CRASH_DUMP) += crash_dump_64.o obj-$(CONFIG_PM) += suspend_64.o obj-$(CONFIG_HIBERNATION) += suspend_asm_64.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o -obj-$(CONFIG_IOMMU) += pci-gart_64.o aperture_64.o +obj-$(CONFIG_GART_IOMMU) += pci-gart_64.o aperture_64.o obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o obj-$(CONFIG_KPROBES) += kprobes_64.o diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 95e0de9a4e4..b8265c1ea0d 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -17,13 +17,13 @@ #include #include -#ifdef CONFIG_IOMMU +#ifdef CONFIG_GART_IOMMU #include #endif static void __init via_bugs(void) { -#ifdef CONFIG_IOMMU +#ifdef CONFIG_GART_IOMMU if ((end_pfn > MAX_DMA32_PFN || force_iommu) && !iommu_aperture_allowed) { printk(KERN_INFO diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 730339fc00d..66b3dc5b3f4 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c @@ -275,7 +275,7 @@ __init int iommu_setup(char *p) swiotlb = 1; #endif -#ifdef CONFIG_IOMMU +#ifdef CONFIG_GART_IOMMU gart_parse_options(p); #endif @@ -298,7 +298,7 @@ void __init pci_iommu_alloc(void) * The order of these functions is important for * fall-back/fail-over reasons */ -#ifdef CONFIG_IOMMU +#ifdef CONFIG_GART_IOMMU iommu_hole_init(); #endif @@ -321,7 +321,7 @@ static int __init pci_iommu_init(void) intel_iommu_init(); -#ifdef CONFIG_IOMMU +#ifdef CONFIG_GART_IOMMU gart_iommu_init(); #endif diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig index f22c253bc09..ccb1fa89de2 100644 --- a/drivers/char/agp/Kconfig +++ b/drivers/char/agp/Kconfig @@ -56,9 +56,9 @@ config AGP_AMD X on AMD Irongate, 761, and 762 chipsets. config AGP_AMD64 - tristate "AMD Opteron/Athlon64 on-CPU GART support" if !IOMMU + tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU depends on AGP && X86 - default y if IOMMU + default y if GART_IOMMU help This option gives you AGP support for the GLX component of X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs. diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index d95662e9632..d8200ac8f8c 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -787,7 +787,7 @@ static void __exit agp_amd64_cleanup(void) /* On AMD64 the PCI driver needs to initialize this driver early for the IOMMU, so it has to be called via a backdoor. */ -#ifndef CONFIG_IOMMU +#ifndef CONFIG_GART_IOMMU module_init(agp_amd64_init); module_exit(agp_amd64_cleanup); #endif diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index eb4ac47612a..316a746e008 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -434,7 +434,7 @@ int usb_sg_init ( if (dma) { io->urbs [i]->transfer_dma = sg_dma_address (sg + i); len = sg_dma_len (sg + i); -#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU) +#if defined(CONFIG_HIGHMEM) || defined(CONFIG_GART_IOMMU) io->urbs[i]->transfer_buffer = NULL; #else io->urbs[i]->transfer_buffer = sg_virt(&sg[i]); diff --git a/include/asm-x86/gart.h b/include/asm-x86/gart.h index 5af471f228e..0765f3d6785 100644 --- a/include/asm-x86/gart.h +++ b/include/asm-x86/gart.h @@ -5,7 +5,7 @@ extern void pci_iommu_shutdown(void); extern void no_iommu_init(void); extern int force_iommu, no_iommu; extern int iommu_detected; -#ifdef CONFIG_IOMMU +#ifdef CONFIG_GART_IOMMU extern void gart_iommu_init(void); extern void gart_iommu_shutdown(void); extern void __init gart_parse_options(char *); diff --git a/include/asm-x86/pci_64.h b/include/asm-x86/pci_64.h index 9baa46d9f59..ef54226a932 100644 --- a/include/asm-x86/pci_64.h +++ b/include/asm-x86/pci_64.h @@ -37,7 +37,7 @@ extern int iommu_setup(char *opt); */ #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) -#if defined(CONFIG_IOMMU) || defined(CONFIG_CALGARY_IOMMU) +#if defined(CONFIG_GART_IOMMU) || defined(CONFIG_CALGARY_IOMMU) #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ dma_addr_t ADDR_NAME; -- cgit v1.2.3 From 79da0874410c0af8958f0ee3a50aa5b67eecc640 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Wed, 24 Oct 2007 12:49:49 +0200 Subject: x86 gart: make some variables and functions static This patch makes some functions and variables static in pci-gart_64.c which are not used somewhere else. Signed-off-by: Joerg Roedel Acked-by: Muli Ben-Yehuda Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/pci-gart_64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index c9ba80bf26e..3be0b83dc4c 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -36,11 +36,11 @@ #include #include -unsigned long iommu_bus_base; /* GART remapping area (physical) */ +static unsigned long iommu_bus_base; /* GART remapping area (physical) */ static unsigned long iommu_size; /* size of remapping area bytes */ static unsigned long iommu_pages; /* .. and in pages */ -u32 *iommu_gatt_base; /* Remapping table */ +static u32 *iommu_gatt_base; /* Remapping table */ /* If this is disabled the IOMMU will use an optimized flushing strategy of only flushing when an mapping is reused. With it true the GART is flushed @@ -135,8 +135,8 @@ static void flush_gart(void) /* Debugging aid for drivers that don't free their IOMMU tables */ static void **iommu_leak_tab; static int leak_trace; -int iommu_leak_pages = 20; -void dump_leak(void) +static int iommu_leak_pages = 20; +static void dump_leak(void) { int i; static int dump; -- cgit v1.2.3 From 0440d4c00dadf8b97657c0864e4d54a088430de8 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Wed, 24 Oct 2007 12:49:50 +0200 Subject: x86 gart: rename symbols only used for the GART implementation This patch renames the 4 symbols iommu_hole_init(), iommu_aperture, iommu_aperture_allowed, iommu_aperture_disabled. All these symbols are only used for the GART implementation of IOMMUs. It adds and additional gart_ prefix to them. Signed-off-by: Joerg Roedel Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/aperture_64.c | 13 +++++++------ arch/x86/kernel/early-quirks.c | 4 ++-- arch/x86/kernel/pci-dma_64.c | 2 +- arch/x86/kernel/pci-gart_64.c | 8 ++++---- include/asm-x86/gart.h | 12 ++++++------ 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index 70c854fdfb2..5b6992799c9 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c @@ -25,9 +25,9 @@ #include #include -int iommu_aperture; -int iommu_aperture_disabled __initdata = 0; -int iommu_aperture_allowed __initdata = 0; +int gart_iommu_aperture; +int gart_iommu_aperture_disabled __initdata = 0; +int gart_iommu_aperture_allowed __initdata = 0; int fallback_aper_order __initdata = 1; /* 64MB */ int fallback_aper_force __initdata = 0; @@ -204,14 +204,15 @@ static __u32 __init search_agp_bridge(u32 *order, int *valid_agp) return 0; } -void __init iommu_hole_init(void) +void __init gart_iommu_hole_init(void) { int fix, num; u32 aper_size, aper_alloc = 0, aper_order = 0, last_aper_order = 0; u64 aper_base, last_aper_base = 0; int valid_agp = 0; - if (iommu_aperture_disabled || !fix_aperture || !early_pci_allowed()) + if (gart_iommu_aperture_disabled || !fix_aperture || + !early_pci_allowed()) return; printk(KERN_INFO "Checking aperture...\n"); @@ -222,7 +223,7 @@ void __init iommu_hole_init(void) continue; iommu_detected = 1; - iommu_aperture = 1; + gart_iommu_aperture = 1; aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7; aper_size = (32 * 1024 * 1024) << aper_order; diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index b8265c1ea0d..88bb83ec895 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -25,11 +25,11 @@ static void __init via_bugs(void) { #ifdef CONFIG_GART_IOMMU if ((end_pfn > MAX_DMA32_PFN || force_iommu) && - !iommu_aperture_allowed) { + !gart_iommu_aperture_allowed) { printk(KERN_INFO "Looks like a VIA chipset. Disabling IOMMU." " Override with iommu=allowed\n"); - iommu_aperture_disabled = 1; + gart_iommu_aperture_disabled = 1; } #endif } diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 66b3dc5b3f4..aa805b11b24 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c @@ -299,7 +299,7 @@ void __init pci_iommu_alloc(void) * fall-back/fail-over reasons */ #ifdef CONFIG_GART_IOMMU - iommu_hole_init(); + gart_iommu_hole_init(); #endif #ifdef CONFIG_CALGARY_IOMMU diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 3be0b83dc4c..06bcba53604 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -627,12 +627,12 @@ void __init gart_iommu_init(void) return; /* Did we detect a different HW IOMMU? */ - if (iommu_detected && !iommu_aperture) + if (iommu_detected && !gart_iommu_aperture) return; if (no_iommu || (!force_iommu && end_pfn <= MAX_DMA32_PFN) || - !iommu_aperture || + !gart_iommu_aperture || (no_agp && init_k8_gatt(&info) < 0)) { if (end_pfn > MAX_DMA32_PFN) { printk(KERN_ERR "WARNING more than 4GB of memory " @@ -733,9 +733,9 @@ void __init gart_parse_options(char *p) fix_aperture = 0; /* duplicated from pci-dma.c */ if (!strncmp(p,"force",5)) - iommu_aperture_allowed = 1; + gart_iommu_aperture_allowed = 1; if (!strncmp(p,"allowed",7)) - iommu_aperture_allowed = 1; + gart_iommu_aperture_allowed = 1; if (!strncmp(p, "memaper", 7)) { fallback_aper_force = 1; p += 7; diff --git a/include/asm-x86/gart.h b/include/asm-x86/gart.h index 0765f3d6785..f704c50519b 100644 --- a/include/asm-x86/gart.h +++ b/include/asm-x86/gart.h @@ -9,16 +9,16 @@ extern int iommu_detected; extern void gart_iommu_init(void); extern void gart_iommu_shutdown(void); extern void __init gart_parse_options(char *); -extern void iommu_hole_init(void); +extern void gart_iommu_hole_init(void); extern int fallback_aper_order; extern int fallback_aper_force; -extern int iommu_aperture; -extern int iommu_aperture_allowed; -extern int iommu_aperture_disabled; +extern int gart_iommu_aperture; +extern int gart_iommu_aperture_allowed; +extern int gart_iommu_aperture_disabled; extern int fix_aperture; #else -#define iommu_aperture 0 -#define iommu_aperture_allowed 0 +#define gart_iommu_aperture 0 +#define gart_iommu_aperture_allowed 0 static inline void gart_iommu_shutdown(void) { -- cgit v1.2.3 From f1aa14b2e930a6dfab888ded1a2a951a0ff279dc Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 24 Oct 2007 18:25:06 +0200 Subject: x86: kernel/setup_32.c: unexport machine_id This patch removes the unused EXPORT_SYMBOL(machine_id). Signed-off-by: Adrian Bunk Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/setup_32.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index cc0e91447b7..e1e18c34c82 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c @@ -86,9 +86,6 @@ unsigned long mmu_cr4_features; /* for MCA, but anyone else can use it if they want */ unsigned int machine_id; -#ifdef CONFIG_MCA -EXPORT_SYMBOL(machine_id); -#endif unsigned int machine_submodel_id; unsigned int BIOS_revision; unsigned int mca_pentium_flag; -- cgit v1.2.3 From fb8c177fe04c81ef5abe603e01d51eafa02d903a Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 24 Oct 2007 18:24:47 +0200 Subject: x86: mm/discontig_32.c: make code static node0_bdata and paddr_to_nid() can become static. Signed-off-by: Adrian Bunk Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/mm/discontig_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/discontig_32.c b/arch/x86/mm/discontig_32.c index fe608a45ffb..13a474d3c6e 100644 --- a/arch/x86/mm/discontig_32.c +++ b/arch/x86/mm/discontig_32.c @@ -40,7 +40,7 @@ struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; EXPORT_SYMBOL(node_data); -bootmem_data_t node0_bdata; +static bootmem_data_t node0_bdata; /* * numa interface - we expect the numa architecture specific code to have @@ -404,7 +404,7 @@ void __init set_highmem_pages_init(int bad_ppro) } #ifdef CONFIG_MEMORY_HOTPLUG -int paddr_to_nid(u64 addr) +static int paddr_to_nid(u64 addr) { int nid; unsigned long pfn = PFN_DOWN(addr); -- cgit v1.2.3 From 1b8a8e95f9671ee449a794f87468738963393a72 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 29 Oct 2007 13:49:36 +0100 Subject: x86: merge EARLY_PRINTK options This patch merges the x86_64 EARLY_PRINTK option into the i386 one. Signed-off-by: Adrian Bunk --- arch/x86/Kconfig.debug | 3 +-- arch/x86/Kconfig.x86_64 | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index fbd77b7dfd7..6f32beb2c47 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -6,9 +6,8 @@ config TRACE_IRQFLAGS_SUPPORT source "lib/Kconfig.debug" config EARLY_PRINTK - bool "Early printk" if EMBEDDED && DEBUG_KERNEL + bool "Early printk" if EMBEDDED && DEBUG_KERNEL && X86_32 default y - depends on X86_32 help Write kernel log output directly into the VGA buffer or to a serial port. diff --git a/arch/x86/Kconfig.x86_64 b/arch/x86/Kconfig.x86_64 index 60ac22769a4..b45855c368a 100644 --- a/arch/x86/Kconfig.x86_64 +++ b/arch/x86/Kconfig.x86_64 @@ -97,10 +97,6 @@ config X86_CMPXCHG bool default y -config EARLY_PRINTK - bool - default y - config GENERIC_ISA_DMA bool default y -- cgit v1.2.3 From 076e21a0142ac33d53bc0cca58c6170d4ad14f5d Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 29 Oct 2007 13:49:16 +0100 Subject: remove the dead X86_REMOTE_DEBUG option This patch removes the dead X86_REMOTE_DEBUG option. Signed-off-by: Adrian Bunk --- arch/x86/Kconfig.debug | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 6f32beb2c47..761ca7b5f12 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -112,7 +112,4 @@ config IOMMU_LEAK Add a simple leak tracer to the IOMMU code. This is useful when you are debugging a buggy device driver that leaks IOMMU mappings. -#config X86_REMOTE_DEBUG -# bool "kgdb debugging stub" - endmenu -- cgit v1.2.3 From aa69432a68fb0aec49551fd69fe920a6df572573 Mon Sep 17 00:00:00 2001 From: "Huang, Ying" Date: Wed, 24 Oct 2007 10:18:49 +0800 Subject: x86 boot: document for 32 bit boot protocol This patch documents the 32-bit boot protocol of x86. It has been used by Kexec and LinuxBIOS. This patch is based on the proposal of Peter Anvin. Signed-off-by: Huang Ying Signed-off-by: H. Peter Anvin Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- Documentation/i386/boot.txt | 38 ++++++++++++ Documentation/i386/zero-page.txt | 122 +++++++++------------------------------ 2 files changed, 65 insertions(+), 95 deletions(-) diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt index 2f75e750e4f..fc49b79bc1a 100644 --- a/Documentation/i386/boot.txt +++ b/Documentation/i386/boot.txt @@ -785,3 +785,41 @@ IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and After completing your hook, you should jump to the address that was in this field before your boot loader overwrote it (relocated, if appropriate.) + + +**** 32-bit BOOT PROTOCOL + +For machine with some new BIOS other than legacy BIOS, such as EFI, +LinuxBIOS, etc, and kexec, the 16-bit real mode setup code in kernel +based on legacy BIOS can not be used, so a 32-bit boot protocol needs +to be defined. + +In 32-bit boot protocol, the first step in loading a Linux kernel +should be to setup the boot parameters (struct boot_params, +traditionally known as "zero page"). The memory for struct boot_params +should be allocated and initialized to all zero. Then the setup header +from offset 0x01f1 of kernel image on should be loaded into struct +boot_params and examined. The end of setup header can be calculated as +follow: + + 0x0202 + byte value at offset 0x0201 + +In addition to read/modify/write the setup header of the struct +boot_params as that of 16-bit boot protocol, the boot loader should +also fill the additional fields of the struct boot_params as that +described in zero-page.txt. + +After setupping the struct boot_params, the boot loader can load the +32/64-bit kernel in the same way as that of 16-bit boot protocol. + +In 32-bit boot protocol, the kernel is started by jumping to the +32-bit kernel entry point, which is the start address of loaded +32/64-bit kernel. + +At entry, the CPU must be in 32-bit protected mode with paging +disabled; a GDT must be loaded with the descriptors for selectors +__BOOT_CS(0x10) and __BOOT_DS(0x18); both descriptors must be 4G flat +segment; __BOOS_CS must have execute/read permission, and __BOOT_DS +must have read/write permission; CS must be __BOOT_CS and DS, ES, SS +must be __BOOT_DS; interrupt must be disabled; %esi must hold the base +address of the struct boot_params; %ebp, %edi and %ebx must be zero. diff --git a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt index 6c0817c4568..169ad423a3d 100644 --- a/Documentation/i386/zero-page.txt +++ b/Documentation/i386/zero-page.txt @@ -1,99 +1,31 @@ ---------------------------------------------------------------------------- -!!!!!!!!!!!!!!!WARNING!!!!!!!! -The zero page is a kernel internal data structure, not a stable ABI. It might change -without warning and the kernel has no way to detect old version of it. -If you're writing some external code like a boot loader you should only use -the stable versioned real mode boot protocol described in boot.txt. Otherwise the kernel -might break you at any time. -!!!!!!!!!!!!!WARNING!!!!!!!!!!! ----------------------------------------------------------------------------- +The additional fields in struct boot_params as a part of 32-bit boot +protocol of kernel. These should be filled by bootloader or 16-bit +real-mode setup code of the kernel. References/settings to it mainly +are in: -Summary of boot_params layout (kernel point of view) - ( collected by Hans Lermen and Martin Mares ) - -The contents of boot_params are used to pass parameters from the -16-bit realmode code of the kernel to the 32-bit part. References/settings -to it mainly are in: + include/asm-x86/bootparam.h - arch/i386/boot/setup.S - arch/i386/boot/video.S - arch/i386/kernel/head.S - arch/i386/kernel/setup.c - -Offset Type Description ------- ---- ----------- - 0 32 bytes struct screen_info, SCREEN_INFO - ATTENTION, overlaps the following !!! - 2 unsigned short EXT_MEM_K, extended memory size in Kb (from int 0x15) - 0x20 unsigned short CL_MAGIC, commandline magic number (=0xA33F) - 0x22 unsigned short CL_OFFSET, commandline offset - Address of commandline is calculated: - 0x90000 + contents of CL_OFFSET - (only taken, when CL_MAGIC = 0xA33F) - 0x40 20 bytes struct apm_bios_info, APM_BIOS_INFO - 0x60 16 bytes Intel SpeedStep (IST) BIOS support information - 0x80 16 bytes hd0-disk-parameter from intvector 0x41 - 0x90 16 bytes hd1-disk-parameter from intvector 0x46 +Offset Proto Name Meaning +/Size - 0xa0 16 bytes System description table truncated to 16 bytes. - ( struct sys_desc_table_struct ) - 0xb0 - 0x13f Free. Add more parameters here if you really need them. - 0x140- 0x1be EDID_INFO Video mode setup - -0x1c4 unsigned long EFI system table pointer -0x1c8 unsigned long EFI memory descriptor size -0x1cc unsigned long EFI memory descriptor version -0x1d0 unsigned long EFI memory descriptor map pointer -0x1d4 unsigned long EFI memory descriptor map size -0x1e0 unsigned long ALT_MEM_K, alternative mem check, in Kb -0x1e4 unsigned long Scratch field for the kernel setup code -0x1e8 char number of entries in E820MAP (below) -0x1e9 unsigned char number of entries in EDDBUF (below) -0x1ea unsigned char number of entries in EDD_MBR_SIG_BUFFER (below) -0x1f1 char size of setup.S, number of sectors -0x1f2 unsigned short MOUNT_ROOT_RDONLY (if !=0) -0x1f4 unsigned short size of compressed kernel-part in the - (b)zImage-file (in 16 byte units, rounded up) -0x1f6 unsigned short swap_dev (unused AFAIK) -0x1f8 unsigned short RAMDISK_FLAGS -0x1fa unsigned short VGA-Mode (old one) -0x1fc unsigned short ORIG_ROOT_DEV (high=Major, low=minor) -0x1ff char AUX_DEVICE_INFO - -0x200 short jump to start of setup code aka "reserved" field. -0x202 4 bytes Signature for SETUP-header, ="HdrS" -0x206 unsigned short Version number of header format - Current version is 0x0201... -0x208 8 bytes (used by setup.S for communication with boot loaders, - look there) -0x210 char LOADER_TYPE, = 0, old one - else it is set by the loader: - 0xTV: T=0 for LILO - 1 for Loadlin - 2 for bootsect-loader - 3 for SYSLINUX - 4 for ETHERBOOT - 5 for ELILO - 7 for GRuB - 8 for U-BOOT - 9 for Xen - V = version -0x211 char loadflags: - bit0 = 1: kernel is loaded high (bzImage) - bit7 = 1: Heap and pointer (see below) set by boot - loader. -0x212 unsigned short (setup.S) -0x214 unsigned long KERNEL_START, where the loader started the kernel -0x218 unsigned long INITRD_START, address of loaded ramdisk image -0x21c unsigned long INITRD_SIZE, size in bytes of ramdisk image -0x220 4 bytes (setup.S) -0x224 unsigned short setup.S heap end pointer -0x226 unsigned short zero_pad -0x228 unsigned long cmd_line_ptr -0x22c unsigned long ramdisk_max -0x230 16 bytes trampoline -0x290 - 0x2cf EDD_MBR_SIG_BUFFER (edd.S) -0x2d0 - 0xd00 E820MAP -0xd00 - 0xeff EDDBUF (edd.S) for disk signature read sector -0xd00 - 0xeeb EDDBUF (edd.S) for edd data +000/040 ALL screen_info Text mode or frame buffer information + (struct screen_info) +040/014 ALL apm_bios_info APM BIOS information (struct apm_bios_info) +060/010 ALL ist_info Intel SpeedStep (IST) BIOS support information + (struct ist_info) +080/010 ALL hd0_info hd0 disk parameter, OBSOLETE!! +090/010 ALL hd1_info hd1 disk parameter, OBSOLETE!! +0A0/010 ALL sys_desc_table System description table (struct sys_desc_table) +140/080 ALL edid_info Video mode setup (struct edid_info) +1C0/020 ALL efi_info EFI 32 information (struct efi_info) +1E0/004 ALL alk_mem_k Alternative mem check, in KB +1E4/004 ALL scratch Scratch field for the kernel setup code +1E8/001 ALL e820_entries Number of entries in e820_map (below) +1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below) +1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer + (below) +290/040 ALL edd_mbr_sig_buffer EDD MBR signatures +2D0/A00 ALL e820_map E820 memory map table + (array of struct e820entry) +D00/1EC ALL eddbuf EDD data (array of struct edd_info) -- cgit v1.2.3