From a6cd6322d594014240465210ccb290971469c6e8 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Mon, 25 Feb 2008 14:32:22 +0900 Subject: [IA64] Fix irq migration in multiple vector domain Fix the problem that the following error message is sometimes displayed at irq migration when vector domain is enabled. "Unexpected interrupt vector %d on CPU %d is not mapped to any IRQ!" The cause of this problem is an interrupt is sent to the previous target CPU after cleaning up vector to irq mapping table. To clean up vector to irq map on the previous target CPU safty, change the irq migration in multiple vector domain as follows. The original idea is from x86 interrupt management code. - Delay vector to irq table cleanup until the interrupts are sent to new target CPUs. By this, it is ensured that target CPU is completely changed on the interrupt controller side. - Even after the interrupts are sent to new target CPUs, there can be pended interrupts remaining on the previous target CPU. So we need to delay clearning up vector to irq table until the pended interrupt is handled. For this, send IPI to the previous target CPU with lower priority vector and clean up vector to irq table in its handler. This patch affects only to irq migration code with multiple vector domain is enabled. Signed-off-by: Kenji Kaneshige Signed-off-by: Tony Luck --- include/asm-ia64/hw_irq.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h index 7e6e3779670a..76366dc9c1a0 100644 --- a/include/asm-ia64/hw_irq.h +++ b/include/asm-ia64/hw_irq.h @@ -93,6 +93,9 @@ extern __u8 isa_irq_to_vector_map[16]; struct irq_cfg { ia64_vector vector; cpumask_t domain; + cpumask_t old_domain; + unsigned move_cleanup_count; + u8 move_in_progress : 1; }; extern spinlock_t vector_lock; extern struct irq_cfg irq_cfg[NR_IRQS]; @@ -106,12 +109,19 @@ extern int assign_irq_vector (int irq); /* allocate a free vector */ extern void free_irq_vector (int vector); extern int reserve_irq_vector (int vector); extern void __setup_vector_irq(int cpu); -extern int reassign_irq_vector(int irq, int cpu); extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); extern int check_irq_used (int irq); extern void destroy_and_reserve_irq (unsigned int irq); +#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG)) +extern int irq_prepare_move(int irq, int cpu); +extern void irq_complete_move(unsigned int irq); +#else +static inline int irq_prepare_move(int irq, int cpu) { return 0; } +static inline void irq_complete_move(unsigned int irq) {} +#endif + static inline void ia64_resend_irq(unsigned int vector) { platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0); -- cgit v1.2.3-59-g8ed1b From 6ed0dc5ba811ce682f48988bf114669265e1120d Mon Sep 17 00:00:00 2001 From: Alex Chiang Date: Wed, 27 Feb 2008 18:41:38 -0700 Subject: [IA64] workaround tiger ia64_sal_get_physical_id_info hang This fixes regression introduced in 113134fcbca83619be4c68d0ca66db6093777b5d Intel Tiger platforms hang when calling SAL_GET_PHYSICAL_ID_INFO instead of properly returning -1 for unimplemented, so add a version check. SGI Altix platforms have an incorrect SAL version hard-coded into their prom -- they encode 2.9, but actually implement 3.2 -- so fix it up and allow ia64_sal_get_physical_id_info to keep working. Signed-off-by: Alex Chiang Acked-by: Russ Anderson Signed-off-by: Tony Luck --- arch/ia64/kernel/sal.c | 7 +++++++ include/asm-ia64/sal.h | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'include') diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c index f44fe8412162..a3022dc48ef8 100644 --- a/arch/ia64/kernel/sal.c +++ b/arch/ia64/kernel/sal.c @@ -109,6 +109,13 @@ check_versions (struct ia64_sal_systab *systab) sal_revision = SAL_VERSION_CODE(2, 8); sal_version = SAL_VERSION_CODE(0, 0); } + + if (ia64_platform_is("sn2") && (sal_revision == SAL_VERSION_CODE(2, 9))) + /* + * SGI Altix has hard-coded version 2.9 in their prom + * but they actually implement 3.2, so let's fix it here. + */ + sal_revision = SAL_VERSION_CODE(3, 2); } static void __init diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h index 2251118894ae..f4904db3b057 100644 --- a/include/asm-ia64/sal.h +++ b/include/asm-ia64/sal.h @@ -807,6 +807,10 @@ static inline s64 ia64_sal_physical_id_info(u16 *splid) { struct ia64_sal_retval isrv; + + if (sal_revision < SAL_VERSION_CODE(3,2)) + return -1; + SAL_CALL(isrv, SAL_PHYSICAL_ID_INFO, 0, 0, 0, 0, 0, 0, 0); if (splid) *splid = isrv.v0; -- cgit v1.2.3-59-g8ed1b From 956d6cad87abdfaef35fa4fc2f2e4ac5bb4ee7a5 Mon Sep 17 00:00:00 2001 From: Doug Chapman Date: Fri, 29 Feb 2008 15:28:43 -0500 Subject: [IA64] move gcc_intrin.h from header-y to unifdef-y When I submitted 0df29025fd0379d5950d206314d0b10a2c8a9607 to ad an #ifdef __KERNEL__ to include/asm-ia64/gcc_intrin.h a few weeks ago I neglected to move gcc_intrin.h from header-y to unifdef-y. Thanks to David Woodhouse for pointing this out. Signed-off-by: Doug Chapman Signed-off-by: Jarod Wilson Signed-off-by: Tony Luck --- include/asm-ia64/Kbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild index 4a1e48b9f403..eb24a3f47caa 100644 --- a/include/asm-ia64/Kbuild +++ b/include/asm-ia64/Kbuild @@ -3,7 +3,6 @@ include include/asm-generic/Kbuild.asm header-y += break.h header-y += fpu.h header-y += fpswa.h -header-y += gcc_intrin.h header-y += ia64regs.h header-y += intel_intrin.h header-y += intrinsics.h @@ -12,5 +11,6 @@ header-y += ptrace_offsets.h header-y += rse.h header-y += ucontext.h +unifdef-y += gcc_intrin.h unifdef-y += perfmon.h unifdef-y += ustack.h -- cgit v1.2.3-59-g8ed1b From 9dad6f5785a9f113dbbd58951d2f5ef9abd06dcc Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 3 Mar 2008 20:07:22 +0200 Subject: [IA64] fix ia64 kprobes compilation This patch fixes the following compile error with a recent gcc: CC kernel/kprobes.o /home/bunk/linux/kernel-2.6/git/linux-2.6/kernel/kprobes.c:1066: error: __ksymtab_jprobe_return causes a section type conflict Signed-off-by: Adrian Bunk Signed-off-by: Tony Luck --- arch/ia64/kernel/kprobes.c | 5 +++++ include/asm-ia64/kprobes.h | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index b618487cdc85..615c3d2b6348 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -1001,6 +1001,11 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) return 1; } +/* ia64 does not need this */ +void __kprobes jprobe_return(void) +{ +} + int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) { struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index a93ce9ef07ff..49684b65c187 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h @@ -122,10 +122,6 @@ extern int kprobes_fault_handler(struct pt_regs *regs, int trapnr); extern int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data); -/* ia64 does not need this */ -static inline void jprobe_return(void) -{ -} extern void invalidate_stacked_regs(void); extern void flush_register_stack(void); extern void arch_remove_kprobe(struct kprobe *p); -- cgit v1.2.3-59-g8ed1b