Index: 2006-01-05/include/asm-x86_64/hw_irq.h =================================================================== --- 2006-01-05.orig/include/asm-x86_64/hw_irq.h 2006-01-06 11:47:23.352286864 +0100 +++ 2006-01-05/include/asm-x86_64/hw_irq.h 2006-01-06 09:39:05.000000000 +0100 @@ -33,6 +33,10 @@ struct hw_interrupt_type; */ #define FIRST_EXTERNAL_VECTOR 0x20 +#ifdef CONFIG_XEN +#define SYSCALL_VECTOR 0x80 +#endif + #define IA32_SYSCALL_VECTOR 0x80 @@ -51,6 +55,7 @@ struct hw_interrupt_type; */ #define SPURIOUS_APIC_VECTOR 0xff #define ERROR_APIC_VECTOR 0xfe +#ifndef CONFIG_XEN #define RESCHEDULE_VECTOR 0xfd #define CALL_FUNCTION_VECTOR 0xfc #define KDB_VECTOR 0xfb /* reserved for KDB */ @@ -60,6 +65,11 @@ struct hw_interrupt_type; #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f8 used for TLB flush */ #define NUM_INVALIDATE_TLB_VECTORS 8 +#else +#define RESCHEDULE_VECTOR 0 +#define CALL_FUNCTION_VECTOR 1 +#define NR_IPIS 2 +#endif /* * Local APIC timer IRQ vector is on a different priority level, @@ -130,7 +140,9 @@ __asm__( \ "push $" #nr "-256 ; " \ "jmp common_interrupt"); -#if defined(CONFIG_X86_IO_APIC) +#if defined(CONFIG_XEN) +extern void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i); +#elif defined(CONFIG_X86_IO_APIC) static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { if (IO_APIC_IRQ(i)) send_IPI_self(IO_APIC_VECTOR(i)); Index: 2006-01-05/include/asm-x86_64/mach-xen/asm/hw_irq.h =================================================================== --- 2006-01-05.orig/include/asm-x86_64/mach-xen/asm/hw_irq.h 2006-01-06 11:47:23.350287168 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -#ifndef _ASM_HW_IRQ_H -#define _ASM_HW_IRQ_H - -/* - * linux/include/asm/hw_irq.h - * - * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar - * - * moved some of the old arch/i386/kernel/irq.h to here. VY - * - * IRQ/IPI changes taken from work by Thomas Radke - * - * - * hacked by Andi Kleen for x86-64. - * - * $Id: hw_irq.h,v 1.24 2001/09/14 20:55:03 vojtech Exp $ - */ - -#ifndef __ASSEMBLY__ -#include -#include -#include -#include -#include - -struct hw_interrupt_type; -#endif - -#define NMI_VECTOR 0x02 -/* - * IDT vectors usable for external interrupt sources start - * at 0x20: - */ -#define FIRST_EXTERNAL_VECTOR 0x20 - -#define IA32_SYSCALL_VECTOR 0x80 - - -/* - * Vectors 0x20-0x2f are used for ISA interrupts. - */ - -/* - * Special IRQ vectors used by the SMP architecture, 0xf0-0xff - * - * some of the following vectors are 'rare', they are merged - * into a single vector (CALL_FUNCTION_VECTOR) to save vector space. - * TLB, reschedule and local APIC vectors are performance-critical. - * - * Vectors 0xf0-0xf9 are free (reserved for future Linux use). - */ -#ifndef CONFIG_XEN -#define SPURIOUS_APIC_VECTOR 0xff -#define ERROR_APIC_VECTOR 0xfe -#define RESCHEDULE_VECTOR 0xfd -#define CALL_FUNCTION_VECTOR 0xfc -#define KDB_VECTOR 0xfb /* reserved for KDB */ -#define THERMAL_APIC_VECTOR 0xfa -#define THRESHOLD_APIC_VECTOR 0xf9 -#define INVALIDATE_TLB_VECTOR_END 0xf8 -#define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f8 used for TLB flush */ - -#define NUM_INVALIDATE_TLB_VECTORS 8 -#endif - -/* - * Local APIC timer IRQ vector is on a different priority level, - * to work around the 'lost local interrupt if more than 2 IRQ - * sources per level' errata. - */ -#define LOCAL_TIMER_VECTOR 0xef - -/* - * First APIC vector available to drivers: (vectors 0x30-0xee) - * we start at 0x31 to spread out vectors evenly between priority - * levels. (0x80 is the syscall vector) - */ -#define FIRST_DEVICE_VECTOR 0x31 -#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */ - - -#ifndef __ASSEMBLY__ -extern u8 irq_vector[NR_IRQ_VECTORS]; -#define IO_APIC_VECTOR(irq) (irq_vector[irq]) -#define AUTO_ASSIGN -1 - -/* - * Various low-level irq details needed by irq.c, process.c, - * time.c, io_apic.c and smp.c - * - * Interrupt entry/exit code at both C and assembly level - */ - -extern void disable_8259A_irq(unsigned int irq); -extern void enable_8259A_irq(unsigned int irq); -extern int i8259A_irq_pending(unsigned int irq); -extern void make_8259A_irq(unsigned int irq); -extern void init_8259A(int aeoi); -extern void FASTCALL(send_IPI_self(int vector)); -extern void init_VISWS_APIC_irqs(void); -extern void setup_IO_APIC(void); -extern void disable_IO_APIC(void); -extern void print_IO_APIC(void); -extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); -extern void send_IPI(int dest, int vector); -extern void setup_ioapic_dest(void); - -extern unsigned long io_apic_irqs; - -extern atomic_t irq_err_count; -extern atomic_t irq_mis_count; - -#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) - -#define __STR(x) #x -#define STR(x) __STR(x) - -#include - -#define IRQ_NAME2(nr) nr##_interrupt(void) -#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr) - -/* - * SMP has a few special interrupts for IPI messages - */ - -#define BUILD_IRQ(nr) \ -asmlinkage void IRQ_NAME(nr); \ -__asm__( \ -"\n.p2align\n" \ -"IRQ" #nr "_interrupt:\n\t" \ - "push $" #nr "-256 ; " \ - "jmp common_interrupt"); - -extern void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i); - -#define platform_legacy_irq(irq) ((irq) < 16) - -#endif - -#endif /* _ASM_HW_IRQ_H */ Index: 2006-01-05/arch/x86_64/kernel/genapic-xen.c =================================================================== --- 2006-01-05.orig/arch/x86_64/kernel/genapic-xen.c 2006-01-06 11:47:23.347287624 +0100 +++ 2006-01-05/arch/x86_64/kernel/genapic-xen.c 2006-01-06 11:15:55.000000000 +0100 @@ -29,11 +29,10 @@ u8 x86_cpu_to_apicid[NR_CPUS] __read_mos EXPORT_SYMBOL(x86_cpu_to_apicid); u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; +#ifndef CONFIG_XEN extern struct genapic apic_cluster; extern struct genapic apic_flat; extern struct genapic apic_physflat; - -#ifndef CONFIG_XEN struct genapic *genapic = &apic_flat; #else extern struct genapic apic_xen; @@ -130,15 +129,7 @@ print: /* Same for both flat and clustered. */ -#ifdef CONFIG_XEN -extern void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest); -#endif - void send_IPI_self(int vector) { -#ifndef CONFIG_XEN __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); -#else - xen_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); -#endif } Index: 2006-01-05/arch/x86_64/kernel/smp-xen.c =================================================================== --- 2006-01-05.orig/arch/x86_64/kernel/smp-xen.c 2006-01-06 11:47:23.329290360 +0100 +++ 2006-01-05/arch/x86_64/kernel/smp-xen.c 2006-01-06 11:14:53.000000000 +0100 @@ -297,11 +297,6 @@ void flush_tlb_all(void) { xen_tlb_flush_all(); } #endif /* Xen */ -void smp_kdb_stop(void) -{ - send_IPI_allbutself(KDB_VECTOR); -} - /* * this function sends a 'reschedule' IPI to another CPU. * it goes straight through and wastes no time serializing Index: 2006-01-05/include/asm-x86_64/ipi.h =================================================================== --- 2006-01-05.orig/include/asm-x86_64/ipi.h 2006-01-06 11:47:23.349287320 +0100 +++ 2006-01-05/include/asm-x86_64/ipi.h 2006-01-06 09:21:22.000000000 +0100 @@ -23,6 +23,8 @@ #include #include +#ifndef CONFIG_XEN + /* * the following functions deal with sending IPIs between CPUs. * @@ -118,4 +120,10 @@ static inline void send_IPI_mask_sequenc local_irq_restore(flags); } +#else + +extern void __send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest); + +#endif + #endif /* __ASM_IPI_H */ Index: 2006-01-05/include/asm-x86_64/mach-xen/irq_vectors.h =================================================================== --- 2006-01-05.orig/include/asm-x86_64/mach-xen/irq_vectors.h 2006-01-06 11:47:23.351287016 +0100 +++ 2006-01-05/include/asm-x86_64/mach-xen/irq_vectors.h 2006-01-06 11:14:54.000000000 +0100 @@ -23,49 +23,10 @@ #define _ASM_IRQ_VECTORS_H /* - * IDT vectors usable for external interrupt sources start - * at 0x20: - */ -#define FIRST_EXTERNAL_VECTOR 0x20 - -#define SYSCALL_VECTOR 0x80 - -/* - * Vectors 0x20-0x2f are used for ISA interrupts. - */ - -#if 0 -/* - * Special IRQ vectors used by the SMP architecture, 0xf0-0xff - * - * some of the following vectors are 'rare', they are merged - * into a single vector (CALL_FUNCTION_VECTOR) to save vector space. - * TLB, reschedule and local APIC vectors are performance-critical. - * - * Vectors 0xf0-0xfa are free (reserved for future Linux use). - */ -#define INVALIDATE_TLB_VECTOR 0xfd -#define RESCHEDULE_VECTOR 0xfc -#define CALL_FUNCTION_VECTOR 0xfb - -#define THERMAL_APIC_VECTOR 0xf0 -/* - * Local APIC timer IRQ vector is on a different priority level, - * to work around the 'lost local interrupt if more than 2 IRQ - * sources per level' errata. - */ -#define LOCAL_TIMER_VECTOR 0xef -#endif - -#define SPURIOUS_APIC_VECTOR 0xff -#define ERROR_APIC_VECTOR 0xfe - -/* * First APIC vector available to drivers: (vectors 0x30-0xee) * we start at 0x31 to spread out vectors evenly between priority * levels. (0x80 is the syscall vector) */ -#define FIRST_DEVICE_VECTOR 0x31 #define FIRST_SYSTEM_VECTOR 0xef /* @@ -78,10 +39,6 @@ * the usable vector space is 0x20-0xff (224 vectors) */ -#define RESCHEDULE_VECTOR 0 -#define CALL_FUNCTION_VECTOR 1 -#define NR_IPIS 2 - /* * The maximum number of vectors supported by i386 processors * is limited to 256. For processors other than i386, NR_VECTORS @@ -89,12 +46,6 @@ */ #define NR_VECTORS 256 -#define FPU_IRQ 13 - -#define FIRST_VM86_IRQ 3 -#define LAST_VM86_IRQ 15 -#define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15) - /* * The flat IRQ space is divided into two regions: * 1. A one-to-one mapping of real physical IRQs. This space is only used Index: 2006-01-05/arch/x86_64/kernel/Makefile =================================================================== --- 2006-01-05.orig/arch/x86_64/kernel/Makefile 2006-01-06 11:47:23.328290512 +0100 +++ 2006-01-05/arch/x86_64/kernel/Makefile 2006-01-06 11:16:37.000000000 +0100 @@ -57,7 +57,7 @@ pci-dma-y += ../../i386/kernel/pci-dma microcode-$(subst m,y,$(CONFIG_MICROCODE)) := ../../i386/kernel/microcode-xen.o quirks-y := ../../i386/kernel/quirks-xen.o -n-obj-xen := i8259.o reboot.o i8237.o smpboot.o trampoline.o +n-obj-xen := i8259.o reboot.o i8237.o smpboot.o trampoline.o genapic_cluster.o genapic_flat.o include $(srctree)/scripts/Makefile.xen Index: 2006-01-05/arch/x86_64/kernel/genapic_xen.c =================================================================== --- 2006-01-05.orig/arch/x86_64/kernel/genapic_xen.c 2005-12-16 15:38:28.000000000 +0100 +++ 2006-01-05/arch/x86_64/kernel/genapic_xen.c 2006-01-06 11:48:33.264658568 +0100 @@ -36,7 +36,7 @@ static inline void __send_IPI_one(unsign notify_remote_via_irq(irq); } -void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest) +void __send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest) { int cpu; @@ -91,13 +91,13 @@ static void xen_send_IPI_allbutself(int */ Dprintk("%s\n", __FUNCTION__); if (num_online_cpus() > 1) - xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL); + __send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL); } static void xen_send_IPI_all(int vector) { Dprintk("%s\n", __FUNCTION__); - xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); + __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); } static void xen_send_IPI_mask(cpumask_t cpumask, int vector)