aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-11 13:09:59 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-11 13:09:59 -0400
commitf43a64c5e1a65d12b9b53a35ed2d5db441fcb64c (patch)
tree64e83b3cce9d8e659a48cd706c59c09dc183b6dc /arch
parent5c23804a0941a111752fdacefe0bea2db1b4d93f (diff)
parentf7ceba360cce9af3fbc4e5a5b1bd40b570b7021c (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/systbls.S4
-rw-r--r--arch/sparc64/Kconfig17
-rw-r--r--arch/sparc64/kernel/entry.S42
-rw-r--r--arch/sparc64/kernel/power.c3
-rw-r--r--arch/sparc64/kernel/ptrace.c46
-rw-r--r--arch/sparc64/kernel/smp.c10
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c2
-rw-r--r--arch/sparc64/kernel/sys32.S2
-rw-r--r--arch/sparc64/kernel/systbls.S8
-rw-r--r--arch/sparc64/kernel/time.c24
-rw-r--r--arch/sparc64/kernel/vmlinux.lds.S2
-rw-r--r--arch/sparc64/mm/fault.c16
-rw-r--r--arch/sparc64/solaris/entry64.S7
13 files changed, 97 insertions, 86 deletions
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S
index 928ffeb0fabb..025f4516e651 100644
--- a/arch/sparc/kernel/systbls.S
+++ b/arch/sparc/kernel/systbls.S
@@ -57,11 +57,11 @@ sys_call_table:
57/*180*/ .long sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_sigpending, sys_ni_syscall 57/*180*/ .long sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_sigpending, sys_ni_syscall
58/*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname 58/*185*/ .long sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
59/*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl 59/*190*/ .long sys_init_module, sys_personality, sparc_remap_file_pages, sys_epoll_create, sys_epoll_ctl
60/*195*/ .long sys_epoll_wait, sys_nis_syscall, sys_getppid, sparc_sigaction, sys_sgetmask 60/*195*/ .long sys_epoll_wait, sys_ioprio_set, sys_getppid, sparc_sigaction, sys_sgetmask
61/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir 61/*200*/ .long sys_ssetmask, sys_sigsuspend, sys_newlstat, sys_uselib, old_readdir
62/*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 62/*205*/ .long sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
63/*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo 63/*210*/ .long sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo
64/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_nis_syscall, sys_adjtimex 64/*215*/ .long sys_ipc, sys_sigreturn, sys_clone, sys_ioprio_get, sys_adjtimex
65/*220*/ .long sys_sigprocmask, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid 65/*220*/ .long sys_sigprocmask, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid
66/*225*/ .long sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16 66/*225*/ .long sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16
67/*230*/ .long sys_select, sys_time, sys_nis_syscall, sys_stime, sys_statfs64 67/*230*/ .long sys_select, sys_time, sys_nis_syscall, sys_stime, sys_statfs64
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 4b1329286242..6a4733683f0f 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -43,6 +43,23 @@ config SPARC64_PAGE_SIZE_4MB
43 43
44endchoice 44endchoice
45 45
46config SECCOMP
47 bool "Enable seccomp to safely compute untrusted bytecode"
48 depends on PROC_FS
49 default y
50 help
51 This kernel feature is useful for number crunching applications
52 that may need to compute untrusted bytecode during their
53 execution. By using pipes or other transports made available to
54 the process as file descriptors supporting the read/write
55 syscalls, it's possible to isolate those applications in
56 their own address space using seccomp. Once seccomp is
57 enabled via /proc/<pid>/seccomp, it cannot be disabled
58 and the task is only allowed to execute a few safe syscalls
59 defined by each seccomp mode.
60
61 If unsure, say Y. Only embedded should say N here.
62
46source kernel/Kconfig.hz 63source kernel/Kconfig.hz
47 64
48source "init/Kconfig" 65source "init/Kconfig"
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index d3973d8a7195..d781f10adc52 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -22,8 +22,6 @@
22#include <asm/estate.h> 22#include <asm/estate.h>
23#include <asm/auxio.h> 23#include <asm/auxio.h>
24 24
25/* #define SYSCALL_TRACING 1 */
26
27#define curptr g6 25#define curptr g6
28 26
29#define NR_SYSCALLS 284 /* Each OS is different... */ 27#define NR_SYSCALLS 284 /* Each OS is different... */
@@ -1554,11 +1552,12 @@ sys_ptrace: add %sp, PTREGS_OFF, %o0
1554 nop 1552 nop
1555 .align 32 1553 .align 32
15561: ldx [%curptr + TI_FLAGS], %l5 15541: ldx [%curptr + TI_FLAGS], %l5
1557 andcc %l5, _TIF_SYSCALL_TRACE, %g0 1555 andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0
1558 be,pt %icc, rtrap 1556 be,pt %icc, rtrap
1559 clr %l6 1557 clr %l6
1558 add %sp, PTREGS_OFF, %o0
1560 call syscall_trace 1559 call syscall_trace
1561 nop 1560 mov 1, %o1
1562 1561
1563 ba,pt %xcc, rtrap 1562 ba,pt %xcc, rtrap
1564 clr %l6 1563 clr %l6
@@ -1642,18 +1641,20 @@ linux_sparc_ni_syscall:
1642 or %l7, %lo(sys_ni_syscall), %l7 1641 or %l7, %lo(sys_ni_syscall), %l7
1643 1642
1644linux_syscall_trace32: 1643linux_syscall_trace32:
1644 add %sp, PTREGS_OFF, %o0
1645 call syscall_trace 1645 call syscall_trace
1646 nop 1646 clr %o1
1647 srl %i0, 0, %o0 1647 srl %i0, 0, %o0
1648 mov %i4, %o4 1648 srl %i4, 0, %o4
1649 srl %i1, 0, %o1 1649 srl %i1, 0, %o1
1650 srl %i2, 0, %o2 1650 srl %i2, 0, %o2
1651 b,pt %xcc, 2f 1651 b,pt %xcc, 2f
1652 srl %i3, 0, %o3 1652 srl %i3, 0, %o3
1653 1653
1654linux_syscall_trace: 1654linux_syscall_trace:
1655 add %sp, PTREGS_OFF, %o0
1655 call syscall_trace 1656 call syscall_trace
1656 nop 1657 clr %o1
1657 mov %i0, %o0 1658 mov %i0, %o0
1658 mov %i1, %o1 1659 mov %i1, %o1
1659 mov %i2, %o2 1660 mov %i2, %o2
@@ -1671,11 +1672,6 @@ linux_sparc_syscall32:
1671 bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI 1672 bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI
1672 srl %i0, 0, %o0 ! IEU0 1673 srl %i0, 0, %o0 ! IEU0
1673 sll %g1, 2, %l4 ! IEU0 Group 1674 sll %g1, 2, %l4 ! IEU0 Group
1674#ifdef SYSCALL_TRACING
1675 call syscall_trace_entry
1676 add %sp, PTREGS_OFF, %o0
1677 srl %i0, 0, %o0
1678#endif
1679 srl %i4, 0, %o4 ! IEU1 1675 srl %i4, 0, %o4 ! IEU1
1680 lduw [%l7 + %l4], %l7 ! Load 1676 lduw [%l7 + %l4], %l7 ! Load
1681 srl %i1, 0, %o1 ! IEU0 Group 1677 srl %i1, 0, %o1 ! IEU0 Group
@@ -1683,7 +1679,7 @@ linux_sparc_syscall32:
1683 1679
1684 srl %i5, 0, %o5 ! IEU1 1680 srl %i5, 0, %o5 ! IEU1
1685 srl %i2, 0, %o2 ! IEU0 Group 1681 srl %i2, 0, %o2 ! IEU0 Group
1686 andcc %l0, _TIF_SYSCALL_TRACE, %g0 ! IEU0 Group 1682 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0
1687 bne,pn %icc, linux_syscall_trace32 ! CTI 1683 bne,pn %icc, linux_syscall_trace32 ! CTI
1688 mov %i0, %l5 ! IEU1 1684 mov %i0, %l5 ! IEU1
1689 call %l7 ! CTI Group brk forced 1685 call %l7 ! CTI Group brk forced
@@ -1699,11 +1695,6 @@ linux_sparc_syscall:
1699 bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI 1695 bgeu,pn %xcc, linux_sparc_ni_syscall ! CTI
1700 mov %i0, %o0 ! IEU0 1696 mov %i0, %o0 ! IEU0
1701 sll %g1, 2, %l4 ! IEU0 Group 1697 sll %g1, 2, %l4 ! IEU0 Group
1702#ifdef SYSCALL_TRACING
1703 call syscall_trace_entry
1704 add %sp, PTREGS_OFF, %o0
1705 mov %i0, %o0
1706#endif
1707 mov %i1, %o1 ! IEU1 1698 mov %i1, %o1 ! IEU1
1708 lduw [%l7 + %l4], %l7 ! Load 1699 lduw [%l7 + %l4], %l7 ! Load
17094: mov %i2, %o2 ! IEU0 Group 17004: mov %i2, %o2 ! IEU0 Group
@@ -1711,7 +1702,7 @@ linux_sparc_syscall:
1711 1702
1712 mov %i3, %o3 ! IEU1 1703 mov %i3, %o3 ! IEU1
1713 mov %i4, %o4 ! IEU0 Group 1704 mov %i4, %o4 ! IEU0 Group
1714 andcc %l0, _TIF_SYSCALL_TRACE, %g0 ! IEU1 Group+1 bubble 1705 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %g0
1715 bne,pn %icc, linux_syscall_trace ! CTI Group 1706 bne,pn %icc, linux_syscall_trace ! CTI Group
1716 mov %i0, %l5 ! IEU0 1707 mov %i0, %l5 ! IEU0
17172: call %l7 ! CTI Group brk forced 17082: call %l7 ! CTI Group brk forced
@@ -1720,12 +1711,6 @@ linux_sparc_syscall:
1720 1711
17213: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 17123: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
1722ret_sys_call: 1713ret_sys_call:
1723#ifdef SYSCALL_TRACING
1724 mov %o0, %o1
1725 call syscall_trace_exit
1726 add %sp, PTREGS_OFF, %o0
1727 mov %o1, %o0
1728#endif
1729 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 1714 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
1730 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc 1715 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
1731 sra %o0, 0, %o0 1716 sra %o0, 0, %o0
@@ -1745,7 +1730,7 @@ ret_sys_call:
17451: 17301:
1746 cmp %o0, -ERESTART_RESTARTBLOCK 1731 cmp %o0, -ERESTART_RESTARTBLOCK
1747 bgeu,pn %xcc, 1f 1732 bgeu,pn %xcc, 1f
1748 andcc %l0, _TIF_SYSCALL_TRACE, %l6 1733 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6
174980: 173480:
1750 /* System call success, clear Carry condition code. */ 1735 /* System call success, clear Carry condition code. */
1751 andn %g3, %g2, %g3 1736 andn %g3, %g2, %g3
@@ -1760,7 +1745,7 @@ ret_sys_call:
1760 /* System call failure, set Carry condition code. 1745 /* System call failure, set Carry condition code.
1761 * Also, get abs(errno) to return to the process. 1746 * Also, get abs(errno) to return to the process.
1762 */ 1747 */
1763 andcc %l0, _TIF_SYSCALL_TRACE, %l6 1748 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT), %l6
1764 sub %g0, %o0, %o0 1749 sub %g0, %o0, %o0
1765 or %g3, %g2, %g3 1750 or %g3, %g2, %g3
1766 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 1751 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
@@ -1773,8 +1758,9 @@ ret_sys_call:
1773 b,pt %xcc, rtrap 1758 b,pt %xcc, rtrap
1774 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] 1759 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
1775linux_syscall_trace2: 1760linux_syscall_trace2:
1761 add %sp, PTREGS_OFF, %o0
1776 call syscall_trace 1762 call syscall_trace
1777 nop 1763 mov 1, %o1
1778 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] 1764 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
1779 ba,pt %xcc, rtrap 1765 ba,pt %xcc, rtrap
1780 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] 1766 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index 52f14e399b1c..533104c7907d 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -4,6 +4,8 @@
4 * Copyright (C) 1999 David S. Miller (davem@redhat.com) 4 * Copyright (C) 1999 David S. Miller (davem@redhat.com)
5 */ 5 */
6 6
7#define __KERNEL_SYSCALLS__
8
7#include <linux/config.h> 9#include <linux/config.h>
8#include <linux/kernel.h> 10#include <linux/kernel.h>
9#include <linux/module.h> 11#include <linux/module.h>
@@ -17,7 +19,6 @@
17#include <asm/ebus.h> 19#include <asm/ebus.h>
18#include <asm/auxio.h> 20#include <asm/auxio.h>
19 21
20#define __KERNEL_SYSCALLS__
21#include <linux/unistd.h> 22#include <linux/unistd.h>
22 23
23/* 24/*
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
index 80a76e2ad732..23ad839d113f 100644
--- a/arch/sparc64/kernel/ptrace.c
+++ b/arch/sparc64/kernel/ptrace.c
@@ -19,6 +19,8 @@
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/smp_lock.h> 20#include <linux/smp_lock.h>
21#include <linux/security.h> 21#include <linux/security.h>
22#include <linux/seccomp.h>
23#include <linux/audit.h>
22#include <linux/signal.h> 24#include <linux/signal.h>
23 25
24#include <asm/asi.h> 26#include <asm/asi.h>
@@ -628,15 +630,27 @@ out:
628 unlock_kernel(); 630 unlock_kernel();
629} 631}
630 632
631asmlinkage void syscall_trace(void) 633asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p)
632{ 634{
633#ifdef DEBUG_PTRACE 635 /* do the secure computing check first */
634 printk("%s [%d]: syscall_trace\n", current->comm, current->pid); 636 secure_computing(regs->u_regs[UREG_G1]);
635#endif 637
636 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 638 if (unlikely(current->audit_context) && syscall_exit_p) {
637 return; 639 unsigned long tstate = regs->tstate;
640 int result = AUDITSC_SUCCESS;
641
642 if (unlikely(tstate & (TSTATE_XCARRY | TSTATE_ICARRY)))
643 result = AUDITSC_FAILURE;
644
645 audit_syscall_exit(current, result, regs->u_regs[UREG_I0]);
646 }
647
638 if (!(current->ptrace & PT_PTRACED)) 648 if (!(current->ptrace & PT_PTRACED))
639 return; 649 goto out;
650
651 if (!test_thread_flag(TIF_SYSCALL_TRACE))
652 goto out;
653
640 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 654 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
641 ? 0x80 : 0)); 655 ? 0x80 : 0));
642 656
@@ -645,12 +659,20 @@ asmlinkage void syscall_trace(void)
645 * for normal use. strace only continues with a signal if the 659 * for normal use. strace only continues with a signal if the
646 * stopping signal is not SIGTRAP. -brl 660 * stopping signal is not SIGTRAP. -brl
647 */ 661 */
648#ifdef DEBUG_PTRACE
649 printk("%s [%d]: syscall_trace exit= %x\n", current->comm,
650 current->pid, current->exit_code);
651#endif
652 if (current->exit_code) { 662 if (current->exit_code) {
653 send_sig (current->exit_code, current, 1); 663 send_sig(current->exit_code, current, 1);
654 current->exit_code = 0; 664 current->exit_code = 0;
655 } 665 }
666
667out:
668 if (unlikely(current->audit_context) && !syscall_exit_p)
669 audit_syscall_entry(current,
670 (test_thread_flag(TIF_32BIT) ?
671 AUDIT_ARCH_SPARC :
672 AUDIT_ARCH_SPARC64),
673 regs->u_regs[UREG_G1],
674 regs->u_regs[UREG_I0],
675 regs->u_regs[UREG_I1],
676 regs->u_regs[UREG_I2],
677 regs->u_regs[UREG_I3]);
656} 678}
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index e5b9c7a27789..441fc2e52ce6 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -45,8 +45,8 @@ extern void calibrate_delay(void);
45/* Please don't make this stuff initdata!!! --DaveM */ 45/* Please don't make this stuff initdata!!! --DaveM */
46static unsigned char boot_cpu_id; 46static unsigned char boot_cpu_id;
47 47
48cpumask_t cpu_online_map = CPU_MASK_NONE; 48cpumask_t cpu_online_map = CPU_MASK_NONE __read_mostly;
49cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 49cpumask_t phys_cpu_present_map = CPU_MASK_NONE __read_mostly;
50static cpumask_t smp_commenced_mask; 50static cpumask_t smp_commenced_mask;
51static cpumask_t cpu_callout_map; 51static cpumask_t cpu_callout_map;
52 52
@@ -155,7 +155,7 @@ void cpu_panic(void)
155 panic("SMP bolixed\n"); 155 panic("SMP bolixed\n");
156} 156}
157 157
158static unsigned long current_tick_offset; 158static unsigned long current_tick_offset __read_mostly;
159 159
160/* This tick register synchronization scheme is taken entirely from 160/* This tick register synchronization scheme is taken entirely from
161 * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit. 161 * the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit.
@@ -1193,8 +1193,8 @@ void smp_send_stop(void)
1193{ 1193{
1194} 1194}
1195 1195
1196unsigned long __per_cpu_base; 1196unsigned long __per_cpu_base __read_mostly;
1197unsigned long __per_cpu_shift; 1197unsigned long __per_cpu_shift __read_mostly;
1198 1198
1199EXPORT_SYMBOL(__per_cpu_base); 1199EXPORT_SYMBOL(__per_cpu_base);
1200EXPORT_SYMBOL(__per_cpu_shift); 1200EXPORT_SYMBOL(__per_cpu_shift);
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 56cd96f4a5cd..9202d925a9ce 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -79,7 +79,7 @@ extern void linux_sparc_syscall(void);
79extern void rtrap(void); 79extern void rtrap(void);
80extern void show_regs(struct pt_regs *); 80extern void show_regs(struct pt_regs *);
81extern void solaris_syscall(void); 81extern void solaris_syscall(void);
82extern void syscall_trace(void); 82extern void syscall_trace(struct pt_regs *, int);
83extern u32 sunos_sys_table[], sys_call_table32[]; 83extern u32 sunos_sys_table[], sys_call_table32[];
84extern void tl0_solaris(void); 84extern void tl0_solaris(void);
85extern void sys_sigsuspend(void); 85extern void sys_sigsuspend(void);
diff --git a/arch/sparc64/kernel/sys32.S b/arch/sparc64/kernel/sys32.S
index 5a95e98c5317..5f9e4fae612e 100644
--- a/arch/sparc64/kernel/sys32.S
+++ b/arch/sparc64/kernel/sys32.S
@@ -135,6 +135,8 @@ SIGN2(sys32_shutdown, sys_shutdown, %o0, %o1)
135SIGN3(sys32_socketpair, sys_socketpair, %o0, %o1, %o2) 135SIGN3(sys32_socketpair, sys_socketpair, %o0, %o1, %o2)
136SIGN1(sys32_getpeername, sys_getpeername, %o0) 136SIGN1(sys32_getpeername, sys_getpeername, %o0)
137SIGN1(sys32_getsockname, sys_getsockname, %o0) 137SIGN1(sys32_getsockname, sys_getsockname, %o0)
138SIGN2(sys32_ioprio_get, sys_ioprio_get, %o0, %o1)
139SIGN3(sys32_ioprio_set, sys_ioprio_set, %o0, %o1, %o2)
138 140
139 .globl sys32_mmap2 141 .globl sys32_mmap2
140sys32_mmap2: 142sys32_mmap2:
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index a5e36a4c8924..bceb91a8a2bd 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -59,11 +59,11 @@ sys_call_table32:
59/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall 59/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
60 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname 60 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname
61/*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl 61/*190*/ .word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
62 .word sys32_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask 62 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask
63/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir 63/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
64 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64 64 .word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
65/*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo 65/*210*/ .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
66 .word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex 66 .word sys32_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, sys32_adjtimex
67/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid 67/*220*/ .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
68 .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16 68 .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
69/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64 69/*230*/ .word sys32_select, compat_sys_time, sys_nis_syscall, compat_sys_stime, compat_sys_statfs64
@@ -125,11 +125,11 @@ sys_call_table:
125/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall 125/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
126 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname 126 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sparc64_newuname
127/*190*/ .word sys_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl 127/*190*/ .word sys_init_module, sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
128 .word sys_epoll_wait, sys_nis_syscall, sys_getppid, sys_nis_syscall, sys_sgetmask 128 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
129/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall 129/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall
130 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 130 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
131/*210*/ .word sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo 131/*210*/ .word sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo
132 .word sys_ipc, sys_nis_syscall, sys_clone, sys_nis_syscall, sys_adjtimex 132 .word sys_ipc, sys_nis_syscall, sys_clone, sys_ioprio_get, sys_adjtimex
133/*220*/ .word sys_nis_syscall, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid 133/*220*/ .word sys_nis_syscall, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid
134 .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid 134 .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid
135/*230*/ .word sys_select, sys_nis_syscall, sys_nis_syscall, sys_stime, sys_statfs64 135/*230*/ .word sys_select, sys_nis_syscall, sys_nis_syscall, sys_stime, sys_statfs64
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index b40db389f90b..362b9c26871b 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -73,7 +73,7 @@ static __initdata struct sparc64_tick_ops dummy_tick_ops = {
73 .get_tick = dummy_get_tick, 73 .get_tick = dummy_get_tick,
74}; 74};
75 75
76struct sparc64_tick_ops *tick_ops = &dummy_tick_ops; 76struct sparc64_tick_ops *tick_ops __read_mostly = &dummy_tick_ops;
77 77
78#define TICK_PRIV_BIT (1UL << 63) 78#define TICK_PRIV_BIT (1UL << 63)
79 79
@@ -195,7 +195,7 @@ static unsigned long tick_add_tick(unsigned long adj, unsigned long offset)
195 return new_tick; 195 return new_tick;
196} 196}
197 197
198static struct sparc64_tick_ops tick_operations = { 198static struct sparc64_tick_ops tick_operations __read_mostly = {
199 .init_tick = tick_init_tick, 199 .init_tick = tick_init_tick,
200 .get_tick = tick_get_tick, 200 .get_tick = tick_get_tick,
201 .get_compare = tick_get_compare, 201 .get_compare = tick_get_compare,
@@ -276,7 +276,7 @@ static unsigned long stick_add_compare(unsigned long adj)
276 return new_compare; 276 return new_compare;
277} 277}
278 278
279static struct sparc64_tick_ops stick_operations = { 279static struct sparc64_tick_ops stick_operations __read_mostly = {
280 .init_tick = stick_init_tick, 280 .init_tick = stick_init_tick,
281 .get_tick = stick_get_tick, 281 .get_tick = stick_get_tick,
282 .get_compare = stick_get_compare, 282 .get_compare = stick_get_compare,
@@ -422,7 +422,7 @@ static unsigned long hbtick_add_compare(unsigned long adj)
422 return val; 422 return val;
423} 423}
424 424
425static struct sparc64_tick_ops hbtick_operations = { 425static struct sparc64_tick_ops hbtick_operations __read_mostly = {
426 .init_tick = hbtick_init_tick, 426 .init_tick = hbtick_init_tick,
427 .get_tick = hbtick_get_tick, 427 .get_tick = hbtick_get_tick,
428 .get_compare = hbtick_get_compare, 428 .get_compare = hbtick_get_compare,
@@ -437,10 +437,9 @@ static struct sparc64_tick_ops hbtick_operations = {
437 * NOTE: On SUN5 systems the ticker interrupt comes in using 2 437 * NOTE: On SUN5 systems the ticker interrupt comes in using 2
438 * interrupts, one at level14 and one with softint bit 0. 438 * interrupts, one at level14 and one with softint bit 0.
439 */ 439 */
440unsigned long timer_tick_offset; 440unsigned long timer_tick_offset __read_mostly;
441unsigned long timer_tick_compare;
442 441
443static unsigned long timer_ticks_per_nsec_quotient; 442static unsigned long timer_ticks_per_nsec_quotient __read_mostly;
444 443
445#define TICK_SIZE (tick_nsec / 1000) 444#define TICK_SIZE (tick_nsec / 1000)
446 445
@@ -464,7 +463,7 @@ static inline void timer_check_rtc(void)
464 463
465static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) 464static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
466{ 465{
467 unsigned long ticks, pstate; 466 unsigned long ticks, compare, pstate;
468 467
469 write_seqlock(&xtime_lock); 468 write_seqlock(&xtime_lock);
470 469
@@ -483,14 +482,14 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
483 : "=r" (pstate) 482 : "=r" (pstate)
484 : "i" (PSTATE_IE)); 483 : "i" (PSTATE_IE));
485 484
486 timer_tick_compare = tick_ops->add_compare(timer_tick_offset); 485 compare = tick_ops->add_compare(timer_tick_offset);
487 ticks = tick_ops->get_tick(); 486 ticks = tick_ops->get_tick();
488 487
489 /* Restore PSTATE_IE. */ 488 /* Restore PSTATE_IE. */
490 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" 489 __asm__ __volatile__("wrpr %0, 0x0, %%pstate"
491 : /* no outputs */ 490 : /* no outputs */
492 : "r" (pstate)); 491 : "r" (pstate));
493 } while (time_after_eq(ticks, timer_tick_compare)); 492 } while (time_after_eq(ticks, compare));
494 493
495 timer_check_rtc(); 494 timer_check_rtc();
496 495
@@ -506,11 +505,6 @@ void timer_tick_interrupt(struct pt_regs *regs)
506 505
507 do_timer(regs); 506 do_timer(regs);
508 507
509 /*
510 * Only keep timer_tick_offset uptodate, but don't set TICK_CMPR.
511 */
512 timer_tick_compare = tick_ops->get_compare() + timer_tick_offset;
513
514 timer_check_rtc(); 508 timer_check_rtc();
515 509
516 write_sequnlock(&xtime_lock); 510 write_sequnlock(&xtime_lock);
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S
index 382fd6798bb9..950423da8a6a 100644
--- a/arch/sparc64/kernel/vmlinux.lds.S
+++ b/arch/sparc64/kernel/vmlinux.lds.S
@@ -32,6 +32,8 @@ SECTIONS
32 .data1 : { *(.data1) } 32 .data1 : { *(.data1) }
33 . = ALIGN(64); 33 . = ALIGN(64);
34 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 34 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
35 . = ALIGN(64);
36 .data.read_mostly : { *(.data.read_mostly) }
35 _edata = .; 37 _edata = .;
36 PROVIDE (edata = .); 38 PROVIDE (edata = .);
37 .fixup : { *(.fixup) } 39 .fixup : { *(.fixup) }
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 3ffee7b51aed..52e9375288a9 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -34,22 +34,6 @@
34extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; 34extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
35 35
36/* 36/*
37 * To debug kernel during syscall entry.
38 */
39void syscall_trace_entry(struct pt_regs *regs)
40{
41 printk("scall entry: %s[%d]/cpu%d: %d\n", current->comm, current->pid, smp_processor_id(), (int) regs->u_regs[UREG_G1]);
42}
43
44/*
45 * To debug kernel during syscall exit.
46 */
47void syscall_trace_exit(struct pt_regs *regs)
48{
49 printk("scall exit: %s[%d]/cpu%d: %d\n", current->comm, current->pid, smp_processor_id(), (int) regs->u_regs[UREG_G1]);
50}
51
52/*
53 * To debug kernel to catch accesses to certain virtual/physical addresses. 37 * To debug kernel to catch accesses to certain virtual/physical addresses.
54 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. 38 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
55 * flags = VM_READ watches memread accesses, flags = VM_WRITE watches memwrite accesses. 39 * flags = VM_READ watches memread accesses, flags = VM_WRITE watches memwrite accesses.
diff --git a/arch/sparc64/solaris/entry64.S b/arch/sparc64/solaris/entry64.S
index 0cc9dad75c5e..4b6ae583c0a3 100644
--- a/arch/sparc64/solaris/entry64.S
+++ b/arch/sparc64/solaris/entry64.S
@@ -24,8 +24,9 @@
24 24
25 .text 25 .text
26solaris_syscall_trace: 26solaris_syscall_trace:
27 add %sp, PTREGS_OFF, %o0
27 call syscall_trace 28 call syscall_trace
28 nop 29 mov 0, %o1
29 srl %i0, 0, %o0 30 srl %i0, 0, %o0
30 mov %i4, %o4 31 mov %i4, %o4
31 srl %i1, 0, %o1 32 srl %i1, 0, %o1
@@ -159,8 +160,10 @@ ret_from_solaris:
159 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] !npc = npc+4 160 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] !npc = npc+4
160 161
161solaris_syscall_trace2: 162solaris_syscall_trace2:
163 add %sp, PTREGS_OFF, %o0
162 call syscall_trace 164 call syscall_trace
163 add %l1, 0x4, %l2 /* npc = npc+4 */ 165 mov 1, %o1
166 add %l1, 0x4, %l2 /* npc = npc+4 */
164 andcc %l1, 1, %g0 167 andcc %l1, 1, %g0
165 bne,pn %icc, 2b 168 bne,pn %icc, 2b
166 nop 169 nop