convert voyager over to the x86 quirks model
Subsystems (2)
cover convert voyager over to the x86 quirks model
Given the lack of feedback, I went ahead and implemented the additions to smp_ops and x86_quirks (and a dynamic mca NMI hook) to allow voyager to be plumbed in.
There also needs to be changes in the boot setup to make voyager work
dynamically: It has to be detected first, so the a20 gate check is only executed if a voyager is not found.
I also completed some of the subarchitecture eliminations, so all the include file infrastructure should be gone.
The result is that I can boot both my PC SMP x86 boxes and voyager with the same kernel.
This patch series applies on the x86/apic branch of the x86 tree (obviously with 965c7ecaf2e2b083d711a01ab33735a4bdeee1a4 reverted)
James
---
[VOYAGER] x86: add {safe,hard}_smp_processor_id to smp_ops [VOYAGER] x86/mca: make mca_nmi_hook external
[VOYAGER] x86: add prefill_possible_map to x86_quirks [VOYAGER] x86: use boot_cpu_id instead of zero for checking boot
processor
[VOYAGER] x86/voyager: Move voyager detection to a new bootparam area [VOYAGER] x86: eliminate subarchitecture file setup_arch.h [VOYAGER] x86: eliminate subarchitecture file entry_arch.h [VOYAGER] x86: eliminate subarchitecture file do_timer.h [VOYAGER] x86: redo irq2 cascade setup
[VOYAGER] x86: make disabling the apics functional instead of a flag [VOYAGER] x86/Voyager: add missing QIC call function single gate [VOYAGER] x86/Voyager: replace inline io area reads with readX
accessors
[VOYAGER] x86/Voyager: Plumb voyager back into the build
arch/x86/Kconfig | 4 +- arch/x86/Makefile | 2 + arch/x86/boot/Makefile | 4 +- arch/x86/boot/a20.c | 13 +- arch/x86/boot/boot.h | 2 +- arch/x86/boot/voyager.c | 5 +- arch/x86/include/asm/apic.h | 6 + arch/x86/include/asm/bootparam.h | 5 +- arch/x86/include/asm/do_timer.h | 16 - arch/x86/include/asm/entry_arch.h | 57 --- arch/x86/include/asm/hw_irq.h | 11 + arch/x86/include/asm/mach-voyager/do_timer.h | 17 - arch/x86/include/asm/mach-voyager/entry_arch.h | 26 -- arch/x86/include/asm/mach-voyager/setup_arch.h | 12 - arch/x86/include/asm/mca.h | 3 + arch/x86/include/asm/setup.h | 6 +- arch/x86/include/asm/setup_arch.h | 3 - arch/x86/include/asm/smp.h | 13 +- arch/x86/include/asm/voyager.h | 80 ++--- arch/x86/include/asm/voyager_bios.h | 21 + arch/x86/include/asm/voyager_boot.h | 27 ++ arch/x86/include/asm/voyager_vectors.h | 37 ++ arch/x86/kernel/apic/apic.c | 8 +- arch/x86/kernel/apic/ipi.c | 2 +- arch/x86/kernel/apic/probe_32.c | 3 + arch/x86/kernel/entry_32.S | 70 +++- arch/x86/kernel/irqinit_32.c | 15 +- arch/x86/kernel/mca_32.c | 12 + arch/x86/kernel/probe_roms_32.c | 1 - arch/x86/kernel/setup.c | 35 +-- arch/x86/kernel/smp.c | 7 + arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/time_32.c | 11 +- arch/x86/kernel/visws_quirks.c | 7 - arch/x86/mach-voyager/setup.c | 66 ++-- arch/x86/mach-voyager/voyager_basic.c | 98 ++--- arch/x86/mach-voyager/voyager_smp.c | 544 ++++++++---------------- arch/x86/mach-voyager/voyager_thread.c | 5 +- arch/x86/xen/smp.c | 7 + 39 files changed, 550 insertions(+), 713 deletions(-) delete mode 100644 arch/x86/include/asm/do_timer.h delete mode 100644 arch/x86/include/asm/entry_arch.h delete mode 100644 arch/x86/include/asm/mach-voyager/do_timer.h delete mode 100644 arch/x86/include/asm/mach-voyager/entry_arch.h delete mode 100644 arch/x86/include/asm/mach-voyager/setup_arch.h delete mode 100644 arch/x86/include/asm/setup_arch.h create mode 100644 arch/x86/include/asm/voyager_bios.h create mode 100644 arch/x86/include/asm/voyager_boot.h create mode 100644 arch/x86/include/asm/voyager_vectors.h
PATCH 1/13 x86: add {safe,hard}_smp_processor_id to smp_ops
Not having apics, Voyager can't use the default apic implementation of these, it has to read from a special port in the VIC to get the processor ID, so abstract these functions in smp_ops to allow voyager to live simultaneously with the apic code.
--- arch/x86/include/asm/smp.h | 13 +++++++++++-- arch/x86/kernel/apic/apic.c | 5 ----- arch/x86/kernel/apic/ipi.c | 2 +- arch/x86/kernel/smp.c | 7 +++++++ arch/x86/xen/smp.c | 7 +++++++ 5 files changed, 26 insertions(+), 8 deletions(-)
arch/x86/include/asm/smp.h +11 -2
@@ -60,6 +60,8 @@ struct smp_ops {void (*send_call_func_ipi)(const struct cpumask *mask);void (*send_call_func_single_ipi)(int cpu); +int (*hard_smp_processor_id)(void ); +int (*safe_smp_processor_id)(void ); };/* Globals due to paravirt */
@@ -158,7 +160,11 @@ extern unsigned disabled_cpus __cpuinitdata;* so this is correct in the x86 case. */ #define raw_smp_processor_id () (percpu_read(cpu_number)) -extern int safe_smp_processor_id (void ); +int apic_safe_smp_processor_id (void ); +static inline int safe_smp_processor_id (void ) +{ +return smp_ops.safe_smp_processor_id (); +}#elif defined(CONFIG_X86_64_SMP )#define raw_smp_processor_id () (percpu_read(cpu_number))
@@ -184,7 +190,10 @@ static inline int logical_smp_processor_id(void)#endif -extern int hard_smp_processor_id (void ); +static inline int hard_smp_processor_id (void ) +{ +return smp_ops.hard_smp_processor_id (); +}#else /* CONFIG_X86_LOCAL_APIC */
arch/x86/kernel/apic/apic.c +0 -5
@@ -1856,11 +1856,6 @@ void __cpuinit generic_processor_info(int apicid, int version)set_cpu_present (cpu, true); } -int hard_smp_processor_id (void ) -{ -return read_apic_id (); -} -void default_init_apic_ldr (void ) {unsigned long val;
arch/x86/kernel/apic/ipi.c +1 -1
@@ -146,7 +146,7 @@ static int convert_apicid_to_cpu(int apic_id)return -1 ; } -int safe_smp_processor_id (void ) +int apic_safe_smp_processor_id (void ) {int apicid, cpuid;
arch/x86/kernel/smp.c +7 -0
@@ -192,6 +192,11 @@ void smp_call_function_single_interrupt(struct pt_regs *regs)irq_exit (); } +static int native_hard_smp_processor_id (void ) +{ +return read_apic_id (); +} +struct smp_ops smp_ops = { .smp_prepare_boot_cpu = native_smp_prepare_boot_cpu, .smp_prepare_cpus = native_smp_prepare_cpus,
@@ -207,5 +212,7 @@ struct smp_ops smp_ops = { .send_call_func_ipi = native_send_call_func_ipi, .send_call_func_single_ipi = native_send_call_func_single_ipi, + .hard_smp_processor_id = native_hard_smp_processor_id, + .safe_smp_processor_id = apic_safe_smp_processor_id, };EXPORT_SYMBOL_GPL (smp_ops);
arch/x86/xen/smp.c +7 -0
@@ -450,6 +450,11 @@ static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } +static int xen_hard_smp_processor_id (void ) +{ +return read_apic_id (); +} +static const struct smp_ops xen_smp_ops__initdata = { .smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu, .smp_prepare_cpus = xen_smp_prepare_cpus,
@@ -465,6 +470,8 @@ static const struct smp_ops xen_smp_ops __initdata = { .send_call_func_ipi = xen_smp_send_call_function_ipi, .send_call_func_single_ipi = xen_smp_send_call_function_single_ipi, + .hard_smp_processor_id = xen_hard_smp_processor_id, + .safe_smp_processor_id = apic_safe_smp_processor_id, };void __init xen_smp_init (void )
Signature · 1 line
1.6.1.3
PATCH 2/13 x86/mca: make mca_nmi_hook external
Part of the apic rework brought the mca_nmi_hook to a place where it can't be accessed by architecture specific code. Publish it again, this time as a settable function vector so that voyager can use it.
If there were more than one possible architecture wanting to use this, it could become a call chain, but there's only one and MCA is an old bus, so leave it as a single call hook.
--- arch/x86/include/asm/mca.h | 3 +++ arch/x86/kernel/mca_32.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-)
arch/x86/include/asm/mca.h +3 -0
@@ -4,6 +4,9 @@#ifndef _ASM_X86_MCA_H#define _ASM_X86_MCA_H +/* hook for the bus chain of the MCA NMI */ +extern void (*mca_nmi_hook)(void ); +/* Maximal number of MCA slots - actually, some machines have less, but * they all have sufficient number of POS registers to cover 8. */
arch/x86/kernel/mca_32.c +12 -0
@@ -466,6 +466,13 @@ static int __kprobes mca_handle_nmi_callback(struct device *dev, void *data)return 0 ; } +/* +* The MCA (Microchannel Architecture) has an NMI chain for NMI sources +* along the MCA bus. Use this to hook into that chain if you will need +* it. +*/ +void (*mca_nmi_hook)(void ) =NULL ; +void __kprobes mca_handle_nmi (void ) {/*
@@ -473,4 +480,9 @@ void __kprobes mca_handle_nmi(void)* adapter was responsible for the error. */ bus_for_each_dev (&mca_bus_type,NULL ,NULL , mca_handle_nmi_callback); + +if (mca_nmi_hook) +mca_nmi_hook (); +else +pr_warning ("NMI generated from unknown source!\n" ); }
Signature · 1 line
1.6.1.3
PATCH 3/13 x86: add prefill_possible_map to x86_quirks
Voyager needs a different prefill of the possible map, so abstract the operation through the x86 quirks mechanism.
--- arch/x86/include/asm/setup.h | 1 + arch/x86/kernel/setup.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletions(-)
arch/x86/include/asm/setup.h +1 -0
@@ -31,6 +31,7 @@ struct x86_quirks {void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable,unsigned short oemsize);int (*setup_ioapic_ids)(void ); +void (*prefill_possible_map)(void ); };extern void x86_quirk_pre_intr_init (void );
arch/x86/kernel/setup.c +4 -1
@@ -937,7 +937,10 @@ void __init setup_arch(char **cmdline_p)get_smp_config ();#endif -prefill_possible_map (); +if (x86_quirks->prefill_possible_map) + x86_quirks->prefill_possible_map (); +else +prefill_possible_map ();#ifdef CONFIG_X86_64 init_cpu_to_node ();
Signature · 1 line
1.6.1.3
PATCH 4/13 x86: use boot_cpu_id instead of zero for checking boot processor
The function smp_store_cpu_info() checks zero to see if it's identifying a secondary. It should check boot_cpu_id.
--- arch/x86/kernel/smpboot.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/smpboot.c +1 -1
@@ -421,7 +421,7 @@ void __cpuinit smp_store_cpu_info(int id) *c = boot_cpu_data; c->cpu_index = id; -if (id !=0 ) +if (id != boot_cpu_id)identify_secondary_cpu (c);smp_apply_quirks (c); }
Signature · 1 line
1.6.1.3
PATCH 5/13 x86/voyager: Move voyager detection to a new bootparam area
For voyager to be detected in arbitrary configurations, it can no longer hijack the apm_bios area and must have a bios area of its own, which this patch implements.
Since the a20 test can't be done on voyager because of VIC incompatibilities, the voyager detection must come first so the a20 test can do a runtime check of voyager presence. The runtime check in is_voyager() relies on boot_params, so move this outside of the _SETUP include guard in asm/setup.h and remove the separate definition from boot/boot.h.
Also added is an early printk if voyager is detected to aid in debugging problems as they arise.
--- arch/x86/boot/Makefile | 4 +++- arch/x86/boot/a20.c | 13 +++++++------ arch/x86/boot/boot.h | 2 +- arch/x86/boot/voyager.c | 5 +++-- arch/x86/include/asm/bootparam.h | 5 ++++- arch/x86/include/asm/setup.h | 4 ++-- arch/x86/include/asm/voyager.h | 13 +++---------- arch/x86/include/asm/voyager_bios.h | 21 +++++++++++++++++++++ arch/x86/include/asm/voyager_boot.h | 27 +++++++++++++++++++++++++++ arch/x86/mach-voyager/voyager_basic.c | 2 +- 10 files changed, 72 insertions(+), 24 deletions(-) create mode 100644 arch/x86/include/asm/voyager_bios.h create mode 100644 arch/x86/include/asm/voyager_boot.h
arch/x86/boot/Makefile +3 -1
@@ -28,11 +28,13 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA targets := vmlinux.bin setup.bin setup.elf zImage bzImage subdir- := compressed +# Voyager must come first because there's a condition in a20.c +# that depends on voyager detection +setup-$(CONFIG_X86_VOYAGER) += voyager.o setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o setup-y += header.o main.o mca.o memory.o pm.o pmjump.o setup-y += printf.o string.o tty.o video.o video-mode.o version.o setup-$(CONFIG_X86_APM_BOOT) += apm.o -setup-$(CONFIG_X86_VOYAGER) += voyager.o # The link order of the video-*.o modules can matter. In particular, # video-vga.o *must* be listed first, followed by video-vesa.o.
arch/x86/boot/a20.c +7 -6
@@ -126,11 +126,13 @@ static void enable_a20_fast(void)int enable_a20 (void ) { -#ifdef CONFIG_X86_VOYAGER -/* On Voyager, a20_test() is unsafe? */ -enable_a20_kbc (); -return 0 ; -#else +if (is_voyager ()) { +/* On Voyager, a20_test() is unsafe becuase it pokes +* about in areas that are VIC specific and causes +* a crash */ +enable_a20_kbc (); +return 0 ; + }int loops =A20_ENABLE_LOOPS ;int kbc_err;
@@ -164,5 +166,4 @@ int enable_a20(void) }return -1 ; -#endif }
arch/x86/boot/boot.h +1 -1
@@ -24,6 +24,7 @@#include <linux/edd.h> #include <asm/boot.h> #include <asm/setup.h> +#include <asm/voyager_boot.h> #include "bitops.h" #include <asm/cpufeature.h>
@@ -33,7 +34,6 @@#define ARRAY_SIZE (x) (sizeof(x) / sizeof(*(x)))extern struct setup_header hdr; -extern struct boot_params boot_params;/* Basic port I/O */ static inline void outb (u8 v,u16 port)
arch/x86/boot/voyager.c +3 -2
@@ -19,9 +19,9 @@ int query_voyager(void)u8 err;u16 es, di;/* Abuse the apm_bios_info area for this */ -u8 *data_ptr = (u8 *)&boot_params.apm_bios_info; +u8 *data_ptr = (u8 *)&boot_params.voyager_bios_info; - data_ptr[0 ] =0xff ;/* Flag on config not found(?) */ + data_ptr[0 ] =NOT_VOYAGER_BIOS_SIG ; asm("pushw %%es ; " "int $0x15 ; "
@@ -33,6 +33,7 @@ int query_voyager(void)if (err)return -1 ;/* Not Voyager */ +printf ("Voyager detected\n" );set_fs (es);copy_from_fs (data_ptr, di,7 );/* Table is 7 bytes apparently */
arch/x86/include/asm/bootparam.h +4 -1
@@ -7,6 +7,7 @@#include <linux/edd.h> #include <asm/e820.h> #include <asm/ist.h> +#include <asm/voyager_bios.h> #include <video/edid.h> /* setup data types */
@@ -105,7 +106,9 @@ struct boot_params {struct e820entry e820_map[E820MAX ];/* 0x2d0 */ __u8 _pad8[48 ];/* 0xcd0 */ struct edd_info eddbuf[EDDMAXNR ];/* 0xd00 */ -__u8 _pad9[276 ];/* 0xeec */ +__u8 _pad9[20 ];/* 0xeec */ +struct voyager_bios_info voyager_bios_info;/* 0xf00 */ +__u8 _pad10[249 ];/* 0xf07 */ } __attribute__((packed));#endif /* _ASM_X86_BOOTPARAM_H */
arch/x86/include/asm/setup.h +2 -2
@@ -88,13 +88,13 @@ extern unsigned long saved_video_mode;#define paravirt_post_allocator_init () do {} while (0)#endif -#ifndef _SETUP -/* * This is set up by the setup-routine at boot-time */ extern struct boot_params boot_params; +#ifndef _SETUP +/* * Do NOT EVER look at the BIOS memory size location. * It does not work on many machines.
arch/x86/include/asm/voyager.h +3 -10
@@ -4,6 +4,9 @@* * Standard include definitions for the NCR Voyager system */ +#include <asm/voyager_bios.h> +#include <asm/voyager_boot.h> +#undef VOYAGER_DEBUG#undef VOYAGER_CAT_DEBUG
@@ -305,16 +308,6 @@ typedef struct voyager_asic_data_table { -struct voyager_bios_info { -__u8 len; -__u8 major; -__u8 minor; -__u8 debug; -__u8 num_classes; -__u8 class_1; -__u8 class_2; -}; -/* The following structures and definitions are for the Kernel/SUS * interface these are needed to find out how SUS initialised any Quad * boards in the system */
arch/x86/include/asm/voyager_bios.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* This file is designed to be included in the boot system +* so must be as minimal as possible +*/ +#ifndef _ASM_VOYAGER_BIOS_H +#define _ASM_VOYAGER_BIOS_H + +/* non voyager signature in the len field (voyager bios length is small) */ +#define NOT_VOYAGER_BIOS_SIG 0xff + +struct voyager_bios_info { +__u8 len; +__u8 major; +__u8 minor; +__u8 debug; +__u8 num_classes; +__u8 class_1; +__u8 class_2; +}; + +#endif /* _ASM_VOYAGER_BIOS_H */
arch/x86/include/asm/voyager_boot.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* This file is designed to be included in the boot system +* so must be as minimal as possible +*/ +#ifndef _ASM_VOYAGER_BOOT_H +#define _ASM_VOYAGER_BOOT_H + +#include <asm/setup.h> +#include <asm/voyager_bios.h> + +#ifdef CONFIG_X86_VOYAGER + +static inline int is_voyager (void ) +{ +return boot_params.voyager_bios_info.len !=NOT_VOYAGER_BIOS_SIG ; +} + +#else + +static inline int is_voyager (void ) +{ +return 0 ; +} + +#endif /* CONFIG_X86_VOYAGER */ + +#endif
arch/x86/mach-voyager/voyager_basic.c +1 -1
@@ -56,7 +56,7 @@ static struct sysrq_key_op sysrq_voyager_dump_op = {void voyager_detect (struct voyager_bios_info *bios) { -if (bios->len !=0xff ) { +if (bios->len !=NOT_VOYAGER_BIOS_SIG ) {int class = (bios->class_1 <<8 ) | (bios->class_2 &0xff );
Signature · 1 line
1.6.1.3
PATCH 6/13 x86: eliminate subarchitecture file setup_arch.h
This serves no purpose any longer since voyager will reappear as an explicit quirk function call instead of via the ARCH_SETUP code insertion.
--- arch/x86/include/asm/mach-voyager/setup_arch.h | 12 ------------ arch/x86/include/asm/setup_arch.h | 3 --- arch/x86/kernel/probe_roms_32.c | 1 - arch/x86/kernel/setup.c | 7 ------- 4 files changed, 0 insertions(+), 23 deletions(-) delete mode 100644 arch/x86/include/asm/mach-voyager/setup_arch.h delete mode 100644 arch/x86/include/asm/setup_arch.h
arch/x86/include/asm/mach-voyager/setup_arch.h deleted +0 -12
@@ -1,12 +0,0 @@ -#include <asm/voyager.h> -#include <asm/setup.h> -#define VOYAGER_BIOS_INFO ((struct voyager_bios_info *) \ - (&boot_params.apm_bios_info)) - -/* Hook to call BIOS initialisation function */ - -/* for voyager, pass the voyager BIOS/SUS info area to the detection -* routines */ - -#define ARCH_SETUP voyager_detect(VOYAGER_BIOS_INFO); -
arch/x86/include/asm/setup_arch.h deleted +0 -3
@@ -1,3 +0,0 @@ -/* Hook to call BIOS initialisation function */ - -/* no action for generic */
arch/x86/kernel/probe_roms_32.c +0 -1
@@ -18,7 +18,6 @@#include <asm/setup.h> #include <asm/sections.h> #include <asm/io.h> -#include <asm/setup_arch.h> static struct resource system_rom_resource = { .name ="System ROM" ,
arch/x86/kernel/setup.c +0 -7
@@ -82,7 +82,6 @@#include <asm/io_apic.h> #include <asm/ist.h> #include <asm/vmi.h> -#include <asm/setup_arch.h> #include <asm/bios_ebda.h> #include <asm/cacheflush.h> #include <asm/processor.h>
@@ -108,10 +107,6 @@#include <asm/numa_64.h> #endif -#ifndef ARCH_SETUP -#define ARCH_SETUP -#endif -unsigned int boot_cpu_id__read_mostly ;#ifdef CONFIG_X86_64
@@ -701,8 +696,6 @@ void __init setup_arch(char **cmdline_p) }#endif -ARCH_SETUP -setup_memory_map ();parse_setup_data ();/* update the e820_saved too */
Signature · 1 line
1.6.1.3
PATCH 7/13 x86: eliminate subarchitecture file entry_arch.h
This was a subarchitecture file designed to customise the vector gate building functions. Since only voyager and the standard PC subarchitectures now have a copy, they can both be merged into entry_32.S surrounded by the appropriate ifdefs.
As part of this reorganisation, split the voyager interrupt vectors out into a separate include file (asm/voyager_vectors.h) that can be included into a .S file rather than hacking voyager.h up to include the appropriate _ASSEMBLY_ gates.
--- arch/x86/include/asm/entry_arch.h | 57 ------------------- arch/x86/include/asm/hw_irq.h | 11 ++++ arch/x86/include/asm/mach-voyager/entry_arch.h | 26 --------- arch/x86/include/asm/voyager.h | 34 +----------- arch/x86/include/asm/voyager_vectors.h | 37 +++++++++++++ arch/x86/kernel/entry_32.S | 70 +++++++++++++++++++++++- 6 files changed, 117 insertions(+), 118 deletions(-) delete mode 100644 arch/x86/include/asm/entry_arch.h delete mode 100644 arch/x86/include/asm/mach-voyager/entry_arch.h create mode 100644 arch/x86/include/asm/voyager_vectors.h
arch/x86/include/asm/entry_arch.h deleted +0 -57
@@ -1,57 +0,0 @@ -/* -* This file is designed to contain the BUILD_INTERRUPT specifications for -* all of the extra named interrupt vectors used by the architecture. -* Usually this is the Inter Process Interrupts (IPIs) -*/ - -/* -* The following vectors are part of the Linux architecture, there -* is no hardware IRQ pin equivalent for them, they are triggered -* through the ICC by us (IPIs) -*/ -#ifdef CONFIG_SMP -BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) -BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) -BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) -BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR) - -BUILD_INTERRUPT3 (invalidate_interrupt0,INVALIDATE_TLB_VECTOR_START +0 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt1,INVALIDATE_TLB_VECTOR_START +1 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt2,INVALIDATE_TLB_VECTOR_START +2 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt3,INVALIDATE_TLB_VECTOR_START +3 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt4,INVALIDATE_TLB_VECTOR_START +4 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt5,INVALIDATE_TLB_VECTOR_START +5 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt6,INVALIDATE_TLB_VECTOR_START +6 , - smp_invalidate_interrupt) -BUILD_INTERRUPT3 (invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START +7 , - smp_invalidate_interrupt) -#endif - -/* -* every pentium local APIC has two 'local interrupts', with a -* soft-definable vector attached to both interrupts, one of -* which is a timer interrupt, the other one is error counter -* overflow. Linux uses the local APIC timer interrupt to get -* a much simpler SMP time architecture: -*/ -#ifdef CONFIG_X86_LOCAL_APIC - -BUILD_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR) -BUILD_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR) -BUILD_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR) - -#ifdef CONFIG_PERF_COUNTERS -BUILD_INTERRUPT(perf_counter_interrupt, LOCAL_PERF_VECTOR) -#endif - -#ifdef CONFIG_X86_MCE_P4THERMAL -BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR) -#endif - -#endif
arch/x86/include/asm/hw_irq.h +11 -0
@@ -74,6 +74,17 @@ extern atomic_t irq_mis_count;/* EISA */ extern void eisa_set_level_irq (unsigned int irq); +/* Voyager functions */ +extern asmlinkage void vic_cpi_interrupt(void); +extern asmlinkage void vic_sys_interrupt(void); +extern asmlinkage void vic_cmn_interrupt(void); +extern asmlinkage void qic_timer_interrupt(void); +extern asmlinkage void qic_invalidate_interrupt(void); +extern asmlinkage void qic_reschedule_interrupt(void); +extern asmlinkage void qic_enable_irq_interrupt(void); +extern asmlinkage void qic_call_function_interrupt(void); +extern asmlinkage void qic_call_function_single_interrupt(void); +/* SMP */ extern void smp_apic_timer_interrupt (struct pt_regs *);extern void smp_spurious_interrupt (struct pt_regs *);
arch/x86/include/asm/mach-voyager/entry_arch.h deleted +0 -26
@@ -1,26 +0,0 @@ -/* -*- mode: c; c-basic-offset: 8 -*- */ - -/* Copyright (C) 2002 -* -* Author: [email protected] -* -* linux/arch/i386/voyager/entry_arch.h -* -* This file builds the VIC and QIC CPI gates -*/ - -/* initialise the voyager interrupt gates -* -* This uses the macros in irq.h to set up assembly jump gates. The -* calls are then redirected to the same routine with smp_ prefixed */ -BUILD_INTERRUPT(vic_sys_interrupt, VIC_SYS_INT) -BUILD_INTERRUPT(vic_cmn_interrupt, VIC_CMN_INT) -BUILD_INTERRUPT (vic_cpi_interrupt,VIC_CPI_LEVEL0 ); - -/* do all the QIC interrupts */ -BUILD_INTERRUPT (qic_timer_interrupt,QIC_TIMER_CPI ); -BUILD_INTERRUPT (qic_invalidate_interrupt,QIC_INVALIDATE_CPI ); -BUILD_INTERRUPT (qic_reschedule_interrupt,QIC_RESCHEDULE_CPI ); -BUILD_INTERRUPT (qic_enable_irq_interrupt,QIC_ENABLE_IRQ_CPI ); -BUILD_INTERRUPT (qic_call_function_interrupt,QIC_CALL_FUNCTION_CPI ); -BUILD_INTERRUPT (qic_call_function_single_interrupt,QIC_CALL_FUNCTION_SINGLE_CPI );
arch/x86/include/asm/voyager.h +1 -33
@@ -6,6 +6,7 @@#include <asm/voyager_bios.h> #include <asm/voyager_boot.h> +#include <asm/voyager_vectors.h> #undef VOYAGER_DEBUG#undef VOYAGER_CAT_DEBUG
@@ -521,39 +522,6 @@ extern void voyager_smp_intr_init(void);#define VOYAGER_PSI_SUBWRITE 3extern void voyager_cat_psi (__u8 ,__u16 ,__u8 *); -/* These define the CPIs we use in linux */ -#define VIC_CPI_LEVEL0 0 -#define VIC_CPI_LEVEL1 1 -/* now the fake CPIs */ -#define VIC_TIMER_CPI 2 -#define VIC_INVALIDATE_CPI 3 -#define VIC_RESCHEDULE_CPI 4 -#define VIC_ENABLE_IRQ_CPI 5 -#define VIC_CALL_FUNCTION_CPI 6 -#define VIC_CALL_FUNCTION_SINGLE_CPI 7 - -/* Now the QIC CPIs: Since we don't need the two initial levels, -* these are 2 less than the VIC CPIs */ -#define QIC_CPI_OFFSET 1 -#define QIC_TIMER_CPI (VIC_TIMER_CPI - QIC_CPI_OFFSET) -#define QIC_INVALIDATE_CPI (VIC_INVALIDATE_CPI - QIC_CPI_OFFSET) -#define QIC_RESCHEDULE_CPI (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET) -#define QIC_ENABLE_IRQ_CPI (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET) -#define QIC_CALL_FUNCTION_CPI (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET) -#define QIC_CALL_FUNCTION_SINGLE_CPI (VIC_CALL_FUNCTION_SINGLE_CPI - QIC_CPI_OFFSET) - -#define VIC_START_FAKE_CPI VIC_TIMER_CPI -#define VIC_END_FAKE_CPI VIC_CALL_FUNCTION_SINGLE_CPI - -/* this is the SYS_INT CPI. */ -#define VIC_SYS_INT 8 -#define VIC_CMN_INT 15 - -/* This is the boot CPI for alternate processors. It gets overwritten -* by the above once the system has activated all available processors */ -#define VIC_CPU_BOOT_CPI VIC_CPI_LEVEL0 -#define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8) - extern asmlinkage void vic_cpi_interrupt(void); extern asmlinkage void vic_sys_interrupt(void); extern asmlinkage void vic_cmn_interrupt(void);
arch/x86/include/asm/voyager_vectors.h new file +37 -0
@@ -0,0 +1,37 @@ +#ifndef _ASM_VOYAGER_VECTORS_H +#define _ASM_VOYAGER_VECTORS_H + +/* These define the CPIs we use in linux */ +#define VIC_CPI_LEVEL0 0 +#define VIC_CPI_LEVEL1 1 +/* now the fake CPIs */ +#define VIC_TIMER_CPI 2 +#define VIC_INVALIDATE_CPI 3 +#define VIC_RESCHEDULE_CPI 4 +#define VIC_ENABLE_IRQ_CPI 5 +#define VIC_CALL_FUNCTION_CPI 6 +#define VIC_CALL_FUNCTION_SINGLE_CPI 7 + +/* Now the QIC CPIs: Since we don't need the two initial levels, +* these are 2 less than the VIC CPIs */ +#define QIC_CPI_OFFSET 1 +#define QIC_TIMER_CPI (VIC_TIMER_CPI - QIC_CPI_OFFSET) +#define QIC_INVALIDATE_CPI (VIC_INVALIDATE_CPI - QIC_CPI_OFFSET) +#define QIC_RESCHEDULE_CPI (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET) +#define QIC_ENABLE_IRQ_CPI (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET) +#define QIC_CALL_FUNCTION_CPI (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET) +#define QIC_CALL_FUNCTION_SINGLE_CPI (VIC_CALL_FUNCTION_SINGLE_CPI - QIC_CPI_OFFSET) + +#define VIC_START_FAKE_CPI VIC_TIMER_CPI +#define VIC_END_FAKE_CPI VIC_CALL_FUNCTION_SINGLE_CPI + +/* this is the SYS_INT CPI. */ +#define VIC_SYS_INT 8 +#define VIC_CMN_INT 15 + +/* This is the boot CPI for alternate processors. It gets overwritten +* by the above once the system has activated all available processors */ +#define VIC_CPU_BOOT_CPI VIC_CPI_LEVEL0 +#define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8) + +#endif
arch/x86/kernel/entry_32.S +68 -2
82 lines not on this page · raw message
Signature · 1 line
1.6.1.3
PATCH 8/13 x86: eliminate subarchitecture file do_timer.h
This one's a bit complex: voyager still needs a timer interrupt hook because it doesn't have local apic timers and the scheduler relies on each CPU ticking, so voyager must rebroadcast the pit clock.
Pull in the standard do_timer.h to time_32.c: all it was doing was calling the global_clock_event event_handler. However, also add a specific voyager hook: voyager_timer_interrupt().
Hedge the asm/voyager.h file around with proper include guards and make sure voyager_timer_interrupt() is inline empty if CONFIG_X86_VOYAGER isn't defined. Also add an is_voyager() check to terminate the voyager_timer_interrupt() hook in case voyager is compiled in but booted on a non-voayger architecture.
--- arch/x86/include/asm/do_timer.h | 16 ---------------- arch/x86/include/asm/mach-voyager/do_timer.h | 17 ----------------- arch/x86/include/asm/voyager.h | 14 ++++++++++++++ arch/x86/kernel/time_32.c | 11 +++++++---- arch/x86/mach-voyager/voyager_basic.c | 3 +++ 5 files changed, 24 insertions(+), 37 deletions(-) delete mode 100644 arch/x86/include/asm/do_timer.h delete mode 100644 arch/x86/include/asm/mach-voyager/do_timer.h
arch/x86/include/asm/do_timer.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* defines for inline arch setup functions */ -#include <linux/clockchips.h> - -#include <asm/i8259.h> -#include <asm/i8253.h> - -/** -* do_timer_interrupt_hook - hook into timer tick -* -* Call the pit clock event handler. see asm/i8253.h -**/ - -static inline void do_timer_interrupt_hook (void ) -{ - global_clock_event->event_handler (global_clock_event); -}
arch/x86/include/asm/mach-voyager/do_timer.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* defines for inline arch setup functions */ -#include <linux/clockchips.h> - -#include <asm/voyager.h> -#include <asm/i8253.h> - -/** -* do_timer_interrupt_hook - hook into timer tick -* -* Call the pit clock event handler. see asm/i8253.h -**/ -static inline void do_timer_interrupt_hook (void ) -{ - global_clock_event->event_handler (global_clock_event); -voyager_timer_interrupt (); -} -
arch/x86/include/asm/voyager.h +14 -0
@@ -3,11 +3,15 @@* Author: [email protected] * * Standard include definitions for the NCR Voyager system */ +#ifndef _ASM_VOYAGER_H +#define _ASM_VOYAGER_H#include <asm/voyager_bios.h> #include <asm/voyager_boot.h> #include <asm/voyager_vectors.h> +#ifdef CONFIG_X86_VOYAGER +#undef VOYAGER_DEBUG#undef VOYAGER_CAT_DEBUG
@@ -530,3 +534,13 @@ extern asmlinkage void qic_invalidate_interrupt(void); extern asmlinkage void qic_reschedule_interrupt(void); extern asmlinkage void qic_enable_irq_interrupt(void); extern asmlinkage void qic_call_function_interrupt(void); + +#else /* CONFIG_X86_VOYAGER */ + +static inline void voyager_timer_interrupt (void ) +{ +} + +#endif /* CONFIG_X86_VOYAGER */ + +#endif
arch/x86/kernel/time_32.c +7 -4
@@ -28,6 +28,7 @@* serialize accesses to xtime/lost_ticks). */ +#include <linux/clockchips.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/time.h>
@@ -37,8 +38,9 @@#include <asm/hpet.h> #include <asm/time.h> #include <asm/timer.h> - -#include <asm/do_timer.h> +#include <asm/i8253.h> +#include <asm/i8259.h> +#include <asm/voyager.h> int timer_ack;
@@ -91,8 +93,9 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)spin_unlock (&i8259A_lock); }#endif - -do_timer_interrupt_hook (); +if (global_clock_event->event_handler) + global_clock_event->event_handler (global_clock_event); +voyager_timer_interrupt ();#ifdef CONFIG_MCA if (MCA_bus) {
arch/x86/mach-voyager/voyager_basic.c +3 -0
@@ -161,6 +161,9 @@ int __init voyager_memory_detect(int region, __u32 * start, __u32 * length)* internal timer (The QIC does, but that's another story). */ void voyager_timer_interrupt (void ) { +if (!is_voyager ()) +return ; +if ((jiffies &0x3ff ) ==0 ) {/* There seems to be something flaky in either
Signature · 1 line
1.6.1.3
PATCH 9/13 x86: redo irq2 cascade setup
The cascade setup really needs to be done as part of the arch_intr_init() because you might need the machine vectors all plumbed in before you set up the cascade.
Fix this by moving the current check in irqinit_32.c to the correct place and also directly calling the x86_quirk hook from there. Tidy up visws (and eventually voyager) which do their own irq2 initialisation but which could quite easily use the generic one.
--- arch/x86/include/asm/setup.h | 1 - arch/x86/kernel/irqinit_32.c | 15 +++++++++------ arch/x86/kernel/setup.c | 17 ----------------- arch/x86/kernel/visws_quirks.c | 7 ------- arch/x86/mach-voyager/setup.c | 11 ----------- 5 files changed, 9 insertions(+), 42 deletions(-)
arch/x86/include/asm/setup.h +0 -1
@@ -35,7 +35,6 @@ struct x86_quirks { };extern void x86_quirk_pre_intr_init (void ); -extern void x86_quirk_intr_init (void );extern void x86_quirk_trap_init (void );
arch/x86/kernel/irqinit_32.c +9 -6
@@ -185,14 +185,17 @@ void __init native_init_IRQ(void)alloc_intr_gate (THERMAL_APIC_VECTOR , thermal_interrupt);#endif -if (!acpi_ioapic) -setup_irq (2 , &irq2); -/* -* Call quirks after call gates are initialised (usually add in -* the architecture specific gates): +* setup after call gates are initialised (usually add in the +* architecture specific gates). Populating the +* arch_intr_init x86_quirk allows final gate setup. If the +* quirk returns true, the cascade interrupt will not be setup +* unless acpi_ioapic is zero */ -x86_quirk_intr_init (); + +if ((x86_quirks->arch_intr_init && !x86_quirks->arch_intr_init ()) || + (!x86_quirks->arch_intr_init && !acpi_ioapic)) +setup_irq (2 , &irq2);/* * External FPU? Set up irq13 if so, for
arch/x86/kernel/setup.c +0 -17
@@ -988,23 +988,6 @@ void __init x86_quirk_pre_intr_init(void) }/** -* x86_quirk_intr_init - post gate setup interrupt initialisation -* -* Description: -* Fill in any interrupts that may have been left out by the general -* init_IRQ() routine. interrupts having to do with the machine rather -* than the devices on the I/O bus (like APIC interrupts in intel MP -* systems) are started here. -**/ -void __init x86_quirk_intr_init (void ) -{ -if (x86_quirks->arch_intr_init) { -if (x86_quirks->arch_intr_init ()) -return ; - } -} - -/** * x86_quirk_trap_init - initialise system specific traps * * Description:
arch/x86/kernel/visws_quirks.c +0 -7
@@ -645,12 +645,6 @@ static struct irqaction master_action = { .name = "PIIX4-8259", }; -static struct irqaction cascade_action = { - .handler = no_action, - .name ="cascade" , -}; - -void init_VISWS_APIC_irqs (void ) {int i;
@@ -683,5 +677,4 @@ void init_VISWS_APIC_irqs(void) }setup_irq (CO_IRQ_8259 , &master_action); -setup_irq (2 , &cascade_action); }
arch/x86/mach-voyager/setup.c +0 -11
@@ -16,22 +16,11 @@ void __init pre_intr_init_hook(void)init_ISA_irqs (); } -/* -* IRQ2 is cascade interrupt to second interrupt controller -*/ -static struct irqaction irq2 = { - .handler = no_action, - .mask =CPU_MASK_NONE , - .name ="cascade" , -}; -void __init intr_init_hook (void ) {#ifdef CONFIG_SMP voyager_smp_intr_init ();#endif - -setup_irq (2 , &irq2); }static void voyager_disable_tsc (void )
Signature · 1 line
1.6.1.3
PATCH 10/13 x86: make disabling the apics functional instead of a flag
This allows the elimination of some ifdef guards in setup.c. Additionally probe_32.c doesn't need to run through the apics in generic_apic_probe() if they're disabled.
--- arch/x86/include/asm/apic.h | 6 ++++++ arch/x86/kernel/apic/apic.c | 3 +++ arch/x86/kernel/apic/probe_32.c | 3 +++ arch/x86/kernel/setup.c | 4 +--- 4 files changed, 13 insertions(+), 3 deletions(-)
arch/x86/include/asm/apic.h +6 -0
@@ -230,12 +230,18 @@ static inline int apic_is_clustered_box(void)extern u8 setup_APIC_eilvt_mce (u8 vector,u8 msg_type,u8 mask);extern u8 setup_APIC_eilvt_ibs (u8 vector,u8 msg_type,u8 mask); +static inline void disable_APIC (void ) +{ +disable_local_APIC (); + disable_apic =1 ; +}#else /* !CONFIG_X86_LOCAL_APIC */ static inline void lapic_shutdown (void ) { }#define local_apic_timer_c2_ok 1static inline void init_apic_mappings (void ) { }static inline void disable_local_APIC (void ) { } +static inline void disable_APIC (void ) { }#endif /* !CONFIG_X86_LOCAL_APIC */
arch/x86/kernel/apic/apic.c +3 -0
@@ -1508,6 +1508,9 @@ void __init early_init_lapic_mapping(void)*/ void __init init_apic_mappings (void ) { +if (disable_apic) +return ; +#ifdef CONFIG_X86_X2APIC if (x2apic) { boot_cpu_physical_apicid =read_apic_id ();
arch/x86/kernel/apic/probe_32.c +3 -0
@@ -225,6 +225,9 @@ void __init generic_bigsmp_probe(void)void __init generic_apic_probe (void ) { +if (disable_apic) +return ; +if (!cmdline_apic) {int i;for (i =0 ; apic_probe[i]; i++) {
arch/x86/kernel/setup.c +1 -3
@@ -750,9 +750,7 @@ void __init setup_arch(char **cmdline_p)reserve_early_setup_data ();if (acpi_mps_check ()) { -#ifdef CONFIG_X86_LOCAL_APIC - disable_apic =1 ; -#endif +disable_APIC ();setup_clear_cpu_cap (X86_FEATURE_APIC ); }
Signature · 1 line
1.6.1.3
PATCH 11/13 x86/Voyager: add missing QIC call function single gate
Apparently this was never plugged into the QIC (it was plugged into the VIC). The lack was detected during testing of smp_call_function() based flushing.
--- arch/x86/mach-voyager/voyager_smp.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/mach-voyager/voyager_smp.c +2 -0
@@ -1266,6 +1266,8 @@ void __init voyager_smp_intr_init(void)QIC_SET_GATE (QIC_RESCHEDULE_CPI , qic_reschedule_interrupt);QIC_SET_GATE (QIC_ENABLE_IRQ_CPI , qic_enable_irq_interrupt);QIC_SET_GATE (QIC_CALL_FUNCTION_CPI , qic_call_function_interrupt); +QIC_SET_GATE (QIC_CALL_FUNCTION_SINGLE_CPI , + qic_call_function_single_interrupt);/* now put the VIC descriptor into the first 48 IRQs *
Signature · 1 line
1.6.1.3
PATCH 12/13 x86/Voyager: replace inline io area reads with readX accessors
Some of the memory manipulations done to reset QIC CPIs and to check on booted processors rely on the read actually being issued. With newer versions of gcc this is no longer happening (presumably it sees the read with no effect and optimises it away). Replace the reads with readX to assure volatile semantics for issuing the access. This fixes a bug where QIC based voyagers won't boot with certain versions of gcc.
--- arch/x86/mach-voyager/voyager_smp.c | 22 ++++++---------------- 1 files changed, 6 insertions(+), 16 deletions(-)
arch/x86/mach-voyager/voyager_smp.c +6 -16
@@ -70,7 +70,7 @@ cpumask_t phys_cpu_present_map = CPU_MASK_NONE;/* The internal functions */ static void send_CPI (__u32 cpuset,__u8 cpi);static void ack_CPI (__u8 cpi); -static int ack_QIC_CPI (__u8 cpi); +static inline void ack_QIC_CPI (__u8 cpi);static void ack_special_QIC_CPI (__u8 cpi);static void ack_VIC_CPI (__u8 cpi);static void send_CPI_allbutself (__u8 cpi);
@@ -433,14 +433,9 @@ static void __init start_secondary(void *unused)qic_setup (); -if (is_cpu_quad () && !is_cpu_vic_boot ()) { +if (is_cpu_quad () && !is_cpu_vic_boot ())/* clear the boot CPI */ -__u8 dummy; - - dummy = - voyager_quad_cpi_addr[cpuid]->qic_cpi[VIC_CPU_BOOT_CPI ].cpi; -printk ("read dummy %d\n" , dummy); - } +readw (&voyager_quad_cpi_addr[cpuid]->qic_cpi[VIC_CPU_BOOT_CPI ].cpi);/* lower the mask to receive CPIs */ vic_enable_cpi ();
@@ -603,9 +598,7 @@ static void __init do_boot_cpu(__u8 cpu)cpu_set (cpu, cpu_present_map); }else {printk ("CPU%d FAILED TO BOOT: " , cpu); -if (* - ((volatile unsigned char *)phys_to_virt (start_phys_address)) - ==0xA5 ) +if (readb (phys_to_virt (start_phys_address)) ==0xA5 )printk ("Stuck.\n" );else printk ("Not responding.\n" );
@@ -1306,18 +1299,15 @@ static void send_CPI(__u32 cpuset, __u8 cpi)/* Acknowledge receipt of CPI in the QIC, clear in QIC hardware and * set the cache line to shared by reading it. -* -* DON'T make this inline otherwise the cache line read will be -* optimised away * */ -static int ack_QIC_CPI (__u8 cpi) +static inline void ack_QIC_CPI (__u8 cpi) {__u8 cpu =hard_smp_processor_id (); cpi &=7 ;outb (1 << cpi,QIC_INTERRUPT_CLEAR1 ); -return voyager_quad_cpi_addr[cpu]->qic_cpi[cpi].cpi; +readw (&voyager_quad_cpi_addr[cpu]->qic_cpi[cpi].cpi); }static void ack_special_QIC_CPI (__u8 cpi)
Signature · 1 line
1.6.1.3
PATCH 13/13 x86/Voyager: Plumb voyager back into the build
Voyager can now be converted over to using x86 quirks thanks to the prior additions. Most of the internal voyager code is made static and the rest has a voyager_ prefix to avoid symbol clashes.
The TLB flushing functions still have an apic entanglement, so give voyager a temporary work around which can be removed when they're all converted to smp_call_function().
--- arch/x86/Kconfig | 4 +- arch/x86/Makefile | 2 + arch/x86/include/asm/voyager.h | 19 +- arch/x86/kernel/setup.c | 2 + arch/x86/mach-voyager/setup.c | 57 +++-- arch/x86/mach-voyager/voyager_basic.c | 95 +++--- arch/x86/mach-voyager/voyager_smp.c | 520 ++++++++++---------------------- arch/x86/mach-voyager/voyager_thread.c | 5 +- 8 files changed, 262 insertions(+), 442 deletions(-)
arch/x86/Kconfig +2 -2
@@ -425,8 +425,8 @@ config X86_ES7000 config X86_VOYAGER bool "Voyager (NCR)" - depends on SMP && !PCI && BROKEN - depends on X86_32_NON_STANDARD + depends on SMP && X86_32_NON_STANDARD + select MCA ---help--- Voyager is an MCA-based 32-way capable SMP architecture proprietary to NCR Corp. Machine classes 345x/35xx/4100/51xx are Voyager-based.
arch/x86/Makefile +2 -0
@@ -127,6 +127,8 @@ core-$(CONFIG_XEN) += arch/x86/xen/ # lguest paravirtualization support core-$(CONFIG_LGUEST_GUEST) += arch/x86/lguest/ +core-$(CONFIG_X86_VOYAGER) += arch/x86/mach-voyager/ + core-y += arch/x86/kernel/ core-y += arch/x86/mm/
arch/x86/include/asm/voyager.h +13 -6
@@ -503,22 +503,19 @@ extern struct voyager_status voyager_status;/* functions exported by the voyager and voyager_smp modules */ extern int voyager_cat_readb (__u8 module,__u8 asic,int reg);extern void voyager_cat_init (void ); -extern void voyager_detect (struct voyager_bios_info *); -extern void voyager_trap_init (void ); -extern void voyager_setup_irqs (void ); +extern void voyager_early_detect (void ); +extern void voyager_detect (void );extern int voyager_memory_detect (int region,__u32 *addr,__u32 *length); -extern void voyager_smp_intr_init (void );extern __u8 voyager_extended_cmos_read (__u16 cmos_address);extern void voyager_smp_dump (void );extern void voyager_timer_interrupt (void ); -extern void smp_local_timer_interrupt (void );extern void voyager_power_off (void ); -extern void smp_voyager_power_off (void *dummy);extern void voyager_restart (void );extern void voyager_cat_power_off (void );extern void voyager_cat_do_common_interrupt (void );extern void voyager_handle_nmi (void );extern void voyager_smp_intr_init (void ); +/* Commands for the following are */ #define VOYAGER_PSI_READ 0#define VOYAGER_PSI_WRITE 1
@@ -535,12 +532,22 @@ extern asmlinkage void qic_reschedule_interrupt(void); extern asmlinkage void qic_enable_irq_interrupt(void); extern asmlinkage void qic_call_function_interrupt(void); +#ifdef CONFIG_SMP +extern void voyager_smp_detect (struct x86_quirks *); +#else +static inline void voyager_smp_detect (struct x86_quirks *) { } +#endif +#else /* CONFIG_X86_VOYAGER */ static inline void voyager_timer_interrupt (void ) { } +static inline void voyager_early_detect (void ) +{ +} +#endif /* CONFIG_X86_VOYAGER */ #endif
arch/x86/kernel/setup.c +2 -0
@@ -99,6 +99,7 @@#include <asm/paravirt.h> #include <asm/hypervisor.h> +#include <asm/voyager.h> #include <asm/percpu.h> #include <asm/topology.h>
@@ -652,6 +653,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 (); +voyager_early_detect ();#else printk (KERN_INFO "Command line: %s\n" , boot_command_line);#endif
arch/x86/mach-voyager/setup.c +36 -21
100 lines not on this page · raw message
arch/x86/mach-voyager/voyager_basic.c +44 -51
141 lines not on this page · raw message
arch/x86/mach-voyager/voyager_smp.c +159 -361
870 lines not on this page · raw message
arch/x86/mach-voyager/voyager_thread.c +4 -1
@@ -110,6 +110,8 @@ static int thread(void *unused)static int __init voyager_thread_start (void ) { +if (!is_voyager ()) +return 0 ; voyager_thread =kthread_run (thread,NULL ,"kvoyagerd" );if (IS_ERR (voyager_thread)) { printk(KERN_ERR
@@ -121,7 +123,8 @@ static int __init voyager_thread_start(void) static void __exit voyager_thread_stop(void) { -kthread_stop (voyager_thread); +if (is_voyager ()) +kthread_stop (voyager_thread); }module_init (voyager_thread_start);
Signature · 1 line
1.6.1.3
Re: [PATCH 01/13] [VOYAGER] x86: add {safe,hard}_smp_processor_id to smp_ops
In reply to James BottomleyQuoted 5 lines · James Bottomley
Not having apics, Voyager can't use the default apic implementation of these, it has to read from a special port in the VIC to get the processor ID, so abstract these functions in
smp_opsto allow voyager to live simultaneously with the apic code.
These aren't performance-sensitive at all, are they? smp_ops is not subject to patching/inlining optimisations happen to more hotpath pvops.
Is safe_smp_processor_id needed at all? It's only got two callers, and x86-64 just implements it as smp_processor_id().
Quoted 17 lines
arch/x86/xen/smp.c +5
-0@@ -450,6 +450,11 @@ static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } +static int xen_hard_smp_processor_id (void ) +{ +return read_apic_id (); +} +static const struct smp_ops xen_smp_ops__initdata = { .smp_prepare_boot_cpu = xen_smp_prepare_boot_cpu, .smp_prepare_cpus = xen_smp_prepare_cpus,
arch/x86/xen/smp.c static const struct smp_ops xen_smp_ops __initdata = { · line 475
Quoted 6 lines
arch/x86/xen/smp.c +2
-0@@ -465,6 +470,8 @@ static const struct smp_ops xen_smp_ops __initdata = { .send_call_func_ipi = xen_smp_send_call_function_ipi, .send_call_func_single_ipi = xen_smp_send_call_function_single_ipi, + .hard_smp_processor_id = xen_hard_smp_processor_id, + .safe_smp_processor_id = apic_safe_smp_processor_id,
Hm, there's no meaningful apic-based implementation for these under Xen. DomU has no access to apics, and Dom0's vcpus don't have any fixed relationship to physical cpu apics. They should both just return smp_processor_id(), I guess.
J
Re: [PATCH 01/13] [VOYAGER] x86: add {safe,hard}_smp_processor_id to smp_ops
Quoted 9 lines · Jeremy Fitzhardinge
Quoted 5 lines · James Bottomley
Not having apics, Voyager can't use the default apic implementation of these, it has to read from a special port in the VIC to get the processor ID, so abstract these functions in
smp_opsto allow voyager to live simultaneously with the apic code.These aren't performance-sensitive at all, are they?
smp_opsis not subject to patching/inlining optimisations happen to more hotpath pvops.
No more than the function pointer indirection of smp_call_function(). Fortunately, the hard version is called in very few places, so the overhead is minimal.
Quoted 2 lines
Is
safe_smp_processor_idneeded at all? It's only got two callers, and x86-64 just implements it assmp_processor_id().
I can't see a reason, no. If you look at voyager it uses the same function for both, but x86 seems to have extra gunk in the safe path, so I didn't feel entitled to remove it.
James
Hi James.
Quoted 1 line
39 files changed, 550 insertions(+), 713 deletions(-)
These numbers looks god considering that you integrated Voyager more thight with x86 using this serie.
Sam
Quoted 37 lines · James Bottomley
Given the lack of feedback, I went ahead and implemented the additions to
smp_opsandx86_quirks(and a dynamic mca NMI hook) to allow voyager to be plumbed in.There also needs to be changes in the boot setup to make voyager work
dynamically: It has to be detected first, so the a20 gate check is only executed if a voyager is not found.I also completed some of the subarchitecture eliminations, so all the include file infrastructure should be gone.
The result is that I can boot both my PC SMP x86 boxes and voyager with the same kernel.
This patch series applies on the x86/apic branch of the x86 tree (obviously with
965c7ecaf2e2b083d711a01ab33735a4bdeee1a4reverted)James
---
[VOYAGER] x86: add {safe,hard}_smp_processor_id to
smp_ops[VOYAGER] x86/mca: makemca_nmi_hookexternal
[VOYAGER] x86: addprefill_possible_maptox86_quirks[VOYAGER] x86: useboot_cpu_idinstead of zero for checking boot processor
[VOYAGER] x86/voyager: Move voyager detection to a new bootparam area [VOYAGER] x86: eliminate subarchitecture filesetup_arch.h[VOYAGER] x86: eliminate subarchitecture fileentry_arch.h[VOYAGER] x86: eliminate subarchitecture filedo_timer.h[VOYAGER] x86: redo irq2 cascade setup
[VOYAGER] x86: make disabling the apics functional instead of a flag [VOYAGER] x86/Voyager: add missing QIC call function single gate [VOYAGER] x86/Voyager: replace inline io area reads with readX accessors
[VOYAGER] x86/Voyager: Plumb voyager back into the build
Quoted 14 lines
arch/x86/Kconfig | 4 +-
arch/x86/Makefile| 2 +arch/x86/boot/Makefile| 4 +-arch/x86/boot/a20.c| 13 +-arch/x86/boot/boot.h| 2 +-arch/x86/boot/voyager.c| 5 +-arch/x86/include/asm/apic.h| 6 +arch/x86/include/asm/bootparam.h| 5 +-arch/x86/include/asm/do_timer.h| 16 -arch/x86/include/asm/entry_arch.h| 57 ---arch/x86/include/asm/hw_irq.h| 11 +arch/x86/include/asm/mach-voyager/do_timer.h| 17 -arch/x86/include/asm/mach-voyager/entry_arch.h| 26 --arch/x86/include/asm/mach-voyager/setup_arch.h| 12 -
could remove "mach-" here.
Quoted 16 lines
arch/x86/include/asm/mca.h | 3 +
arch/x86/include/asm/setup.h| 6 +-arch/x86/include/asm/setup_arch.h| 3 -arch/x86/include/asm/smp.h| 13 +-arch/x86/include/asm/voyager.h| 80 ++---arch/x86/include/asm/voyager_bios.h| 21 +arch/x86/include/asm/voyager_boot.h| 27 ++arch/x86/include/asm/voyager_vectors.h| 37 ++arch/x86/kernel/apic/apic.c| 8 +-arch/x86/kernel/apic/ipi.c| 2 +-arch/x86/kernel/apic/probe_32.c| 3 +arch/x86/kernel/entry_32.S| 70 +++-arch/x86/kernel/irqinit_32.c| 15 +-arch/x86/kernel/mca_32.c| 12 +arch/x86/kernel/probe_roms_32.c| 1 -arch/x86/kernel/setup.c| 35 +--
Quoted 8 lines
arch/x86/kernel/smp.c | 7 +
arch/x86/kernel/smpboot.c| 2 +-arch/x86/kernel/time_32.c| 11 +-arch/x86/kernel/visws_quirks.c| 7 -arch/x86/mach-voyager/setup.c| 66 ++--arch/x86/mach-voyager/voyager_basic.c| 98 ++---arch/x86/mach-voyager/voyager_smp.c| 544 ++++++++----------------arch/x86/mach-voyager/voyager_thread.c| 5 +-
same here
YH
Quoted 1 line
Quoted 54 lines · Yinghai Lu
Quoted 37 lines · James Bottomley
Given the lack of feedback, I went ahead and implemented the additions to
smp_opsandx86_quirks(and a dynamic mca NMI hook) to allow voyager to be plumbed in.There also needs to be changes in the boot setup to make voyager work
dynamically: It has to be detected first, so the a20 gate check is only executed if a voyager is not found.I also completed some of the subarchitecture eliminations, so all the include file infrastructure should be gone.
The result is that I can boot both my PC SMP x86 boxes and voyager with the same kernel.
This patch series applies on the x86/apic branch of the x86 tree (obviously with
965c7ecaf2e2b083d711a01ab33735a4bdeee1a4reverted)James
---
[VOYAGER] x86: add {safe,hard}_smp_processor_id to
smp_ops[VOYAGER] x86/mca: makemca_nmi_hookexternal
[VOYAGER] x86: addprefill_possible_maptox86_quirks[VOYAGER] x86: useboot_cpu_idinstead of zero for checking boot
processor
[VOYAGER] x86/voyager: Move voyager detection to a new bootparam area [VOYAGER] x86: eliminate subarchitecture filesetup_arch.h[VOYAGER] x86: eliminate subarchitecture fileentry_arch.h[VOYAGER] x86: eliminate subarchitecture filedo_timer.h[VOYAGER] x86: redo irq2 cascade setup
[VOYAGER] x86: make disabling the apics functional instead of a flag [VOYAGER] x86/Voyager: add missing QIC call function single gate [VOYAGER] x86/Voyager: replace inline io area reads with readX
accessors
[VOYAGER] x86/Voyager: Plumb voyager back into the buildQuoted 14 lines
arch/x86/Kconfig | 4 +- arch/x86/Makefile | 2 + arch/x86/boot/Makefile | 4 +- arch/x86/boot/a20.c | 13 +- arch/x86/boot/boot.h | 2 +- arch/x86/boot/voyager.c | 5 +- arch/x86/include/asm/apic.h | 6 + arch/x86/include/asm/bootparam.h | 5 +- arch/x86/include/asm/do_timer.h | 16 - arch/x86/include/asm/entry_arch.h | 57 --- arch/x86/include/asm/hw_irq.h | 11 + arch/x86/include/asm/mach-voyager/do_timer.h | 17 - arch/x86/include/asm/mach-voyager/entry_arch.h | 26 -- arch/x86/include/asm/mach-voyager/setup_arch.h | 12 -
Quoted 1 line
could remove "mach-" here.
This directory is actually gone after the patch.
Quoted 25 lines
Quoted 16 lines
arch/x86/include/asm/mca.h | 3 + arch/x86/include/asm/setup.h | 6 +- arch/x86/include/asm/setup_arch.h | 3 - arch/x86/include/asm/smp.h | 13 +- arch/x86/include/asm/voyager.h | 80 ++--- arch/x86/include/asm/voyager_bios.h | 21 + arch/x86/include/asm/voyager_boot.h | 27 ++ arch/x86/include/asm/voyager_vectors.h | 37 ++ arch/x86/kernel/apic/apic.c | 8 +- arch/x86/kernel/apic/ipi.c | 2 +- arch/x86/kernel/apic/probe_32.c | 3 + arch/x86/kernel/entry_32.S | 70 +++- arch/x86/kernel/irqinit_32.c | 15 +- arch/x86/kernel/mca_32.c | 12 + arch/x86/kernel/probe_roms_32.c | 1 - arch/x86/kernel/setup.c | 35 +--Quoted 8 lines
arch/x86/kernel/smp.c | 7 + arch/x86/kernel/smpboot.c | 2 +- arch/x86/kernel/time_32.c | 11 +- arch/x86/kernel/visws_quirks.c | 7 - arch/x86/mach-voyager/setup.c | 66 ++-- arch/x86/mach-voyager/voyager_basic.c | 98 ++--- arch/x86/mach-voyager/voyager_smp.c | 544 ++++++++---------------- arch/x86/mach-voyager/voyager_thread.c | 5 +-
Quoted 1 line
same here
Heh, that would blow my nice diffstat out of the water ...
It's useful to keep code like this separated, since you don't necessarily want some kernelnewby wandering across it as an example of how to do SMP on x86 ... I'm not wedded to the name, but mach-voyager is as good a descriptive directory name as any other.
James
Quoted 11 lines · James Bottomley
Given the lack of feedback, I went ahead and implemented the additions to
smp_opsandx86_quirks(and a dynamic mca NMI hook) to allow voyager to be plumbed in.There also needs to be changes in the boot setup to make voyager work dynamically: It has to be detected first, so the a20 gate check is only executed if a voyager is not found.
I also completed some of the subarchitecture eliminations, so all the include file infrastructure should be gone.
Quoted 6 lines
The result is that I can boot both my PC SMP x86 boxes and voyager with the same kernel.
This patch series applies on the x86/apic branch of the x86 tree (obviously with
965c7ecaf2e2b083d711a01ab33735a4bdeee1a4reverted)
The question is, why would we want to merge Voyager back ever again?
The hardware is obsolete and is not being produced anymore, nobody but you uses development kernels on it, and it caused all sorts of x86 maintenance overhead all along. It did not even build since August 2008, up until the point we removed it - 2.6.26.0 was the last time it built.
Ingo
Quoted 16 lines · Ingo Molnar
Quoted 14 lines · James Bottomley
Given the lack of feedback, I went ahead and implemented the additions to
smp_opsandx86_quirks(and a dynamic mca NMI hook) to allow voyager to be plumbed in.There also needs to be changes in the boot setup to make voyager work dynamically: It has to be detected first, so the a20 gate check is only executed if a voyager is not found.
I also completed some of the subarchitecture eliminations, so all the include file infrastructure should be gone.
The result is that I can boot both my PC SMP x86 boxes and voyager with the same kernel.
Quoted 6 lines
Quoted 3 lines
This patch series applies on the x86/apic branch of the x86 tree (obviously with
965c7ecaf2e2b083d711a01ab33735a4bdeee1a4reverted)The question is, why would we want to merge Voyager back ever again?
What do you mean merge back? It's an existing and supported architecture in git head.
Quoted 1 line
The hardware is obsolete and is not being produced anymore,
That goes for a huge number of drivers we have in the kernel currently, and several whole architectures, so it's not a barrier to keeping something maintained.
Quoted 1 line
nobody but you uses development kernels on it,
I don't think we've ever had a problem with a downstream community being supported by a single upstream developer.
Quoted 4 lines
and it caused all
sorts of x86 maintenance overhead all along. It did not even build since August 2008, up until the point we removed it - 2.6.26.0 was the last time it built.
2.6.29-rc7 builds and boots just fine from git head.
Your prior statement was that you wanted it moved to the x86 quirks infrastructure to make it easily maintainable, which this patch series does ... I don't quite see what your problem is now ... are you saying that x86 quirks isn't as maintainable as you previously thought? In which case, how can I help?
James
H. Peter Anvin
reviewerQuoted 10 lines · James Bottomley
That goes for a huge number of drivers we have in the kernel currently, and several whole architectures, so it's not a barrier to keeping something maintained.
Quoted 1 line
nobody but you uses development kernels on it,
I don't think we've ever had a problem with a downstream community being supported by a single upstream developer.
What "downstream community"? There is none, and you know it.
That is the whole point. Voyager isn't just a driver -- it's an odd-man-out variant of the most used architecture in the world. If it was just a driver, it would make sense. However, its very existence forces constraints on the upstream x86 architecture, and it imposes a real and considerable workload on the upstream maintainers -- and that is not you, but on us. When that happens with drivers for obsolete hardware, we remove them.
Hence, Ingo rather logically asks you to justify this impact on our workload. I would like to know as well. I'm personally sick of the extra overhead this museum piece imposes.
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · James Bottomley
That goes for a huge number of drivers we have in the kernel currently, and several whole architectures, so it's not a barrier to keeping something maintained.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
nobody but you uses development kernels on it,
I don't think we've ever had a problem with a downstream community being supported by a single upstream developer.
What "downstream community"? There is none, and you know it.
There are actually two ... as you've heard me say before. However, upstream development is driven by willing maintainers, not by user popularity contests.
Quoted 7 lines
That is the whole point. Voyager isn't just a driver -- it's an odd-man-out variant of the most used architecture in the world. If it was just a driver, it would make sense. However, its very existence forces constraints on the upstream x86 architecture, and it imposes a real and considerable workload on the upstream maintainers -- and that is not you, but on us. When that happens with drivers for obsolete hardware, we remove them.
The last I heard from you was that the Subarchitecture infrastructure was the cause of your increased workload. Fine, it's gone. Let me ask again, what is the *current* problem? This patch set moves voyager to the x86_quirks setup as you x86 maintainers requested with the given reason of reducing your workload.
Quoted 3 lines
Hence, Ingo rather logically asks you to justify this impact on our workload. I would like to know as well. I'm personally sick of the extra overhead this museum piece imposes.
Well, I've already answered your workload above, but given the general question, there are at least three reasons
1. It's a currently supported architecture.
2. It works.
3. It has a committed maintainer.
It's also important to demonstrate that Linux development is based on technical merit not personal prejudice.
James
Quoted 21 lines · James Bottomley
Quoted 20 lines · Ingo Molnar
Quoted 17 lines · James Bottomley
Given the lack of feedback, I went ahead and implemented the additions to
smp_opsandx86_quirks(and a dynamic mca NMI hook) to allow voyager to be plumbed in.There also needs to be changes in the boot setup to make voyager work dynamically: It has to be detected first, so the a20 gate check is only executed if a voyager is not found.
I also completed some of the subarchitecture eliminations, so all the include file infrastructure should be gone.
The result is that I can boot both my PC SMP x86 boxes and voyager with the same kernel.
This patch series applies on the x86/apic branch of the x86 tree (obviously with
965c7ecaf2e2b083d711a01ab33735a4bdeee1a4reverted)
Quoted 5 lines
Quoted 2 lines
The question is, why would we want to merge Voyager back ever again?
What do you mean merge back? It's an existing and supported architecture in git head.
That's revisionist history that ignores a few inconvenient facts. The x86/Voyager subarch last built successfully in v2.6.26.0 - in the summer of last year (!):
v2.6.27.0: Voyager was broken - it did not even build.
v2.6.28.0: Voyager was broken - it did not even build.
v2.6.29-rc5: Voyager was broken - it did not even build.
... then we removed it from the x86 development tree and mentioned that it did not even build for a long time, and Cc:-ed you to all that. A few days later you finally sent a fix patch for mainline.
We merged that fix into -rc6 as it was small so yes, technically 'git head works now', but that ignores the long negative track record of that code that we as x86 maintainers have experienced.
I.e. by all means it was broken code for almost 3 full kernel cycles, up until the very last minute when you saw us removing it. Talking about any sort of 'downstream community' and 'supported architecture' is mocking these terms.
With regards to v2.6.30 it's simply too late - at least as far as my schedule goes. v2.6.29-final is maybe a week or two away, the merge window is very crowded already and we've pretty much closed down APIC related changes already.
You can still try to convince Thomas or Peter (i'm not the only x86 maintainer so merge decisions do not depend on me alone and you can convince them if you disagree with my position - they have symmetric commit rights to the x86 devel tree), but as far as i'm concerned personally, this merge window is too tight already.
In any case, if you find that code useful feel free to maintain it in a separate git tree (where any interested people/users can access it easily) and we can revisit this issue in the next development cycle, in 2-3 weeks or so, after the merge window.
Thanks,
Ingo