Commit 162bdafa 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 couple of bux fixes, notable are the regression with ptrace vs
  restarting system calls and the patch for kdump to be able to copy
  from virtual memory"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390: fix system call restart after inferior call
  s390: Allow vmalloc target buffers for copy_from_oldmem()
  s390/sclp: properly detect line mode console
  s390/kprobes: add exrl to list of prohibited opcodes
  s390/3270: fix return value check in tty3270_resize_work()
parents d0e639c9 dbbfe487
...@@ -40,28 +40,26 @@ static inline void *load_real_addr(void *addr) ...@@ -40,28 +40,26 @@ static inline void *load_real_addr(void *addr)
} }
/* /*
* Copy up to one page to vmalloc or real memory * Copy real to virtual or real memory
*/ */
static ssize_t copy_page_real(void *buf, void *src, size_t csize) static int copy_from_realmem(void *dest, void *src, size_t count)
{ {
size_t size; unsigned long size;
int rc;
if (is_vmalloc_addr(buf)) { if (!count)
BUG_ON(csize >= PAGE_SIZE); return 0;
/* If buf is not page aligned, copy first part */ if (!is_vmalloc_or_module_addr(dest))
size = min(roundup(__pa(buf), PAGE_SIZE) - __pa(buf), csize); return memcpy_real(dest, src, count);
if (size) { do {
if (memcpy_real(load_real_addr(buf), src, size)) size = min(count, PAGE_SIZE - (__pa(dest) & ~PAGE_MASK));
if (memcpy_real(load_real_addr(dest), src, size))
return -EFAULT; return -EFAULT;
buf += size; count -= size;
dest += size;
src += size; src += size;
} } while (count);
/* Copy second part */ return 0;
size = csize - size;
return (size) ? memcpy_real(load_real_addr(buf), src, size) : 0;
} else {
return memcpy_real(buf, src, csize);
}
} }
/* /*
...@@ -114,7 +112,7 @@ static ssize_t copy_oldmem_page_kdump(char *buf, size_t csize, ...@@ -114,7 +112,7 @@ static ssize_t copy_oldmem_page_kdump(char *buf, size_t csize,
rc = copy_to_user_real((void __force __user *) buf, rc = copy_to_user_real((void __force __user *) buf,
(void *) src, csize); (void *) src, csize);
else else
rc = copy_page_real(buf, (void *) src, csize); rc = copy_from_realmem(buf, (void *) src, csize);
return (rc == 0) ? rc : csize; return (rc == 0) ? rc : csize;
} }
...@@ -210,7 +208,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count) ...@@ -210,7 +208,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count)
if (OLDMEM_BASE) { if (OLDMEM_BASE) {
if ((unsigned long) src < OLDMEM_SIZE) { if ((unsigned long) src < OLDMEM_SIZE) {
copied = min(count, OLDMEM_SIZE - (unsigned long) src); copied = min(count, OLDMEM_SIZE - (unsigned long) src);
rc = memcpy_real(dest, src + OLDMEM_BASE, copied); rc = copy_from_realmem(dest, src + OLDMEM_BASE, copied);
if (rc) if (rc)
return rc; return rc;
} }
...@@ -223,7 +221,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count) ...@@ -223,7 +221,7 @@ int copy_from_oldmem(void *dest, void *src, size_t count)
return rc; return rc;
} }
} }
return memcpy_real(dest + copied, src + copied, count - copied); return copy_from_realmem(dest + copied, src + copied, count - copied);
} }
/* /*
......
...@@ -266,6 +266,7 @@ sysc_sigpending: ...@@ -266,6 +266,7 @@ sysc_sigpending:
tm __TI_flags+3(%r12),_TIF_SYSCALL tm __TI_flags+3(%r12),_TIF_SYSCALL
jno sysc_return jno sysc_return
lm %r2,%r7,__PT_R2(%r11) # load svc arguments lm %r2,%r7,__PT_R2(%r11) # load svc arguments
l %r10,__TI_sysc_table(%r12) # 31 bit system call table
xr %r8,%r8 # svc 0 returns -ENOSYS xr %r8,%r8 # svc 0 returns -ENOSYS
clc __PT_INT_CODE+2(2,%r11),BASED(.Lnr_syscalls+2) clc __PT_INT_CODE+2(2,%r11),BASED(.Lnr_syscalls+2)
jnl sysc_nr_ok # invalid svc number -> do svc 0 jnl sysc_nr_ok # invalid svc number -> do svc 0
......
...@@ -297,6 +297,7 @@ sysc_sigpending: ...@@ -297,6 +297,7 @@ sysc_sigpending:
tm __TI_flags+7(%r12),_TIF_SYSCALL tm __TI_flags+7(%r12),_TIF_SYSCALL
jno sysc_return jno sysc_return
lmg %r2,%r7,__PT_R2(%r11) # load svc arguments lmg %r2,%r7,__PT_R2(%r11) # load svc arguments
lg %r10,__TI_sysc_table(%r12) # address of system call table
lghi %r8,0 # svc 0 returns -ENOSYS lghi %r8,0 # svc 0 returns -ENOSYS
llgh %r1,__PT_INT_CODE+2(%r11) # load new svc number llgh %r1,__PT_INT_CODE+2(%r11) # load new svc number
cghi %r1,NR_syscalls cghi %r1,NR_syscalls
......
...@@ -67,6 +67,11 @@ static int __kprobes is_prohibited_opcode(kprobe_opcode_t *insn) ...@@ -67,6 +67,11 @@ static int __kprobes is_prohibited_opcode(kprobe_opcode_t *insn)
case 0xac: /* stnsm */ case 0xac: /* stnsm */
case 0xad: /* stosm */ case 0xad: /* stosm */
return -EINVAL; return -EINVAL;
case 0xc6:
switch (insn[0] & 0x0f) {
case 0x00: /* exrl */
return -EINVAL;
}
} }
switch (insn[0]) { switch (insn[0]) {
case 0x0101: /* pr */ case 0x0101: /* pr */
...@@ -180,7 +185,6 @@ static int __kprobes is_insn_relative_long(kprobe_opcode_t *insn) ...@@ -180,7 +185,6 @@ static int __kprobes is_insn_relative_long(kprobe_opcode_t *insn)
break; break;
case 0xc6: case 0xc6:
switch (insn[0] & 0x0f) { switch (insn[0] & 0x0f) {
case 0x00: /* exrl */
case 0x02: /* pfdrl */ case 0x02: /* pfdrl */
case 0x04: /* cghrl */ case 0x04: /* cghrl */
case 0x05: /* chrl */ case 0x05: /* chrl */
......
...@@ -145,9 +145,11 @@ bool __init sclp_has_linemode(void) ...@@ -145,9 +145,11 @@ bool __init sclp_has_linemode(void)
if (sccb->header.response_code != 0x20) if (sccb->header.response_code != 0x20)
return 0; return 0;
if (sccb->sclp_send_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK)) if (!(sccb->sclp_send_mask & (EVTYP_OPCMD_MASK | EVTYP_PMSGCMD_MASK)))
return 1; return 0;
if (!(sccb->sclp_receive_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK)))
return 0; return 0;
return 1;
} }
bool __init sclp_has_vt220(void) bool __init sclp_has_vt220(void)
......
...@@ -810,7 +810,7 @@ static void tty3270_resize_work(struct work_struct *work) ...@@ -810,7 +810,7 @@ static void tty3270_resize_work(struct work_struct *work)
struct winsize ws; struct winsize ws;
screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols); screen = tty3270_alloc_screen(tp->n_rows, tp->n_cols);
if (!screen) if (IS_ERR(screen))
return; return;
/* Switch to new output size */ /* Switch to new output size */
spin_lock_bh(&tp->view.lock); spin_lock_bh(&tp->view.lock);
......
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