## Automatically generated incremental diff ## From: linux-2.4.23-bk22 ## To: linux-2.4.23-bk23 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.4.23-bk22/Documentation/s390/cds.txt linux-2.4.23-bk23/Documentation/s390/cds.txt --- linux-2.4.23-bk22/Documentation/s390/cds.txt 2003-08-25 04:44:39.000000000 -0700 +++ linux-2.4.23-bk23/Documentation/s390/cds.txt 2004-01-04 02:50:34.000000000 -0800 @@ -1122,23 +1122,6 @@ not operational -EBUSY - the console device is already defined -reset_cons_dev - Reset Console Device - -This routine allows for resetting the console device specification. See -wait_cons_dev() for details. - -int reset_cons_dev( int irq); - -irq : subchannel identifying the system console device - -The reset_cons_dev() function returns - - 0 - successful completion --EIO - an unhandled interrupt condition is pending for the - specified subchannel (irq) - status pending --ENODEV - irq doesn't specify a valid subchannel or the devive is - not operational - wait_cons_dev - Synchronously Wait for Console Processing The wait_cons_dev() routine is used by the console device driver when its diff -urN linux-2.4.23-bk22/Makefile linux-2.4.23-bk23/Makefile --- linux-2.4.23-bk22/Makefile 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/Makefile 2004-01-04 02:50:34.000000000 -0800 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 23 -EXTRAVERSION = -bk22 +EXTRAVERSION = -bk23 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -urN linux-2.4.23-bk22/arch/ppc/boot/include/mpc10x.h linux-2.4.23-bk23/arch/ppc/boot/include/mpc10x.h --- linux-2.4.23-bk22/arch/ppc/boot/include/mpc10x.h 2003-06-13 07:51:31.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc/boot/include/mpc10x.h 2004-01-04 02:50:36.000000000 -0800 @@ -58,7 +58,7 @@ #define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */ #define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */ -#define MPC10X_MCTLR_MEM_END_2i 0x94 /* Banks 4-7 */ +#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */ #define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */ #define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */ diff -urN linux-2.4.23-bk22/arch/ppc/boot/prep/misc.c linux-2.4.23-bk23/arch/ppc/boot/prep/misc.c --- linux-2.4.23-bk22/arch/ppc/boot/prep/misc.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc/boot/prep/misc.c 2004-01-04 02:50:36.000000000 -0800 @@ -258,7 +258,7 @@ /* get the info */ if (getprop(dev_handle, "reg", mem_info, - sizeof(mem_info) != 8)) + sizeof(mem_info)) !=8) break; TotalMemory = mem_info[1]; diff -urN linux-2.4.23-bk22/arch/ppc/kernel/open_pic.c linux-2.4.23-bk23/arch/ppc/kernel/open_pic.c --- linux-2.4.23-bk22/arch/ppc/kernel/open_pic.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc/kernel/open_pic.c 2004-01-04 02:50:36.000000000 -0800 @@ -166,13 +166,21 @@ { u_int val; +#ifdef CONFIG_PPC_OPENPIC_BE + val = in_be32(addr); +#else val = in_le32(addr); +#endif return val; } static inline void openpic_write(volatile u_int *addr, u_int val) { +#ifdef CONFIG_PPC_OPENPIC_BE + out_be32(addr, val); +#else out_le32(addr, val); +#endif } static inline u_int openpic_readfield(volatile u_int *addr, u_int mask) @@ -211,7 +219,7 @@ u_int openpic_read_IPI(volatile u_int* addr) { u_int val = 0; -#ifdef CONFIG_POWER3 +#if defined(CONFIG_PPC_OPENPIC_BE) || defined(CONFIG_POWER3) val = in_be32(addr); #else val = in_le32(addr); diff -urN linux-2.4.23-bk22/arch/ppc64/Makefile linux-2.4.23-bk23/arch/ppc64/Makefile --- linux-2.4.23-bk22/arch/ppc64/Makefile 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/Makefile 2004-01-04 02:50:36.000000000 -0800 @@ -50,10 +50,6 @@ SUBDIRS += arch/ppc64/xmon CORE_FILES += arch/ppc64/xmon/x.o endif -ifdef CONFIG_KDB -SUBDIRS += arch/ppc64/kdb -CORE_FILES += arch/ppc64/kdb/kdba.o -endif MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot diff -urN linux-2.4.23-bk22/arch/ppc64/boot/ppc32-types.h linux-2.4.23-bk23/arch/ppc64/boot/ppc32-types.h --- linux-2.4.23-bk22/arch/ppc64/boot/ppc32-types.h 2002-08-02 17:39:43.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/boot/ppc32-types.h 2004-01-04 02:50:36.000000000 -0800 @@ -27,4 +27,10 @@ #define BITS_PER_LONG 32 +typedef struct { + __u32 u[4]; +} __attribute((aligned(16))) __vector128; + +typedef __vector128 vector128; + #endif /* _PPC64_TYPES_H */ diff -urN linux-2.4.23-bk22/arch/ppc64/config.in linux-2.4.23-bk23/arch/ppc64/config.in --- linux-2.4.23-bk22/arch/ppc64/config.in 2003-11-28 10:26:19.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/config.in 2004-01-04 02:50:36.000000000 -0800 @@ -25,7 +25,7 @@ choice 'Machine Type' \ "pSeries CONFIG_PPC_PSERIES \ iSeries CONFIG_PPC_ISERIES" CONFIG_PPC_PSERIES - +bool 'VMX ( AltiVec ) Support' CONFIG_ALTIVEC bool 'Symmetric multi-processing support' CONFIG_SMP if [ "$CONFIG_SMP" = "y" ]; then bool ' Distribute interrupts on all CPUs by default' CONFIG_IRQ_ALL_CPUS @@ -245,15 +245,8 @@ bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ bool 'Include kgdb kernel debugger' CONFIG_KGDB bool 'Include xmon kernel debugger' CONFIG_XMON -bool 'Include kdb kernel debugger' CONFIG_KDB bool 'Debug memory allocations' CONFIG_DEBUG_SLAB -if [ "$CONFIG_KDB" = "y" ]; then - bool ' KDB off by default' CONFIG_KDB_OFF - define_bool CONFIG_KALLSYMS y - define_bool CONFIG_XMON n -fi if [ "$CONFIG_XMON" = "y" ]; then - define_bool CONFIG_KDB n define_bool CONFIG_KALLSYMS n fi bool 'Include PPCDBG realtime debugging' CONFIG_PPCDBG diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/cputable.c linux-2.4.23-bk23/arch/ppc64/kernel/cputable.c --- linux-2.4.23-bk22/arch/ppc64/kernel/cputable.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/cputable.c 2004-01-04 02:50:36.000000000 -0800 @@ -30,8 +30,10 @@ */ #ifdef CONFIG_ALTIVEC #define CPU_FTR_ALTIVEC_COMP CPU_FTR_ALTIVEC +#define PPC_FEATURE_HAS_ALTIVEC_COMP PPC_FEATURE_HAS_ALTIVEC #else #define CPU_FTR_ALTIVEC_COMP 0 +#define PPC_FEATURE_HAS_ALTIVEC_COMP 0 #endif struct cpu_spec cpu_specs[] = { @@ -101,6 +103,15 @@ __setup_cpu_power4, COMMON_PPC64_FW }, + { /* PPC970 */ + 0xffff0000, 0x00390000, "PPC970", + CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | + CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_ALTIVEC_COMP, + COMMON_USER_PPC64 | PPC_FEATURE_HAS_ALTIVEC_COMP, + 128, 128, + __setup_cpu_power4, + COMMON_PPC64_FW + }, { /* Power5 */ 0xffff0000, 0x003a0000, "Power5", CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/entry.S linux-2.4.23-bk23/arch/ppc64/kernel/entry.S --- linux-2.4.23-bk22/arch/ppc64/kernel/entry.S 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/entry.S 2004-01-04 02:50:36.000000000 -0800 @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef CONFIG_PPC_ISERIES #define DO_SOFT_DISABLE @@ -257,6 +258,11 @@ mflr r20 /* Return to switch caller */ mfmsr r22 li r6,MSR_FP /* Disable floating-point */ +#ifdef CONFIG_ALTIVEC +BEGIN_FTR_SECTION + oris r6,r6,MSR_VEC@h /* Disable altivec */ +END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) +#endif /* CONFIG_ALTIVEC */ andc r22,r22,r6 mtmsrd r22 isync @@ -385,6 +391,12 @@ andi. r0,r0,MSR_PR beq+ 1f ld r4,PACACURRENT(r13) +#ifdef CONFIG_ALTIVEC +BEGIN_FTR_SECTION + ld r0,THREAD+THREAD_VRSAVE(r4) + mtspr SPRN_VRSAVE,r0 /* if GPUL, restore VRSAVE reg */ +END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) +#endif /* CONFIG_ALTIVEC */ addi r0,r1,INT_FRAME_SIZE /* size of frame */ std r0,THREAD+KSP(r4) /* save kernel stack pointer */ std r1,PACAKSAVE(r13) /* save exception stack pointer */ diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/head.S linux-2.4.23-bk23/arch/ppc64/kernel/head.S --- linux-2.4.23-bk22/arch/ppc64/kernel/head.S 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/head.S 2004-01-04 02:50:36.000000000 -0800 @@ -14,6 +14,10 @@ * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com * + * VMX/Altivec port from ppc32 (C) IBM 2003 + * Denis Joseph Barrow (dj@de.ibm.com,barrow_dj@yahoo.com) + * additional debugging & 2.4-2.5 VMX port + * Ben Herrenschmidt (benh@kernel.crashing.org) * This file contains the low-level support and setup for the * PowerPC-64 platform, including trap and interrupt dispatch. * @@ -376,8 +380,17 @@ STD_EXCEPTION_PSERIES( 0xc00, SystemCall ) STD_EXCEPTION_PSERIES( 0xd00, SingleStep ) STD_EXCEPTION_PSERIES( 0xe00, Trap_0e ) - STD_EXCEPTION_PSERIES( 0xf00, PerformanceMonitor ) + . = 0xf00 + b PerformanceMonitor_Pseries + STD_EXCEPTION_PSERIES( 0xf20, AltiVecUnavailable ) + . = 0xf90 + .globl PerformanceMonitor_Pseries +PerformanceMonitor_Pseries: + EXCEPTION_PROLOG_PSERIES( 0xf00, PerformanceMonitor_common ) STD_EXCEPTION_PSERIES( 0x1300, InstructionBreakpoint ) + STD_EXCEPTION_PSERIES( 0x1700, AltiVecAssist ) + STD_EXCEPTION_PSERIES( 0x1800, ThermalInterrupt) + /* Space for the naca. Architected to be located at real address * 0x4000. Various tools rely on this location being fixed. @@ -564,6 +577,47 @@ STD_EXCEPTION_COMMON( 0xb00, Trap_0b, .UnknownException ) STD_EXCEPTION_COMMON( 0xd00, SingleStep, .SingleStepException ) STD_EXCEPTION_COMMON( 0xe00, Trap_0e, .UnknownException ) + + .globl AltiVecUnavailable_common +AltiVecUnavailable_common: + EXCEPTION_PROLOG_COMMON +#ifdef CONFIG_ALTIVEC + bne .load_up_altivec /* if from user, just load it up */ +#endif + addi r3,r1,STACK_FRAME_OVERHEAD + DO_COPY_EE() + li r6,0xf20 + bl .save_remaining_regs +#ifndef CONFIG_ALTIVEC + beq 1f + bl .IllegalAltiVecInstruction + b .ret_from_except +1: +#endif + bl .KernelAltiVecUnavailableException + BUG_OPCODE + + .global AltiVecAssist_common +AltiVecAssist_common: + EXCEPTION_PROLOG_COMMON + addi r3,r1,STACK_FRAME_OVERHEAD + DO_COPY_EE() + li r6,0x1700 + bl .save_remaining_regs + bl .AltiVecAssistException + b .ret_from_except + + .global ThermalInterrupt_common +ThermalInterrupt_common: + EXCEPTION_PROLOG_COMMON + addi r3,r1,STACK_FRAME_OVERHEAD + DO_COPY_EE() + li r6,0x1800 + bl .save_remaining_regs + bl .ThermalInterrupt + BUG_OPCODE + + STD_EXCEPTION_COMMON(0x1300, InstructionBreakpoint, .InstructionBreakpointException ) /* @@ -1324,6 +1378,12 @@ addi r24,r1,STACK_FRAME_OVERHEAD ld r22,PACACURRENT(r13) std r24,THREAD+PT_REGS(r22) +#ifdef CONFIG_ALTIVEC +BEGIN_FTR_SECTION + mfspr r24,SPRN_VRSAVE /* if save vrsave register value */ + std r24,THREAD+THREAD_VRSAVE(r22) +END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) +#endif /* CONFIG_ALTIVEC */ 2: SET_REG_TO_CONST(r22, MSR_KERNEL) @@ -1694,6 +1754,100 @@ #endif /* CONFIG_SMP */ blr +#ifdef CONFIG_ALTIVEC +/* + * load_up_altivec(unused, unused, tsk) + * Disable Altivec for the task which used altivec upreviously, + * and save its altivec registers in its thread_struct. + * Enables Altivec for use in the kernel on return. + * On SMP we know the fpu is free, since we give it up every + * switch (ie, no lazy save of the altivec registers). + * On entry: r13 == 'current' && last_task_used_altivec != 'current' + */ +_STATIC(load_up_altivec) +/* + * Disable AltiVec for the task which had AltiVec previously, + * and save its AltiVec registers in its thread_struct. + * Enables AltiVec for use in the kernel on return. + * On SMP we know the AltiVec units are free, since we give it up every + * switch. -- Kumar + */ + mfmsr r5 + oris r5,r5,MSR_VEC@h + mtmsrd r5 /* enable use of AltiVec now */ + isync +/* + * For SMP, we don't do lazy AltiVec switching because it just gets too + * horrendously complex, especially when a task switches from one CPU + * to another. Instead we call giveup_altivec in switch_to. + */ +#ifndef CONFIG_SMP + LOADBASE(r3,last_task_used_altivec) + ld r4,last_task_used_altivec@l(r3) + cmpi 0,r4,0 + beq 1f + addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */ + SAVE_32VR(0,r20,r4) + MFVSCR(vr0) + li r20,THREAD_VSCR + STVX(vr0,r20,r4) + ld r5,PT_REGS(r4) + ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) + lis r20,MSR_VEC@h + andc r4,r4,r20 /* disable altivec for previous task */ + std r4,_MSR-STACK_FRAME_OVERHEAD(r5) +1: +#endif /* CONFIG_SMP */ + /* enable use of AltiVec after return */ + ld r4,PACACURRENT(r13) + addi r5,r4,THREAD + oris r23,r23,MSR_VEC@h + li r20,THREAD_VSCR + LVX(vr0,r20,r5) + MTVSCR(vr0) + REST_32VR(0,r20,r5) +#ifndef CONFIG_SMP + /* Update last_task_used_altivec to 'current' */ + std r4,last_task_used_altivec@l(r3) +#endif /* CONFIG_SMP */ + /* restore registers and return */ + b fast_exception_return +/* + * giveup_altivec(tsk) + * Disable AltiVec for the task given as the argument, + * and save the AltiVec registers in its thread_struct. + * Enables AltiVec for use in the kernel on return. + */ +_GLOBAL(giveup_altivec) + mfmsr r5 + oris r5,r5,MSR_VEC@h + mtmsrd r5 /* enable use of AltiVec now */ + isync + cmpi 0,r3,0 + beqlr- /* if no previous owner, done */ + addi r3,r3,THREAD /* want THREAD of task */ + ld r5,PT_REGS(r3) + cmpi 0,r5,0 + SAVE_32VR(0, r4, r3) + MFVSCR(vr0) + li r4,THREAD_VSCR + STVX(vr0, r4, r3) + beq 1f + ld r4,_MSR-STACK_FRAME_OVERHEAD(r5) + lis r3,MSR_VEC@h + andc r4,r4,r3 /* disable AltiVec for previous task */ + std r4,_MSR-STACK_FRAME_OVERHEAD(r5) +1: +#ifndef CONFIG_SMP + li r5,0 + LOADBASE(r4,last_task_used_altivec) + std r5,last_task_used_altivec@l(r4) +#endif /* CONFIG_SMP */ + blr +#endif /* CONFIG_ALTIVEC */ + + + #ifdef CONFIG_SMP /* * This function is called after the master CPU has released the @@ -1782,7 +1936,6 @@ mtspr SRR0,r3 mtspr SRR1,r4 rfid -#endif /* CONFIG_SMP */ /* * Running with relocation on at this point. All we want to do is @@ -1792,6 +1945,7 @@ li r3,0 std r3,0(r1) /* Zero the stack frame pointer */ bl .start_secondary +#endif /* CONFIG_SMP */ /* * This subroutine clobbers r11, r12 and the LR diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/misc.S linux-2.4.23-bk23/arch/ppc64/kernel/misc.S --- linux-2.4.23-bk22/arch/ppc64/kernel/misc.S 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/misc.S 2004-01-04 02:50:36.000000000 -0800 @@ -505,6 +505,9 @@ * r3 = data offset (not changed) */ _GLOBAL(do_cpu_ftr_fixups) +/* Dummy feature section to make sure section exists */ +BEGIN_FTR_SECTION +END_FTR_SECTION(0,0) /* Get CPU 0 features */ LOADADDR(r6,cur_cpu_spec) sub r6,r6,r3 diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/mk_defs.c linux-2.4.23-bk23/arch/ppc64/kernel/mk_defs.c --- linux-2.4.23-bk22/arch/ppc64/kernel/mk_defs.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/mk_defs.c 2004-01-04 02:50:36.000000000 -0800 @@ -133,6 +133,11 @@ DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr)); +#ifdef CONFIG_ALTIVEC + DEFINE(THREAD_VR0, offsetof(struct thread_struct, vr[0])); + DEFINE(THREAD_VRSAVE, offsetof(struct thread_struct, vrsave)); + DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr)); +#endif /* CONFIG_ALTIVEC */ DEFINE(THREAD_FLAGS, offsetof(struct thread_struct, flags)); DEFINE(PPC_FLAG_32BIT, PPC_FLAG_32BIT); /* @@ -196,5 +201,12 @@ DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); + /* About the CPU features table */ + DEFINE(CPU_SPEC_ENTRY_SIZE, sizeof(struct cpu_spec)); + DEFINE(CPU_SPEC_PVR_MASK, offsetof(struct cpu_spec, pvr_mask)); + DEFINE(CPU_SPEC_PVR_VALUE, offsetof(struct cpu_spec, pvr_value)); + DEFINE(CPU_SPEC_FEATURES, offsetof(struct cpu_spec, cpu_features)); + DEFINE(CPU_SPEC_SETUP, offsetof(struct cpu_spec, cpu_setup)); + return 0; } diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/pSeries_lpar.c linux-2.4.23-bk23/arch/ppc64/kernel/pSeries_lpar.c --- linux-2.4.23-bk22/arch/ppc64/kernel/pSeries_lpar.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/pSeries_lpar.c 2004-01-04 02:50:36.000000000 -0800 @@ -60,6 +60,17 @@ return(0); } +void vpa_init(int cpu) +{ + unsigned long flags; + + /* Register the Virtual Processor Area (VPA) */ + printk(KERN_INFO "register_vpa: cpu 0x%x\n", cpu); + flags = 1UL << (63 - 18); + paca[cpu].xLpPaca.xSLBCount = 64; /* SLB restore highwater mark */ + register_vpa(flags, cpu, __pa((unsigned long)&(paca[cpu].xLpPaca))); +} + long plpar_tce_get(unsigned long liobn, unsigned long ioba, unsigned long *tce_ret) diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/ppc_asm.h linux-2.4.23-bk23/arch/ppc64/kernel/ppc_asm.h --- linux-2.4.23-bk22/arch/ppc64/kernel/ppc_asm.h 2002-08-02 17:39:43.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/ppc_asm.h 2004-01-04 02:50:36.000000000 -0800 @@ -44,6 +44,31 @@ #define REST_16FPRS(n, base) REST_8FPRS(n, base); REST_8FPRS(n+8, base) #define REST_32FPRS(n, base) REST_16FPRS(n, base); REST_16FPRS(n+16, base) +/* + * Once a version of gas that understands the AltiVec instructions + * is freely available, we can do this the normal way... - paulus + */ +#define LVX(r,a,b) .long (31<<26)+((r)<<21)+((a)<<16)+((b)<<11)+(103<<1) +#define STVX(r,a,b) .long (31<<26)+((r)<<21)+((a)<<16)+((b)<<11)+(231<<1) +#define MFVSCR(r) .long (4<<26)+((r)<<21)+(770<<1) +#define MTVSCR(r) .long (4<<26)+((r)<<11)+(802<<1) +#define DSSALL .long (0x1f<<26)+(0x10<<21)+(0x336<<1) + + +#define SAVE_VR(n,b,base) li b,THREAD_VR0+(16*(n)); STVX(n,b,base) +#define SAVE_2VR(n,b,base) SAVE_VR(n,b,base); SAVE_VR(n+1,b,base) +#define SAVE_4VR(n,b,base) SAVE_2VR(n,b,base); SAVE_2VR(n+2,b,base) +#define SAVE_8VR(n,b,base) SAVE_4VR(n,b,base); SAVE_4VR(n+4,b,base) +#define SAVE_16VR(n,b,base) SAVE_8VR(n,b,base); SAVE_8VR(n+8,b,base) +#define SAVE_32VR(n,b,base) SAVE_16VR(n,b,base); SAVE_16VR(n+16,b,base) +#define REST_VR(n,b,base) li b,THREAD_VR0+(16*(n)); LVX(n,b,base) +#define REST_2VR(n,b,base) REST_VR(n,b,base); REST_VR(n+1,b,base) +#define REST_4VR(n,b,base) REST_2VR(n,b,base); REST_2VR(n+2,b,base) +#define REST_8VR(n,b,base) REST_4VR(n,b,base); REST_4VR(n+4,b,base) +#define REST_16VR(n,b,base) REST_8VR(n,b,base); REST_8VR(n+8,b,base) +#define REST_32VR(n,b,base) REST_16VR(n,b,base); REST_16VR(n+16,b,base) + + #define CHECKANYINT(ra,rb) \ mfspr rb,SPRG3; /* Get Paca address */\ ld ra,PACALPPACA+LPPACAANYINT(rb); /* Get pending interrupt flags */\ diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/ppc_ksyms.c linux-2.4.23-bk23/arch/ppc64/kernel/ppc_ksyms.c --- linux-2.4.23-bk22/arch/ppc64/kernel/ppc_ksyms.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/ppc_ksyms.c 2004-01-04 02:50:36.000000000 -0800 @@ -232,6 +232,12 @@ EXPORT_SYMBOL(flush_icache_user_range); EXPORT_SYMBOL(flush_icache_page); EXPORT_SYMBOL(flush_dcache_page); +#ifdef CONFIG_ALTIVEC +#ifndef CONFIG_SMP +EXPORT_SYMBOL(last_task_used_altivec); +#endif /* CONFIG_SMP */ +EXPORT_SYMBOL(giveup_altivec); +#endif /* CONFIG_ALTIVEC */ #ifdef CONFIG_SMP EXPORT_SYMBOL(__global_cli); EXPORT_SYMBOL(__global_sti); diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/process.c linux-2.4.23-bk23/arch/ppc64/kernel/process.c --- linux-2.4.23-bk22/arch/ppc64/kernel/process.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/process.c 2004-01-04 02:50:36.000000000 -0800 @@ -10,6 +10,9 @@ * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * + * VMX/Altivec port from ppc32 (c) IBM 2003 + * Denis Joseph Barrow (dj@de.ibm.com,barrow_dj@yahoo.com) + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version @@ -46,7 +49,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs); +#ifndef CONFIG_SMP struct task_struct *last_task_used_math = NULL; +struct task_struct *last_task_used_altivec = NULL; +#endif /* CONFIG_SMP */ static struct fs_struct init_fs = INIT_FS; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; @@ -93,6 +99,32 @@ return 1; } +#ifdef CONFIG_ALTIVEC +int +dump_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs) +{ + if (regs->msr & MSR_VEC) + giveup_altivec(current); + memcpy(vrregs, ¤t->thread.vr[0], sizeof(*vrregs)); + return 1; +} + + +void +enable_kernel_altivec(void) +{ +#ifdef CONFIG_SMP + if (current->thread.regs && (current->thread.regs->msr & MSR_VEC)) + giveup_altivec(current); + else + giveup_altivec(NULL); /* just enable AltiVec for kernel - force */ +#else + giveup_altivec(last_task_used_altivec); +#endif /* __SMP __ */ +} +#endif /* CONFIG_ALTIVEC */ + + void _switch_to(struct task_struct *prev, struct task_struct *new, struct task_struct **last) @@ -121,7 +153,21 @@ */ if ( prev->thread.regs && (prev->thread.regs->msr & MSR_FP) ) giveup_fpu(prev); - +#ifdef CONFIG_ALTIVEC + /* + * If the previous thread used altivec in the last quantum + * (thus changing altivec regs) then save them. + * We used to check the VRSAVE register but not all apps + * set it, so we don't rely on it now (and in fact we need + * to save & restore VSCR even if VRSAVE == 0). -- paulus + * + * On SMP we always save/restore altivec regs just to avoid the + * complexity of changing processors. + * -- Cort + */ + if ((prev->thread.regs && (prev->thread.regs->msr & MSR_VEC))) + giveup_altivec(prev); +#endif /* CONFIG_ALTIVEC */ /* prev->last_processor = prev->processor; */ current_set[smp_processor_id()].task = new; #endif /* CONFIG_SMP */ @@ -145,8 +191,11 @@ printk("TASK = %p[%d] '%s' ", current, current->pid, current->comm); printk("Last syscall: %ld ", current->thread.last_syscall); - printk("\nlast math %p ", last_task_used_math); - +#ifndef CONFIG_SMP + printk("\nlast math %p last altivec %p", last_task_used_math, + last_task_used_altivec); +#endif + #ifdef CONFIG_SMP /* printk(" CPU: %d last CPU: %d", current->processor,current->last_processor); */ #endif /* CONFIG_SMP */ @@ -173,14 +222,22 @@ void exit_thread(void) { +#ifndef CONFIG_SMP if (last_task_used_math == current) last_task_used_math = NULL; + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; +#endif } void flush_thread(void) { +#ifndef CONFIG_SMP if (last_task_used_math == current) last_task_used_math = NULL; + if (last_task_used_altivec == current) + last_task_used_altivec = NULL; +#endif } void @@ -244,6 +301,18 @@ p->thread.fpscr = current->thread.fpscr; p->thread.fpexc_mode = current->thread.fpexc_mode; +#ifdef CONFIG_ALTIVEC + /* + * copy altiVec info - assume lazy altiVec switch + * - kumar + */ + if (regs->msr & MSR_VEC) + giveup_altivec(current); + memcpy(&p->thread.vr, ¤t->thread.vr, sizeof(p->thread.vr)); + p->thread.vscr = current->thread.vscr; + childregs->msr &= ~MSR_VEC; +#endif /* CONFIG_ALTIVEC */ + return 0; } @@ -275,9 +344,19 @@ regs->gpr[1] = sp; regs->gpr[2] = toc; regs->msr = MSR_USER64; +#ifndef CONFIG_SMP if (last_task_used_math == current) last_task_used_math = 0; + if (last_task_used_altivec == current) + last_task_used_altivec = 0; +#endif /* CONFIG_SMP */ + memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); current->thread.fpscr = 0; +#ifdef CONFIG_ALTIVEC + memset(¤t->thread.vr[0], 0,offsetof(struct thread_struct,vrsave[2])- + offsetof(struct thread_struct,vr[0])); + current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */ +#endif /* CONFIG_ALTIVEC */ } # define PR_FP_EXC_DISABLED 0 /* FP exceptions disabled */ @@ -337,7 +416,10 @@ goto out; if (regs->msr & MSR_FP) giveup_fpu(current); - +#ifdef CONFIG_ALTIVEC + if (regs->msr & MSR_VEC) + giveup_altivec(current); +#endif /* CONFIG_ALTIVEC */ error = do_execve(filename, (char **) a1, (char **) a2, regs); if (error == 0) diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/prom.c linux-2.4.23-bk23/arch/ppc64/kernel/prom.c --- linux-2.4.23-bk22/arch/ppc64/kernel/prom.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/prom.c 2004-01-04 02:50:36.000000000 -0800 @@ -1909,6 +1909,23 @@ *prev_propp = PTRUNRELOC(pp); prev_propp = &pp->next; } + + /* Add a "linux_phandle" value */ + if (np->node != NULL) { + u32 ibm_phandle = 0; + int len; + + /* First see if "ibm,phandle" exists and use its value */ + len = (int) call_prom(RELOC("getprop"), 4, 1, node, + RELOC("ibm,phandle"), + &ibm_phandle, sizeof(ibm_phandle)); + if (len < 0) { + np->linux_phandle = np->node; + } else { + np->linux_phandle = ibm_phandle; + } + } + *prev_propp = 0; /* get the node's full name */ @@ -2408,7 +2425,7 @@ struct device_node *np; for (np = allnodes; np != 0; np = np->allnext) - if (np->node == ph) + if (np->linux_phandle == ph) return np; return NULL; } @@ -2499,7 +2516,7 @@ void __init -abort() +abort(void) { #ifdef CONFIG_XMON xmon(NULL); diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/ptrace.c linux-2.4.23-bk23/arch/ppc64/kernel/ptrace.c --- linux-2.4.23-bk22/arch/ppc64/kernel/ptrace.c 2003-06-13 07:51:32.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/ptrace.c 2004-01-04 02:50:36.000000000 -0800 @@ -67,6 +67,28 @@ return -EIO; } +#ifdef CONFIG_ALTIVEC +/* + * Get contents of AltiVec register state in task TASK + */ +static inline int get_vrregs(unsigned long data, struct task_struct *task) +{ + return (copy_to_user((void *)data,&task->thread.vr[0], + offsetof(struct thread_struct,vrsave[2])- + offsetof(struct thread_struct,vr[0])) ? -EFAULT : 0 ); +} + +/* + * Write contents of AltiVec register state into task TASK. + */ +static inline int set_vrregs(struct task_struct *task, unsigned long data) +{ + return (copy_from_user(&task->thread.vr[0],(void *)data, + offsetof(struct thread_struct,vrsave[2])- + offsetof(struct thread_struct,vr[0])) ? -EFAULT : 0 ); +} +#endif + static inline void set_single_step(struct task_struct *task) { @@ -316,6 +338,23 @@ } break; } +#ifdef CONFIG_ALTIVEC + case PTRACE_GETVRREGS: + /* Get the child altivec register state. */ + if (child->thread.regs->msr & MSR_VEC) + giveup_altivec(child); + ret = get_vrregs(data, child); + break; + + case PTRACE_SETVRREGS: + /* Set the child altivec register state. */ + /* this is to clear the MSR_VEC bit to force a reload + * of register state from memory */ + if (child->thread.regs->msr & MSR_VEC) + giveup_altivec(child); + ret = set_vrregs(child,data); + break; +#endif default: ret = -EIO; diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/ptrace32.c linux-2.4.23-bk23/arch/ppc64/kernel/ptrace32.c --- linux-2.4.23-bk22/arch/ppc64/kernel/ptrace32.c 2003-06-13 07:51:32.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/ptrace32.c 2004-01-04 02:50:36.000000000 -0800 @@ -31,6 +31,40 @@ #include #include +#ifdef CONFIG_ALTIVEC +/* + * Get contents of AltiVec register state in task TASK + */ +static inline int get_vrregs32(unsigned long data, struct task_struct *task) +{ + if(copy_to_user((void *)data,&task->thread.vr[0], + offsetof(struct thread_struct,vrsave)- + offsetof(struct thread_struct,vr[0]))) + return -EFAULT; + data+=offsetof(struct thread_struct,vrsave[1])- + offsetof(struct thread_struct,vr[0]); + if (put_user(task->thread.vrsave[1],((u32 *)data))) + return -EFAULT; + return 0; +} + +/* + * Write contents of AltiVec register state into task TASK. + */ +static inline int set_vrregs32(struct task_struct *task, unsigned long data) +{ + if(copy_from_user(&task->thread.vr[0],(void *)data, + offsetof(struct thread_struct,vrsave)- + offsetof(struct thread_struct,vr[0]))) + return -EFAULT; + data+=offsetof(struct thread_struct,vrsave[1])- + offsetof(struct thread_struct,vr[0]); + if (get_user(task->thread.vrsave[1],((u32 *)data))) + return -EFAULT; + return 0; +} +#endif + /* * Set of msr bits that gdb can change on behalf of a process. */ @@ -463,6 +497,23 @@ +#ifdef CONFIG_ALTIVEC + case PTRACE_GETVRREGS: + /* Get the child altivec register state. */ + if (child->thread.regs->msr & MSR_VEC) + giveup_altivec(child); + ret = get_vrregs32((unsigned long)data, child); + break; + + case PTRACE_SETVRREGS: + /* Set the child altivec register state. */ + /* this is to clear the MSR_VEC bit to force a reload + * of register state from memory */ + if (child->thread.regs->msr & MSR_VEC) + giveup_altivec(child); + ret = set_vrregs32(child,(unsigned long)data); + break; +#endif default: ret = -EIO; break; diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/setup.c linux-2.4.23-bk23/arch/ppc64/kernel/setup.c --- linux-2.4.23-bk22/arch/ppc64/kernel/setup.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/setup.c 2004-01-04 02:50:36.000000000 -0800 @@ -63,7 +63,6 @@ extern void pSeriesLP_init_early(void); extern void mm_init_ppc64( void ); extern void pseries_secondary_smp_init(unsigned long); -extern void vpa_init(int cpu); unsigned long decr_overclock = 1; unsigned long decr_overclock_proc0 = 1; diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/smp.c linux-2.4.23-bk23/arch/ppc64/kernel/smp.c --- linux-2.4.23-bk22/arch/ppc64/kernel/smp.c 2004-01-04 02:50:29.000000000 -0800 +++ linux-2.4.23-bk23/arch/ppc64/kernel/smp.c 2004-01-04 02:50:36.000000000 -0800 @@ -297,17 +297,6 @@ } } -void vpa_init(int cpu) -{ - unsigned long flags; - - /* Register the Virtual Processor Area (VPA) */ - printk(KERN_INFO "register_vpa: cpu 0x%x\n", cpu); - flags = 1UL << (63 - 18); - paca[cpu].xLpPaca.xSLBCount = 64; /* SLB restore highwater mark */ - register_vpa(flags, cpu, __pa((unsigned long)&(paca[cpu].xLpPaca))); -} - static void smp_chrp_setup_cpu(int cpu_nr) { diff -urN linux-2.4.23-bk22/arch/ppc64/kernel/traps.c linux-2.4.23-bk23/arch/ppc64/kernel/traps.c --- linux-2.4.23-bk22/arch/ppc64/kernel/traps.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/ppc64/kernel/traps.c 2004-01-04 02:50:36.000000000 -0800 @@ -279,6 +279,19 @@ _exception(SIGFPE, info, regs); } +#ifndef CONFIG_ALTIVEC +void IllegalAltiVecInstruction(struct pt_regs *regs) +{ + siginfo_t info; + + info.si_signo = SIGILL; + info.si_errno = 0; + info.si_code = ILL_ILLTRP; + info.si_addr = (void *)regs->nip; + _exception(SIGILL, &info, regs); +} +#endif + void ProgramCheckException(struct pt_regs *regs) { @@ -327,6 +340,47 @@ panic("Unrecoverable FP Unavailable Exception in Kernel"); } + +void +KernelAltiVecUnavailableException(struct pt_regs *regs) +{ + printk("Illegal Altivec used in kernel (task=0x%016lx, pc=0x%016lx, trap=0x%08x)\n", + (unsigned long)current, regs->nip, (unsigned int)regs->trap); + panic("Unrecoverable Altivec Unavailable Exception in Kernel"); +} + +void +AltiVecAssistException(struct pt_regs *regs) +{ +#ifdef CONFIG_ALTIVEC + printk("Altivec assist called by %s, switching java mode off\n", + current->comm); + /* We do this the "hard" way, but that's ok for now, maybe one + * day, we'll have a proper implementation... + */ + if (regs->msr & MSR_VEC) + giveup_altivec(current); + current->thread.vscr.u[3] |= 0x00010000; +#else + siginfo_t info; + + printk("Altivec assist called by %s;, no altivec support !\n", + current->comm); + + info.si_signo = SIGTRAP; + info.si_errno = 0; + info.si_code = 0; + info.si_addr = 0; + _exception(SIGTRAP, &info, regs); +#endif /* CONFIG_ALTIVEC */ +} + +void +ThermalInterrupt(struct pt_regs *regs) +{ + panic("Thermal interrupt exception not handled !"); +} + void SingleStepException(struct pt_regs *regs) { diff -urN linux-2.4.23-bk22/arch/s390/defconfig linux-2.4.23-bk23/arch/s390/defconfig --- linux-2.4.23-bk22/arch/s390/defconfig 2003-11-28 10:26:19.000000000 -0800 +++ linux-2.4.23-bk23/arch/s390/defconfig 2004-01-04 02:50:36.000000000 -0800 @@ -35,9 +35,11 @@ CONFIG_FAST_IRQ=y CONFIG_MACHCHK_WARNING=y CONFIG_CHSC=y +CONFIG_QDIO=m +# CONFIG_QDIO_PERF_STATS is not set CONFIG_IPL=y -CONFIG_IPL_TAPE=y -# CONFIG_IPL_VM is not set +# CONFIG_IPL_TAPE is not set +CONFIG_IPL_VM=y CONFIG_NET=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -106,8 +108,8 @@ # # S/390 tape hardware support # -CONFIG_S390_TAPE_3490=m -CONFIG_S390_TAPE_3480=m +CONFIG_S390_TAPE_3490=y +CONFIG_S390_TAPE_3480=y # # Network device drivers @@ -119,6 +121,7 @@ # CONFIG_TUN is not set CONFIG_NET_ETHERNET=y CONFIG_TR=y +# CONFIG_C7000 is not set CONFIG_FDDI=y # @@ -169,6 +172,7 @@ CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m +# CONFIG_IP_NF_MATCH_RECENT is not set # CONFIG_IP_NF_MATCH_ECN is not set # CONFIG_IP_NF_MATCH_DSCP is not set CONFIG_IP_NF_MATCH_AH_ESP=m @@ -201,8 +205,14 @@ CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m +# CONFIG_IP_NF_ARP_MANGLE is not set # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set CONFIG_IPV6=m # @@ -227,8 +237,13 @@ CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m -CONFIG_SHARED_IPV6_CARDS=y # CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=m +# CONFIG_IP_SCTP is not set # CONFIG_ATM is not set CONFIG_VLAN_8021Q=m @@ -267,6 +282,7 @@ # File systems # # CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_REISERFS_FS is not set @@ -276,6 +292,7 @@ # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set @@ -317,6 +334,11 @@ # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set # CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_FS is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set # # Network File Systems @@ -325,6 +347,7 @@ # CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y CONFIG_NFS_V3=y +# CONFIG_NFS_DIRECTIO is not set # CONFIG_ROOT_NFS is not set CONFIG_NFSD=y CONFIG_NFSD_V3=y @@ -414,9 +437,17 @@ # Kernel hacking # CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=0 + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set # # Library routines # +# CONFIG_CRC32 is not set # CONFIG_ZLIB_INFLATE is not set # CONFIG_ZLIB_DEFLATE is not set +# CONFIG_FW_LOADER is not set diff -urN linux-2.4.23-bk22/arch/s390/kernel/process.c linux-2.4.23-bk23/arch/s390/kernel/process.c --- linux-2.4.23-bk22/arch/s390/kernel/process.c 2003-06-13 07:51:32.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390/kernel/process.c 2004-01-04 02:50:36.000000000 -0800 @@ -60,7 +60,9 @@ current->nice = 20; current->counter = -100; while (1) { + __cli(); if (current->need_resched) { + __sti(); schedule(); check_pgt_cache(); continue; diff -urN linux-2.4.23-bk22/arch/s390/kernel/s390_ksyms.c linux-2.4.23-bk23/arch/s390/kernel/s390_ksyms.c --- linux-2.4.23-bk22/arch/s390/kernel/s390_ksyms.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390/kernel/s390_ksyms.c 2004-01-04 02:50:36.000000000 -0800 @@ -23,6 +23,7 @@ EXPORT_SYMBOL_NOVERS(__copy_from_user_asm); EXPORT_SYMBOL_NOVERS(__copy_to_user_asm); EXPORT_SYMBOL_NOVERS(__clear_user_asm); +EXPORT_SYMBOL(diag10); /* * semaphore ops diff -urN linux-2.4.23-bk22/arch/s390/mm/init.c linux-2.4.23-bk23/arch/s390/mm/init.c --- linux-2.4.23-bk22/arch/s390/mm/init.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390/mm/init.c 2004-01-04 02:50:36.000000000 -0800 @@ -67,6 +67,11 @@ return freed; } +void diag10(unsigned long addr) +{ + asm volatile ("diag %0,%0,0x10" : : "a" (addr)); +} + void show_mem(void) { int i, total = 0, reserved = 0; diff -urN linux-2.4.23-bk22/arch/s390x/defconfig linux-2.4.23-bk23/arch/s390x/defconfig --- linux-2.4.23-bk22/arch/s390x/defconfig 2003-11-28 10:26:19.000000000 -0800 +++ linux-2.4.23-bk23/arch/s390x/defconfig 2004-01-04 02:50:36.000000000 -0800 @@ -19,9 +19,9 @@ # Processor type and features # CONFIG_SMP=y +CONFIG_NR_CPUS=32 CONFIG_S390_SUPPORT=y CONFIG_BINFMT_ELF32=y -CONFIG_NR_CPUS=32 # # Loadable module support @@ -36,9 +36,11 @@ CONFIG_FAST_IRQ=y CONFIG_MACHCHK_WARNING=y CONFIG_CHSC=y +CONFIG_QDIO=m +# CONFIG_QDIO_PERF_STATS is not set CONFIG_IPL=y -CONFIG_IPL_TAPE=y -# CONFIG_IPL_VM is not set +# CONFIG_IPL_TAPE is not set +CONFIG_IPL_VM=y CONFIG_NET=y CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set @@ -106,8 +108,8 @@ # # S/390 tape hardware support # -CONFIG_S390_TAPE_3490=m -CONFIG_S390_TAPE_3480=m +CONFIG_S390_TAPE_3490=y +CONFIG_S390_TAPE_3480=y # # Network device drivers @@ -119,6 +121,7 @@ # CONFIG_TUN is not set CONFIG_NET_ETHERNET=y CONFIG_TR=y +# CONFIG_C7000 is not set CONFIG_FDDI=y # @@ -162,6 +165,11 @@ # CONFIG_IP_NF_ARPTABLES is not set # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set + +# +# IP: Virtual Server Configuration +# +# CONFIG_IP_VS is not set CONFIG_IPV6=m # @@ -169,8 +177,13 @@ # # CONFIG_IP6_NF_QUEUE is not set # CONFIG_IP6_NF_IPTABLES is not set -CONFIG_SHARED_IPV6_CARDS=y # CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=m +# CONFIG_IP_SCTP is not set # CONFIG_ATM is not set CONFIG_VLAN_8021Q=m @@ -209,6 +222,7 @@ # File systems # # CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_REISERFS_FS is not set @@ -218,6 +232,7 @@ # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set @@ -259,6 +274,11 @@ # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set # CONFIG_UFS_FS_WRITE is not set +# CONFIG_XFS_FS is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set # # Network File Systems @@ -267,6 +287,7 @@ # CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y CONFIG_NFS_V3=y +# CONFIG_NFS_DIRECTIO is not set # CONFIG_ROOT_NFS is not set CONFIG_NFSD=y CONFIG_NFSD_V3=y @@ -358,9 +379,17 @@ # Kernel hacking # CONFIG_MAGIC_SYSRQ=y +CONFIG_LOG_BUF_SHIFT=0 + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set # # Library routines # +# CONFIG_CRC32 is not set # CONFIG_ZLIB_INFLATE is not set # CONFIG_ZLIB_DEFLATE is not set +# CONFIG_FW_LOADER is not set diff -urN linux-2.4.23-bk22/arch/s390x/kernel/head.S linux-2.4.23-bk23/arch/s390x/kernel/head.S --- linux-2.4.23-bk22/arch/s390x/kernel/head.S 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390x/kernel/head.S 2004-01-04 02:50:36.000000000 -0800 @@ -553,6 +553,10 @@ bne 1f-.LPG1(%r13) oi 7(%r12),4 # set P/390 flag 1: + chi %r0,0x2084 # new stidp format? + bne 2f-.LPG1(%r13) + oi 7(%r12),64 # set new stidp flag +2: # # find out if we have the MVPG instruction diff -urN linux-2.4.23-bk22/arch/s390x/kernel/linux32.c linux-2.4.23-bk23/arch/s390x/kernel/linux32.c --- linux-2.4.23-bk22/arch/s390x/kernel/linux32.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390x/kernel/linux32.c 2004-01-04 02:50:36.000000000 -0800 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1873,7 +1874,11 @@ u32 totalswap; u32 freeswap; unsigned short procs; - char _f[22]; + unsigned short pad; + u32 totalhigh; + u32 freehigh; + unsigned int mem_unit; + char _f[8]; }; extern asmlinkage int sys_sysinfo(struct sysinfo *info); @@ -1898,6 +1903,9 @@ err |= __put_user (s.totalswap, &info->totalswap); err |= __put_user (s.freeswap, &info->freeswap); err |= __put_user (s.procs, &info->procs); + err |= __put_user (s.totalhigh, &info->totalhigh); + err |= __put_user (s.freehigh, &info->freehigh); + err |= __put_user (s.mem_unit, &info->mem_unit); if (err) return -EFAULT; return ret; diff -urN linux-2.4.23-bk22/arch/s390x/kernel/process.c linux-2.4.23-bk23/arch/s390x/kernel/process.c --- linux-2.4.23-bk22/arch/s390x/kernel/process.c 2003-06-13 07:51:32.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390x/kernel/process.c 2004-01-04 02:50:36.000000000 -0800 @@ -60,7 +60,9 @@ current->nice = 20; current->counter = -100; while (1) { + __cli(); if (current->need_resched) { + __sti(); schedule(); check_pgt_cache(); continue; diff -urN linux-2.4.23-bk22/arch/s390x/kernel/s390_ksyms.c linux-2.4.23-bk23/arch/s390x/kernel/s390_ksyms.c --- linux-2.4.23-bk22/arch/s390x/kernel/s390_ksyms.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390x/kernel/s390_ksyms.c 2004-01-04 02:50:36.000000000 -0800 @@ -13,6 +13,7 @@ #include #include #include +#include #if CONFIG_IP_MULTICAST #include #endif @@ -26,6 +27,7 @@ EXPORT_SYMBOL_NOVERS(__copy_from_user_asm); EXPORT_SYMBOL_NOVERS(__copy_to_user_asm); EXPORT_SYMBOL_NOVERS(__clear_user_asm); +EXPORT_SYMBOL(diag10); /* * semaphore ops @@ -66,14 +68,9 @@ /* * Dynamically add/remove 31 bit ioctl conversion functions. */ -extern int register_ioctl32_conversion(unsigned int cmd, - int (*handler)(unsigned int, - unsigned int, - unsigned long, - struct file *)); -int unregister_ioctl32_conversion(unsigned int cmd); EXPORT_SYMBOL(register_ioctl32_conversion); EXPORT_SYMBOL(unregister_ioctl32_conversion); +EXPORT_SYMBOL(sys_ioctl); #endif /* diff -urN linux-2.4.23-bk22/arch/s390x/mm/init.c linux-2.4.23-bk23/arch/s390x/mm/init.c --- linux-2.4.23-bk22/arch/s390x/mm/init.c 2003-08-25 04:44:40.000000000 -0700 +++ linux-2.4.23-bk23/arch/s390x/mm/init.c 2004-01-04 02:50:36.000000000 -0800 @@ -170,6 +170,15 @@ return freed; } +void diag10(unsigned long addr) +{ + if (addr >= 0x80000000) + return; + asm volatile ("sam31\n\t" + "diag %0,%0,0x10\n\t" + "sam64" : : "a" (addr) ); +} + void show_mem(void) { int i, total = 0,reserved = 0; diff -urN linux-2.4.23-bk22/drivers/char/random.c linux-2.4.23-bk23/drivers/char/random.c --- linux-2.4.23-bk22/drivers/char/random.c 2003-08-25 04:44:41.000000000 -0700 +++ linux-2.4.23-bk23/drivers/char/random.c 2004-01-04 02:50:37.000000000 -0800 @@ -715,7 +715,9 @@ static struct timer_rand_state keyboard_timer_state; static struct timer_rand_state mouse_timer_state; static struct timer_rand_state extract_timer_state; +#ifndef CONFIG_ARCH_S390 static struct timer_rand_state *irq_timer_state[NR_IRQS]; +#endif static struct timer_rand_state *blkdev_timer_state[MAX_BLKDEV]; /* @@ -791,6 +793,7 @@ batch_entropy_store(num, time, entropy); } +#ifndef CONFIG_ARCH_S390 void add_keyboard_randomness(unsigned char scancode) { static unsigned char last_scancode; @@ -813,6 +816,7 @@ add_timer_randomness(irq_timer_state[irq], 0x100+irq); } +#endif void add_blkdev_randomness(int major) { @@ -1445,8 +1449,10 @@ #ifdef CONFIG_SYSCTL sysctl_init_random(random_state); #endif +#ifndef CONFIG_ARCH_S390 for (i = 0; i < NR_IRQS; i++) irq_timer_state[i] = NULL; +#endif for (i = 0; i < MAX_BLKDEV; i++) blkdev_timer_state[i] = NULL; memset(&keyboard_timer_state, 0, sizeof(struct timer_rand_state)); @@ -1455,6 +1461,7 @@ extract_timer_state.dont_count_entropy = 1; } +#ifndef CONFIG_ARCH_S390 void rand_initialize_irq(int irq) { struct timer_rand_state *state; @@ -1472,6 +1479,7 @@ irq_timer_state[irq] = state; } } +#endif void rand_initialize_blkdev(int major, int mode) { @@ -2304,9 +2312,11 @@ +#ifndef CONFIG_ARCH_S390 EXPORT_SYMBOL(add_keyboard_randomness); EXPORT_SYMBOL(add_mouse_randomness); EXPORT_SYMBOL(add_interrupt_randomness); +#endif EXPORT_SYMBOL(add_blkdev_randomness); EXPORT_SYMBOL(batch_entropy_store); EXPORT_SYMBOL(generate_random_uuid); diff -urN linux-2.4.23-bk22/drivers/s390/s390io.c linux-2.4.23-bk23/drivers/s390/s390io.c --- linux-2.4.23-bk22/drivers/s390/s390io.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.23-bk23/drivers/s390/s390io.c 2004-01-04 02:50:37.000000000 -0800 @@ -1,7 +1,7 @@ /* * drivers/s390/s390io.c * S/390 common I/O routines - * $Revision: 1.247 $ + * $Revision: 1.258 $ * * S390 version * Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH, @@ -766,6 +766,8 @@ return; } +void s390_free_irq (unsigned int irq, void *dev_id); + /* * Note : internal use of irqflags SA_PROBE for NOT path grouping * @@ -802,7 +804,11 @@ */ s390irq_spin_lock_irqsave (irq, flags); - if (!ioinfo[irq]->ui.flags.ready) { + if (ioinfo[irq]->ui.flags.unfriendly && + !(irqflags & SA_FORCE)) { + retval = -EUSERS; + + } else if (!ioinfo[irq]->ui.flags.ready) { retry = 5; ioinfo[irq]->irq_desc.handler = io_handler; @@ -836,12 +842,55 @@ s390irq_spin_unlock_irqrestore (irq, flags); if (retval == 0) { + if (irqflags & SA_DOPATHGROUP) { + ioinfo[irq]->ui.flags.pgid_supp = 1; + ioinfo[irq]->ui.flags.notacccap = 1; + } + if ((irqflags & SA_DOPATHGROUP) && + (!ioinfo[irq]->ui.flags.pgid || + irqflags & SA_PROBE)) { + pgid_t pgid; + int i, mask; + /* + * Do an initial SensePGID to find out if device + * is locked by someone else. + */ + memcpy(&pgid, global_pgid, sizeof(pgid_t)); + + retval = -EAGAIN; + for (i=0; i<8 && retval==-EAGAIN; i++) { + + mask = (0x80 >> i) & ioinfo[irq]->opm; + + if (!mask) + continue; + + retval = s390_SensePGID(irq, mask, &pgid); + + if (retval == -EOPNOTSUPP) + /* Doesn't prevent us from proceeding */ + retval = 0; + } + + } if (!(irqflags & SA_PROBE) && + (irqflags & SA_DOPATHGROUP) && (!ioinfo[irq]->ui.flags.unfriendly)) s390_DevicePathVerification (irq, 0); - ioinfo[irq]->ui.flags.newreq = 1; - ioinfo[irq]->nopfunc = not_oper_handler; + if (ioinfo[irq]->ui.flags.unfriendly && + !(irqflags & SA_FORCE)) { + /* + * We found out during path verification that the + * device is locked by someone else and we have to + * let the device driver know. + */ + retval = -EUSERS; + free_irq(irq, dev_id); + } else { + ioinfo[irq]->ui.flags.newreq = 1; + ioinfo[irq]->nopfunc = not_oper_handler; + } } if (cio_debug_initialized) @@ -981,61 +1030,6 @@ } /* - * Generic enable/disable code - */ -int -disable_irq (unsigned int irq) -{ - unsigned long flags; - int ret; - char dbf_txt[15]; - - SANITY_CHECK (irq); - - if (!ioinfo[irq]->ui.flags.ready) - return -ENODEV; - - sprintf (dbf_txt, "disirq%x", irq); - CIO_TRACE_EVENT (4, dbf_txt); - - s390irq_spin_lock_irqsave (irq, flags); - ret = disable_subchannel (irq); - s390irq_spin_unlock_irqrestore (irq, flags); - - synchronize_irq (); - - sprintf (dbf_txt, "ret:%d", ret); - CIO_TRACE_EVENT (4, dbf_txt); - - return (ret); -} - -int -enable_irq (unsigned int irq) -{ - unsigned long flags; - int ret; - char dbf_txt[15]; - - SANITY_CHECK (irq); - - if (!ioinfo[irq]->ui.flags.ready) - return -ENODEV; - - sprintf (dbf_txt, "enirq%x", irq); - CIO_TRACE_EVENT (4, dbf_txt); - - s390irq_spin_lock_irqsave (irq, flags); - ret = enable_subchannel (irq); - s390irq_spin_unlock_irqrestore (irq, flags); - - sprintf (dbf_txt, "ret:%d", ret); - CIO_TRACE_EVENT (4, dbf_txt); - - return (ret); -} - -/* * Enable IRQ by modifying the subchannel */ static int @@ -1442,8 +1436,6 @@ } - ioinfo[irq]->ulpm = ioinfo[irq]->orb.lpm; - /* * If synchronous I/O processing is requested, we have * to wait for the corresponding interrupt to occur by @@ -1782,35 +1774,6 @@ */ if (!ioinfo[irq]->ui.flags.busy) { /* last I/O completed ? */ ret = s390_start_IO (irq, cpa, user_intparm, lpm, flag); - if ((ret == -ETIMEDOUT) && (flag & DOIO_CANCEL_ON_TIMEOUT)) { - /* - * We should better cancel the io request here - * or we might not be able to do io on this sch - * again - */ - cancel_IO (irq); - } - - } else if (ioinfo[irq]->ui.flags.fast) { - /* - * If primary status was received and ending status is missing, - * the device driver won't be notified on the ending status - * if early (fast) interrupt notification was requested. - * Therefore we have to queue the next incoming request. If - * halt_IO() is issued while there is a request queued, a HSCH - * needs to be issued and the queued request must be deleted - * but its intparm must be returned (see halt_IO() processing) - */ - if (ioinfo[irq]->ui.flags.w4final - && !ioinfo[irq]->ui.flags.doio_q) { - ioinfo[irq]->qflag = flag; - ioinfo[irq]->qcpa = cpa; - ioinfo[irq]->qintparm = user_intparm; - ioinfo[irq]->qlpm = lpm; - } else { - ret = -EBUSY; - - } } else { ret = -EBUSY; @@ -3004,47 +2967,6 @@ */ dp->intparm = 0; - /* - * Was there anything queued ? Start the pending channel program - * if there is one. - */ - if (ioinfo[irq]->ui.flags.doio_q) { - int ret; - int do_cancel = - ioinfo[irq]-> - qflag & DOIO_CANCEL_ON_TIMEOUT; - - ret = s390_start_IO (irq, - ioinfo[irq]->qcpa, - ioinfo[irq]-> - qintparm, - ioinfo[irq]->qlpm, - ioinfo[irq]-> - qflag); - - ioinfo[irq]->ui.flags.doio_q = 0; - - /* - * If s390_start_IO() failed call the device's interrupt - * handler, the IRQ related devstat area was setup by - * s390_start_IO() accordingly already (status pending - * condition). - */ - if (ret) { - ioinfo[irq]->irq_desc. - handler (irq, udp, NULL); - - } - - /* - * better cancel the io when we time out... - */ - if ((ret == -ETIMEDOUT) && do_cancel) { - cancel_IO (irq); - } - - } - } else { ioinfo[irq]->ui.flags.w4final = 1; @@ -3098,32 +3020,19 @@ ioinfo[irq]->devstat.flag |= DEVSTAT_NOT_OPER; ioinfo[irq]->devstat.flag |= DEVSTAT_FINAL_STATUS; - /* - * When we find a device "not oper" we save the status - * information into the device status area and call the - * device specific interrupt handler. - * - * Note: currently we don't have any way to reenable - * the device unless an unsolicited interrupt - * is presented. We don't check for spurious - * interrupts on "not oper" conditions. - */ - - if ((ioinfo[irq]->ui.flags.fast) - && (ioinfo[irq]->ui.flags.w4final)) { - /* - * If a new request was queued already, we have - * to simulate the "not oper" status for the - * queued request by switching the "intparm" value - * and notify the interrupt handler. - */ - if (ioinfo[irq]->ui.flags.doio_q) { - ioinfo[irq]->devstat.intparm = - ioinfo[irq]->qintparm; - } - } + /* + * When we find a device "not oper" we save the status + * information into the device status area and call the + * device specific interrupt handler. + * + * Note: currently we don't have any way to reenable + * the device unless an unsolicited interrupt + * is presented. We don't check for spurious + * interrupts on "not oper" conditions. + */ + ioinfo[irq]->ui.flags.fast = 0; ioinfo[irq]->ui.flags.repall = 0; ioinfo[irq]->ui.flags.w4final = 0; @@ -3175,9 +3084,8 @@ * without having to delay I/O processing (by queueing) * for non-console devices. * - * Setting of this isc is done by set_cons_dev(), while - * reset_cons_dev() resets this isc and re-enables the - * default isc3 for this device. wait_cons_dev() allows + * Setting of this isc is done by set_cons_dev(). + * wait_cons_dev() allows * to actively wait on an interrupt for this device in * disabed state. When the interrupt condition is * encountered, wait_cons_dev(9 calls do_IRQ() to have @@ -3229,52 +3137,6 @@ } int -reset_cons_dev (int irq) -{ - int rc = 0; - int ccode; - char dbf_txt[15]; - - SANITY_CHECK (irq); - - if (cons_dev != -1) - return -EBUSY; - - sprintf (dbf_txt, "rcons%x", irq); - CIO_TRACE_EVENT (4, dbf_txt); - - /* - * reset the indicated console device to operate - * on default console interrupt sublass 3 - */ - ccode = stsch (irq, &(ioinfo[irq]->schib)); - - if (ccode) { - rc = -ENODEV; - ioinfo[irq]->devstat.flag |= DEVSTAT_NOT_OPER; - } else { - - ioinfo[irq]->schib.pmcw.isc = 3; - - ccode = msch (irq, &(ioinfo[irq]->schib)); - - if (ccode) { - rc = -EIO; - } else { - cons_dev = -1; - - /* - * disable special console I/O-interrupt sublass 7 - */ - ctl_clear_bit(6, 24); - - } - } - - return (rc); -} - -int wait_cons_dev (int irq) { int rc = 0; @@ -3376,10 +3238,8 @@ cr6 |= 0x04000000; /* disable standard isc 3 */ cr6 &= 0xEFFFFFFF; - /* disable console isc 7, - * if neccessary */ - if (cons_dev != -1) - cr6 &= 0xFEFFFFFF; + /* disable console isc 7 */ + cr6 &= 0xFEFFFFFF; ioinfo[irq]->ui.flags.syncio = 1; __ctl_load (cr6, 6, 6); rc = 0; @@ -3500,10 +3360,8 @@ cr6 &= 0xFBFFFFFF; /* enable standard isc 3 */ cr6 |= 0x10000000; - /* enable console isc 7, - * if neccessary */ - if (cons_dev != -1) - cr6 |= 0x01000000; + /* enable console isc 7 */ + cr6 |= 0x01000000; __ctl_load (cr6, 6, 6); retry2 = 0; @@ -4515,69 +4373,50 @@ int irq_ret; devstat_t devstat; - irq_ret = request_irq (irq, - init_IRQ_handler, - SA_PROBE, "INIT", &devstat); + if (ioinfo[irq]->ui.flags.pgid_supp) + irq_ret = request_irq (irq, + init_IRQ_handler, + SA_PROBE | SA_DOPATHGROUP, + "INIT", &devstat); + else + irq_ret = request_irq (irq, + init_IRQ_handler, + SA_PROBE, "INIT", &devstat); if (!irq_ret) { ret = enable_cpu_sync_isc (irq); if (!ret) { - pgid_t pgid; - int i, mask; - /* - * First thing we should do is a sensePGID in - * order to find out how we can proceed with - * the recognition process. - * An unfriendly (locked by so else) device - * won't take kindly to our attempts at - * SetPGID and SenseID... - */ - - memcpy(&pgid, global_pgid, sizeof(pgid_t)); - - ret = -EAGAIN; - for (i=0; i<8 && ret==-EAGAIN; i++) { - - mask = (0x80 >> i) & ioinfo[irq]->opm; - - if (!mask) - continue; - - ret = s390_SensePGID(irq, mask, &pgid); - + ioinfo[irq]->ui.flags.unknown = 0; + + memset (&ioinfo[irq]->senseid, '\0', + sizeof (senseid_t)); + + if (cio_sid_with_pgid) { + + ret = s390_DevicePathVerification(irq,0); + if (ret == -EOPNOTSUPP) /* * Doesn't prevent us from proceeding */ ret = 0; - } - - if (!ret && !ioinfo[irq]->ui.flags.unfriendly) { - - ioinfo[irq]->ui.flags.unknown = 0; - - memset (&ioinfo[irq]->senseid, '\0', - sizeof (senseid_t)); - - if (cio_sid_with_pgid) { - - ret = s390_DevicePathVerification(irq,0); - - if (ret == -EOPNOTSUPP) - /* - * Doesn't prevent us from proceeding - */ - ret = 0; + + /* + * we'll fallthrough here if we don't want + * to do SPID before SID + */ + if (!ret) { + ret = s390_SenseID (irq, &ioinfo[irq]->senseid, 0xff); + if (ret == -ETIMEDOUT) { + /* SenseID timed out. + * We consider this device to be + * boxed for now. + */ + ioinfo[irq]->ui.flags.unfriendly = 1; } - /* - * we'll fallthrough here if we don't want - * to do SPID before SID - */ - if (!ret) { - s390_SenseID (irq, &ioinfo[irq]->senseid, 0xff); #if 0 /* FIXME */ /* * We initially check the configuration data for @@ -4620,7 +4459,6 @@ } } #endif - } } disable_cpu_sync_isc (irq); @@ -4628,7 +4466,7 @@ free_irq (irq, &devstat); - } + } } } @@ -4716,6 +4554,13 @@ return -EBUSY; } + /* + * This function is called by dasd if it just executed a "steal lock". + * Therefore, re-initialize the 'unfriendly' flag to 0. + * We run into timeouts if the device is still boxed... + */ + ioinfo[irq]->ui.flags.unfriendly = 0; + s390_device_recognition_irq(irq); return 0; @@ -4897,8 +4742,6 @@ if (ioinfo[irq]->st) return -ENODEV; - ioinfo[irq]->ui.flags.pgid_supp = 1; - ioinfo[irq]->opm = ioinfo[irq]->schib.pmcw.pim & ioinfo[irq]->schib.pmcw.pam & ioinfo[irq]->schib.pmcw.pom; @@ -5577,7 +5420,7 @@ if (!ioinfo[irq]->ui.flags.unknown) irq_ret = 0; - else + else if (irq_ret != -ETIMEDOUT) irq_ret = -ENODEV; return (irq_ret); @@ -5845,9 +5688,24 @@ "No logical path for sch %d...\n", irq); - if (ioinfo[irq]->nopfunc) - ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC); - + if (ioinfo[irq]->nopfunc) { + if (ioinfo[irq]->ui.flags.notacccap) + ioinfo[irq]->nopfunc(irq, + DEVSTAT_NOT_ACC); + else { + not_oper_handler_func_t nopfunc = + ioinfo[irq]->nopfunc; +#ifdef CONFIG_PROC_FS + /* remove procfs entry */ + if (cio_proc_devinfo) + cio_procfs_device_remove + (ioinfo[irq]->devno); +#endif + free_irq(irq, + ioinfo[irq]->irq_desc.dev_id); + nopfunc(irq, DEVSTAT_DEVICE_GONE); + } + } return -ENODEV; } if (!old_opm) { @@ -5905,7 +5763,9 @@ return 0; } - return s390_do_path_verification (irq, usermask); + if (ioinfo[irq]->ui.flags.ready) + return s390_do_path_verification (irq, usermask); + return 0; } @@ -7249,10 +7109,15 @@ s390irq_spin_unlock(irq); - /* Tell the device driver not to disturb us. */ + /* + * Tell the device driver not to disturb us. + * If the driver is not capable of handling + * DEVSTAT_NOT_ACC, it doesn't want path grouping anyway. + */ if (ioinfo[irq]->ui.flags.ready && schib->pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) { + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) { if (err) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC_ERR); else @@ -7387,7 +7252,8 @@ /* Tell the device driver not to disturb us. */ if (ioinfo[irq]->ui.flags.ready && ioinfo[irq]->schib.pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC); ioinfo[irq]->ui.flags.noio = 1; @@ -7463,7 +7329,8 @@ /* Tell the device driver not to disturb us. */ if (ioinfo[irq]->ui.flags.ready && ioinfo[irq]->schib.pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC); ioinfo[irq]->ui.flags.noio = 1; @@ -7489,11 +7356,41 @@ } } +static int +__get_chpid_from_lir(void *data) +{ + struct lir { + u8 iq; + u8 ic; + u16 sci; + /* incident-node descriptor */ + u32 indesc[28]; + /* attached-node descriptor */ + u32 andesc[28]; + /* incident-specific information */ + u32 isinfo[28]; + } *lir; + + lir = (struct lir*) data; + if (!(lir->iq&0x80)) + /* NULL link incident record */ + return -EINVAL; + if (!(lir->indesc[0]&0xc0000000)) + /* node descriptor not valid */ + return -EINVAL; + if (!(lir->indesc[0]&0x10000000)) + /* don't handle device-type nodes - FIXME */ + return -EINVAL; + /* Byte 3 contains the chpid. Could also be CTCA, but we don't care */ + + return (u16) (lir->indesc[0]&0x000000ff); +} + void s390_process_css( void ) { - int ccode, do_sei; + int ccode, do_sei, chpid; CIO_TRACE_EVENT( 2, "prcss"); @@ -7646,9 +7543,11 @@ chsc_area_sei->response_block. response_block_data.sei_res.rsid); - s390_do_chpid_processing(chsc_area_sei->response_block. - response_block_data.sei_res.rsid); - + chpid = __get_chpid_from_lir(chsc_area_sei->response_block. + response_block_data.sei_res. + ccdf); + if (chpid >= 0) + s390_do_chpid_processing(chpid); break; case 2: /* i/o resource accessibiliy */ @@ -7788,7 +7687,8 @@ /* Tell the device driver not to disturb us. */ if (ioinfo[irq]->ui.flags.ready && schib->pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) { + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) { if (err) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC_ERR); else @@ -7823,7 +7723,8 @@ /* Tell the device driver not to disturb us. */ if (ioinfo[irq]->ui.flags.ready && schib->pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC); ioinfo[irq]->ui.flags.noio = 1; @@ -8198,7 +8099,8 @@ /* Tell the device driver not to disturb us. */ if (ioinfo[irq]->ui.flags.ready && schib->pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC); if (out) @@ -8228,7 +8130,8 @@ /* Tell the device driver not to disturb us. */ if (ioinfo[irq]->ui.flags.ready && schib->pmcw.pim != 0x80 && - ioinfo[irq]->nopfunc) + ioinfo[irq]->nopfunc && + ioinfo[irq]->ui.flags.notacccap) ioinfo[irq]->nopfunc(irq, DEVSTAT_NOT_ACC); ioinfo[irq]->ui.flags.noio = 1; @@ -8238,10 +8141,7 @@ /* Wait for interrupt. */ break; - if (ioinfo[irq]->ui.flags.ready) - s390_schedule_path_verification(irq); - else - ioinfo[irq]->ui.flags.noio = 0; + s390_schedule_path_verification(irq); break; } @@ -9256,7 +9156,6 @@ #ifdef CIO_DEBUG_IO printk("/proc/chpids: '%s'\n", buffer); #endif /* CIO_DEBUG_IO */ - CIO_MSG_EVENT( 2, "/proc/chpids: '%s'\n", buffer); cio_parse_chpids_proc_parameters(buffer); diff -urN linux-2.4.23-bk22/drivers/scsi/st.c linux-2.4.23-bk23/drivers/scsi/st.c --- linux-2.4.23-bk22/drivers/scsi/st.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.23-bk23/drivers/scsi/st.c 2004-01-04 02:50:37.000000000 -0800 @@ -9,10 +9,10 @@ Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky, Michael Schaefer, J"org Weule, and Eric Youngdale. - Copyright 1992 - 2003 Kai Makisara + Copyright 1992 - 2004 Kai Makisara email Kai.Makisara@kolumbus.fi - Last modified: Sun Apr 6 22:44:42 2003 by makisara + Last modified: Fri Jan 2 17:50:08 2004 by makisara Some small formal changes - aeb, 950809 Last modified: 18-JAN-1998 Richard Gooch Devfs support @@ -21,7 +21,7 @@ error handling will be discarded. */ -static char *verstr = "20030406"; +static char *verstr = "20040102"; #include @@ -1277,6 +1277,18 @@ goto out; } + if ((STp->buffer)->writing) { + write_behind_check(STp); + if ((STp->buffer)->syscall_result) { + DEBC(printk(ST_DEB_MSG "st%d: Async write error (write) %x.\n", + dev, (STp->buffer)->midlevel_result)); + if ((STp->buffer)->midlevel_result == INT_MAX) + STps->eof = ST_EOM_OK; + else + STps->eof = ST_EOM_ERROR; + } + } + if (STp->block_size == 0) { if (STp->max_block > 0 && (count < STp->min_block || count > STp->max_block)) { @@ -1324,18 +1336,6 @@ } } - if ((STp->buffer)->writing) { - write_behind_check(STp); - if ((STp->buffer)->syscall_result) { - DEBC(printk(ST_DEB_MSG "st%d: Async write error (write) %x.\n", - dev, (STp->buffer)->midlevel_result)); - if ((STp->buffer)->midlevel_result == INT_MAX) - STps->eof = ST_EOM_OK; - else - STps->eof = ST_EOM_ERROR; - } - } - if (STps->eof == ST_EOM_OK) { retval = (-ENOSPC); goto out; diff -urN linux-2.4.23-bk22/include/asm-ppc/floppy.h linux-2.4.23-bk23/include/asm-ppc/floppy.h --- linux-2.4.23-bk22/include/asm-ppc/floppy.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc/floppy.h 2004-01-04 02:50:37.000000000 -0800 @@ -12,7 +12,7 @@ #define __ASM_PPC_FLOPPY_H #define fd_inb(port) inb_p(port) -#define fd_outb(port,value) outb_p(port,value) +#define fd_outb(value,port) outb_p(value,port) #define fd_enable_dma() enable_dma(FLOPPY_DMA) #define fd_disable_dma() disable_dma(FLOPPY_DMA) @@ -24,7 +24,11 @@ #define fd_set_dma_count(count) set_dma_count(FLOPPY_DMA,count) #define fd_enable_irq() enable_irq(FLOPPY_IRQ) #define fd_disable_irq() disable_irq(FLOPPY_IRQ) +#if CONFIG_NOT_COHERENT_CACHE +#define fd_cacheflush(addr,size) dma_cache_wback_inv(addr, size) +#else #define fd_cacheflush(addr,size) /* nothing */ +#endif #define fd_request_irq() request_irq(FLOPPY_IRQ, floppy_interrupt, \ SA_INTERRUPT|SA_SAMPLE_RANDOM, \ "floppy", NULL) diff -urN linux-2.4.23-bk22/include/asm-ppc/mpc10x.h linux-2.4.23-bk23/include/asm-ppc/mpc10x.h --- linux-2.4.23-bk22/include/asm-ppc/mpc10x.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc/mpc10x.h 2004-01-04 02:50:37.000000000 -0800 @@ -121,7 +121,7 @@ #define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */ #define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */ -#define MPC10X_MCTLR_MEM_END_2i 0x94 /* Banks 4-7 */ +#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */ #define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */ #define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */ diff -urN linux-2.4.23-bk22/include/asm-ppc64/cputable.h linux-2.4.23-bk23/include/asm-ppc64/cputable.h --- linux-2.4.23-bk22/include/asm-ppc64/cputable.h 2004-01-04 02:50:32.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/cputable.h 2004-01-04 02:50:37.000000000 -0800 @@ -152,11 +152,25 @@ .llong 99b; \ .previous -#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) -#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) +#else + +#define BEGIN_FTR_SECTION "98:\n" +#define END_FTR_SECTION(msk, val) \ +"99:\n" \ +" .section __ftr_fixup,\"a\";\n" \ +" .align 3;\n" \ +" .llong "#msk";\n" \ +" .llong "#val";\n" \ +" .llong 98b;\n" \ +" .llong 99b;\n" \ +" .previous\n" #endif /* __ASSEMBLY__ */ + +#define END_FTR_SECTION_IFSET(msk) END_FTR_SECTION((msk), (msk)) +#define END_FTR_SECTION_IFCLR(msk) END_FTR_SECTION((msk), 0) + #endif /* __ASM_PPC_CPUTABLE_H */ #endif /* __KERNEL__ */ diff -urN linux-2.4.23-bk22/include/asm-ppc64/elf.h linux-2.4.23-bk23/include/asm-ppc64/elf.h --- linux-2.4.23-bk22/include/asm-ppc64/elf.h 2003-11-28 10:26:21.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/elf.h 2004-01-04 02:50:37.000000000 -0800 @@ -9,6 +9,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ @@ -40,9 +41,15 @@ # define elf_caddr_t u32 #endif +/* Floating point registers */ typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; +/* Altivec registers */ +typedef __vector128 elf_vrreg_t; +typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG]; + + #ifdef __KERNEL__ /* diff -urN linux-2.4.23-bk22/include/asm-ppc64/iSeries/vio.h linux-2.4.23-bk23/include/asm-ppc64/iSeries/vio.h --- linux-2.4.23-bk22/include/asm-ppc64/iSeries/vio.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/iSeries/vio.h 2004-01-04 02:50:37.000000000 -0800 @@ -0,0 +1,130 @@ +/* -*- linux-c -*- + * drivers/char/vio.h + * + * iSeries Virtual I/O Message Path header + * + * Authors: Dave Boutcher + * Ryan Arnold + * Colin Devilbiss + * + * (C) Copyright 2000 IBM Corporation + * + * This header file is used by the iSeries virtual I/O device + * drivers. It defines the interfaces to the common functions + * (implemented in drivers/char/viopath.h) as well as defining + * common functions and structures. Currently (at the time I + * wrote this comment) the iSeries virtual I/O device drivers + * that use this are + * drivers/block/viodasd.c + * drivers/char/viocons.c + * drivers/char/viotape.c + * drivers/cdrom/viocd.c + * + * The iSeries virtual ethernet support (veth.c) uses a whole + * different set of functions. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) anyu later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef _VIO_H +#define _VIO_H + +#include +#include + +/* iSeries virtual I/O events use the subtype field in + * HvLpEvent to figure out what kind of vio event is coming + * in. We use a table to route these, and this defines + * the maximum number of distinct subtypes + */ +#define VIO_MAX_SUBTYPES 7 + +/* Each subtype can register a handler to process their events. + * The handler must have this interface. + */ +typedef void (vio_event_handler_t) (struct HvLpEvent * event); + +int viopath_open(HvLpIndex remoteLp, int subtype, int numReq); +int viopath_close(HvLpIndex remoteLp, int subtype, int numReq); +int vio_setHandler(int subtype, vio_event_handler_t * beh); +int vio_clearHandler(int subtype); +int viopath_isactive(HvLpIndex lp); +HvLpInstanceId viopath_sourceinst(HvLpIndex lp); +HvLpInstanceId viopath_targetinst(HvLpIndex lp); +void vio_set_hostlp(void); +void *vio_get_event_buffer(int subtype); +void vio_free_event_buffer(int subtype, void *buffer); + +extern HvLpIndex viopath_hostLp; +extern HvLpIndex viopath_ourLp; + +#define VIO_MESSAGE "iSeries virtual I/O: " +#define KERN_DEBUG_VIO KERN_DEBUG VIO_MESSAGE +#define KERN_INFO_VIO KERN_INFO VIO_MESSAGE +#define KERN_WARNING_VIO KERN_WARNING VIO_MESSAGE + +#define VIOCHAR_MAX_DATA 200 + +#define VIOMAJOR_SUBTYPE_MASK 0xff00 +#define VIOMINOR_SUBTYPE_MASK 0x00ff +#define VIOMAJOR_SUBTYPE_SHIFT 8 + +#define VIOVERSION 0x0101 + +/* +This is the general structure for VIO errors; each module should have a table +of them, and each table should be terminated by an entry of { 0, 0, NULL }. +Then, to find a specific error message, a module should pass its local table +and the return code. +*/ +struct vio_error_entry { + u16 rc; + int errno; + const char *msg; +}; +const struct vio_error_entry *vio_lookup_rc(const struct vio_error_entry + *local_table, u16 rc); + +enum viosubtypes { + viomajorsubtype_monitor = 0x0100, + viomajorsubtype_blockio = 0x0200, + viomajorsubtype_chario = 0x0300, + viomajorsubtype_config = 0x0400, + viomajorsubtype_cdio = 0x0500, + viomajorsubtype_tape = 0x0600 +}; + + +enum vioconfigsubtype { + vioconfigget = 0x0001, +}; + +enum viorc { + viorc_good = 0x0000, + viorc_noConnection = 0x0001, + viorc_noReceiver = 0x0002, + viorc_noBufferAvailable = 0x0003, + viorc_invalidMessageType = 0x0004, + viorc_invalidRange = 0x0201, + viorc_invalidToken = 0x0202, + viorc_DMAError = 0x0203, + viorc_useError = 0x0204, + viorc_releaseError = 0x0205, + viorc_invalidDisk = 0x0206, + viorc_openRejected = 0x0301 +}; + + +#endif /* _VIO_H */ diff -urN linux-2.4.23-bk22/include/asm-ppc64/mmu_context.h linux-2.4.23-bk23/include/asm-ppc64/mmu_context.h --- linux-2.4.23-bk22/include/asm-ppc64/mmu_context.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc64/mmu_context.h 2004-01-04 02:50:37.000000000 -0800 @@ -6,7 +6,9 @@ #include #include #include - +#ifdef CONFIG_ALTIVEC +#include +#endif /* * Copyright (C) 2001 PPC 64 Team, IBM Corp * @@ -130,6 +132,14 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk, int cpu) { +#ifdef CONFIG_ALTIVEC + __asm__ __volatile__( + BEGIN_FTR_SECTION + "\tdssall\n" + "\tsync\n" + END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) + ::); +#endif flush_stab(); } diff -urN linux-2.4.23-bk22/include/asm-ppc64/paca.h linux-2.4.23-bk23/include/asm-ppc64/paca.h --- linux-2.4.23-bk22/include/asm-ppc64/paca.h 2004-01-04 02:50:32.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/paca.h 2004-01-04 02:50:37.000000000 -0800 @@ -178,4 +178,6 @@ u8 guard[0x1000]; /* ... and then hang 'em */ }; +#define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum) + #endif /* _PPC64_PACA_H */ diff -urN linux-2.4.23-bk22/include/asm-ppc64/page.h linux-2.4.23-bk23/include/asm-ppc64/page.h --- linux-2.4.23-bk22/include/asm-ppc64/page.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc64/page.h 2004-01-04 02:50:37.000000000 -0800 @@ -128,14 +128,6 @@ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ xmon(0); \ } while (0) -#elif defined(CONFIG_KDB) -#include -#include -/* extern void kdb(kdb_reason_t reason, int error, kdb_eframe_t ef); */ -#define BUG() do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ - kdb(KDB_REASON_CALL, 0, (kdb_eframe_t) 0); \ -} while (0) #else #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ diff -urN linux-2.4.23-bk22/include/asm-ppc64/ppcdebug.h linux-2.4.23-bk23/include/asm-ppc64/ppcdebug.h --- linux-2.4.23-bk22/include/asm-ppc64/ppcdebug.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc64/ppcdebug.h 2004-01-04 02:50:37.000000000 -0800 @@ -103,11 +103,6 @@ #define PPCDBG_ENTER_DEBUGGER() xmon(0) #define PPCDBG_ENTER_DEBUGGER_REGS(X) xmon(X) #endif -#ifdef CONFIG_KDB -#include -#define PPCDBG_ENTER_DEBUGGER() kdb(KDB_REASON_CALL, 0, 0) -#define PPCDBG_ENTER_DEBUGGER_REGS(X) kdb(KDB_REASON_CALL, 0, X) -#endif #else #define PPCDBG(...) do {;} while (0) diff -urN linux-2.4.23-bk22/include/asm-ppc64/processor.h linux-2.4.23-bk23/include/asm-ppc64/processor.h --- linux-2.4.23-bk22/include/asm-ppc64/processor.h 2004-01-04 02:50:32.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/processor.h 2004-01-04 02:50:37.000000000 -0800 @@ -317,6 +317,7 @@ #define WRS_SYSTEM 3 /* WDT forced system reset */ #define TSR_PIS 0x08000000 /* PIT Interrupt Status */ #define TSR_FIS 0x04000000 /* FIT Interrupt Status */ +#define SPRN_VRSAVE 0x100 /* Vector Register Save Register */ #define SPRN_XER 0x001 /* Fixed Point Exception Register */ #define SPRN_ZPR 0x3B0 /* Zone Protection Register */ @@ -485,6 +486,7 @@ #define PV_ICESTAR 0x0036 #define PV_SSTAR 0x0037 #define PV_POWER4p 0x0038 +#define PV_POWER4ul 0x0039 #define PV_630 0x0040 #define PV_630p 0x0041 @@ -613,8 +615,11 @@ #define MCA_bus 0 #define MCA_bus__is_a_macro /* for versions in ksyms.c */ +#ifndef CONFIG_SMP /* Lazy FPU handling on uni-processor */ extern struct task_struct *last_task_used_math; +extern struct task_struct *last_task_used_altivec; +#endif /* CONFIG_SMP */ #ifdef __KERNEL__ @@ -658,6 +663,11 @@ unsigned long fpexc_mode; /* Floating-point exception mode */ unsigned long saved_msr; /* Save MSR across signal handlers */ unsigned long saved_softe; /* Ditto for Soft Enable/Disable */ +#ifdef CONFIG_ALTIVEC + vector128 vr[32]; /* Complete AltiVec set */ + vector128 vscr; /* AltiVec status */ + u32 vrsave[2]; /* 32 bit vrsave is in vrsave[1] */ +#endif /* CONFIG_ALTIVEC */ }; #define PPC_FLAG_32BIT 0x01 diff -urN linux-2.4.23-bk22/include/asm-ppc64/prom.h linux-2.4.23-bk23/include/asm-ppc64/prom.h --- linux-2.4.23-bk22/include/asm-ppc64/prom.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc64/prom.h 2004-01-04 02:50:37.000000000 -0800 @@ -120,6 +120,7 @@ char *name; char *type; phandle node; + phandle linux_phandle; int n_addrs; struct address_range *addrs; int n_intrs; diff -urN linux-2.4.23-bk22/include/asm-ppc64/ptrace.h linux-2.4.23-bk23/include/asm-ppc64/ptrace.h --- linux-2.4.23-bk22/include/asm-ppc64/ptrace.h 2004-01-04 02:50:32.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/ptrace.h 2004-01-04 02:50:37.000000000 -0800 @@ -16,7 +16,7 @@ * that the overall structure is a multiple of 16 bytes in length. * * Note that the offsets of the fields in this struct correspond with - * the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c. + * the PT_* values below. This simplifies arch/ppc64/kernel/ptrace.c. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -126,11 +126,14 @@ #define PT_RESULT 43 #define PT_FPR0 48 + +/* Kernel and userspace will both use this PT_FPSCR value. 32-bit apps will have + * visibility to the asm-ppc/ptrace.h header instead of this one. + */ +#define PT_FPSCR (PT_FPR0 + 32 + 1) /* each FP reg occupies 1 slot in 64-bit space */ + #ifdef __KERNEL__ -#define PT_FPSCR (PT_FPR0 + 32 + 1) /* each FP reg occupies 1 slot in this space */ -#define PT_FPSCR32 (PT_FPR0 + 2*32 + 1) /* To the 32-bit user - each FP reg occupies 2 slots in this space */ -#else -#define PT_FPSCR (PT_FPR0 + 2*32 + 1) /* each FP reg occupies 2 slots in this space -- Fix when 64-bit apps. */ +#define PT_FPSCR32 (PT_FPR0 + 2*32 + 1) /* each FP reg occupies 2 32-bit userspace slots */ #endif /* Additional PTRACE requests implemented on PowerPC. */ @@ -145,5 +148,8 @@ #define PPC_PTRACE_PEEKUSR_3264 0x91 /* Read a register (specified by ADDR) out of the "user area" on a 64-bit process from a 32-bit process. */ #define PPC_PTRACE_POKEUSR_3264 0x90 /* Write DATA into location ADDR within the "user area" on a 64-bit process from a 32-bit process. */ +/* Get/set all the altivec registers vr0..vr31, vscr, vrsave, in one go */ +#define PTRACE_GETVRREGS 18 +#define PTRACE_SETVRREGS 19 #endif /* _PPC64_PTRACE_H */ diff -urN linux-2.4.23-bk22/include/asm-ppc64/smp.h linux-2.4.23-bk23/include/asm-ppc64/smp.h --- linux-2.4.23-bk22/include/asm-ppc64/smp.h 2004-01-04 02:50:32.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/smp.h 2004-01-04 02:50:37.000000000 -0800 @@ -21,9 +21,9 @@ #include #include /* for NR_CPUS */ -#ifdef CONFIG_SMP #ifndef __ASSEMBLY__ +#ifdef CONFIG_SMP #include @@ -60,7 +60,6 @@ #define smp_processor_id() (get_paca()->xPacaIndex) #define hard_smp_processor_id() (get_paca()->xHwProcNum) -#define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum) @@ -76,7 +75,11 @@ void smp_init_iSeries(void); void smp_init_pSeries(void); -#endif /* __ASSEMBLY__ */ +#else /* CONFIG_SMP */ +#define cpu_possible(cpu) ((cpu) == 0) +#define cpu_available(cpu) ((cpu) == 0) + #endif /* !(CONFIG_SMP) */ +#endif /* __ASSEMBLY__ */ #endif /* !(_PPC64_SMP_H) */ #endif /* __KERNEL__ */ diff -urN linux-2.4.23-bk22/include/asm-ppc64/system.h linux-2.4.23-bk23/include/asm-ppc64/system.h --- linux-2.4.23-bk22/include/asm-ppc64/system.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc64/system.h 2004-01-04 02:50:37.000000000 -0800 @@ -63,10 +63,13 @@ extern void _set_L2CR(unsigned long); extern void giveup_fpu(struct task_struct *); extern void enable_kernel_fp(void); +extern void giveup_altivec(struct task_struct *); +extern void load_up_altivec(struct task_struct *); extern void cvt_fd(float *from, double *to, unsigned long *fpscr); extern void cvt_df(double *from, float *to, unsigned long *fpscr); extern int abs(int); extern void cacheable_memzero(void *p, unsigned int nb); +extern void vpa_init(int cpu); struct device_node; diff -urN linux-2.4.23-bk22/include/asm-ppc64/systemcfg.h linux-2.4.23-bk23/include/asm-ppc64/systemcfg.h --- linux-2.4.23-bk22/include/asm-ppc64/systemcfg.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-ppc64/systemcfg.h 2004-01-04 02:50:37.000000000 -0800 @@ -70,6 +70,7 @@ #define PV_ICESTAR 0x0036 #define PV_SSTAR 0x0037 #define PV_POWER4p 0x0038 +#define PV_POWER4ul 0x0039 #define PV_630 0x0040 #define PV_630p 0x0041 diff -urN linux-2.4.23-bk22/include/asm-ppc64/user_exports.h linux-2.4.23-bk23/include/asm-ppc64/user_exports.h --- linux-2.4.23-bk22/include/asm-ppc64/user_exports.h 2002-11-28 15:53:15.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-ppc64/user_exports.h 2004-01-04 02:50:37.000000000 -0800 @@ -72,10 +72,13 @@ #define PLATFORM_ISERIES_LPAR 0x0201 /* Processor types */ +#define PV_NORTHSTAR 0x0033 #define PV_PULSAR 0x0034 #define PV_POWER4 0x0035 #define PV_ICESTAR 0x0036 #define PV_SSTAR 0x0037 +#define PV_POWER4p 0x0038 +#define PV_POWER4ul 0x0039 #define PV_630 0x0040 #define PV_630p 0x0041 diff -urN linux-2.4.23-bk22/include/asm-s390/ioctl32.h linux-2.4.23-bk23/include/asm-s390/ioctl32.h --- linux-2.4.23-bk22/include/asm-s390/ioctl32.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-s390/ioctl32.h 2004-01-04 02:50:37.000000000 -0800 @@ -0,0 +1,36 @@ +/* + * include/asm-s390/ioctl32.h + * include/asm-s390x/ioctl32.h + * + * Copyright (C) 2003 IBM Corporation + * Author: Arnd Bergmann + */ +#ifndef ASM_IOCTL32_H +#define ASM_IOCTL32_H + +extern int sys_ioctl(unsigned int, unsigned int, unsigned long, struct file*); +typedef int (*ioctl_trans_handler_t)(unsigned int, unsigned int, unsigned long, struct file *); + +#ifdef CONFIG_S390_SUPPORT + +extern int +register_ioctl32_conversion(unsigned int cmd, ioctl_trans_handler_t handler); + +extern void +unregister_ioctl32_conversion(unsigned int cmd); + +#else + +static inline int +register_ioctl32_conversion(unsigned int cmd, ioctl_trans_handler_t handler) +{ + return 0; +} + +static inline void +unregister_ioctl32_conversion(unsigned int cmd) +{ +} + +#endif /* CONFIG_S390_SUPPORT */ +#endif /* ASM_IOCTL32_H */ diff -urN linux-2.4.23-bk22/include/asm-s390/irq.h linux-2.4.23-bk23/include/asm-s390/irq.h --- linux-2.4.23-bk22/include/asm-s390/irq.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390/irq.h 2004-01-04 02:50:37.000000000 -0800 @@ -16,9 +16,6 @@ #define INVALID_STORAGE_AREA ((void *)(-1 - 0x3FFF )) -extern int disable_irq(unsigned int); -extern int enable_irq(unsigned int); - /* * path management control word */ @@ -420,14 +417,8 @@ __u32 reserved2; /* word 5 */ __u32 reserved3; - /* word 6 */ - __u32 ccdf; /* content-code dependent field */ - /* word 7 */ - __u32 reserved4; - /* word 8 */ - __u32 reserved5; - /* word 9 */ - __u32 reserved6; + /* word 6-102 */ + __u32 ccdf[96]; /* content-code dependent field */ } __attribute__ ((packed,aligned(8))) sei_res; struct { /* word 2 */ @@ -445,6 +436,8 @@ __u8 chpid[8]; /* chpids 0-7 */ /* words 6-9 */ __u16 fla[8]; /* full link addresses 0-7 */ + /* words 10-102 */ + __u32 padding[92]; } __attribute__ ((packed,aligned(8))) ssd_res; } response_block_data; } __attribute__ ((packed,aligned(8))) response_block; @@ -582,7 +575,6 @@ /* ... for suspended CCWs */ #define DOIO_TIMEOUT 0x0080 /* 3 secs. timeout for sync. I/O */ #define DOIO_DONT_CALL_INTHDLR 0x0100 /* don't call interrupt handler */ -#define DOIO_CANCEL_ON_TIMEOUT 0x0200 /* cancel I/O if it timed out */ #define DOIO_USE_DIAG98 0x0400 /* use DIAG98 instead of SSCH */ /* @@ -665,7 +657,6 @@ void *dev_id); extern int set_cons_dev(int irq); -extern int reset_cons_dev(int irq); extern int wait_cons_dev(int irq); extern schib_t *s390_get_schib( int irq ); diff -urN linux-2.4.23-bk22/include/asm-s390/pgalloc.h linux-2.4.23-bk23/include/asm-s390/pgalloc.h --- linux-2.4.23-bk22/include/asm-s390/pgalloc.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390/pgalloc.h 2004-01-04 02:50:37.000000000 -0800 @@ -1,5 +1,5 @@ /* - * include/asm-s390/bugs.h + * include/asm-s390/pgalloc.h * * S390 version * Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation @@ -22,6 +22,8 @@ #define pte_quicklist (S390_lowcore.cpu_data.pte_quick) #define pgtable_cache_size (S390_lowcore.cpu_data.pgtable_cache_sz) +extern void diag10(unsigned long addr); + /* * Allocate and free page tables. The xxx_kernel() versions are * used to allocate a kernel page table - this turns on ASN bits diff -urN linux-2.4.23-bk22/include/asm-s390/s390io.h linux-2.4.23-bk23/include/asm-s390/s390io.h --- linux-2.4.23-bk22/include/asm-s390/s390io.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390/s390io.h 2004-01-04 02:50:37.000000000 -0800 @@ -37,8 +37,6 @@ unsigned int ready : 1; /* interrupt handler registered */ unsigned int haltio : 1; /* halt_IO in process */ unsigned int doio : 1; /* do_IO in process */ - unsigned int doio_q : 1; /* do_IO queued - only possible ... */ - /* ... if 'fast' is set too */ unsigned int w4final : 1; /* wait for final status, internally */ /* ... used with 'fast' setting only */ unsigned int repall : 1; /* report every interrupt status */ @@ -52,7 +50,6 @@ unsigned int pgid : 1; /* "path group ID" is valid */ unsigned int pgid_supp : 1; /* "path group ID" command is supported */ unsigned int esid : 1; /* Ext. SenseID supported by HW */ - unsigned int rcd : 1; /* RCD supported by HW */ unsigned int repnone : 1; /* don't call IRQ handler on interrupt */ unsigned int newreq : 1; /* new register interface */ unsigned int dval : 1; /* device number valid */ @@ -60,7 +57,8 @@ unsigned int unfriendly: 1; /* device is locked by someone else */ unsigned int killio : 1; /* currently killing pending io */ unsigned int noio : 1; /* don't let drivers start io */ - unsigned int unused : (sizeof(unsigned int)*8 - 27); /* unused */ + unsigned int notacccap : 1; /* capable of handling DEVSTAT_NOT_ACC */ + unsigned int unused : (sizeof(unsigned int)*8 - 26); /* unused */ } __attribute__ ((packed)) flags; } ui; @@ -68,20 +66,15 @@ senseid_t senseid; /* SenseID info */ irq_desc_t irq_desc; /* irq descriptor */ not_oper_handler_func_t nopfunc; /* not oper handler */ - __u8 ulpm; /* logical path mask used for I/O */ __u8 opm; /* path mask of operational paths */ __u16 devno; /* device number */ pgid_t pgid; /* path group ID */ schib_t schib; /* subchannel information block */ orb_t orb; /* operation request block */ devstat_t devstat; /* device status */ - ccw1_t *qcpa; /* queued channel program */ ccw1_t senseccw; /* ccw for sense command */ __u8 sense_data[32];/* buffer for basic sense */ unsigned int stctl; /* accumulated status control from irb */ - unsigned long qintparm; /* queued interruption parameter */ - unsigned long qflag; /* queued flags */ - __u8 qlpm; /* queued logical path mask */ ssd_info_t ssd_info; /* subchannel description */ struct tq_struct pver_bh; /* path verification bottom half task */ atomic_t pver_pending; /* != 0 if path verification for sch is pending */ diff -urN linux-2.4.23-bk22/include/asm-s390/signal.h linux-2.4.23-bk23/include/asm-s390/signal.h --- linux-2.4.23-bk22/include/asm-s390/signal.h 2001-04-11 19:02:28.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390/signal.h 2004-01-04 02:50:37.000000000 -0800 @@ -127,6 +127,8 @@ #define SA_PROBE SA_ONESHOT #define SA_SAMPLE_RANDOM SA_RESTART #define SA_SHIRQ 0x04000000 +#define SA_DOPATHGROUP 0x00100000 +#define SA_FORCE 0x00200000 #endif #define SIG_BLOCK 0 /* for blocking signals */ diff -urN linux-2.4.23-bk22/include/asm-s390x/ioctl32.h linux-2.4.23-bk23/include/asm-s390x/ioctl32.h --- linux-2.4.23-bk22/include/asm-s390x/ioctl32.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.23-bk23/include/asm-s390x/ioctl32.h 2004-01-04 02:50:37.000000000 -0800 @@ -0,0 +1,36 @@ +/* + * include/asm-s390/ioctl32.h + * include/asm-s390x/ioctl32.h + * + * Copyright (C) 2003 IBM Corporation + * Author: Arnd Bergmann + */ +#ifndef ASM_IOCTL32_H +#define ASM_IOCTL32_H + +extern int sys_ioctl(unsigned int, unsigned int, unsigned long, struct file*); +typedef int (*ioctl_trans_handler_t)(unsigned int, unsigned int, unsigned long, struct file *); + +#ifdef CONFIG_S390_SUPPORT + +extern int +register_ioctl32_conversion(unsigned int cmd, ioctl_trans_handler_t handler); + +extern void +unregister_ioctl32_conversion(unsigned int cmd); + +#else + +static inline int +register_ioctl32_conversion(unsigned int cmd, ioctl_trans_handler_t handler) +{ + return 0; +} + +static inline void +unregister_ioctl32_conversion(unsigned int cmd) +{ +} + +#endif /* CONFIG_S390_SUPPORT */ +#endif /* ASM_IOCTL32_H */ diff -urN linux-2.4.23-bk22/include/asm-s390x/irq.h linux-2.4.23-bk23/include/asm-s390x/irq.h --- linux-2.4.23-bk22/include/asm-s390x/irq.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390x/irq.h 2004-01-04 02:50:37.000000000 -0800 @@ -16,9 +16,6 @@ #define INVALID_STORAGE_AREA ((void *)(-1 - 0x3FFF )) -extern int disable_irq(unsigned int); -extern int enable_irq(unsigned int); - /* * path management control word */ @@ -421,14 +418,8 @@ __u32 reserved2; /* word 5 */ __u32 reserved3; - /* word 6 */ - __u32 ccdf; /* content-code dependent field */ - /* word 7 */ - __u32 reserved4; - /* word 8 */ - __u32 reserved5; - /* word 9 */ - __u32 reserved6; + /* word 6-102 */ + __u32 ccdf[96]; /* content-code dependent field */ } __attribute__ ((packed,aligned(8))) sei_res; struct { /* word 2 */ @@ -446,6 +437,8 @@ __u8 chpid[8]; /* chpids 0-7 */ /* words 6-9 */ __u16 fla[8]; /* full link addresses 0-7 */ + /* words 10-102 */ + __u32 padding[92]; } __attribute__ ((packed,aligned(8))) ssd_res; } response_block_data; } __attribute__ ((packed,aligned(8))) response_block; @@ -583,7 +576,6 @@ /* ... for suspended CCWs */ #define DOIO_TIMEOUT 0x0080 /* 3 secs. timeout for sync. I/O */ #define DOIO_DONT_CALL_INTHDLR 0x0100 /* don't call interrupt handler */ -#define DOIO_CANCEL_ON_TIMEOUT 0x0200 /* cancel I/O if it timed out */ #define DOIO_USE_DIAG98 0x0400 /* use DIAG98 instead of SSCH */ /* @@ -666,7 +658,6 @@ void *dev_id); extern int set_cons_dev(int irq); -extern int reset_cons_dev(int irq); extern int wait_cons_dev(int irq); extern schib_t *s390_get_schib( int irq ); diff -urN linux-2.4.23-bk22/include/asm-s390x/pgalloc.h linux-2.4.23-bk23/include/asm-s390x/pgalloc.h --- linux-2.4.23-bk22/include/asm-s390x/pgalloc.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390x/pgalloc.h 2004-01-04 02:50:37.000000000 -0800 @@ -23,6 +23,8 @@ #define pte_quicklist (S390_lowcore.cpu_data.pte_quick) #define pgtable_cache_size (S390_lowcore.cpu_data.pgtable_cache_sz) +extern void diag10(unsigned long addr); + /* * Allocate and free page tables. The xxx_kernel() versions are * used to allocate a kernel page table - this turns on ASN bits diff -urN linux-2.4.23-bk22/include/asm-s390x/s390io.h linux-2.4.23-bk23/include/asm-s390x/s390io.h --- linux-2.4.23-bk22/include/asm-s390x/s390io.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390x/s390io.h 2004-01-04 02:50:37.000000000 -0800 @@ -37,8 +37,6 @@ unsigned int ready : 1; /* interrupt handler registered */ unsigned int haltio : 1; /* halt_IO in process */ unsigned int doio : 1; /* do_IO in process */ - unsigned int doio_q : 1; /* do_IO queued - only possible ... */ - /* ... if 'fast' is set too */ unsigned int w4final : 1; /* wait for final status, internally */ /* ... used with 'fast' setting only */ unsigned int repall : 1; /* report every interrupt status */ @@ -52,7 +50,6 @@ unsigned int pgid : 1; /* "path group ID" is valid */ unsigned int pgid_supp : 1; /* "path group ID" command is supported */ unsigned int esid : 1; /* Ext. SenseID supported by HW */ - unsigned int rcd : 1; /* RCD supported by HW */ unsigned int repnone : 1; /* don't call IRQ handler on interrupt */ unsigned int newreq : 1; /* new register interface */ unsigned int dval : 1; /* device number valid */ @@ -60,7 +57,8 @@ unsigned int unfriendly: 1; /* device is locked by someone else */ unsigned int killio : 1; /* currently killing pending io */ unsigned int noio : 1; /* don't let drivers start io */ - unsigned int unused : (sizeof(unsigned int)*8 - 27); /* unused */ + unsigned int notacccap : 1; /* capable of handling DEVSTAT_NOT_ACC */ + unsigned int unused : (sizeof(unsigned int)*8 - 26); /* unused */ } __attribute__ ((packed)) flags; } ui; @@ -68,20 +66,15 @@ senseid_t senseid; /* SenseID info */ irq_desc_t irq_desc; /* irq descriptor */ not_oper_handler_func_t nopfunc; /* not oper handler */ - __u8 ulpm; /* logical path mask used for I/O */ __u8 opm; /* path mask of operational paths */ __u16 devno; /* device number */ pgid_t pgid; /* path group ID */ schib_t schib; /* subchannel information block */ orb_t orb; /* operation request block */ devstat_t devstat; /* device status */ - ccw1_t *qcpa; /* queued channel program */ ccw1_t senseccw; /* ccw for sense command */ __u8 sense_data[32];/* buffer for basic sense */ unsigned int stctl; /* accumulated status control from irb */ - unsigned long qintparm; /* queued interruption parameter */ - unsigned long qflag; /* queued flags */ - __u8 qlpm; /* queued logical path mask */ ssd_info_t ssd_info; /* subchannel description */ struct tq_struct pver_bh; /* path verification bottom half task */ atomic_t pver_pending; /* != 0 if path verification for sch is pending */ diff -urN linux-2.4.23-bk22/include/asm-s390x/signal.h linux-2.4.23-bk23/include/asm-s390x/signal.h --- linux-2.4.23-bk22/include/asm-s390x/signal.h 2001-07-25 14:12:02.000000000 -0700 +++ linux-2.4.23-bk23/include/asm-s390x/signal.h 2004-01-04 02:50:37.000000000 -0800 @@ -127,6 +127,8 @@ #define SA_PROBE SA_ONESHOT #define SA_SAMPLE_RANDOM SA_RESTART #define SA_SHIRQ 0x04000000 +#define SA_DOPATHGROUP 0x00100000 +#define SA_FORCE 0x00200000 #endif #define SIG_BLOCK 0 /* for blocking signals */