turn x86 VISWS into a generic architecture
Subsystems (4)
PATCH 1/1 turn x86 VISWS into a generic architecture
here's something i've been working on to simplify the x86 architecture code. I've extended generic x86 code with VISWS support and eliminated the VISWS subarch. The commits can be seen here (also attached):
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86/generalize-visws
The purpose of this is to eliminate the x86 subarch complications altogether from the tree.
[ I couldnt test it on real VISWS hardware, but all the intermediate
steps booted fine on a real PC, so if there's someone still with a VISWS around, it should be testable. (and bisectable) ]
The majority of the VISWS quirks are now contained in the arch/x86/kernel/visws_quirks.c file.
I think x86/Voyager could be converted in a similar way - by using the new quirk mechanism i've added. Doing so would largely eliminate most of our subarch complications in the x86 space.
Ingo
------------------>
Ingo Molnar (25):
x86: add early quirk support
x86, VisWS: turn into generic arch, make VisWS boot on a regular PC
x86, VisWS: turn into generic arch, add early init quirks
x86, VisWS: turn into generic arch, use generic mpparse code
x86, VisWS: turn into generic arch, install proper PCI quirk
x86, VisWS: turn into generic arch, update asm-x86/mach-visws/mach_apic.h x86, VisWS: turn into generic arch, eliminate include/asm-x86/mach-visws/mach_apic.h x86, VisWS: turn into generic arch, enhance include/asm-x86/mach-default/smpboot_hooks.h x86, VisWS: turn into generic arch, update include/asm-x86/mach-visws/smpboot_hooks.h x86, VisWS: turn into generic arch, eliminate include/asm-x86/mach-visws/smpboot_hooks.h x86, VisWS: turn into generic arch, update asm-x86/mach-visws/mach_apicdef.h x86, VisWS: turn into generic arch, eliminate asm-x86/mach-visws/mach_apicdef.h x86, VisWS: turn into generic arch, create include/asm-x86/visws/
x86, VisWS: turn into generic arch, move definitions
x86, VisWS: turn into generic arch, eliminate include/asm-x86/mach-visws/setup_arch.h x86, VisWS: turn into generic arch, add NR_IRQS quirk
x86, VisWS: turn into generic arch, add early quirks to default architectures x86, VisWS: turn into generic arch, copy visws files
x86, VisWS: turn into generic arch, flip over VISWS to generic arch
x86, VisWS: turn into generic arch, clean up
x86, VisWS: turn into generic arch, IO-APIC setup fix
x86, VisWS: turn into generic arch, clean up
x86, VisWS: turn into generic arch, clean up
x86, VisWS: turn into generic arch, remove leftover files
x86, VisWS: turn into generic arch, eliminate Kconfig specials
arch/x86/Kconfig | 62 +-
arch/x86/Makefile | 4 -
arch/x86/kernel/Makefile | 1 +
arch/x86/kernel/apic_32.c | 2 +-
arch/x86/kernel/e820.c | 11 +
arch/x86/kernel/mpparse.c | 20 +-
arch/x86/kernel/setup.c | 1 +
arch/x86/kernel/visws_quirks.c | 707 +++++++++++++++++++++++
arch/x86/lguest/Kconfig | 2 +-
arch/x86/mach-default/setup.c | 32 +-
arch/x86/mach-visws/Makefile | 8 -
arch/x86/mach-visws/mpparse.c | 85 ---
arch/x86/mach-visws/reboot.c | 55 --
arch/x86/mach-visws/setup.c | 183 ------
arch/x86/mach-visws/traps.c | 69 ---
arch/x86/mach-visws/visws_apic.c | 296 ----------
arch/x86/pci/Makefile | 4 +-
arch/x86/pci/visws.c | 19 +-
drivers/acpi/Kconfig | 1 -
drivers/lguest/Kconfig | 2 +-
drivers/video/sgivwfb.c | 3 +-
include/asm-x86/irq_vectors.h | 4 +-
include/asm-x86/mach-default/smpboot_hooks.h | 6 +
include/asm-x86/mach-visws/mach_apic.h | 104 +----
include/asm-x86/mach-visws/mach_apicdef.h | 13 +-
include/asm-x86/mach-visws/setup_arch.h | 7 +-
include/asm-x86/mach-visws/smpboot_hooks.h | 29 +-
include/asm-x86/setup.h | 19 +
include/asm-x86/{mach-visws => visws}/cobalt.h | 0
include/asm-x86/{mach-visws => visws}/lithium.h | 0
include/asm-x86/{mach-visws => visws}/piix4.h | 0
include/asm-x86/visws/sgivw.h | 5 +
32 files changed, 855 insertions(+), 899 deletions(-)
create mode 100644 arch/x86/kernel/visws_quirks.c
delete mode 100644 arch/x86/mach-visws/Makefile
delete mode 100644 arch/x86/mach-visws/mpparse.c
delete mode 100644 arch/x86/mach-visws/reboot.c
delete mode 100644 arch/x86/mach-visws/setup.c
delete mode 100644 arch/x86/mach-visws/traps.c
delete mode 100644 arch/x86/mach-visws/visws_apic.c
rename include/asm-x86/{mach-visws => visws}/cobalt.h (100%)
rename include/asm-x86/{mach-visws => visws}/lithium.h (100%)
rename include/asm-x86/{mach-visws => visws}/piix4.h (100%)
create mode 100644 include/asm-x86/visws/sgivw.harch/x86/Kconfig +31 -31
@@ -181,12 +181,12 @@ config X86_64_SMP config X86_HT bool depends on SMP - depends on (X86_32 && !(X86_VISWS || X86_VOYAGER)) || X86_64 + depends on (X86_32 && !X86_VOYAGER) || X86_64 default y config X86_BIOS_REBOOT bool - depends on !X86_VISWS && !X86_VOYAGER + depends on !X86_VOYAGER default y config X86_TRAMPOLINE
@@ -232,13 +232,13 @@ config SMP config X86_FIND_SMP_CONFIG def_bool y - depends on X86_MPPARSE || X86_VOYAGER || X86_VISWS + depends on X86_MPPARSE || X86_VOYAGER if ACPI config X86_MPPARSE def_bool y bool "Enable MPS table" - depends on X86_LOCAL_APIC && !X86_VISWS + depends on X86_LOCAL_APIC help For old smp systems that do not have proper acpi support. Newer systems (esp with 64bit cpus) with acpi support, MADT and DSDT will override it
@@ -247,7 +247,7 @@ endif if !ACPI config X86_MPPARSE def_bool y - depends on X86_LOCAL_APIC && !X86_VISWS + depends on X86_LOCAL_APIC endif choice
@@ -281,18 +281,6 @@ config X86_VOYAGER If you do not specifically know you have a Voyager based machine, say N here, otherwise the kernel you build will not be bootable. -config X86_VISWS - bool "SGI 320/540 (Visual Workstation)" - depends on X86_32 && PCI - help - The SGI Visual Workstation series is an IA32-based workstation - based on SGI systems chips with some legacy PC hardware attached. - - Say Y here to create a kernel to run on the SGI 320 or 540. - - A kernel compiled for the Visual Workstation will not run on PCs - and vice versa. See <file:Documentation/sgi-visws.txt> for details. - config X86_GENERICARCH bool "Generic architecture" depends on X86_32
@@ -363,6 +351,18 @@ config X86_VSMP endchoice +config X86_VISWS + bool "SGI 320/540 (Visual Workstation)" + depends on X86_32 && PCI + help + The SGI Visual Workstation series is an IA32-based workstation + based on SGI systems chips with some legacy PC hardware attached. + + Say Y here to create a kernel to run on the SGI 320 or 540. + + A kernel compiled for the Visual Workstation will run on general + PCs as well. See <file:Documentation/sgi-visws.txt> for details. + config SCHED_NO_NO_OMIT_FRAME_POINTER def_bool y prompt "Single-depth WCHAN output"
@@ -391,7 +391,7 @@ config VMI bool "VMI Guest support" select PARAVIRT depends on X86_32 - depends on !(X86_VISWS || X86_VOYAGER) + depends on !X86_VOYAGER help VMI provides a paravirtualized interface to the VMware ESX server (it could be used by other hypervisors in theory too, but is not
@@ -402,7 +402,7 @@ config KVM_CLOCK bool "KVM paravirtualized clock" select PARAVIRT select PARAVIRT_CLOCK - depends on !(X86_VISWS || X86_VOYAGER) + depends on !X86_VOYAGER help Turning on this option will allow you to run a paravirtualized clock when running over the KVM hypervisor. Instead of relying on a PIT
@@ -413,7 +413,7 @@ config KVM_CLOCK config KVM_GUEST bool "KVM Guest support" select PARAVIRT - depends on !(X86_VISWS || X86_VOYAGER) + depends on !X86_VOYAGER help This option enables various optimizations for running under the KVM hypervisor.
@@ -422,7 +422,7 @@ source "arch/x86/lguest/Kconfig" config PARAVIRT bool "Enable paravirtualization code" - depends on !(X86_VISWS || X86_VOYAGER) + depends on !X86_VOYAGER help This changes the kernel so it can modify itself when it is run under a hypervisor, potentially improving performance significantly
@@ -628,7 +628,7 @@ source "kernel/Kconfig.preempt" config X86_UP_APIC bool "Local APIC support on uniprocessors" - depends on X86_32 && !SMP && !(X86_VISWS || X86_VOYAGER || X86_GENERICARCH) + depends on X86_32 && !SMP && !(X86_VOYAGER || X86_GENERICARCH) help A local APIC (Advanced Programmable Interrupt Controller) is an integrated interrupt controller in the CPU. If you have a single-CPU
@@ -653,11 +653,11 @@ config X86_UP_IOAPIC config X86_LOCAL_APIC def_bool y - depends on X86_64 || (X86_32 && (X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH)) + depends on X86_64 || (X86_32 && (X86_UP_APIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH)) config X86_IO_APIC def_bool y - depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH)) + depends on X86_64 || (X86_32 && (X86_UP_IOAPIC || (SMP && !X86_VOYAGER) || X86_GENERICARCH)) config X86_VISWS_APIC def_bool y
@@ -711,7 +711,7 @@ config X86_MCE_NONFATAL config X86_MCE_P4THERMAL bool "check for P4 thermal throttling interrupt." - depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) && !X86_VISWS + depends on X86_32 && X86_MCE && (X86_UP_APIC || SMP) help Enabling this feature will cause a message to be printed when the P4 enters thermal throttling.
@@ -1414,7 +1414,7 @@ config X86_APM_BOOT menuconfig APM tristate "APM (Advanced Power Management) BIOS support" - depends on X86_32 && PM_SLEEP && !X86_VISWS + depends on X86_32 && PM_SLEEP ---help--- APM is a BIOS specification for saving power using several different techniques. This is mostly useful for battery powered laptops with
@@ -1561,7 +1561,7 @@ config PCI choice prompt "PCI access mode" - depends on X86_32 && PCI && !X86_VISWS + depends on X86_32 && PCI default PCI_GOANY ---help--- On PCI systems, the BIOS can be used to detect the PCI devices and
@@ -1598,12 +1598,12 @@ endchoice config PCI_BIOS def_bool y - depends on X86_32 && !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY) + depends on X86_32 && PCI && (PCI_GOBIOS || PCI_GOANY) # x86-64 doesn't support PCI BIOS access from long mode so always go direct. config PCI_DIRECT def_bool y - depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC) || X86_VISWS) + depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC)) config PCI_MMCONFIG def_bool y
@@ -1663,7 +1663,7 @@ if X86_32 config ISA bool "ISA support" - depends on !(X86_VOYAGER || X86_VISWS) + depends on !X86_VOYAGER help Find out whether you have ISA slots on your motherboard. ISA is the name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -1690,7 +1690,7 @@ config EISA source "drivers/eisa/Kconfig" config MCA - bool "MCA support" if !(X86_VISWS || X86_VOYAGER) + bool "MCA support" if !X86_VOYAGER default y if X86_VOYAGER help MicroChannel Architecture is found in some IBM PS/2 machines and
arch/x86/Makefile +0 -4
@@ -113,10 +113,6 @@ mcore-y := arch/x86/mach-default/ mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-x86/mach-voyager mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/ -# VISWS subarch support -mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-x86/mach-visws -mcore-$(CONFIG_X86_VISWS) := arch/x86/mach-visws/ - # generic subarchitecture mflags-$(CONFIG_X86_GENERICARCH):= -Iinclude/asm-x86/mach-generic fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
arch/x86/kernel/Makefile +1 -0
@@ -19,6 +19,7 @@ obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o obj-y += traps_$(BITS).o irq_$(BITS).o obj-y += time_$(BITS).o ioport.o ldt.o obj-y += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o +obj-$(CONFIG_X86_VISWS) += visws_quirks.o obj-$(CONFIG_X86_32) += probe_roms_32.o obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
arch/x86/kernel/apic_32.c +1 -1
@@ -974,7 +974,7 @@ void __cpuinit setup_local_APIC(void)* Double-check whether this APIC is really registered. */ if (!apic_id_registered ()) -BUG (); +WARN_ON_ONCE (1 );/* * Intel recommends to set DFR, LDR and TPR before enabling
arch/x86/kernel/e820.c +11 -0
@@ -1297,6 +1297,11 @@ void __init e820_reserve_resources(void) } } +/* +* Non-standard memory setup can be specified via this quirk: +*/ +char * (*arch_memory_setup_quirk)(void ); +char *__init default_machine_specific_memory_setup (void ) {char *who ="BIOS-e820" ;
@@ -1337,6 +1342,12 @@ char *__init default_machine_specific_memory_setup(void) char *__init __attribute__((weak)) machine_specific_memory_setup(void) { +if (arch_memory_setup_quirk) { +char *who =arch_memory_setup_quirk (); + +if (who) +return who; + }return default_machine_specific_memory_setup (); }
arch/x86/kernel/mpparse.c +18 -2
@@ -726,12 +726,22 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)static struct intel_mp_floating *mpf_found;/* +* Machine specific quirk for finding the SMP config before other setup +* activities destroy the table: +*/ +int (*mach_get_smp_config_quirk)(unsigned int early); + +/* * Scan the memory blocks for an SMP configuration block. */ -static void __init __get_smp_config (unsigned early) +static void __init __get_smp_config (unsigned int early) {struct intel_mp_floating *mpf = mpf_found; +if (mach_get_smp_config_quirk) { +if (mach_get_smp_config_quirk (early)) +return ; + }if (acpi_lapic && early)return ;/*
@@ -889,10 +899,16 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,return 0 ; } -static void __init __find_smp_config (unsigned reserve) +int (*mach_find_smp_config_quirk)(unsigned int reserve); + +static void __init __find_smp_config (unsigned int reserve) {unsigned int address; +if (mach_find_smp_config_quirk) { +if (mach_find_smp_config_quirk (reserve)) +return ; + }/* * FIXME: Linux assumes you have 640K of base ram.. * this continues the error...
arch/x86/kernel/setup.c +1 -0
@@ -596,6 +596,7 @@ void __init setup_arch(char **cmdline_p) {#ifdef CONFIG_X86_32 memcpy (&boot_cpu_data, &new_cpu_data,sizeof (new_cpu_data)); +visws_early_detect ();pre_setup_arch_hook ();early_cpu_init ();#else
arch/x86/kernel/visws_quirks.c new file +707 -0
707 lines not on this page · raw message
arch/x86/lguest/Kconfig +1 -1
@@ -3,7 +3,7 @@ config LGUEST_GUEST select PARAVIRT depends on X86_32 depends on !X86_PAE - depends on !(X86_VISWS || X86_VOYAGER) + depends on !X86_VOYAGER select VIRTIO select VIRTIO_RING select VIRTIO_CONSOLE
arch/x86/mach-default/setup.c +31 -1
@@ -10,6 +10,14 @@#include <asm/e820.h> #include <asm/setup.h> +/* +* Any quirks to be performed to initialize timers/irqs/etc? +*/ +int (*arch_time_init_quirk)(void ); +int (*arch_pre_intr_init_quirk)(void ); +int (*arch_intr_init_quirk)(void ); +int (*arch_trap_init_quirk)(void ); +#ifdef CONFIG_HOTPLUG_CPU #define DEFAULT_SEND_IPI (1)#else
@@ -29,6 +37,10 @@ int no_broadcast=DEFAULT_SEND_IPI;**/ void __init pre_intr_init_hook (void ) { +if (arch_pre_intr_init_quirk) { +if (arch_pre_intr_init_quirk ()) +return ; + }init_ISA_irqs (); }
@@ -52,6 +64,10 @@ static struct irqaction irq2 = {**/ void __init intr_init_hook (void ) { +if (arch_intr_init_quirk) { +if (arch_intr_init_quirk ()) +return ; + }#ifdef CONFIG_X86_LOCAL_APIC apic_intr_init ();#endif
@@ -65,7 +81,7 @@ void __init intr_init_hook(void)* * Description: * generally used to activate any machine specific identification -* routines that may be needed before setup_arch() runs. On VISWS +* routines that may be needed before setup_arch() runs. On Voyager * this is used to get the board revision and type. **/ void __init pre_setup_arch_hook (void )
@@ -81,6 +97,10 @@ void __init pre_setup_arch_hook(void)**/ void __init trap_init_hook (void ) { +if (arch_trap_init_quirk) { +if (arch_trap_init_quirk ()) +return ; + } }static struct irqaction irq0 = {
@@ -99,6 +119,16 @@ static struct irqaction irq0 = {**/ void __init time_init_hook (void ) { +if (arch_time_init_quirk) { +/* +* A nonzero return code does not mean failure, it means +* that the architecture quirk does not want any +* generic (timer) setup to be performed after this: +*/ +if (arch_time_init_quirk ()) +return ; + } + irq0.mask =cpumask_of_cpu (0 );setup_irq (0 , &irq0); }
arch/x86/mach-visws/Makefile deleted +0 -8
@@ -1,8 +0,0 @@ -# -# Makefile for the linux kernel. -# - -obj-y := setup.o traps.o reboot.o - -obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o -obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o
arch/x86/mach-visws/mpparse.c deleted +0 -85
85 lines not on this page · raw message
arch/x86/mach-visws/reboot.c deleted +0 -55
55 lines not on this page · raw message
arch/x86/mach-visws/setup.c deleted +0 -183
183 lines not on this page · raw message
arch/x86/mach-visws/traps.c deleted +0 -69
69 lines not on this page · raw message
arch/x86/mach-visws/visws_apic.c deleted +0 -296
296 lines not on this page · raw message
arch/x86/pci/Makefile +1 -3
@@ -9,9 +9,7 @@ pci-y := fixup.o pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o -# Careful: VISWS overrule the pci-y above. The colons are -# therefor correct. This needs a proper fix by distangling the code. -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_VISWS) += visws.o pci-$(CONFIG_X86_NUMAQ) += numa.o
arch/x86/pci/visws.c +14 -5
@@ -8,18 +8,19 @@#include <linux/pci.h> #include <linux/init.h> -#include "cobalt.h" -#include "lithium.h" +#include <asm/setup.h> +#include <asm/visws/cobalt.h> +#include <asm/visws/lithium.h> #include "pci.h" static int pci_visws_enable_irq (struct pci_dev *dev) {return 0 ; }static void pci_visws_disable_irq (struct pci_dev *dev) { } -int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; -void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; +/* int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; */ +/* void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; */ -void __init pcibios_penalize_isa_irq (int irq,int active) {} +/* void __init pcibios_penalize_isa_irq(int irq, int active) {} */ unsigned int pci_bus0, pci_bus1;
@@ -107,7 +108,15 @@ static int __init pci_visws_init(void)static __init int pci_subsys_init (void ) { +if (!is_visws_box ()) +return -1 ; + + pcibios_enable_irq = &pci_visws_enable_irq; + pcibios_disable_irq = &pci_visws_disable_irq; +pci_visws_init ();pcibios_init (); + +return 0 ; }subsys_initcall (pci_subsys_init);
drivers/acpi/Kconfig +0 -1
@@ -4,7 +4,6 @@ menuconfig ACPI bool "ACPI (Advanced Configuration and Power Interface) Support" - depends on !X86_VISWS depends on !IA64_HP_SIM depends on IA64 || X86 depends on PCI
drivers/lguest/Kconfig +1 -1
@@ -1,6 +1,6 @@ config LGUEST tristate "Linux hypervisor example code" - depends on X86_32 && EXPERIMENTAL && !X86_PAE && FUTEX && !(X86_VISWS || X86_VOYAGER) + depends on X86_32 && EXPERIMENTAL && !X86_PAE && FUTEX && !X86_VOYAGER select HVC_DRIVER ---help--- This is a very simple module which allows you to run
drivers/video/sgivwfb.c +1 -2
@@ -21,8 +21,7 @@#include <asm/io.h> #include <asm/mtrr.h> - -#include <setup_arch.h> +#include <asm/visws/sgivw.h> #define INCLUDE_TIMING_TABLE_DATA #define DBE_REG_BASE par->regs
include/asm-x86/irq_vectors.h +2 -2
@@ -107,9 +107,9 @@#define LAST_VM86_IRQ 15#define invalid_vm86_irq (irq) ((irq) < 3 || (irq) > 15) -#if !defined(CONFIG_X86_VISWS ) && !defined(CONFIG_X86_VOYAGER ) +#if !defined(CONFIG_X86_VOYAGER ) -# if defined(CONFIG_X86_IO_APIC ) || defined(CONFIG_PARAVIRT ) +# if defined(CONFIG_X86_IO_APIC ) || defined(CONFIG_PARAVIRT ) || defined(CONFIG_X86_VISWS )# define NR_IRQS 224
include/asm-x86/mach-default/smpboot_hooks.h +6 -0
@@ -3,7 +3,9 @@static inline void smpboot_clear_io_apic_irqs (void ) { +#ifdef CONFIG_X86_IO_APIC io_apic_irqs =0 ; +#endif }static inline void smpboot_setup_warm_reset_vector (unsigned long start_eip)
@@ -35,6 +37,7 @@ static inline void smpboot_restore_warm_reset_vector(void)static inline void __init smpboot_setup_io_apic (void ) { +#ifdef CONFIG_X86_IO_APIC /* * Here we can be sure that there is an IO-APIC in the system. Let's * go and set it up:
@@ -45,9 +48,12 @@ static inline void __init smpboot_setup_io_apic(void) nr_ioapics =0 ; localise_nmi_watchdog(); } +#endif }static inline void smpboot_clear_io_apic (void ) { +#ifdef CONFIG_X86_IO_APIC nr_ioapics =0 ; +#endif }
include/asm-x86/mach-visws/mach_apic.h +1 -103
104 lines not on this page · raw message
include/asm-x86/mach-visws/mach_apicdef.h +1 -12
@@ -1,12 +1 @@ -#ifndef __ASM_MACH_APICDEF_H -#define __ASM_MACH_APICDEF_H - -#define APIC_ID_MASK (0xF<<24) - -static inline unsigned get_apic_id (unsigned long x) -{ -return (((x)>>24 )&0xF ); -} -#define GET_APIC_ID (x) get_apic_id(x) - -#endif +#include "../mach-default/mach_apicdef.h"
include/asm-x86/mach-visws/setup_arch.h +1 -6
@@ -1,6 +1 @@ -/* Hook to call BIOS initialisation function */ - -extern unsigned long sgivwfb_mem_phys; -extern unsigned long sgivwfb_mem_size; - -/* no action for visws */ +#include "../mach-default/setup_arch.h"
include/asm-x86/mach-visws/smpboot_hooks.h +1 -28
@@ -1,28 +1 @@ -static inline void smpboot_setup_warm_reset_vector (unsigned long start_eip) -{ -CMOS_WRITE (0xa ,0xf ); -local_flush_tlb (); -Dprintk ("1.\n" ); - *((volatile unsigned short *)TRAMPOLINE_HIGH ) = start_eip >>4 ; -Dprintk ("2.\n" ); - *((volatile unsigned short *)TRAMPOLINE_LOW ) = start_eip &0xf ; -Dprintk ("3.\n" ); -} - -/* for visws do nothing for any of these */ - -static inline void smpboot_clear_io_apic_irqs (void ) -{ -} - -static inline void smpboot_restore_warm_reset_vector (void ) -{ -} - -static inline void smpboot_setup_io_apic (void ) -{ -} - -static inline void smpboot_clear_io_apic (void ) -{ -} +#include "../mach-default/smpboot_hooks.h"
include/asm-x86/setup.h +19 -0
@@ -8,6 +8,25 @@/* Interrupt control for vSMPowered x86_64 systems */ void vsmp_init (void ); +#ifdef CONFIG_X86_VISWS +extern void visws_early_detect (void ); +extern int is_visws_box (void ); +#else +static inline void visws_early_detect (void ) { } +static inline int is_visws_box (void ) {return 0 ; } +#endif + +/* +* Any setup quirks to be performed? +*/ +extern int (*arch_time_init_quirk)(void ); +extern int (*arch_pre_intr_init_quirk)(void ); +extern int (*arch_intr_init_quirk)(void ); +extern int (*arch_trap_init_quirk)(void ); +extern char * (*arch_memory_setup_quirk)(void ); +extern int (*mach_get_smp_config_quirk)(unsigned int early); +extern int (*mach_find_smp_config_quirk)(unsigned int reserve); +#ifndef CONFIG_PARAVIRT #define paravirt_post_allocator_init () do {} while (0)#endif
include/asm-x86/visws/cobalt.h renamed from include/asm-x86/mach-visws/cobalt.h +0 -0
include/asm-x86/visws/lithium.h renamed from include/asm-x86/mach-visws/lithium.h +0 -0
include/asm-x86/visws/piix4.h renamed from include/asm-x86/mach-visws/piix4.h +0 -0
include/asm-x86/visws/sgivw.h new file +5 -0
@@ -0,0 +1,5 @@ +/* +* Frame buffer position and size: +*/ +extern unsigned long sgivwfb_mem_phys; +extern unsigned long sgivwfb_mem_size;
On 10.07.08 19:07:12, Ingo Molnar wrote:
[...]
arch/x86/pci/Makefile pci-y := fixup.o · line 12
Quoted 12 lines
arch/x86/pci/Makefile +1
-3@@ -9,9 +9,7 @@ pci-y := fixup.o pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o -# Careful: VISWS overrule the pci-y above. The colons are -# therefor correct. This needs a proper fix by distangling the code. -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_VISWS) += visws.o
Ingo, if we turn this into generic code, we have to remove the subsys_initcall for this too. Otherwise subsystem initialization is running twice, in legacy.c and in visws.c.
Quoted 38 lines
arch/x86/pci/Makefile +0
-0pci-$(CONFIG_X86_NUMAQ) += numa.oarch/x86/pci/visws.c +8
-5@@ -8,18 +8,19 @@#include <linux/pci.h> #include <linux/init.h> -#include "cobalt.h" -#include "lithium.h" +#include <asm/setup.h> +#include <asm/visws/cobalt.h> +#include <asm/visws/lithium.h> #include "pci.h" static int pci_visws_enable_irq (struct pci_dev *dev) {return 0 ; }static void pci_visws_disable_irq (struct pci_dev *dev) { } -int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; -void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; +/* int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; */ +/* void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; */ -void __init pcibios_penalize_isa_irq (int irq,int active) {} +/* void __init pcibios_penalize_isa_irq(int irq, int active) {} */ unsigned int pci_bus0, pci_bus1;@@ -107,7 +108,15 @@ static int __init pci_visws_init(void)static __init int pci_subsys_init (void ) { +if (!is_visws_box ()) +return -1 ;
arch/x86/pci/visws.c static int __init pci_visws_init(void) · line 122
Quoted 10 lines
arch/x86/pci/visws.c +6
-0+ + pcibios_enable_irq = &pci_visws_enable_irq; + pcibios_disable_irq = &pci_visws_disable_irq; +pci_visws_init ();pcibios_init (); + +return 0 ; }subsys_initcall (pci_subsys_init);
This code should be moved to pci_subsys_init() of legacy.c.
[...]
Signature · 3 lines
Advanced Micro Devices, Inc. Operating System Research Center email: [email protected]
Quoted 12 lines · Robert Richter
On 10.07.08 19:07:12, Ingo Molnar wrote:
[...]
Quoted 8 lines
arch/x86/pci/Makefile +0
-0@@ -9,9 +9,7 @@ pci-y := fixup.o pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o
Quoted 8 lines
arch/x86/pci/Makefile pci-y := fixup.o · line 12
Quoted 4 lines
arch/x86/pci/Makefile +1
-3-# Careful: VISWS overrule the pci-y above. The colons are -# therefor correct. This needs a proper fix by distangling the code. -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_VISWS) += visws.oIngo, if we turn this into generic code, we have to remove the
subsys_initcallfor this too. Otherwise subsystem initialization is running twice, inlegacy.cand invisws.c.
Ok. Mind sending a patch for this against tip/master? Both your changes and the visws cleanups are all in there and are tested through on typical hardware.
(Also, there's the suggestion from Yinghai to first do the numa init.)
Ingo
Quoted 24 lines · Ingo Molnar
Quoted 12 lines · Robert Richter
On 10.07.08 19:07:12, Ingo Molnar wrote:
[...]
Quoted 8 lines
arch/x86/pci/Makefile +0
-0@@ -9,9 +9,7 @@ pci-y := fixup.o pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.oQuoted 8 lines
arch/x86/pci/Makefile pci-y := fixup.o · line 12
Quoted 4 lines
arch/x86/pci/Makefile +1
-3-# Careful: VISWS overrule the pci-y above. The colons are -# therefor correct. This needs a proper fix by distangling the code. -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_VISWS) += visws.oIngo, if we turn this into generic code, we have to remove the
subsys_initcallfor this too. Otherwise subsystem initialization is running twice, inlegacy.cand invisws.c.
Quoted 5 lines
Ok. Mind sending a patch for this against tip/master? Both your changes and the visws cleanups are all in there and are tested through on typical hardware.
(Also, there's the suggestion from Yinghai to first do the numa init.)
could change the numa.c to numaq.c too. that name is confusing..
YH
Quoted 25 lines · Yinghai Lu
Quoted 24 lines · Ingo Molnar
Quoted 20 lines · Robert Richter
On 10.07.08 19:07:12, Ingo Molnar wrote:
[...]
arch/x86/pci/Makefile pci-y := fixup.o · line 12
Quoted 12 lines
arch/x86/pci/Makefile +1
-3@@ -9,9 +9,7 @@ pci-y := fixup.o pci-$(CONFIG_ACPI) += acpi.o pci-y += legacy.o irq.o -# Careful: VISWS overrule the pci-y above. The colons are -# therefor correct. This needs a proper fix by distangling the code. -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_VISWS) += visws.oIngo, if we turn this into generic code, we have to remove the
subsys_initcallfor this too. Otherwise subsystem initialization is running twice, inlegacy.cand invisws.c.
Quoted 7 lines
Quoted 5 lines
Ok. Mind sending a patch for this against tip/master? Both your changes and the visws cleanups are all in there and are tested through on typical hardware.
(Also, there's the suggestion from Yinghai to first do the numa init.)
could change the
numa.ctonumaq.ctoo. that name is confusing..
Ok, I will send out patches that cover all this and also pci-y removal.
-Robert
Signature · 3 lines
Advanced Micro Devices, Inc. Operating System Research Center email: [email protected]
Quoted 8 lines · Yinghai Lu
Quoted 6 lines
Ok. Mind sending a patch for this against tip/master? Both your changes and the visws cleanups are all in there and are tested through on typical hardware.
(Also, there's the suggestion from Yinghai to first do the numa init.)
could change the
numa.ctonumaq.ctoo. that name is confusing..
agreed. Maybe rename it to numaq_32.c as well.
Then we could potentially eliminate the NUMAQ subarch altogether as well and merge all it into arch/x86/kernel/numaq_quirks.c, just like we did it for arch/x86/kernel/visws_quirks.c?
That reminds me, wouldnt it all be better in a single place, i.e. move arch/x86/pci/visws.c into arch/x86/kernel/visws_quirks.c as well? Such quirks are better viewed in their entirety in a single file, i'm not sure it makes sense to spread them out.
This way, instead of having this mess of entire subarches, we'd have a single, clean "quirks driver" file, conditionally buildable into the generic PC code, that would register itself with all the generic quirk hooks that are needed for a given weird box.
Ingo