2.5.38 s390 fixes: 15_beauty.
Subsystems (3)
PATCH 1/1 2.5.38 s390 fixes: 15_beauty.
Remove bogus sanity checks and code cleanup.
arch/s390/kernel/process.c +5 -5
@@ -302,15 +302,15 @@ dump->magic =CMAGIC ; dump->start_code =0 ; dump->start_stack = regs->gprs[15 ] & ~(PAGE_SIZE -1 ); - dump->u_tsize = ((unsigned long ) current->mm->end_code) >>PAGE_SHIFT ; - dump->u_dsize = ((unsigned long ) (current->mm->brk + (PAGE_SIZE -1 ))) >>PAGE_SHIFT ; + dump->u_tsize = current->mm->end_code >>PAGE_SHIFT ; + dump->u_dsize = (current->mm->brk +PAGE_SIZE -1 ) >>PAGE_SHIFT ; dump->u_dsize -= dump->u_tsize; dump->u_ssize =0 ;if (dump->start_stack <TASK_SIZE ) - dump->u_ssize = ((unsigned long ) (TASK_SIZE - dump->start_stack)) >>PAGE_SHIFT ; -memcpy (&dump->regs.gprs[0 ],regs,sizeof (s390_regs)); + dump->u_ssize = (TASK_SIZE - dump->start_stack) >>PAGE_SHIFT ; +memcpy (&dump->regs, regs,sizeof (s390_regs));dump_fpu (regs, &dump->regs.fp_regs); -memcpy (&dump->regs.per_info,¤t->thread.per_info,sizeof (per_struct)); + dump->regs.per_info = current->thread.per_info; }/*
arch/s390/kernel/setup.c +4 -1
@@ -526,7 +526,10 @@ (loops_per_jiffy/(5000/HZ))%100); }if (cpu_online_map & (1 << n)) { - cpuinfo = &safe_get_cpu_lowcore (n)->cpu_data; +if (smp_processor_id () == n) + cpuinfo = &S390_lowcore.cpu_data; +else + cpuinfo = &lowcore_ptr[n]->cpu_data;seq_printf (m,"processor %li: " "version = %02X, " "identification = %06X, "
arch/s390/kernel/smp.c +6 -6
@@ -173,7 +173,7 @@for (i =0 ; i <NR_CPUS ; i++) {if (!cpu_online (i) ||smp_processor_id () == i)continue ; - low_core_addr = (unsigned long )get_cpu_lowcore (i); + low_core_addr = (unsigned long ) lowcore_ptr[i]; do { rc = signal_processor_ps(&dummy, low_core_addr, i, sigp_store_status_at_address);
@@ -188,7 +188,7 @@void smp_send_stop (void ) {/* write magic number to zero page (absolute 0) */ -get_cpu_lowcore (smp_processor_id ())->panic_magic = __PANIC_MAGIC; + lowcore_ptr[smp_processor_id ()]->panic_magic = __PANIC_MAGIC;/* stop other processors. */ do_send_stop ();
@@ -296,7 +296,7 @@*/ static sigp_ccode smp_ext_bitcall (int cpu,ec_bit_sig sig) { -struct _lowcore *lowcore =get_cpu_lowcore (cpu); +struct _lowcore *lowcore = lowcore_ptr[cpu];sigp_ccode ccode;/*
@@ -319,7 +319,7 @@for (i =0 ; i <NR_CPUS ; i++) {if (!cpu_online (i) ||smp_processor_id () == i)continue ; - lowcore =get_cpu_lowcore (i); + lowcore = lowcore_ptr[i];/* * Set signaling bit in lowcore of target cpu and kick it */
@@ -519,7 +519,7 @@unhash_process (idle); - cpu_lowcore =get_cpu_lowcore (cpu); + cpu_lowcore = lowcore_ptr[cpu]; cpu_lowcore->save_area[15 ] = idle->thread.ksp; cpu_lowcore->kernel_stack = (__u32 ) idle->thread_info + (2 *PAGE_SIZE ); __asm__ __volatile__("la 1,%0\n\t"
@@ -555,7 +555,7 @@/* * Initialize prefix pages and stacks for all possible cpus */ -print_cpu_info (&safe_get_cpu_lowcore (0 )->cpu_data); +print_cpu_info (&S390_lowcore.cpu_data);for (i =0 ; i <NR_CPUS ; i++) {if (!cpu_possible (i))
arch/s390/mm/fault.c +6 -4
@@ -234,16 +234,18 @@* the fault. */ switch (handle_mm_fault (mm, vma, address, error_code ==4 )) { -case 1 : +case VM_FAULT_MINOR : tsk->min_flt++;break ; -case 2 : +case VM_FAULT_MAJOR : tsk->maj_flt++;break ; -case 0 : +case VM_FAULT_SIGBUS : goto do_sigbus; -default : +case VM_FAULT_OOM : goto out_of_memory; +default : +BUG (); }up_read (&mm->mmap_sem);
arch/s390x/kernel/process.c +5 -5
@@ -292,15 +292,15 @@ dump->magic =CMAGIC ; dump->start_code =0 ; dump->start_stack = regs->gprs[15 ] & ~(PAGE_SIZE -1 ); - dump->u_tsize = ((unsigned long ) current->mm->end_code) >>PAGE_SHIFT ; - dump->u_dsize = ((unsigned long ) (current->mm->brk + (PAGE_SIZE -1 ))) >>PAGE_SHIFT ; + dump->u_tsize = current->mm->end_code >>PAGE_SHIFT ; + dump->u_dsize = (current->mm->brk +PAGE_SIZE -1 ) >>PAGE_SHIFT ; dump->u_dsize -= dump->u_tsize; dump->u_ssize =0 ;if (dump->start_stack <TASK_SIZE ) - dump->u_ssize = ((unsigned long ) (TASK_SIZE - dump->start_stack)) >>PAGE_SHIFT ; -memcpy (&dump->regs.gprs[0 ],regs,sizeof (s390_regs)); + dump->u_ssize = (TASK_SIZE - dump->start_stack) >>PAGE_SHIFT ; +memcpy (&dump->regs, regs,sizeof (s390_regs));dump_fpu (regs, &dump->regs.fp_regs); -memcpy (&dump->regs.per_info,¤t->thread.per_info,sizeof (per_struct)); + dump->regs.per_info = current->thread.per_info; }/*
arch/s390x/kernel/setup.c +4 -1
@@ -516,7 +516,10 @@ (loops_per_jiffy/(5000/HZ))%100); }if (cpu_online_map & (1 << n)) { - cpuinfo = &safe_get_cpu_lowcore (n)->cpu_data; +if (smp_processor_id () == n) + cpuinfo = &S390_lowcore.cpu_data; +else + cpuinfo = &lowcore_ptr[n]->cpu_data;seq_printf (m,"processor %li: " "version = %02X, " "identification = %06X, "
arch/s390x/kernel/smp.c +6 -6
@@ -172,7 +172,7 @@for (i =0 ; i <NR_CPUS ; i++) {if (!cpu_online (i) ||smp_processor_id () == i)continue ; - low_core_addr = (unsigned long )get_cpu_lowcore (i); + low_core_addr = (unsigned long ) lowcore_ptr[i]; do { rc = signal_processor_ps(&dummy, low_core_addr, i, sigp_store_status_at_address);
@@ -187,7 +187,7 @@void smp_send_stop (void ) {/* write magic number to zero page (absolute 0) */ -get_cpu_lowcore (smp_processor_id ())->panic_magic = __PANIC_MAGIC; + lowcore_ptr[smp_processor_id ()]->panic_magic = __PANIC_MAGIC;/* stop other processors. */ do_send_stop ();
@@ -298,7 +298,7 @@/* * Set signaling bit in lowcore of target cpu and kick it */ -set_bit (sig, &(get_cpu_lowcore (cpu)->ext_call_fast)); +set_bit (sig, &lowcore_ptr[cpu]->ext_call_fast); ccode =signal_processor (cpu, sigp_external_call);return ccode; }
@@ -317,7 +317,7 @@/* * Set signaling bit in lowcore of target cpu and kick it */ -set_bit (sig, &(get_cpu_lowcore (i)->ext_call_fast)); +set_bit (sig, &lowcore_ptr[i]->ext_call_fast);while (signal_processor (i, sigp_external_call) == sigp_busy)udelay (10 ); }
@@ -499,7 +499,7 @@unhash_process (idle); - cpu_lowcore =get_cpu_lowcore (cpu); + cpu_lowcore = lowcore_ptr[cpu]; cpu_lowcore->save_area[15 ] = idle->thread.ksp; cpu_lowcore->kernel_stack = (__u64 ) idle->thread_info + (4 *PAGE_SIZE ); __asm__ __volatile__("la 1,%0\n\t"
@@ -535,7 +535,7 @@/* * Initialize prefix pages and stacks for all possible cpus */ -print_cpu_info (&safe_get_cpu_lowcore (0 )->cpu_data); +print_cpu_info (&S390_lowcore.cpu_data);for (i =0 ; i <NR_CPUS ; i++) {if (!cpu_possible (i))
arch/s390x/mm/fault.c +6 -4
@@ -234,16 +234,18 @@* the fault. */ switch (handle_mm_fault (mm, vma, address, error_code ==4 )) { -case 1 : +case VM_FAULT_MINOR : tsk->min_flt++;break ; -case 2 : +case VM_FAULT_MAJOR : tsk->maj_flt++;break ; -case 0 : +case VM_FAULT_SIGBUS : goto do_sigbus; -default : +case VM_FAULT_OOM : goto out_of_memory; +default : +BUG (); }up_read (&mm->mmap_sem);
drivers/s390/char/hwc_rw.c +0 -2
@@ -2215,8 +2215,6 @@void hwc_interrupt_handler (struct pt_regs *regs,__u16 code) { -int cpu =smp_processor_id (); -u32 ext_int_param =hwc_ext_int_param ();irq_enter ();
drivers/s390/cio/airq.c +3 -3
@@ -3,7 +3,7 @@* S/390 common I/O routines -- special interrupt registration * currently used only by qdio * -* $Revision: 1.2 $ +* $Revision: 1.3 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation
@@ -60,7 +60,7 @@sprintf (dbf_txt,"ret:%d" , ret);CIO_TRACE_EVENT (4 , dbf_txt); -return (ret); +return ret; }int
@@ -85,7 +85,7 @@sprintf (dbf_txt,"ret:%d" , ret);CIO_TRACE_EVENT (4 , dbf_txt); -return (ret); +return ret; }void
drivers/s390/cio/blacklist.c +4 -4
@@ -1,7 +1,7 @@/* * drivers/s390/cio/blacklist.c * S/390 common I/O routines -- blacklisting of specific devices -* $Revision: 1.5 $ +* $Revision: 1.7 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation
@@ -134,7 +134,7 @@int is_blacklisted (int devno) { -return (test_bit (devno, &bl_dev)); +return test_bit (devno, &bl_dev); }#ifdef CONFIG_PROC_FS
@@ -243,10 +243,10 @@return -EFAULT ; } buf[user_len] ='\0' ; - +#if 0 CIO_DEBUG (KERN_DEBUG ,2 ,"/proc/cio_ignore: '%s'\n" , buf); - +#endif blacklist_parse_proc_parameters (buf);vfree (buf);
drivers/s390/cio/cio.c +17 -29
167 lines not on this page · raw message
drivers/s390/cio/cio_debug.h +4 -4
@@ -3,9 +3,9 @@#define SANITY_CHECK (irq) do { \ if (irq > highest_subchannel || irq < 0) \ - return (-ENODEV); \ + return -ENODEV; \ if (ioinfo[irq] == INVALID_STORAGE_AREA) \ - return (-ENODEV); \ + return -ENODEV; \ if (ioinfo[irq]->st) \ return -ENODEV; \ } while(0)
@@ -20,14 +20,14 @@ #define CIO_MSG_EVENT(imp, args...) do { \ if (cio_debug_initialized) \ debug_sprintf_event(cio_debug_msg_id, \ - imp, \ + imp , \ ##args); \ } while (0) #define CIO_CRW_EVENT(imp, args...) do { \ if (cio_debug_initialized) \ debug_sprintf_event(cio_debug_crw_id, \ - imp, \ + imp , \ ##args); \ } while (0)
drivers/s390/cio/ioinfo.c +12 -12
@@ -1,7 +1,7 @@/* * drivers/s390/cio/ioinfo.c * S/390 common I/O routines -- the ioinfo structure -* $Revision: 1.3 $ +* $Revision: 1.4 $ * * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, * IBM Corporation
@@ -102,12 +102,12 @@int get_dev_info_by_irq (int irq,s390_dev_info_t * pdi) { -if (irq > highest_subchannel || irq <0 ) \ -return (-ENODEV ); \ -if (ioinfo[irq] ==INVALID_STORAGE_AREA ) \ -return (-ENODEV ); \ -if (ioinfo[irq]->st) \ -return -ENODEV ; \ +if (irq > highest_subchannel || irq <0 ) +return -ENODEV ; +if (ioinfo[irq] ==INVALID_STORAGE_AREA ) +return -ENODEV ; +if (ioinfo[irq]->st) +return -ENODEV ;if (pdi ==NULL )return -EINVAL ;
@@ -189,7 +189,7 @@ } } -return (rc); +return rc; }
@@ -211,7 +211,7 @@ } } -return (rc); +return rc; }unsigned int
@@ -235,7 +235,7 @@* defined who's device number isn't valid ... */ if (ioinfo[irq]->schib.pmcw.dnv) -return (ioinfo[irq]->schib.pmcw.dev); +return ioinfo[irq]->schib.pmcw.dev;else return -1 ; }
@@ -258,9 +258,9 @@ s390_set_private_data(int irq, void *data) {if (irq > highest_subchannel || irq <0 ) -return (-ENODEV ); +return -ENODEV ;if (ioinfo[irq] ==INVALID_STORAGE_AREA ) -return (-ENODEV ); +return -ENODEV ;if (ioinfo[irq]->st)return -ENODEV ; ioinfo[irq]->private_data = data;
drivers/s390/cio/requestirq.c +2 -6
@@ -253,8 +253,6 @@int retry =5 ;char dbf_txt[15 ]; -SANITY_CHECK (irq); -sprintf (dbf_txt,"ensch%x" , irq);CIO_TRACE_EVENT (2 , dbf_txt);
@@ -324,7 +322,7 @@sprintf (dbf_txt,"ret:%d" , ret);CIO_TRACE_EVENT (2 , dbf_txt); -return (ret); +return ret; }/*
@@ -338,8 +336,6 @@int retry =5 ;char dbf_txt[15 ]; -SANITY_CHECK (irq); -sprintf (dbf_txt,"dissch%x" , irq);CIO_TRACE_EVENT (2 , dbf_txt);
@@ -427,7 +423,7 @@sprintf (dbf_txt,"ret:%d" , ret);CIO_TRACE_EVENT (2 , dbf_txt); -return (ret); +return ret; }/* FIXME: there must be a cleaner way to express what happens */
drivers/s390/cio/s390io.c +14 -26
@@ -565,17 +565,13 @@char dbf_txt[15 ]; -if (!buffer || !length) { -return (-EINVAL ); - - } +if (!buffer || !length) +return -EINVAL ;SANITY_CHECK (irq); -if (ioinfo[irq]->ui.flags.oper ==0 ) { -return (-ENODEV ); - - } +if (ioinfo[irq]->ui.flags.oper ==0 ) +return -ENODEV ;sprintf (dbf_txt,"rddevch%x" , irq);CIO_TRACE_EVENT (4 , dbf_txt);
@@ -687,11 +683,11 @@SANITY_CHECK (irq);if (!buffer || !length) { -return (-EINVAL ); +return -EINVAL ; }else if (ioinfo[irq]->ui.flags.oper ==0 ) { -return (-ENODEV ); +return -ENODEV ; }else if (ioinfo[irq]->ui.flags.esid ==0 ) { -return (-EOPNOTSUPP ); +return -EOPNOTSUPP ; }
@@ -857,7 +853,7 @@ } -return (ret); +return ret; }
@@ -1299,7 +1295,7 @@ } -return (ret); +return ret; }/*
@@ -1336,10 +1332,8 @@int i;int failure =0 ;/* nothing went wrong yet */ -SANITY_CHECK (irq); -if (ioinfo[irq]->ui.flags.oper ==0 ) { -return (-ENODEV ); +return -ENODEV ; }
@@ -1939,10 +1933,8 @@int inlreq =0 ;/* inline request_irq() */ int mpath =1 ;/* try multi-path first */ -SANITY_CHECK (irq); -if (ioinfo[irq]->ui.flags.oper ==0 ) { -return (-ENODEV ); +return -ENODEV ; }
@@ -2150,7 +2142,7 @@if (inlreq)free_irq (irq, pdevstat); -return (irq_ret); +return irq_ret; }/*
@@ -2172,10 +2164,8 @@int inlreq =0 ;/* inline request_irq() */ unsigned long flags; -SANITY_CHECK (irq); -if (ioinfo[irq]->ui.flags.oper ==0 ) { -return (-ENODEV ); +return -ENODEV ; }
@@ -2339,7 +2329,7 @@if (inlreq)free_irq (irq, pdevstat); -return (irq_ret); +return irq_ret; }/*
@@ -2360,8 +2350,6 @@int irq_ret =0 ;int inlreq =0 ; -SANITY_CHECK (irq); -if (!ioinfo[irq]->ui.flags.oper)/* no sense in trying */ return -ENODEV ;
drivers/s390/s390mach.c +3 -3
@@ -314,7 +314,7 @@ }while (1 ); -return (0 ); +return 0 ; }/*
@@ -557,7 +557,7 @@ }while (ccode ==0 ); -return (count); +return count; }#ifdef CONFIG_MACHCHK_WARNING
@@ -587,6 +587,6 @@DBG (KERN_DEBUG "post_warning : 1 warning machine check posted\n" ); - return (1); + return 1; }#endif
include/asm-s390/debug.h +4 -2
@@ -160,7 +160,8 @@ }extern debug_entry_t * -debug_sprintf_event (debug_info_t * id,int level,char *string,...); +debug_sprintf_event (debug_info_t * id,int level,char *string,...) + __attribute__ ((format (printf,3 ,4 ))); extern inline debug_entry_t*
@@ -195,7 +196,8 @@extern debug_entry_t * -debug_sprintf_exception (debug_info_t * id,int level,char *string,...); +debug_sprintf_exception (debug_info_t * id,int level,char *string,...) + __attribute__ ((format (printf,3 ,4 )));int debug_register_view (debug_info_t * id,struct debug_view * view);int debug_unregister_view (debug_info_t * id,struct debug_view * view);
include/asm-s390/lowcore.h +4 -13
@@ -176,25 +176,16 @@__u8 pad12[0x1000 -0xe04 ];/* 0xe04 */ } __attribute__((packed)); /* End structure*/ +#define S390_lowcore (*((struct _lowcore *) 0)) +extern struct _lowcore *lowcore_ptr[]; +extern __inline__void set_prefix (__u32 address) { __asm__ __volatile__ ("spx %0" : :"m" (address) :"memory" ); } -#define S390_lowcore (*((struct _lowcore *) 0)) -extern struct _lowcore *lowcore_ptr[]; - -#ifndef CONFIG_SMP -#define get_cpu_lowcore (cpu) (&S390_lowcore) -#define safe_get_cpu_lowcore (cpu) (&S390_lowcore) -#else -#define get_cpu_lowcore (cpu) (lowcore_ptr[(cpu)]) -#define safe_get_cpu_lowcore (cpu) \ - ((cpu) == smp_processor_id() ? &S390_lowcore : lowcore_ptr[(cpu)]) -#endif -#endif /* __ASSEMBLY__ */ -#define __PANIC_MAGIC 0xDEADC0DE#endif +#endif
include/asm-s390/system.h +3 -3
@@ -184,18 +184,18 @@#define local_irq_enable () ({ \ __u8 __dummy; \ __asm__ __volatile__ ( \ - "stosm 0(%0),0x03" : : "a" (&__dummy) : "memory"); \ + "stosm 0(%1),0x03" : "=m" (__dummy) : "a" (&__dummy) ); \ })#define local_irq_disable () ({ \ __u32 __flags; \ __asm__ __volatile__ ( \ - "stnsm 0(%0),0xFC" : : "a" (&__flags) : "memory"); \ + "stnsm 0(%1),0xFC" : "=m" (__flags) : "a" (&__flags) ); \ __flags; \ })#define local_save_flags (x) \ - __asm__ __volatile__("stosm 0(%0),0" : : "a" (&x) : "memory") + __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x) )#define local_irq_restore (x) \ __asm__ __volatile__("ssm 0(%0)" : : "a" (&x) : "memory")
include/asm-s390x/debug.h +4 -2
@@ -160,7 +160,8 @@ }extern debug_entry_t * -debug_sprintf_event (debug_info_t * id,int level,char *string,...); +debug_sprintf_event (debug_info_t * id,int level,char *string,...) + __attribute__ ((format (printf,3 ,4 ))); extern inline debug_entry_t*
@@ -195,7 +196,8 @@extern debug_entry_t * -debug_sprintf_exception (debug_info_t * id,int level,char *string,...); +debug_sprintf_exception (debug_info_t * id,int level,char *string,...) + __attribute__ ((format (printf,3 ,4 )));int debug_register_view (debug_info_t * id,struct debug_view * view);int debug_unregister_view (debug_info_t * id,struct debug_view * view);
include/asm-s390x/lowcore.h +4 -12
@@ -194,25 +194,17 @@__u8 pad17[0x2000 -0x1400 ];/* 0x1400 */ } __attribute__((packed)); /* End structure*/ +#define S390_lowcore (*((struct _lowcore *) 0)) +extern struct _lowcore *lowcore_ptr[]; +extern __inline__void set_prefix (__u32 address) { __asm__ __volatile__ ("spx %0" : :"m" (address) :"memory" ); } -#define S390_lowcore (*((struct _lowcore *) 0)) -extern struct _lowcore *lowcore_ptr[]; +#define __PANIC_MAGIC 0xDEADC0DE -#ifndef CONFIG_SMP -#define get_cpu_lowcore (cpu) (&S390_lowcore) -#define safe_get_cpu_lowcore (cpu) (&S390_lowcore) -#else -#define get_cpu_lowcore (cpu) (lowcore_ptr[(cpu)]) -#define safe_get_cpu_lowcore (cpu) \ - ((cpu) == smp_processor_id() ? &S390_lowcore : lowcore_ptr[(cpu)])#endif -#endif /* __ASSEMBLY__ */ - -#define __PANIC_MAGIC 0xDEADC0DE#endif
include/asm-s390x/system.h +4 -4
@@ -202,21 +202,21 @@#define local_irq_enable () ({ \ unsigned long __dummy; \ __asm__ __volatile__ ( \ - "stosm 0(%0),0x03" : : "a" (&__dummy) : "memory"); \ + "stosm 0(%1),0x03" : "=m" (__dummy) : "a" (&__dummy) ); \ })#define local_irq_disable () ({ \ unsigned long __flags; \ __asm__ __volatile__ ( \ - "stnsm 0(%0),0xFC" : : "a" (&__flags) : "memory"); \ + "stnsm 0(%1),0xfc" : "=m" (__flags) : "a" (&__flags) ); \ __flags; \ })#define local_save_flags (x) \ - __asm__ __volatile__("stosm 0(%0),0" : : "a" (&x) : "memory") + __asm__ __volatile__("stosm 0(%1),0" : "=m" (x) : "a" (&x) )#define local_irq_restore (x) \ - __asm__ __volatile__("ssm 0(%0)" : : "a" (&x) : "memory") + __asm__ __volatile__("ssm 0(%0)" : : "a" (&x) )#define irqs_disabled () \ ({ \