Skip to content

Commit 976fb3f

Browse files
committed
Merge branch 'parisc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller: "This patchset adds stack usage debug info for parisc and metag (on both the stack grows upwards), switches to the new generic realative extable search and sort routines, drops the long time ago removed syscalls alloc_hugepages and free_hugepages and wires up the new preadv2 and pwritev2 syscalls" * 'parisc-4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Wire up preadv2 and pwritev2 syscalls parisc: Use generic extable search and sort routines parisc: Panic immediately when panic_on_oops parisc,metag: Implement CONFIG_DEBUG_STACK_USAGE option parisc: Drop alloc_hugepages and free_hugepages syscalls
2 parents 9d85460 + 119a0a3 commit 976fb3f

11 files changed

Lines changed: 28 additions & 31 deletions

File tree

‎arch/parisc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config PARISC
1111
select RTC_DRV_GENERIC
1212
select INIT_ALL_POSSIBLE
1313
select BUG
14+
select BUILDTIME_EXTABLE_SORT
1415
select HAVE_PERF_EVENTS
1516
select GENERIC_ATOMIC64 if !64BIT
1617
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

‎arch/parisc/include/asm/assembly.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@
523523
*/
524524
#define ASM_EXCEPTIONTABLE_ENTRY(fault_addr, except_addr) \
525525
.section __ex_table,"aw" ! \
526-
ASM_ULONG_INSN fault_addr, except_addr ! \
526+
.word (fault_addr - .), (except_addr - .) ! \
527527
.previous
528528

529529

‎arch/parisc/include/asm/uaccess.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ static inline long access_ok(int type, const void __user * addr,
6060
* use a 32bit (unsigned int) address here.
6161
*/
6262

63+
#define ARCH_HAS_RELATIVE_EXTABLE
6364
struct exception_table_entry {
64-
unsigned long insn; /* address of insn that is allowed to fault. */
65-
unsigned long fixup; /* fixup routine */
65+
int insn; /* relative address of insn that is allowed to fault. */
66+
int fixup; /* relative address of fixup routine */
6667
};
6768

6869
#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\
6970
".section __ex_table,\"aw\"\n" \
70-
ASM_WORD_INSN #fault_addr ", " #except_addr "\n\t" \
71+
".word (" #fault_addr " - .), (" #except_addr " - .)\n\t" \
7172
".previous\n"
7273

7374
/*

‎arch/parisc/include/uapi/asm/unistd.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@
235235
#define __NR_io_getevents (__NR_Linux + 217)
236236
#define __NR_io_submit (__NR_Linux + 218)
237237
#define __NR_io_cancel (__NR_Linux + 219)
238-
#define __NR_alloc_hugepages (__NR_Linux + 220)
239-
#define __NR_free_hugepages (__NR_Linux + 221)
238+
#define __NR_alloc_hugepages (__NR_Linux + 220) /* not used */
239+
#define __NR_free_hugepages (__NR_Linux + 221) /* not used */
240240
#define __NR_exit_group (__NR_Linux + 222)
241241
#define __NR_lookup_dcookie (__NR_Linux + 223)
242242
#define __NR_epoll_create (__NR_Linux + 224)
@@ -362,8 +362,10 @@
362362
#define __NR_userfaultfd (__NR_Linux + 344)
363363
#define __NR_mlock2 (__NR_Linux + 345)
364364
#define __NR_copy_file_range (__NR_Linux + 346)
365+
#define __NR_preadv2 (__NR_Linux + 347)
366+
#define __NR_pwritev2 (__NR_Linux + 348)
365367

366-
#define __NR_Linux_syscalls (__NR_copy_file_range + 1)
368+
#define __NR_Linux_syscalls (__NR_pwritev2 + 1)
367369

368370

369371
#define __IGNORE_select /* newselect */

‎arch/parisc/kernel/sys_parisc.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,16 +368,6 @@ asmlinkage long parisc_fallocate(int fd, int mode, u32 offhi, u32 offlo,
368368
((u64)lenhi << 32) | lenlo);
369369
}
370370

