Commit 55bea71e authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fixes from Martin Schwidefsky:
 "A few more s390 patches for 4.9:
   - a fix for an overflow in the dasd driver reported by UBSAN
   - fix a regression and add hotplug memory to the zone movable again
   - add ignore defines for the pkey system calls
   - fix the ouput of the merged stack tracer
   - replace printk with pr_cont in arch/s390 where appropriate
   - remove the arch specific return_address function again
   - ignore reserved channel paths at boot time
   - add a missing hugetlb_bad_size call to the arch backend"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/mm: fix zone calculation in arch_add_memory()
  s390/dumpstack: use pr_cont within show_stack and die
  s390/dumpstack: get rid of return_address again
  s390/disassambler: use pr_cont where appropriate
  s390/dumpstack: use pr_cont where appropriate
  s390/dumpstack: restore reliable indicator for call traces
  s390/mm: use hugetlb_bad_size()
  s390/cio: don't register chpids in reserved state
  s390: ignore pkey system calls
  s390/dasd: avoid undefined behaviour
parents 7618c6a1 4a654294
...@@ -12,9 +12,7 @@ ...@@ -12,9 +12,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
unsigned long return_address(int depth); #define ftrace_return_address(n) __builtin_return_address(n)
#define ftrace_return_address(n) return_address(n)
void _mcount(void); void _mcount(void);
void ftrace_caller(void); void ftrace_caller(void);
......
...@@ -192,7 +192,7 @@ struct task_struct; ...@@ -192,7 +192,7 @@ struct task_struct;
struct mm_struct; struct mm_struct;
struct seq_file; struct seq_file;
typedef int (*dump_trace_func_t)(void *data, unsigned long address); typedef int (*dump_trace_func_t)(void *data, unsigned long address, int reliable);
void dump_trace(dump_trace_func_t func, void *data, void dump_trace(dump_trace_func_t func, void *data,
struct task_struct *task, unsigned long sp); struct task_struct *task, unsigned long sp);
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define __IGNORE_time #define __IGNORE_time
#define __IGNORE_pkey_mprotect
#define __IGNORE_pkey_alloc
#define __IGNORE_pkey_free
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_ALARM
......
...@@ -2014,12 +2014,12 @@ void show_code(struct pt_regs *regs) ...@@ -2014,12 +2014,12 @@ void show_code(struct pt_regs *regs)
*ptr++ = '\t'; *ptr++ = '\t';
ptr += print_insn(ptr, code + start, addr); ptr += print_insn(ptr, code + start, addr);
start += opsize; start += opsize;
printk("%s", buffer); pr_cont("%s", buffer);
ptr = buffer; ptr = buffer;
ptr += sprintf(ptr, "\n "); ptr += sprintf(ptr, "\n ");
hops++; hops++;
} }
printk("\n"); pr_cont("\n");
} }
void print_fn_code(unsigned char *code, unsigned long len) void print_fn_code(unsigned char *code, unsigned long len)
......
...@@ -38,10 +38,10 @@ __dump_trace(dump_trace_func_t func, void *data, unsigned long sp, ...@@ -38,10 +38,10 @@ __dump_trace(dump_trace_func_t func, void *data, unsigned long sp,
if (sp < low || sp > high - sizeof(*sf)) if (sp < low || sp > high - sizeof(*sf))
return sp; return sp;
sf = (struct stack_frame *) sp; sf = (struct stack_frame *) sp;
if (func(data, sf->gprs[8], 0))
return sp;
/* Follow the backchain. */ /* Follow the backchain. */
while (1) { while (1) {
if (func(data, sf->gprs[8]))
return sp;
low = sp; low = sp;
sp = sf->back_chain; sp = sf->back_chain;
if (!sp) if (!sp)
...@@ -49,6 +49,8 @@ __dump_trace(dump_trace_func_t func, void *data, unsigned long sp, ...@@ -49,6 +49,8 @@ __dump_trace(dump_trace_func_t func, void *data, unsigned long sp,
if (sp <= low || sp > high - sizeof(*sf)) if (sp <= low || sp > high - sizeof(*sf))
return sp; return sp;
sf = (struct stack_frame *) sp; sf = (struct stack_frame *) sp;
if (func(data, sf->gprs[8], 1))
return sp;
} }
/* Zero backchain detected, check for interrupt frame. */ /* Zero backchain detected, check for interrupt frame. */
sp = (unsigned long) (sf + 1); sp = (unsigned long) (sf + 1);
...@@ -56,7 +58,7 @@ __dump_trace(dump_trace_func_t func, void *data, unsigned long sp, ...@@ -56,7 +58,7 @@ __dump_trace(dump_trace_func_t func, void *data, unsigned long sp,
return sp; return sp;
regs = (struct pt_regs *) sp; regs = (struct pt_regs *) sp;
if (!user_mode(regs)) { if (!user_mode(regs)) {
if (func(data, regs->psw.addr)) if (func(data, regs->psw.addr, 1))
return sp; return sp;
} }
low = sp; low = sp;
...@@ -85,33 +87,12 @@ void dump_trace(dump_trace_func_t func, void *data, struct task_struct *task, ...@@ -85,33 +87,12 @@ void dump_trace(dump_trace_func_t func, void *data, struct task_struct *task,
} }
EXPORT_SYMBOL_GPL(dump_trace); EXPORT_SYMBOL_GPL(dump_trace);
struct return_address_data { static int show_address(void *data, unsigned long address, int reliable)
unsigned long address;
int depth;
};
static int __return_address(void *data, unsigned long address)
{
struct return_address_data *rd = data;
if (rd->depth--)
return 0;
rd->address = address;
return 1;
}
unsigned long return_address(int depth)
{
struct return_address_data rd = { .depth = depth + 2 };
dump_trace(__return_address, &rd, NULL, current_stack_pointer());
return rd.address;
}
EXPORT_SYMBOL_GPL(return_address);
static int show_address(void *data, unsigned long address)
{ {
printk("([<%016lx>] %pSR)\n", address, (void *)address); if (reliable)
printk(" [<%016lx>] %pSR \n", address, (void *)address);
else
printk("([<%016lx>] %pSR)\n", address, (void *)address);
return 0; return 0;
} }
...@@ -138,14 +119,14 @@ void show_stack(struct task_struct *task, unsigned long *sp) ...@@ -138,14 +119,14 @@ void show_stack(struct task_struct *task, unsigned long *sp)
else else
stack = (unsigned long *)task->thread.ksp; stack = (unsigned long *)task->thread.ksp;
} }
printk(KERN_DEFAULT "Stack:\n");
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
if (((addr_t) stack & (THREAD_SIZE-1)) == 0) if (((addr_t) stack & (THREAD_SIZE-1)) == 0)
break; break;
if ((i * sizeof(long) % 32) == 0) if (i % 4 == 0)
printk("%s ", i == 0 ? "" : "\n"); printk(KERN_DEFAULT " ");
printk("%016lx ", *stack++); pr_cont("%016lx%c", *stack++, i % 4 == 3 ? '\n' : ' ');
} }
printk("\n");
show_trace(task, (unsigned long)sp); show_trace(task, (unsigned long)sp);
} }
...@@ -163,13 +144,13 @@ void show_registers(struct pt_regs *regs) ...@@ -163,13 +144,13 @@ void show_registers(struct pt_regs *regs)
mode = user_mode(regs) ? "User" : "Krnl"; mode = user_mode(regs) ? "User" : "Krnl";
printk("%s PSW : %p %p", mode, (void *)regs->psw.mask, (void *)regs->psw.addr); printk("%s PSW : %p %p", mode, (void *)regs->psw.mask, (void *)regs->psw.addr);
if (!user_mode(regs)) if (!user_mode(regs))
printk(" (%pSR)", (void *)regs->psw.addr); pr_cont(" (%pSR)", (void *)regs->psw.addr);
printk("\n"); pr_cont("\n");
printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x "
"P:%x AS:%x CC:%x PM:%x", psw->r, psw->t, psw->i, psw->e, "P:%x AS:%x CC:%x PM:%x", psw->r, psw->t, psw->i, psw->e,
psw->key, psw->m, psw->w, psw->p, psw->as, psw->cc, psw->pm); psw->key, psw->m, psw->w, psw->p, psw->as, psw->cc, psw->pm);
printk(" RI:%x EA:%x", psw->ri, psw->eaba); pr_cont(" RI:%x EA:%x\n", psw->ri, psw->eaba);
printk("\n%s GPRS: %016lx %016lx %016lx %016lx\n", mode, printk("%s GPRS: %016lx %016lx %016lx %016lx\n", mode,
regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]);
printk(" %016lx %016lx %016lx %016lx\n", printk(" %016lx %016lx %016lx %016lx\n",
regs->gprs[4], regs->gprs[5], regs->gprs[6], regs->gprs[7]); regs->gprs[4], regs->gprs[5], regs->gprs[6], regs->gprs[7]);
...@@ -205,14 +186,14 @@ void die(struct pt_regs *regs, const char *str) ...@@ -205,14 +186,14 @@ void die(struct pt_regs *regs, const char *str)
printk("%s: %04x ilc:%d [#%d] ", str, regs->int_code & 0xffff, printk("%s: %04x ilc:%d [#%d] ", str, regs->int_code & 0xffff,
regs->int_code >> 17, ++die_counter); regs->int_code >> 17, ++die_counter);
#ifdef CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
printk("PREEMPT "); pr_cont("PREEMPT ");
#endif #endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
printk("SMP "); pr_cont("SMP ");
#endif #endif
if (debug_pagealloc_enabled()) if (debug_pagealloc_enabled())
printk("DEBUG_PAGEALLOC"); pr_cont("DEBUG_PAGEALLOC");
printk("\n"); pr_cont("\n");
notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV); notify_die(DIE_OOPS, str, regs, 0, regs->int_code & 0xffff, SIGSEGV);
print_modules(); print_modules();
show_regs(regs); show_regs(regs);
......
...@@ -222,7 +222,7 @@ static int __init service_level_perf_register(void) ...@@ -222,7 +222,7 @@ static int __init service_level_perf_register(void)
} }
arch_initcall(service_level_perf_register); arch_initcall(service_level_perf_register);
static int __perf_callchain_kernel(void *data, unsigned long address) static int __perf_callchain_kernel(void *data, unsigned long address, int reliable)
{ {
struct perf_callchain_entry_ctx *entry = data; struct perf_callchain_entry_ctx *entry = data;
......
...@@ -27,12 +27,12 @@ static int __save_address(void *data, unsigned long address, int nosched) ...@@ -27,12 +27,12 @@ static int __save_address(void *data, unsigned long address, int nosched)
return 1; return 1;
} }
static int save_address(void *data, unsigned long address) static int save_address(void *data, unsigned long address, int reliable)
{ {
return __save_address(data, address, 0); return __save_address(data, address, 0);
} }
static int save_address_nosched(void *data, unsigned long address) static int save_address_nosched(void *data, unsigned long address, int reliable)
{ {
return __save_address(data, address, 1); return __save_address(data, address, 1);
} }
......
...@@ -217,6 +217,7 @@ static __init int setup_hugepagesz(char *opt) ...@@ -217,6 +217,7 @@ static __init int setup_hugepagesz(char *opt)
} else if (MACHINE_HAS_EDAT2 && size == PUD_SIZE) { } else if (MACHINE_HAS_EDAT2 && size == PUD_SIZE) {
hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT); hugetlb_add_hstate(PUD_SHIFT - PAGE_SHIFT);
} else { } else {
hugetlb_bad_size();
pr_err("hugepagesz= specifies an unsupported page size %s\n", pr_err("hugepagesz= specifies an unsupported page size %s\n",
string); string);
return 0; return 0;
......
...@@ -151,36 +151,40 @@ void __init free_initrd_mem(unsigned long start, unsigned long end) ...@@ -151,36 +151,40 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
#ifdef CONFIG_MEMORY_HOTPLUG #ifdef CONFIG_MEMORY_HOTPLUG
int arch_add_memory(int nid, u64 start, u64 size, bool for_device) int arch_add_memory(int nid, u64 start, u64 size, bool for_device)
{ {
unsigned long normal_end_pfn = PFN_DOWN(memblock_end_of_DRAM()); unsigned long zone_start_pfn, zone_end_pfn, nr_pages;
unsigned long dma_end_pfn = PFN_DOWN(MAX_DMA_ADDRESS);
unsigned long start_pfn = PFN_DOWN(start); unsigned long start_pfn = PFN_DOWN(start);
unsigned long size_pages = PFN_DOWN(size); unsigned long size_pages = PFN_DOWN(size);
unsigned long nr_pages; pg_data_t *pgdat = NODE_DATA(nid);
int rc, zone_enum; struct zone *zone;
int rc, i;
rc = vmem_add_mapping(start, size); rc = vmem_add_mapping(start, size);
if (rc) if (rc)
return rc; return rc;
while (size_pages > 0) { for (i = 0; i < MAX_NR_ZONES; i++) {
if (start_pfn < dma_end_pfn) { zone = pgdat->node_zones + i;
nr_pages = (start_pfn + size_pages > dma_end_pfn) ? if (zone_idx(zone) != ZONE_MOVABLE) {
dma_end_pfn - start_pfn : size_pages; /* Add range within existing zone limits, if possible */
zone_enum = ZONE_DMA; zone_start_pfn = zone->zone_start_pfn;
} else if (start_pfn < normal_end_pfn) { zone_end_pfn = zone->zone_start_pfn +
nr_pages = (start_pfn + size_pages > normal_end_pfn) ? zone->spanned_pages;
normal_end_pfn - start_pfn : size_pages;
zone_enum = ZONE_NORMAL;
} else { } else {
nr_pages = size_pages; /* Add remaining range to ZONE_MOVABLE */
zone_enum = ZONE_MOVABLE; zone_start_pfn = start_pfn;
zone_end_pfn = start_pfn + size_pages;
} }
rc = __add_pages(nid, NODE_DATA(nid)->node_zones + zone_enum, if (start_pfn < zone_start_pfn || start_pfn >= zone_end_pfn)
start_pfn, size_pages); continue;
nr_pages = (start_pfn + size_pages > zone_end_pfn) ?
zone_end_pfn - start_pfn : size_pages;
rc = __add_pages(nid, zone, start_pfn, nr_pages);
if (rc) if (rc)
break; break;
start_pfn += nr_pages; start_pfn += nr_pages;
size_pages -= nr_pages; size_pages -= nr_pages;
if (!size_pages)
break;
} }
if (rc) if (rc)
vmem_remove_mapping(start, size); vmem_remove_mapping(start, size);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/processor.h> #include <asm/processor.h>
static int __s390_backtrace(void *data, unsigned long address) static int __s390_backtrace(void *data, unsigned long address, int reliable)
{ {
unsigned int *depth = data; unsigned int *depth = data;
......
...@@ -1205,7 +1205,7 @@ static int verify_fcx_max_data(struct dasd_device *device, __u8 lpm) ...@@ -1205,7 +1205,7 @@ static int verify_fcx_max_data(struct dasd_device *device, __u8 lpm)
mdc, lpm); mdc, lpm);
return mdc; return mdc;
} }
fcx_max_data = mdc * FCX_MAX_DATA_FACTOR; fcx_max_data = (u32)mdc * FCX_MAX_DATA_FACTOR;
if (fcx_max_data < private->fcx_max_data) { if (fcx_max_data < private->fcx_max_data) {
dev_warn(&device->cdev->dev, dev_warn(&device->cdev->dev,
"The maximum data size for zHPF requests %u " "The maximum data size for zHPF requests %u "
...@@ -1675,7 +1675,7 @@ static u32 get_fcx_max_data(struct dasd_device *device) ...@@ -1675,7 +1675,7 @@ static u32 get_fcx_max_data(struct dasd_device *device)
" data size for zHPF requests failed\n"); " data size for zHPF requests failed\n");
return 0; return 0;
} else } else
return mdc * FCX_MAX_DATA_FACTOR; return (u32)mdc * FCX_MAX_DATA_FACTOR;
} }
/* /*
......
...@@ -780,7 +780,7 @@ static int cfg_wait_idle(void) ...@@ -780,7 +780,7 @@ static int cfg_wait_idle(void)
static int __init chp_init(void) static int __init chp_init(void)
{ {
struct chp_id chpid; struct chp_id chpid;
int ret; int state, ret;
ret = crw_register_handler(CRW_RSC_CPATH, chp_process_crw); ret = crw_register_handler(CRW_RSC_CPATH, chp_process_crw);
if (ret) if (ret)
...@@ -791,7 +791,9 @@ static int __init chp_init(void) ...@@ -791,7 +791,9 @@ static int __init chp_init(void)
return 0; return 0;
/* Register available channel-paths. */ /* Register available channel-paths. */
chp_id_for_each(&chpid) { chp_id_for_each(&chpid) {
if (chp_info_get_status(chpid) != CHP_STATUS_NOT_RECOGNIZED) state = chp_info_get_status(chpid);
if (state == CHP_STATUS_CONFIGURED ||
state == CHP_STATUS_STANDBY)
chp_new(chpid); chp_new(chpid);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment