diff options
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/dis.c | 7 | ||||
-rw-r--r-- | arch/s390/kernel/early.c | 45 | ||||
-rw-r--r-- | arch/s390/kernel/entry.S | 7 | ||||
-rw-r--r-- | arch/s390/kernel/entry64.S | 7 | ||||
-rw-r--r-- | arch/s390/kernel/ipl.c | 29 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/s390/kernel/ptrace.c | 11 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 63 | ||||
-rw-r--r-- | arch/s390/kernel/stacktrace.c | 26 | ||||
-rw-r--r-- | arch/s390/kernel/time.c | 4 | ||||
-rw-r--r-- | arch/s390/kernel/traps.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/vtime.c | 4 |
12 files changed, 84 insertions, 128 deletions
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c index a057ebf108a..d3057318f2b 100644 --- a/arch/s390/kernel/dis.c +++ b/arch/s390/kernel/dis.c @@ -240,8 +240,8 @@ static const unsigned char formats[][7] = { [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },/* e.g. ley */ [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 }, /* e.g. ae */ [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 }, /* e.g. l */ - [INSTR_RX_URRD] = { 0x00, U4_8,D_20,X_12,B_16,0,0 }, /* e.g. bc */ - [INSTR_SI_URD] = { 0x00, D_20,B_16,U8_8,0,0,0 }, /* e.g. cli */ + [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 }, /* e.g. bc */ + [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 }, /* e.g. cli */ [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 }, /* e.g. tmy */ [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 }, /* e.g. mvsdk */ [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 }, @@ -1190,7 +1190,8 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr) else if (operand->flags & OPERAND_CR) ptr += sprintf(ptr, "%%c%i", value); else if (operand->flags & OPERAND_PCREL) - ptr += sprintf(ptr, "%lx", value + addr); + ptr += sprintf(ptr, "%lx", (signed int) value + + addr); else if (operand->flags & OPERAND_SIGNED) ptr += sprintf(ptr, "%i", value); else diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index 50538e54561..e6289ee74ec 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -171,37 +171,6 @@ static inline int memory_fast_detect(void) } #endif -#define ADDR2G (1UL << 31) - -static noinline __init unsigned long sclp_memory_detect(void) -{ - struct sclp_readinfo_sccb *sccb; - unsigned long long memsize; - - sccb = &s390_readinfo_sccb; - - if (sccb->header.response_code != 0x10) - return 0; - - if (sccb->rnsize) - memsize = sccb->rnsize << 20; - else - memsize = sccb->rnsize2 << 20; - if (sccb->rnmax) - memsize *= sccb->rnmax; - else - memsize *= sccb->rnmax2; -#ifndef CONFIG_64BIT - /* - * Can't deal with more than 2G in 31 bit addressing mode, so - * limit the value in order to avoid strange side effects. - */ - if (memsize > ADDR2G) - memsize = ADDR2G; -#endif - return (unsigned long) memsize; -} - static inline __init unsigned long __tprot(unsigned long addr) { int cc = -1; @@ -218,6 +187,7 @@ static inline __init unsigned long __tprot(unsigned long addr) /* Checking memory in 128KB increments. */ #define CHUNK_INCR (1UL << 17) +#define ADDR2G (1UL << 31) static noinline __init void find_memory_chunks(unsigned long memsize) { @@ -293,7 +263,7 @@ static noinline __init void setup_lowcore_early(void) */ void __init startup_init(void) { - unsigned long memsize; + unsigned long long memsize; ipl_save_parameters(); clear_bss_section(); @@ -305,8 +275,17 @@ void __init startup_init(void) sort_main_extable(); setup_lowcore_early(); sclp_readinfo_early(); + sclp_facilities_detect(); memsize = sclp_memory_detect(); +#ifndef CONFIG_64BIT + /* + * Can't deal with more than 2G in 31 bit addressing mode, so + * limit the value in order to avoid strange side effects. + */ + if (memsize > ADDR2G) + memsize = ADDR2G; +#endif if (memory_fast_detect() < 0) - find_memory_chunks(memsize); + find_memory_chunks((unsigned long) memsize); lockdep_on(); } diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 6234c6978a1..bc7ff3658c3 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -107,6 +107,11 @@ STACK_SIZE = 1 << STACK_SHIFT l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13 .endm + .macro SAVE_ALL_SVC psworg,savearea + la %r12,\psworg + l %r15,__LC_KERNEL_STACK # problem state -> load ksp + .endm + .macro SAVE_ALL_SYNC psworg,savearea la %r12,\psworg tm \psworg+1,0x01 # test problem state bit @@ -218,7 +223,7 @@ system_call: STORE_TIMER __LC_SYNC_ENTER_TIMER sysc_saveall: SAVE_ALL_BASE __LC_SAVE_AREA - SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA + SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA lh %r7,0x8a # get svc number from lowcore #ifdef CONFIG_VIRT_CPU_ACCOUNTING diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 685f11faa4b..2a7b1304418 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S @@ -99,6 +99,11 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \ larl %r13,system_call .endm + .macro SAVE_ALL_SVC psworg,savearea + la %r12,\psworg + lg %r15,__LC_KERNEL_STACK # problem state -> load ksp + .endm + .macro SAVE_ALL_SYNC psworg,savearea la %r12,\psworg tm \psworg+1,0x01 # test problem state bit @@ -207,7 +212,7 @@ system_call: STORE_TIMER __LC_SYNC_ENTER_TIMER sysc_saveall: SAVE_ALL_BASE __LC_SAVE_AREA - SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA + SAVE_ALL_SVC __LC_SVC_OLD_PSW,__LC_SAVE_AREA CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore #ifdef CONFIG_VIRT_CPU_ACCOUNTING diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 367caf92ea7..8b8f136d9cc 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -25,10 +25,6 @@ #define IPL_PARM_BLOCK_VERSION 0 -#define SCCB_VALID (s390_readinfo_sccb.header.response_code == 0x10) -#define SCCB_LOADPARM (&s390_readinfo_sccb.loadparm) -#define SCCB_FLAG (s390_readinfo_sccb.flags) - #define IPL_UNKNOWN_STR "unknown" #define IPL_CCW_STR "ccw" #define IPL_FCP_STR "fcp" @@ -146,6 +142,8 @@ static struct ipl_parameter_block *dump_block_ccw; static enum shutdown_action on_panic_action = SHUTDOWN_STOP; +static struct sclp_ipl_info sclp_ipl_info; + int diag308(unsigned long subcode, void *addr) { register unsigned long _addr asm("0") = (unsigned long) addr; @@ -297,8 +295,8 @@ static ssize_t sys_ipl_device_show(struct kset *kset, char *page) static struct subsys_attribute sys_ipl_device_attr = __ATTR(device, S_IRUGO, sys_ipl_device_show, NULL); -static ssize_t ipl_parameter_read(struct kobject *kobj, char *buf, loff_t off, - size_t count) +static ssize_t ipl_parameter_read(struct kobject *kobj, struct bin_attribute *attr, + char *buf, loff_t off, size_t count) { unsigned int size = IPL_PARMBLOCK_SIZE; @@ -314,14 +312,13 @@ static struct bin_attribute ipl_parameter_attr = { .attr = { .name = "binary_parameter", .mode = S_IRUGO, - .owner = THIS_MODULE, }, .size = PAGE_SIZE, .read = &ipl_parameter_read, }; -static ssize_t ipl_scp_data_read(struct kobject *kobj, char *buf, loff_t off, - size_t count) +static ssize_t ipl_scp_data_read(struct kobject *kobj, struct bin_attribute *attr, + char *buf, loff_t off, size_t count) { unsigned int size = IPL_PARMBLOCK_START->ipl_info.fcp.scp_data_len; void *scp_data = &IPL_PARMBLOCK_START->ipl_info.fcp.scp_data; @@ -338,10 +335,9 @@ static struct bin_attribute ipl_scp_data_attr = { .attr = { .name = "scp_data", .mode = S_IRUGO, - .owner = THIS_MODULE, }, .size = PAGE_SIZE, - .read = &ipl_scp_data_read, + .read = ipl_scp_data_read, }; /* FCP ipl device attributes */ @@ -375,9 +371,9 @@ static ssize_t ipl_ccw_loadparm_show(struct kset *kset, char *page) { char loadparm[LOADPARM_LEN + 1] = {}; - if (!SCCB_VALID) + if (!sclp_ipl_info.is_valid) return sprintf(page, "#unknown#\n"); - memcpy(loadparm, SCCB_LOADPARM, LOADPARM_LEN); + memcpy(loadparm, &sclp_ipl_info.loadparm, LOADPARM_LEN); EBCASC(loadparm, LOADPARM_LEN); strstrip(loadparm); return sprintf(page, "%s\n", loadparm); @@ -910,9 +906,9 @@ static int __init reipl_ccw_init(void) reipl_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN; reipl_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW; /* check if read scp info worked and set loadparm */ - if (SCCB_VALID) + if (sclp_ipl_info.is_valid) memcpy(reipl_block_ccw->ipl_info.ccw.load_param, - SCCB_LOADPARM, LOADPARM_LEN); + &sclp_ipl_info.loadparm, LOADPARM_LEN); else /* read scp info failed: set empty loadparm (EBCDIC blanks) */ memset(reipl_block_ccw->ipl_info.ccw.load_param, 0x40, @@ -1007,7 +1003,7 @@ static int __init dump_fcp_init(void) { int rc; - if(!(SCCB_FLAG & 0x2) || !SCCB_VALID) + if (!sclp_ipl_info.has_dump) return 0; /* LDIPL DUMP is not installed */ if (!diag308_set_works) return 0; @@ -1088,6 +1084,7 @@ static int __init s390_ipl_init(void) { int rc; + sclp_get_ipl_info(&sclp_ipl_info); reipl_probe(); rc = ipl_init(); if (rc) diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index eb43c3b3126..441975b796f 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -93,8 +93,8 @@ void do_monitor_call(struct pt_regs *regs, long interruption_code) /* disable monitor call class 0 */ __ctl_clear_bit(8, 15); - atomic_notifier_call_chain(&idle_chain, CPU_NOT_IDLE, - (void *)(long) smp_processor_id()); + atomic_notifier_call_chain(&idle_chain, S390_CPU_NOT_IDLE, + (void *)(long) smp_processor_id()); } extern void s390_handle_mcck(void); @@ -115,7 +115,7 @@ static void default_idle(void) } rc = atomic_notifier_call_chain(&idle_chain, - CPU_IDLE, (void *)(long) cpu); + S390_CPU_IDLE, (void *)(long) cpu); if (rc != NOTIFY_OK && rc != NOTIFY_DONE) BUG(); if (rc != NOTIFY_OK) { diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 2a8f0872ea8..f4503ca2763 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c @@ -294,7 +294,6 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data) static int do_ptrace_normal(struct task_struct *child, long request, long addr, long data) { - unsigned long tmp; ptrace_area parea; int copied, ret; @@ -304,10 +303,7 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data) /* Remove high order bit from address (only for 31 bit). */ addr &= PSW_ADDR_INSN; /* read word at location addr. */ - copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); - if (copied != sizeof(tmp)) - return -EIO; - return put_user(tmp, (unsigned long __force __user *) data); + return generic_ptrace_peekdata(child, addr, data); case PTRACE_PEEKUSR: /* read the word at location addr in the USER area. */ @@ -318,10 +314,7 @@ do_ptrace_normal(struct task_struct *child, long request, long addr, long data) /* Remove high order bit from address (only for 31 bit). */ addr &= PSW_ADDR_INSN; /* write the word at location addr. */ - copied = access_process_vm(child, addr, &data, sizeof(data),1); - if (copied != sizeof(data)) - return -EIO; - return 0; + return generic_ptrace_pokedata(child, addr, data); case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 8ff2feaf9b0..182c085ae4d 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -410,58 +410,40 @@ EXPORT_SYMBOL(smp_ctl_clear_bit); unsigned int zfcpdump_prefix_array[NR_CPUS + 1] \ __attribute__((__section__(".data"))); -static void __init smp_get_save_areas(void) +static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { - unsigned int cpu, cpu_num, rc; - __u16 boot_cpu_addr; - if (ipl_info.type != IPL_TYPE_FCP_DUMP) return; - boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; - cpu_num = 1; - for (cpu = 0; cpu <= 65535; cpu++) { - if ((u16) cpu == boot_cpu_addr) - continue; - __cpu_logical_map[1] = (__u16) cpu; - if (signal_processor(1, sigp_sense) == sigp_not_operational) - continue; - if (cpu_num >= NR_CPUS) { - printk("WARNING: Registers for cpu %i are not " - "saved, since dump kernel was compiled with" - "NR_CPUS=%i!\n", cpu_num, NR_CPUS); - continue; - } - zfcpdump_save_areas[cpu_num] = - alloc_bootmem(sizeof(union save_area)); - while (1) { - rc = signal_processor(1, sigp_stop_and_store_status); - if (rc != sigp_busy) - break; - cpu_relax(); - } - memcpy(zfcpdump_save_areas[cpu_num], - (void *)(unsigned long) store_prefix() + - SAVE_AREA_BASE, SAVE_AREA_SIZE); -#ifdef __s390x__ - /* copy original prefix register */ - zfcpdump_save_areas[cpu_num]->s390x.pref_reg = - zfcpdump_prefix_array[cpu_num]; -#endif - cpu_num++; + if (cpu >= NR_CPUS) { + printk(KERN_WARNING "Registers for cpu %i not saved since dump " + "kernel was compiled with NR_CPUS=%i\n", cpu, NR_CPUS); + return; } + zfcpdump_save_areas[cpu] = alloc_bootmem(sizeof(union save_area)); + __cpu_logical_map[1] = (__u16) phy_cpu; + while (signal_processor(1, sigp_stop_and_store_status) == sigp_busy) + cpu_relax(); + memcpy(zfcpdump_save_areas[cpu], + (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE, + SAVE_AREA_SIZE); +#ifdef CONFIG_64BIT + /* copy original prefix register */ + zfcpdump_save_areas[cpu]->s390x.pref_reg = zfcpdump_prefix_array[cpu]; +#endif } union save_area *zfcpdump_save_areas[NR_CPUS + 1]; EXPORT_SYMBOL_GPL(zfcpdump_save_areas); #else -#define smp_get_save_areas() do { } while (0) -#endif + +static inline void smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) { } + +#endif /* CONFIG_ZFCPDUMP || CONFIG_ZFCPDUMP_MODULE */ /* * Lets check how many CPUs we have. */ - static unsigned int __init smp_count_cpus(void) { unsigned int cpu, num_cpus; @@ -470,7 +452,6 @@ static unsigned int __init smp_count_cpus(void) /* * cpu 0 is the boot cpu. See smp_prepare_boot_cpu. */ - boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; current_thread_info()->cpu = 0; num_cpus = 1; @@ -480,12 +461,11 @@ static unsigned int __init smp_count_cpus(void) __cpu_logical_map[1] = (__u16) cpu; if (signal_processor(1, sigp_sense) == sigp_not_operational) continue; + smp_get_save_area(num_cpus, cpu); num_cpus++; } - printk("Detected %d CPU's\n", (int) num_cpus); printk("Boot cpu address %2X\n", boot_cpu_addr); - return num_cpus; } @@ -606,7 +586,6 @@ void __init smp_setup_cpu_possible_map(void) { unsigned int phy_cpus, pos_cpus, cpu; - smp_get_save_areas(); phy_cpus = smp_count_cpus(); pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS); diff --git a/arch/s390/kernel/stacktrace.c b/arch/s390/kernel/stacktrace.c index 515ff9011dd..da692472996 100644 --- a/arch/s390/kernel/stacktrace.c +++ b/arch/s390/kernel/stacktrace.c @@ -12,7 +12,6 @@ #include <linux/kallsyms.h> static unsigned long save_context_stack(struct stack_trace *trace, - unsigned int *skip, unsigned long sp, unsigned long low, unsigned long high) @@ -28,10 +27,10 @@ static unsigned long save_context_stack(struct stack_trace *trace, sf = (struct stack_frame *)sp; while(1) { addr = sf->gprs[8] & PSW_ADDR_INSN; - if (!(*skip)) + if (!trace->skip) trace->entries[trace->nr_entries++] = addr; else - (*skip)--; + trace->skip--; if (trace->nr_entries >= trace->max_entries) return sp; low = sp; @@ -48,10 +47,10 @@ static unsigned long save_context_stack(struct stack_trace *trace, return sp; regs = (struct pt_regs *)sp; addr = regs->psw.addr & PSW_ADDR_INSN; - if (!(*skip)) + if (!trace->skip) trace->entries[trace->nr_entries++] = addr; else - (*skip)--; + trace->skip--; if (trace->nr_entries >= trace->max_entries) return sp; low = sp; @@ -65,20 +64,17 @@ void save_stack_trace(struct stack_trace *trace) unsigned long orig_sp, new_sp; orig_sp = sp & PSW_ADDR_INSN; - - new_sp = save_context_stack(trace, &trace->skip, orig_sp, - S390_lowcore.panic_stack - PAGE_SIZE, - S390_lowcore.panic_stack); + new_sp = save_context_stack(trace, orig_sp, + S390_lowcore.panic_stack - PAGE_SIZE, + S390_lowcore.panic_stack); if (new_sp != orig_sp) return; - new_sp = save_context_stack(trace, &trace->skip, new_sp, - S390_lowcore.async_stack - ASYNC_SIZE, - S390_lowcore.async_stack); + new_sp = save_context_stack(trace, new_sp, + S390_lowcore.async_stack - ASYNC_SIZE, + S390_lowcore.async_stack); if (new_sp != orig_sp) return; - - save_context_stack(trace, &trace->skip, new_sp, + save_context_stack(trace, new_sp, S390_lowcore.thread_info, S390_lowcore.thread_info + THREAD_SIZE); - return; } diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index 9c2872a7cca..48dae49bc1e 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c @@ -226,10 +226,10 @@ static int nohz_idle_notify(struct notifier_block *self, unsigned long action, void *hcpu) { switch (action) { - case CPU_IDLE: + case S390_CPU_IDLE: stop_hz_timer(); break; - case CPU_NOT_IDLE: + case S390_CPU_NOT_IDLE: start_hz_timer(); break; } diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index ee9186f8fb0..8ec9def83cc 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c @@ -262,6 +262,7 @@ void die(const char * str, struct pt_regs * regs, long err) print_modules(); show_regs(regs); bust_spinlocks(0); + add_taint(TAINT_DIE); spin_unlock_irq(&die_lock); if (in_interrupt()) panic("Fatal exception in interrupt"); @@ -319,7 +320,7 @@ static void __kprobes inline do_trap(long interruption_code, int signr, else { enum bug_trap_type btt; - btt = report_bug(regs->psw.addr & PSW_ADDR_INSN); + btt = report_bug(regs->psw.addr & PSW_ADDR_INSN, regs); if (btt == BUG_TRAP_TYPE_WARN) return; die(str, regs, interruption_code); diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 1e1a6ee2cac..b6ed143e859 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c @@ -545,10 +545,10 @@ static int vtimer_idle_notify(struct notifier_block *self, unsigned long action, void *hcpu) { switch (action) { - case CPU_IDLE: + case S390_CPU_IDLE: stop_cpu_timer(); break; - case CPU_NOT_IDLE: + case S390_CPU_NOT_IDLE: start_cpu_timer(); break; } |