371-
asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)
372-
{
373-
return -ENOMEM;
374-
}
375-
376-
asmlinkage int sys_free_hugepages(unsigned long addr)
377-
{
378-
return -EINVAL;
379-
}
380-
381371
long parisc_personality(unsigned long personality)
382372
{
383373
long err;

‎arch/parisc/kernel/syscall_table.S‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@
315315
ENTRY_COMP(io_getevents)
316316
ENTRY_COMP(io_submit)
317317
ENTRY_SAME(io_cancel)
318-
ENTRY_SAME(alloc_hugepages) /* 220 */
319-
ENTRY_SAME(free_hugepages)
318+
ENTRY_SAME(ni_syscall) /* 220: was alloc_hugepages */
319+
ENTRY_SAME(ni_syscall) /* was free_hugepages */
320320
ENTRY_SAME(exit_group)
321321
ENTRY_COMP(lookup_dcookie)
322322
ENTRY_SAME(epoll_create)
@@ -442,6 +442,8 @@
442442
ENTRY_SAME(userfaultfd)
443443
ENTRY_SAME(mlock2) /* 345 */
444444
ENTRY_SAME(copy_file_range)
445+
ENTRY_COMP(preadv2)
446+
ENTRY_COMP(pwritev2)
445447

446448

447449
.ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))

‎arch/parisc/kernel/traps.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
284284
if (in_interrupt())
285285
panic("Fatal exception in interrupt");
286286

287-
if (panic_on_oops) {
288-
printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
289-
ssleep(5);
287+
if (panic_on_oops)
290288
panic("Fatal exception");
291-
}
292289

293290
oops_exit();
294291
do_exit(SIGSEGV);

‎arch/parisc/mm/fault.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,6 @@ int fixup_exception(struct pt_regs *regs)
140140
{
141141
const struct exception_table_entry *fix;
142142

143-
/* If we only stored 32bit addresses in the exception table we can drop
144-
* out if we faulted on a 64bit address. */
145-
if ((sizeof(regs->iaoq[0]) > sizeof(fix->insn))
146-
&& (regs->iaoq[0] >> 32))
147-
return 0;
148-
149143
fix = search_exception_tables(regs->iaoq[0]);
150144
if (fix) {
151145
struct exception_data *d;
@@ -154,7 +148,8 @@ int fixup_exception(struct pt_regs *regs)
154148
d->fault_space = regs->isr;
155149
d->fault_addr = regs->ior;
156150

157-
regs->iaoq[0] = ((fix->fixup) & ~3);
151+
regs->iaoq[0] = (unsigned long)&fix->fixup + fix->fixup;
152+
regs->iaoq[0] &= ~3;
158153
/*
159154
* NOTE: In some cases the faulting instruction
160155
* may be in the delay slot of a branch. We

‎include/linux/sched.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,10 +2870,18 @@ static inline unsigned long stack_not_used(struct task_struct *p)
28702870
unsigned long *n = end_of_stack(p);
28712871

28722872
do { /* Skip over canary */
2873+
# ifdef CONFIG_STACK_GROWSUP
2874+
n--;
2875+
# else
28732876
n++;
2877+
# endif
28742878
} while (!*n);
28752879

2880+
# ifdef CONFIG_STACK_GROWSUP
2881+
return (unsigned long)end_of_stack(p) - (unsigned long)n;
2882+
# else
28762883
return (unsigned long)n - (unsigned long)end_of_stack(p);
2884+
# endif
28772885
}
28782886
#endif
28792887
extern void set_task_stack_end_magic(struct task_struct *tsk);

‎lib/Kconfig.debug‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ config DEBUG_KMEMLEAK_DEFAULT_OFF
558558

559559
config DEBUG_STACK_USAGE
560560
bool "Stack utilization instrumentation"
561-
depends on DEBUG_KERNEL && !IA64 && !PARISC && !METAG
561+
depends on DEBUG_KERNEL && !IA64
562562
help
563563
Enables the display of the minimum amount of free stack which each
564564
task has ever had available in the sysrq-T and sysrq-P debug output.

0 commit comments

Comments
 (0)