diff options
Diffstat (limited to 'arch/sparc64/kernel')
| -rw-r--r-- | arch/sparc64/kernel/kprobes.c | 36 | ||||
| -rw-r--r-- | arch/sparc64/kernel/sunos_ioctl32.c | 9 | ||||
| -rw-r--r-- | arch/sparc64/kernel/sys_sparc32.c | 24 | ||||
| -rw-r--r-- | arch/sparc64/kernel/time.c | 2 | ||||
| -rw-r--r-- | arch/sparc64/kernel/vmlinux.lds.S | 1 |
5 files changed, 28 insertions, 44 deletions
diff --git a/arch/sparc64/kernel/kprobes.c b/arch/sparc64/kernel/kprobes.c index bbf11f85dab1..0d66d07c8c6e 100644 --- a/arch/sparc64/kernel/kprobes.c +++ b/arch/sparc64/kernel/kprobes.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/kprobes.h> | 8 | #include <linux/kprobes.h> |
| 9 | #include <asm/kdebug.h> | 9 | #include <asm/kdebug.h> |
| 10 | #include <asm/signal.h> | 10 | #include <asm/signal.h> |
| 11 | #include <asm/cacheflush.h> | ||
| 11 | 12 | ||
| 12 | /* We do not have hardware single-stepping on sparc64. | 13 | /* We do not have hardware single-stepping on sparc64. |
| 13 | * So we implement software single-stepping with breakpoint | 14 | * So we implement software single-stepping with breakpoint |
| @@ -37,31 +38,31 @@ | |||
| 37 | * - Mark that we are no longer actively in a kprobe. | 38 | * - Mark that we are no longer actively in a kprobe. |
| 38 | */ | 39 | */ |
| 39 | 40 | ||
| 40 | int arch_prepare_kprobe(struct kprobe *p) | 41 | int __kprobes arch_prepare_kprobe(struct kprobe *p) |
| 41 | { | 42 | { |
| 42 | return 0; | 43 | return 0; |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | void arch_copy_kprobe(struct kprobe *p) | 46 | void __kprobes arch_copy_kprobe(struct kprobe *p) |
| 46 | { | 47 | { |
| 47 | p->ainsn.insn[0] = *p->addr; | 48 | p->ainsn.insn[0] = *p->addr; |
| 48 | p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2; | 49 | p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2; |
| 49 | p->opcode = *p->addr; | 50 | p->opcode = *p->addr; |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | void arch_arm_kprobe(struct kprobe *p) | 53 | void __kprobes arch_arm_kprobe(struct kprobe *p) |
| 53 | { | 54 | { |
| 54 | *p->addr = BREAKPOINT_INSTRUCTION; | 55 | *p->addr = BREAKPOINT_INSTRUCTION; |
| 55 | flushi(p->addr); | 56 | flushi(p->addr); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | void arch_disarm_kprobe(struct kprobe *p) | 59 | void __kprobes arch_disarm_kprobe(struct kprobe *p) |
| 59 | { | 60 | { |
| 60 | *p->addr = p->opcode; | 61 | *p->addr = p->opcode; |
| 61 | flushi(p->addr); | 62 | flushi(p->addr); |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | void arch_remove_kprobe(struct kprobe *p) | 65 | void __kprobes arch_remove_kprobe(struct kprobe *p) |
| 65 | { | 66 | { |
| 66 | } | 67 | } |
| 67 | 68 | ||
| @@ -111,7 +112,7 @@ static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | |||
| 111 | } | 112 | } |
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | static int kprobe_handler(struct pt_regs *regs) | 115 | static int __kprobes kprobe_handler(struct pt_regs *regs) |
| 115 | { | 116 | { |
| 116 | struct kprobe *p; | 117 | struct kprobe *p; |
| 117 | void *addr = (void *) regs->tpc; | 118 | void *addr = (void *) regs->tpc; |
| @@ -191,8 +192,9 @@ no_kprobe: | |||
| 191 | * The original INSN location was REAL_PC, it actually | 192 | * The original INSN location was REAL_PC, it actually |
| 192 | * executed at PC and produced destination address NPC. | 193 | * executed at PC and produced destination address NPC. |
| 193 | */ | 194 | */ |
| 194 | static unsigned long relbranch_fixup(u32 insn, unsigned long real_pc, | 195 | static unsigned long __kprobes relbranch_fixup(u32 insn, unsigned long real_pc, |
| 195 | unsigned long pc, unsigned long npc) | 196 | unsigned long pc, |
| 197 | unsigned long npc) | ||
| 196 | { | 198 | { |
| 197 | /* Branch not taken, no mods necessary. */ | 199 | /* Branch not taken, no mods necessary. */ |
| 198 | if (npc == pc + 0x4UL) | 200 | if (npc == pc + 0x4UL) |
| @@ -217,7 +219,8 @@ static unsigned long relbranch_fixup(u32 insn, unsigned long real_pc, | |||
| 217 | /* If INSN is an instruction which writes it's PC location | 219 | /* If INSN is an instruction which writes it's PC location |
| 218 | * into a destination register, fix that up. | 220 | * into a destination register, fix that up. |
| 219 | */ | 221 | */ |
| 220 | static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc) | 222 | static void __kprobes retpc_fixup(struct pt_regs *regs, u32 insn, |
| 223 | unsigned long real_pc) | ||
| 221 | { | 224 | { |
| 222 | unsigned long *slot = NULL; | 225 | unsigned long *slot = NULL; |
| 223 | 226 | ||
| @@ -257,7 +260,7 @@ static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc) | |||
| 257 | * This function prepares to return from the post-single-step | 260 | * This function prepares to return from the post-single-step |
| 258 | * breakpoint trap. | 261 | * breakpoint trap. |
| 259 | */ | 262 | */ |
| 260 | static void resume_execution(struct kprobe *p, struct pt_regs *regs) | 263 | static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) |
| 261 | { | 264 | { |
| 262 | u32 insn = p->ainsn.insn[0]; | 265 | u32 insn = p->ainsn.insn[0]; |
| 263 | 266 | ||
| @@ -315,8 +318,8 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
| 315 | /* | 318 | /* |
| 316 | * Wrapper routine to for handling exceptions. | 319 | * Wrapper routine to for handling exceptions. |
| 317 | */ | 320 | */ |
| 318 | int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, | 321 | int __kprobes kprobe_exceptions_notify(struct notifier_block *self, |
| 319 | void *data) | 322 | unsigned long val, void *data) |
| 320 | { | 323 | { |
| 321 | struct die_args *args = (struct die_args *)data; | 324 | struct die_args *args = (struct die_args *)data; |
| 322 | switch (val) { | 325 | switch (val) { |
| @@ -344,7 +347,8 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, | |||
| 344 | return NOTIFY_DONE; | 347 | return NOTIFY_DONE; |
| 345 | } | 348 | } |
| 346 | 349 | ||
| 347 | asmlinkage void kprobe_trap(unsigned long trap_level, struct pt_regs *regs) | 350 | asmlinkage void __kprobes kprobe_trap(unsigned long trap_level, |
| 351 | struct pt_regs *regs) | ||
| 348 | { | 352 | { |
| 349 | BUG_ON(trap_level != 0x170 && trap_level != 0x171); | 353 | BUG_ON(trap_level != 0x170 && trap_level != 0x171); |
| 350 | 354 | ||
| @@ -368,7 +372,7 @@ static struct pt_regs jprobe_saved_regs; | |||
| 368 | static struct pt_regs *jprobe_saved_regs_location; | 372 | static struct pt_regs *jprobe_saved_regs_location; |
| 369 | static struct sparc_stackf jprobe_saved_stack; | 373 | static struct sparc_stackf jprobe_saved_stack; |
| 370 | 374 | ||
| 371 | int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | 375 | int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) |
| 372 | { | 376 | { |
| 373 | struct jprobe *jp = container_of(p, struct jprobe, kp); | 377 | struct jprobe *jp = container_of(p, struct jprobe, kp); |
| 374 | 378 | ||
| @@ -390,7 +394,7 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) | |||
| 390 | return 1; | 394 | return 1; |
| 391 | } | 395 | } |
| 392 | 396 | ||
| 393 | void jprobe_return(void) | 397 | void __kprobes jprobe_return(void) |
| 394 | { | 398 | { |
| 395 | preempt_enable_no_resched(); | 399 | preempt_enable_no_resched(); |
| 396 | __asm__ __volatile__( | 400 | __asm__ __volatile__( |
| @@ -403,7 +407,7 @@ extern void jprobe_return_trap_instruction(void); | |||
| 403 | 407 | ||
| 404 | extern void __show_regs(struct pt_regs * regs); | 408 | extern void __show_regs(struct pt_regs * regs); |
| 405 | 409 | ||
| 406 | int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) | 410 | int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) |
| 407 | { | 411 | { |
| 408 | u32 *addr = (u32 *) regs->tpc; | 412 | u32 *addr = (u32 *) regs->tpc; |
| 409 | 413 | ||
diff --git a/arch/sparc64/kernel/sunos_ioctl32.c b/arch/sparc64/kernel/sunos_ioctl32.c index 87c1aeb02220..7654b8a7f03a 100644 --- a/arch/sparc64/kernel/sunos_ioctl32.c +++ b/arch/sparc64/kernel/sunos_ioctl32.c | |||
| @@ -152,11 +152,12 @@ asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg) | |||
| 152 | ret = compat_sys_ioctl(fd, SIOCGIFCONF, arg); | 152 | ret = compat_sys_ioctl(fd, SIOCGIFCONF, arg); |
| 153 | goto out; | 153 | goto out; |
| 154 | 154 | ||
| 155 | case _IOW('i', 21, struct ifreq): /* SIOCSIFMTU */ | 155 | case _IOW('i', 21, struct ifreq32): |
| 156 | ret = sys_ioctl(fd, SIOCSIFMTU, arg); | 156 | ret = compat_sys_ioctl(fd, SIOCSIFMTU, arg); |
| 157 | goto out; | 157 | goto out; |
| 158 | case _IOWR('i', 22, struct ifreq): /* SIOCGIFMTU */ | 158 | |
| 159 | ret = sys_ioctl(fd, SIOCGIFMTU, arg); | 159 | case _IOWR('i', 22, struct ifreq32): |
| 160 | ret = compat_sys_ioctl(fd, SIOCGIFMTU, arg); | ||
| 160 | goto out; | 161 | goto out; |
| 161 | 162 | ||
| 162 | case _IOWR('i', 23, struct ifreq32): | 163 | case _IOWR('i', 23, struct ifreq32): |
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index 1d3aa588df8a..7f6239ed2521 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c | |||
| @@ -1002,29 +1002,7 @@ asmlinkage long sys32_adjtimex(struct timex32 __user *utp) | |||
| 1002 | asmlinkage long sparc32_open(const char __user *filename, | 1002 | asmlinkage long sparc32_open(const char __user *filename, |
| 1003 | int flags, int mode) | 1003 | int flags, int mode) |
| 1004 | { | 1004 | { |
| 1005 | char * tmp; | 1005 | return do_sys_open(filename, flags, mode); |
| 1006 | int fd, error; | ||
| 1007 | |||
| 1008 | tmp = getname(filename); | ||
| 1009 | fd = PTR_ERR(tmp); | ||
| 1010 | if (!IS_ERR(tmp)) { | ||
| 1011 | fd = get_unused_fd(); | ||
| 1012 | if (fd >= 0) { | ||
| 1013 | struct file * f = filp_open(tmp, flags, mode); | ||
| 1014 | error = PTR_ERR(f); | ||
| 1015 | if (IS_ERR(f)) | ||
| 1016 | goto out_error; | ||
| 1017 | fd_install(fd, f); | ||
| 1018 | } | ||
| 1019 | out: | ||
| 1020 | putname(tmp); | ||
| 1021 | } | ||
| 1022 | return fd; | ||
| 1023 | |||
| 1024 | out_error: | ||
| 1025 | put_unused_fd(fd); | ||
| 1026 | fd = error; | ||
| 1027 | goto out; | ||
| 1028 | } | 1006 | } |
| 1029 | 1007 | ||
| 1030 | extern unsigned long do_mremap(unsigned long addr, | 1008 | extern unsigned long do_mremap(unsigned long addr, |
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index 362b9c26871b..3f08a32f51a1 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c | |||
| @@ -449,7 +449,7 @@ static inline void timer_check_rtc(void) | |||
| 449 | static long last_rtc_update; | 449 | static long last_rtc_update; |
| 450 | 450 | ||
| 451 | /* Determine when to update the Mostek clock. */ | 451 | /* Determine when to update the Mostek clock. */ |
| 452 | if ((time_status & STA_UNSYNC) == 0 && | 452 | if (ntp_synced() && |
| 453 | xtime.tv_sec > last_rtc_update + 660 && | 453 | xtime.tv_sec > last_rtc_update + 660 && |
| 454 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && | 454 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && |
| 455 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { | 455 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { |
diff --git a/arch/sparc64/kernel/vmlinux.lds.S b/arch/sparc64/kernel/vmlinux.lds.S index 950423da8a6a..f47d0be39378 100644 --- a/arch/sparc64/kernel/vmlinux.lds.S +++ b/arch/sparc64/kernel/vmlinux.lds.S | |||
| @@ -17,6 +17,7 @@ SECTIONS | |||
| 17 | *(.text) | 17 | *(.text) |
| 18 | SCHED_TEXT | 18 | SCHED_TEXT |
| 19 | LOCK_TEXT | 19 | LOCK_TEXT |
| 20 | KPROBES_TEXT | ||
| 20 | *(.gnu.warning) | 21 | *(.gnu.warning) |
| 21 | } =0 | 22 | } =0 |
| 22 | _etext = .; | 23 | _etext = .; |
