I-pipe ppc64 0.9-02
Subsystems (7)
Updated ppc64 I-pipe patch for 2.6.14. Changes:
* sync with ppc 1.0-07
* send IPI to self fixed
* additional IPI (#4) for xenomai SMP timer implementation
Also at the usual
http://www.cs.helsinki.fi/group/nonsto/rtaippc64.html
Philippe, please put this in Xenomai 2.1.
-- Heikki Lindholm
arch/ppc64/Kconfig +2 -0
@@ -227,6 +227,8 @@ depends on SMP default "32" +source "kernel/ipipe/Kconfig" + config HMT bool "Hardware multithreading" depends on SMP && PPC_PSERIES && BROKEN
arch/ppc64/kernel/entry.S +69 -0
96 lines not on this page · raw message
arch/ppc64/kernel/head.S +21 -0
@@ -376,6 +376,18 @@ bl hdlr; \ b .ret_from_except_lite +#ifdef CONFIG_IPIPE +#define IPIPE_EXCEPTION_COMMON_LITE(trap, label, hdlr) \ + .align 7; \ + .globl label##_common; \ +label##_common: \ + EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ + DISABLE_INTS; \ + addi r3,r1,STACK_FRAME_OVERHEAD; \ + bl hdlr; \ + b .__ipipe_ret_from_except_lite +#endif /* CONFIG_IPIPE */ + /* * Start of pSeries system interrupt routines */
@@ -685,7 +697,11 @@ bl .machine_check_exception b .ret_from_except +#ifdef CONFIG_IPIPE + IPIPE_EXCEPTION_COMMON_LITE(0x900, decrementer, .__ipipe_grab_timer) +#else /* !CONFIG_IPIPE */ STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt) +#endif /* CONFIG_IPIPE */ STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception) STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
@@ -815,8 +831,13 @@ hardware_interrupt_entry: DISABLE_INTS addi r3,r1,STACK_FRAME_OVERHEAD +#ifdef CONFIG_IPIPE + bl .__ipipe_grab_irq + b .__ipipe_ret_from_except_lite +#else /* !CONFIG_IPIPE */ bl .do_IRQ b .ret_from_except_lite +#endif /* CONFIG_IPIPE */ .align 7 .globl alignment_common
arch/ppc64/kernel/idle.c +4 -0
@@ -45,6 +45,7 @@while (!need_resched () && !cpu_is_offline (cpu)) {ppc64_runlatch_off (); +ipipe_suspend_domain ();/* * Go into low thread priority and possibly * low power mode.
@@ -74,7 +75,10 @@ppc64_runlatch_off ();if (!need_resched ()) + { +ipipe_suspend_domain ();power4_idle (); + }if (need_resched ()) {ppc64_runlatch_on ();
arch/ppc64/kernel/ipipe-core.c +634 -0
634 lines not on this page · raw message
arch/ppc64/kernel/ipipe-root.c +613 -0
613 lines not on this page · raw message
arch/ppc64/kernel/irq.c +4 -0
@@ -165,14 +165,18 @@if (desc->status &IRQ_PER_CPU ) {/* no locking required for CPU-local interrupts: */ +#ifndef CONFIG_IPIPE ack_irq (irq); +#endif /* CONFIG_IPIPE */ action_ret =handle_IRQ_event (irq, regs, desc->action); desc->handler->end (irq);return ; }spin_lock (&desc->lock); +#ifndef CONFIG_IPIPE ack_irq (irq); +#endif /* CONFIG_IPIPE */ /* REPLAY is when Linux resends an IRQ that was dropped earlier WAITING is used by probe to mark irqs that are being tested
arch/ppc64/kernel/Makefile +1 -0
@@ -75,6 +75,7 @@ endif obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o +obj-$(CONFIG_IPIPE) += ipipe-core.o ipipe-root.o obj-$(CONFIG_KPROBES) += kprobes.o CFLAGS_ioctl32.o += -Ifs/
arch/ppc64/kernel/mpic.c +11 -1
@@ -44,7 +44,6 @@static struct mpic *mpic_primary;static DEFINE_SPINLOCK (mpic_lock); -/* * Register accessor functions */
@@ -867,6 +866,11 @@#ifdef CONFIG_SMP void mpic_request_ipis (void ) { +#ifdef CONFIG_IPIPE +extern void __ipipe_register_ipi (unsigned int irq); +extern irqreturn_t __ipipe_ipi_action (int irq, +void *dev_id,struct pt_regs *regs); +#endif struct mpic *mpic = mpic_primary;BUG_ON (mpic ==NULL );
@@ -878,8 +882,14 @@ "IPI0 (call function)", mpic);request_irq (mpic->ipi_offset+1 , mpic_ipi_action,SA_INTERRUPT ,"IPI1 (reschedule)" , mpic); +#ifdef CONFIG_IPIPE +request_irq (mpic->ipi_offset+2 , __ipipe_ipi_action,SA_INTERRUPT , +"IPI2 (I-pipe one-for-all)" , mpic); +__ipipe_register_ipi (mpic->ipi_offset+2 ); +#else request_irq (mpic->ipi_offset+2 , mpic_ipi_action,SA_INTERRUPT ,"IPI2 (unused)" , mpic); +#endif /* CONFIG_IPIPE */ request_irq (mpic->ipi_offset+3 , mpic_ipi_action,SA_INTERRUPT ,"IPI3 (debugger break)" , mpic);
arch/ppc64/kernel/time.c +6 -0
@@ -72,6 +72,9 @@EXPORT_SYMBOL (jiffies_64); +#ifdef CONFIG_IPIPE +unsigned long disarm_decr[NR_CPUS ]; +#endif /* CONFIG_IPIPE */ /* keep track of when we need to update the rtc */ time_t last_rtc_update;extern int piranha_simulator;
@@ -363,6 +366,9 @@ next_dec = lpaca->next_jiffy_update_tb - cur_tb;if (next_dec > lpaca->default_decr) next_dec = lpaca->default_decr; +#ifdef CONFIG_IPIPE + if (!disarm_decr[smp_processor_id()]) +#endif /* CONFIG_IPIPE */ set_dec (next_dec);#ifdef CONFIG_PPC_ISERIES
arch/ppc64/kernel/traps.c +36 -0
@@ -174,6 +174,9 @@if (ppc_md.system_reset_exception) ppc_md.system_reset_exception (regs); +if (ipipe_trap_notify (IPIPE_TRAP_SYSRESET , regs)) +return ; +die ("System Reset" , regs,0 );/* Must die if the interrupt is not recoverable */
@@ -191,6 +194,9 @@if (ppc_md.machine_check_exception) recover = ppc_md.machine_check_exception (regs); +if (ipipe_trap_notify (IPIPE_TRAP_MCE , regs)) +return ; +if (recover)return ;
@@ -205,6 +211,9 @@void unknown_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_UNKNOWN , regs)) +return ; +printk ("Bad trap at PC: %lx, SR: %lx, vector=%lx\n" , regs->nip, regs->msr, regs->trap);
@@ -213,6 +222,9 @@void instruction_breakpoint_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_IABR , regs)) +return ; +if (notify_die (DIE_IABR_MATCH ,"iabr_match" , regs,5 ,5 ,SIGTRAP ) ==NOTIFY_STOP )return ;
@@ -225,6 +237,9 @@ { regs->msr &= ~MSR_SE ;/* Turn off 'trace' bit */ +if (ipipe_trap_notify (IPIPE_TRAP_SSTEP , regs)) +return ; +if (notify_die (DIE_SSTEP ,"single_step" , regs,5 ,5 ,SIGTRAP ) ==NOTIFY_STOP )return ;
@@ -401,6 +416,9 @@void __kprobes program_check_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_PCE , regs)) +return ; +if (debugger_fault_handler (regs))return ;
@@ -448,6 +466,9 @@void kernel_fp_unavailable_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_KFPUNAVAIL , regs)) +return ; +printk (KERN_EMERG "Unrecoverable FP Unavailable Exception " "%lx at %lx\n" , regs->trap, regs->nip);die ("Unrecoverable FP Unavailable Exception" , regs,SIGABRT );
@@ -455,6 +476,9 @@void altivec_unavailable_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_ALTUNAVAIL , regs)) +return ; +if (user_mode (regs)) {/* A user program has executed an altivec instruction, but this kernel doesn't support altivec. */
@@ -470,6 +494,9 @@void performance_monitor_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_PERFMON , regs)) +return ; +perf_irq (regs); }
@@ -484,6 +511,9 @@emulate_single_step (regs);return ; } + +if (ipipe_trap_notify (IPIPE_TRAP_ALIGNMENT , regs)) +return ;/* Operand address was bad */ if (fixed == -EFAULT ) {
@@ -506,6 +536,9 @@int err;siginfo_t info; +if (ipipe_trap_notify (IPIPE_TRAP_ALTASSIST , regs)) +return ; +if (!user_mode (regs)) {printk (KERN_EMERG "VMX/Altivec assist exception in kernel mode" " at %lx\n" , regs->nip);
@@ -547,6 +580,9 @@*/ void unrecoverable_exception (struct pt_regs *regs) { +if (ipipe_trap_notify (IPIPE_TRAP_NREC , regs)) +return ; +printk (KERN_EMERG "Unrecoverable exception %lx at %lx\n" , regs->trap, regs->nip);die ("Unrecoverable exception" , regs,SIGABRT );
arch/ppc64/mm/fault.c +3 -0
@@ -121,6 +121,9 @@BUG_ON ((trap ==0x380 ) || (trap ==0x480 )); +if (ipipe_trap_notify (IPIPE_TRAP_ACCESS , regs)) +return 0 ; +if (notify_die (DIE_PAGE_FAULT ,"page_fault" , regs, error_code,11 ,SIGSEGV ) ==NOTIFY_STOP )return 0 ;
arch/ppc64/mm/hash_native.c +4 -4
@@ -264,7 +264,7 @@if (large) avpn &= ~1 ; -local_irq_save (flags); +local_irq_save_hw (flags);native_lock_hpte (hptep); hpte_v = hptep->v;
@@ -288,7 +288,7 @@if (lock_tlbie)spin_unlock (&native_tlbie_lock); } -local_irq_restore (flags); +local_irq_restore_hw (flags); }/*
@@ -345,7 +345,7 @@struct ppc64_tlb_batch *batch = &__get_cpu_var (ppc64_tlb_batch);unsigned long large = batch->large; -local_irq_save (flags); +local_irq_save_hw (flags); j =0 ;for (i =0 ; i < number; i++) {
@@ -413,7 +413,7 @@spin_unlock (&native_tlbie_lock); } -local_irq_restore (flags); +local_irq_restore_hw (flags); }#ifdef CONFIG_PPC_PSERIES
arch/ppc64/mm/tlb.c +4 -0
@@ -168,7 +168,11 @@cpumask_t tmp;int local =0 ; +#ifdef CONFIG_IPIPE +BUG_ON (ipipe_current_domain == ipipe_root_domain &&in_interrupt ()); +#else /* !CONFIG_IPIPE */ BUG_ON (in_interrupt ()); +#endif /* CONFIG_IPIPE */ cpu =get_cpu (); i = batch->index;
include/asm-ppc64/hw_irq.h +82 -0
94 lines not on this page · raw message
include/asm-ppc64/ipipe.h +203 -0
203 lines not on this page · raw message
include/asm-ppc64/mmu_context.h +2 -2
@@ -79,9 +79,9 @@ {unsigned long flags; -local_irq_save (flags); +local_irq_save_hw (flags);switch_mm (prev, next, current); -local_irq_restore (flags); +local_irq_restore_hw (flags); }#endif /* __PPC64_MMU_CONTEXT_H */
include/asm-ppc64/pgalloc.h +5 -0
@@ -117,4 +117,9 @@#define check_pgt_cache () do { } while (0) +static inline void set_pgdir (unsigned long address,pgd_t entry) +{ +/* nop */ +} +#endif /* _PPC64_PGALLOC_H */
include/asm-ppc64/time.h +3 -0
@@ -23,6 +23,9 @@#include <asm/iSeries/HvCall.h> /* time.c */ +#ifdef CONFIG_IPIPE +extern unsigned long disarm_decr[NR_CPUS ]; +#endif /* CONFIG_IPIPE */ extern unsigned long tb_ticks_per_jiffy;extern unsigned long tb_ticks_per_usec;extern unsigned long tb_ticks_per_sec;
include/linux/hardirq.h +13 -0
@@ -87,8 +87,21 @@# define synchronize_irq (irq) barrier()#endif +#ifdef CONFIG_IPIPE +#define nmi_enter () \ +do { \ + if (ipipe_current_domain == ipipe_root_domain) \ + irq_enter(); \ +} while(0) +#define nmi_exit () \ +do { \ + if (ipipe_current_domain == ipipe_root_domain) \ + sub_preempt_count(HARDIRQ_OFFSET); \ +} while(0) +#else /* !CONFIG_IPIPE */ #define nmi_enter () irq_enter()#define nmi_exit () sub_preempt_count(HARDIRQ_OFFSET) +#endif /* CONFIG_IPIPE */ #ifndef CONFIG_VIRT_CPU_ACCOUNTING static inline void account_user_vtime (struct task_struct *tsk)
include/linux/ipipe.h +757 -0
757 lines not on this page · raw message
include/linux/preempt.h +33 -16
61 lines not on this page · raw message
include/linux/sched.h +4 -0
@@ -4,6 +4,7 @@#include <asm/param.h> /* for HZ */ #include <linux/config.h> +#include <linux/ipipe.h> #include <linux/capability.h> #include <linux/threads.h> #include <linux/kernel.h>
@@ -813,6 +814,9 @@int cpuset_mems_generation;#endif atomic_t fs_excl;/* holding fs exclusive resources */ +#ifdef CONFIG_IPIPE +void *ptd[IPIPE_ROOT_NPTDKEYS ]; +#endif };static inline pid_t process_group (struct task_struct *tsk)
init/Kconfig +1 -0
@@ -69,6 +69,7 @@ config LOCALVERSION string "Local version - append to kernel release" + default "-ipipe" help Append an extra string to the end of your kernel version. This will show up when you type uname, for example.
init/main.c +8 -1
@@ -402,8 +402,9 @@*/ schedule (); +ipipe_reset_stats ();cpu_idle (); -} +}/* Check for early params. */ static int __init do_early_param (char *param,char *val)
@@ -487,6 +488,11 @@init_timers ();softirq_init ();time_init (); +/* +* We need to wait for the interrupt and time subsystems to be +* initialized before enabling the pipeline. +*/ +ipipe_init ();/* * HACK ALERT! This is early. We're enabling the console before
@@ -611,6 +617,7 @@#ifdef CONFIG_SYSCTL sysctl_init ();#endif +ipipe_init_proc ();/* Networking initialization needs a process context */ sock_init ();
kernel/exit.c +1 -0
@@ -846,6 +846,7 @@exit_itimers (tsk->signal);acct_process (code); } +ipipe_exit_notify (tsk);exit_mm (tsk);exit_sem (tsk);
kernel/fork.c +8 -0
@@ -1153,6 +1153,14 @@ total_forks++;write_unlock_irq (&tasklist_lock); retval =0 ; +#ifdef CONFIG_IPIPE + { +int k; + +for (k =0 ; k <IPIPE_ROOT_NPTDKEYS ; k++) + p->ptd[k] =NULL ; + } +#endif /* CONFIG_IPIPE */ fork_out:if (retval)
kernel/ipipe/core.c +678 -0
118 lines not on this page · raw message
kernel/ipipe/generic.c +392 -0
392 lines not on this page · raw message
kernel/printk.c +73 -0
73 lines not on this page · raw message
kernel/sched.c +58 -0
58 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Philippe Gerum
AppliedQuoted 10 lines · Heikki Lindholm
Updated ppc64 I-pipe patch for 2.6.14. Changes:
* sync with ppc 1.0-07
* send IPI to self fixed
* additional IPI (#4) for xenomai SMP timer implementationAlso at the usual
http://www.cs.helsinki.fi/group/nonsto/rtaippc64.htmlPhilippe, please put this in Xenomai 2.1.
Applied, thanks.
Signature · 1 line
Philippe.