Skip to content

Commit

Permalink
Merge branch 'parisc-4.5-2' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/deller/parisc-linux

Pull parisc fixes from Helge Deller:
 "We wire up the copy_file_range syscall, fix two bugs in the parisc
  ptrace code and have a trivial fix for floppy.h to clarify an
  expression with parentheses"

* 'parisc-4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Wire up copy_file_range syscall
  parisc: Fix ptrace syscall number and return value modification
  parisc: Use parentheses around expression in floppy.h
  • Loading branch information
Linus Torvalds committed Mar 2, 2016
2 parents 12f1d7e + b4f09ae commit f983cd3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arch/parisc/include/asm/floppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* floppy accesses go through the track buffer.
*/
#define _CROSS_64KB(a,s,vdma) \
(!vdma && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))

#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)

Expand Down
3 changes: 2 additions & 1 deletion arch/parisc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,9 @@
#define __NR_membarrier (__NR_Linux + 343)
#define __NR_userfaultfd (__NR_Linux + 344)
#define __NR_mlock2 (__NR_Linux + 345)
#define __NR_copy_file_range (__NR_Linux + 346)

#define __NR_Linux_syscalls (__NR_mlock2 + 1)
#define __NR_Linux_syscalls (__NR_copy_file_range + 1)


#define __IGNORE_select /* newselect */
Expand Down
16 changes: 11 additions & 5 deletions arch/parisc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,19 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,

long do_syscall_trace_enter(struct pt_regs *regs)
{
long ret = 0;

/* Do the secure computing check first. */
secure_computing_strict(regs->gr[20]);

if (test_thread_flag(TIF_SYSCALL_TRACE) &&
tracehook_report_syscall_entry(regs))
ret = -1L;
tracehook_report_syscall_entry(regs)) {
/*
* Tracing decided this syscall should not happen or the
* debugger stored an invalid system call number. Skip
* the system call and the system call restart handling.
*/
regs->gr[20] = -1UL;
goto out;
}

#ifdef CONFIG_64BIT
if (!is_compat_task())
Expand All @@ -290,7 +295,8 @@ long do_syscall_trace_enter(struct pt_regs *regs)
regs->gr[24] & 0xffffffff,
regs->gr[23] & 0xffffffff);

return ret ? : regs->gr[20];
out:
return regs->gr[20];
}

void do_syscall_trace_exit(struct pt_regs *regs)
Expand Down
5 changes: 4 additions & 1 deletion arch/parisc/kernel/syscall.S
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ tracesys_next:
#endif

comiclr,>>= __NR_Linux_syscalls, %r20, %r0
b,n .Lsyscall_nosys
b,n .Ltracesys_nosys

LDREGX %r20(%r19), %r19

Expand All @@ -359,6 +359,9 @@ tracesys_next:
be 0(%sr7,%r19)
ldo R%tracesys_exit(%r2),%r2

.Ltracesys_nosys:
ldo -ENOSYS(%r0),%r28 /* set errno */

/* Do *not* call this function on the gateway page, because it
makes a direct call to syscall_trace. */

Expand Down
1 change: 1 addition & 0 deletions arch/parisc/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@
ENTRY_SAME(membarrier)
ENTRY_SAME(userfaultfd)
ENTRY_SAME(mlock2) /* 345 */
ENTRY_SAME(copy_file_range)


.ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))
Expand Down

0 comments on commit f983cd3

Please sign in to comment.