Commit b14662ca authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull sparc changes from David Miller:
 "Several bug fixes (from Kirill Tkhai, Geery Uytterhoeven, and Alexey
  Dobriyan) and some support for Fujitsu sparc64x chips (from Allen
  Pais)"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Export flush_ptrace_access() (needed by lustre)
  sparc: fix PCI device proc file mmap(2)
  sparc64: Remove RWSEM export leftovers
  sparc64: Fix off by one in trampoline TLB mapping installation loop.
  sparc64: Fix ITLB handler of null page
  esp_scsi: Fix tag state corruption when autosensing.
  sparc64: Fix not SRA'ed %o5 in 32-bit traced syscall
  sparc64: cleanup: Rename ret_from_syscall to ret_from_fork
  sparc32: Fix exit flag passed from traced sys_sigreturn
  sparc64: Fix wrong syscall return value passed to trace_sys_exit()
  support sparc64x chip type in cpumap.c
  cpu hw caps support for sparc64x
parents cc998ff8 dc76f9ca
...@@ -48,8 +48,8 @@ do { save_and_clear_fpu(); \ ...@@ -48,8 +48,8 @@ do { save_and_clear_fpu(); \
"wrpr %%g0, 14, %%pil\n\t" \ "wrpr %%g0, 14, %%pil\n\t" \
"brz,pt %%o7, switch_to_pc\n\t" \ "brz,pt %%o7, switch_to_pc\n\t" \
" mov %%g7, %0\n\t" \ " mov %%g7, %0\n\t" \
"sethi %%hi(ret_from_syscall), %%g1\n\t" \ "sethi %%hi(ret_from_fork), %%g1\n\t" \
"jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \ "jmpl %%g1 + %%lo(ret_from_fork), %%g0\n\t" \
" nop\n\t" \ " nop\n\t" \
".globl switch_to_pc\n\t" \ ".globl switch_to_pc\n\t" \
"switch_to_pc:\n\t" \ "switch_to_pc:\n\t" \
......
...@@ -327,6 +327,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index) ...@@ -327,6 +327,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
case SUN4V_CHIP_NIAGARA3: case SUN4V_CHIP_NIAGARA3:
case SUN4V_CHIP_NIAGARA4: case SUN4V_CHIP_NIAGARA4:
case SUN4V_CHIP_NIAGARA5: case SUN4V_CHIP_NIAGARA5:
case SUN4V_CHIP_SPARC64X:
rover_inc_table = niagara_iterate_method; rover_inc_table = niagara_iterate_method;
break; break;
default: default:
......
...@@ -839,7 +839,7 @@ sys_sigreturn: ...@@ -839,7 +839,7 @@ sys_sigreturn:
nop nop
call syscall_trace call syscall_trace
nop mov 1, %o1
1: 1:
/* We don't want to muck with user registers like a /* We don't want to muck with user registers like a
......
...@@ -42,7 +42,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) ...@@ -42,7 +42,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
{ {
struct thread_info *t = task_thread_info(p); struct thread_info *t = task_thread_info(p);
extern unsigned int switch_to_pc; extern unsigned int switch_to_pc;
extern unsigned int ret_from_syscall; extern unsigned int ret_from_fork;
struct reg_window *win; struct reg_window *win;
unsigned long pc, cwp; unsigned long pc, cwp;
int i; int i;
...@@ -66,7 +66,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) ...@@ -66,7 +66,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
gdb_regs[i] = 0; gdb_regs[i] = 0;
if (t->new_child) if (t->new_child)
pc = (unsigned long) &ret_from_syscall; pc = (unsigned long) &ret_from_fork;
else else
pc = (unsigned long) &switch_to_pc; pc = (unsigned long) &switch_to_pc;
......
...@@ -25,11 +25,10 @@ kvmap_itlb: ...@@ -25,11 +25,10 @@ kvmap_itlb:
*/ */
kvmap_itlb_4v: kvmap_itlb_4v:
kvmap_itlb_nonlinear:
/* Catch kernel NULL pointer calls. */ /* Catch kernel NULL pointer calls. */
sethi %hi(PAGE_SIZE), %g5 sethi %hi(PAGE_SIZE), %g5
cmp %g4, %g5 cmp %g4, %g5
bleu,pn %xcc, kvmap_dtlb_longpath blu,pn %xcc, kvmap_itlb_longpath
nop nop
KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_itlb_load) KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_itlb_load)
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/export.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/user.h> #include <linux/user.h>
#include <linux/smp.h> #include <linux/smp.h>
...@@ -116,6 +117,7 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, ...@@ -116,6 +117,7 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
preempt_enable(); preempt_enable();
} }
EXPORT_SYMBOL_GPL(flush_ptrace_access);
static int get_from_target(struct task_struct *target, unsigned long uaddr, static int get_from_target(struct task_struct *target, unsigned long uaddr,
void *kbuf, int len) void *kbuf, int len)
...@@ -1087,7 +1089,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs) ...@@ -1087,7 +1089,7 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
audit_syscall_exit(regs); audit_syscall_exit(regs);
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
trace_sys_exit(regs, regs->u_regs[UREG_G1]); trace_sys_exit(regs, regs->u_regs[UREG_I0]);
if (test_thread_flag(TIF_SYSCALL_TRACE)) if (test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, 0); tracehook_report_syscall_exit(regs, 0);
......
...@@ -499,12 +499,14 @@ static void __init init_sparc64_elf_hwcap(void) ...@@ -499,12 +499,14 @@ static void __init init_sparc64_elf_hwcap(void)
sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA3 || sun4v_chip_type == SUN4V_CHIP_NIAGARA3 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA4 || sun4v_chip_type == SUN4V_CHIP_NIAGARA4 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5) sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= HWCAP_SPARC_BLKINIT; cap |= HWCAP_SPARC_BLKINIT;
if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA3 || sun4v_chip_type == SUN4V_CHIP_NIAGARA3 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA4 || sun4v_chip_type == SUN4V_CHIP_NIAGARA4 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5) sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= HWCAP_SPARC_N2; cap |= HWCAP_SPARC_N2;
} }
...@@ -530,13 +532,15 @@ static void __init init_sparc64_elf_hwcap(void) ...@@ -530,13 +532,15 @@ static void __init init_sparc64_elf_hwcap(void)
if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA3 || sun4v_chip_type == SUN4V_CHIP_NIAGARA3 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA4 || sun4v_chip_type == SUN4V_CHIP_NIAGARA4 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5) sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 | cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
AV_SPARC_ASI_BLK_INIT | AV_SPARC_ASI_BLK_INIT |
AV_SPARC_POPC); AV_SPARC_POPC);
if (sun4v_chip_type == SUN4V_CHIP_NIAGARA3 || if (sun4v_chip_type == SUN4V_CHIP_NIAGARA3 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA4 || sun4v_chip_type == SUN4V_CHIP_NIAGARA4 ||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5) sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC | cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
AV_SPARC_FMAF); AV_SPARC_FMAF);
} }
......
...@@ -98,8 +98,8 @@ sys_clone: ...@@ -98,8 +98,8 @@ sys_clone:
ba,pt %xcc, sparc_do_fork ba,pt %xcc, sparc_do_fork
add %sp, PTREGS_OFF, %o2 add %sp, PTREGS_OFF, %o2
.globl ret_from_syscall .globl ret_from_fork
ret_from_syscall: ret_from_fork:
/* Clear current_thread_info()->new_child. */ /* Clear current_thread_info()->new_child. */
stb %g0, [%g6 + TI_NEW_CHILD] stb %g0, [%g6 + TI_NEW_CHILD]
call schedule_tail call schedule_tail
...@@ -152,7 +152,7 @@ linux_syscall_trace32: ...@@ -152,7 +152,7 @@ linux_syscall_trace32:
srl %i4, 0, %o4 srl %i4, 0, %o4
srl %i1, 0, %o1 srl %i1, 0, %o1
srl %i2, 0, %o2 srl %i2, 0, %o2
ba,pt %xcc, 2f ba,pt %xcc, 5f
srl %i3, 0, %o3 srl %i3, 0, %o3
linux_syscall_trace: linux_syscall_trace:
...@@ -182,13 +182,13 @@ linux_sparc_syscall32: ...@@ -182,13 +182,13 @@ linux_sparc_syscall32:
srl %i1, 0, %o1 ! IEU0 Group srl %i1, 0, %o1 ! IEU0 Group
ldx [%g6 + TI_FLAGS], %l0 ! Load ldx [%g6 + TI_FLAGS], %l0 ! Load
srl %i5, 0, %o5 ! IEU1 srl %i3, 0, %o3 ! IEU0
srl %i2, 0, %o2 ! IEU0 Group srl %i2, 0, %o2 ! IEU0 Group
andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
bne,pn %icc, linux_syscall_trace32 ! CTI bne,pn %icc, linux_syscall_trace32 ! CTI
mov %i0, %l5 ! IEU1 mov %i0, %l5 ! IEU1
call %l7 ! CTI Group brk forced 5: call %l7 ! CTI Group brk forced
srl %i3, 0, %o3 ! IEU0 srl %i5, 0, %o5 ! IEU1
ba,a,pt %xcc, 3f ba,a,pt %xcc, 3f
/* Linux native system calls enter here... */ /* Linux native system calls enter here... */
......
...@@ -129,7 +129,6 @@ startup_continue: ...@@ -129,7 +129,6 @@ startup_continue:
clr %l5 clr %l5
sethi %hi(num_kernel_image_mappings), %l6 sethi %hi(num_kernel_image_mappings), %l6
lduw [%l6 + %lo(num_kernel_image_mappings)], %l6 lduw [%l6 + %lo(num_kernel_image_mappings)], %l6
add %l6, 1, %l6
mov 15, %l7 mov 15, %l7
BRANCH_IF_ANY_CHEETAH(g1,g5,2f) BRANCH_IF_ANY_CHEETAH(g1,g5,2f)
...@@ -222,7 +221,6 @@ niagara_lock_tlb: ...@@ -222,7 +221,6 @@ niagara_lock_tlb:
clr %l5 clr %l5
sethi %hi(num_kernel_image_mappings), %l6 sethi %hi(num_kernel_image_mappings), %l6
lduw [%l6 + %lo(num_kernel_image_mappings)], %l6 lduw [%l6 + %lo(num_kernel_image_mappings)], %l6
add %l6, 1, %l6
1: 1:
mov HV_FAST_MMU_MAP_PERM_ADDR, %o5 mov HV_FAST_MMU_MAP_PERM_ADDR, %o5
......
...@@ -98,15 +98,6 @@ EXPORT_SYMBOL(___copy_from_user); ...@@ -98,15 +98,6 @@ EXPORT_SYMBOL(___copy_from_user);
EXPORT_SYMBOL(___copy_in_user); EXPORT_SYMBOL(___copy_in_user);
EXPORT_SYMBOL(__clear_user); EXPORT_SYMBOL(__clear_user);
/* RW semaphores */
EXPORT_SYMBOL(__down_read);
EXPORT_SYMBOL(__down_read_trylock);
EXPORT_SYMBOL(__down_write);
EXPORT_SYMBOL(__down_write_trylock);
EXPORT_SYMBOL(__up_read);
EXPORT_SYMBOL(__up_write);
EXPORT_SYMBOL(__downgrade_write);
/* Atomic counter implementation. */ /* Atomic counter implementation. */
EXPORT_SYMBOL(atomic_add); EXPORT_SYMBOL(atomic_add);
EXPORT_SYMBOL(atomic_add_ret); EXPORT_SYMBOL(atomic_add_ret);
......
...@@ -530,7 +530,7 @@ static int esp_need_to_nego_sync(struct esp_target_data *tp) ...@@ -530,7 +530,7 @@ static int esp_need_to_nego_sync(struct esp_target_data *tp)
static int esp_alloc_lun_tag(struct esp_cmd_entry *ent, static int esp_alloc_lun_tag(struct esp_cmd_entry *ent,
struct esp_lun_data *lp) struct esp_lun_data *lp)
{ {
if (!ent->tag[0]) { if (!ent->orig_tag[0]) {
/* Non-tagged, slot already taken? */ /* Non-tagged, slot already taken? */
if (lp->non_tagged_cmd) if (lp->non_tagged_cmd)
return -EBUSY; return -EBUSY;
...@@ -564,9 +564,9 @@ static int esp_alloc_lun_tag(struct esp_cmd_entry *ent, ...@@ -564,9 +564,9 @@ static int esp_alloc_lun_tag(struct esp_cmd_entry *ent,
return -EBUSY; return -EBUSY;
} }
BUG_ON(lp->tagged_cmds[ent->tag[1]]); BUG_ON(lp->tagged_cmds[ent->orig_tag[1]]);
lp->tagged_cmds[ent->tag[1]] = ent; lp->tagged_cmds[ent->orig_tag[1]] = ent;
lp->num_tagged++; lp->num_tagged++;
return 0; return 0;
...@@ -575,9 +575,9 @@ static int esp_alloc_lun_tag(struct esp_cmd_entry *ent, ...@@ -575,9 +575,9 @@ static int esp_alloc_lun_tag(struct esp_cmd_entry *ent,
static void esp_free_lun_tag(struct esp_cmd_entry *ent, static void esp_free_lun_tag(struct esp_cmd_entry *ent,
struct esp_lun_data *lp) struct esp_lun_data *lp)
{ {
if (ent->tag[0]) { if (ent->orig_tag[0]) {
BUG_ON(lp->tagged_cmds[ent->tag[1]] != ent); BUG_ON(lp->tagged_cmds[ent->orig_tag[1]] != ent);
lp->tagged_cmds[ent->tag[1]] = NULL; lp->tagged_cmds[ent->orig_tag[1]] = NULL;
lp->num_tagged--; lp->num_tagged--;
} else { } else {
BUG_ON(lp->non_tagged_cmd != ent); BUG_ON(lp->non_tagged_cmd != ent);
...@@ -667,6 +667,8 @@ static struct esp_cmd_entry *find_and_prep_issuable_command(struct esp *esp) ...@@ -667,6 +667,8 @@ static struct esp_cmd_entry *find_and_prep_issuable_command(struct esp *esp)
ent->tag[0] = 0; ent->tag[0] = 0;
ent->tag[1] = 0; ent->tag[1] = 0;
} }
ent->orig_tag[0] = ent->tag[0];
ent->orig_tag[1] = ent->tag[1];
if (esp_alloc_lun_tag(ent, lp) < 0) if (esp_alloc_lun_tag(ent, lp) < 0)
continue; continue;
......
...@@ -271,6 +271,7 @@ struct esp_cmd_entry { ...@@ -271,6 +271,7 @@ struct esp_cmd_entry {
#define ESP_CMD_FLAG_AUTOSENSE 0x04 /* Doing automatic REQUEST_SENSE */ #define ESP_CMD_FLAG_AUTOSENSE 0x04 /* Doing automatic REQUEST_SENSE */
u8 tag[2]; u8 tag[2];
u8 orig_tag[2];
u8 status; u8 status;
u8 message; u8 message;
......
...@@ -285,6 +285,20 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -285,6 +285,20 @@ static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma)
return rv; return rv;
} }
static unsigned long proc_reg_get_unmapped_area(struct file *file, unsigned long orig_addr, unsigned long len, unsigned long pgoff, unsigned long flags)
{
struct proc_dir_entry *pde = PDE(file_inode(file));
int rv = -EIO;
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
if (use_pde(pde)) {
get_unmapped_area = pde->proc_fops->get_unmapped_area;
if (get_unmapped_area)
rv = get_unmapped_area(file, orig_addr, len, pgoff, flags);
unuse_pde(pde);
}
return rv;
}
static int proc_reg_open(struct inode *inode, struct file *file) static int proc_reg_open(struct inode *inode, struct file *file)
{ {
struct proc_dir_entry *pde = PDE(inode); struct proc_dir_entry *pde = PDE(inode);
...@@ -356,6 +370,7 @@ static const struct file_operations proc_reg_file_ops = { ...@@ -356,6 +370,7 @@ static const struct file_operations proc_reg_file_ops = {
.compat_ioctl = proc_reg_compat_ioctl, .compat_ioctl = proc_reg_compat_ioctl,
#endif #endif
.mmap = proc_reg_mmap, .mmap = proc_reg_mmap,
.get_unmapped_area = proc_reg_get_unmapped_area,
.open = proc_reg_open, .open = proc_reg_open,
.release = proc_reg_release, .release = proc_reg_release,
}; };
...@@ -368,6 +383,7 @@ static const struct file_operations proc_reg_file_ops_no_compat = { ...@@ -368,6 +383,7 @@ static const struct file_operations proc_reg_file_ops_no_compat = {
.poll = proc_reg_poll, .poll = proc_reg_poll,
.unlocked_ioctl = proc_reg_unlocked_ioctl, .unlocked_ioctl = proc_reg_unlocked_ioctl,
.mmap = proc_reg_mmap, .mmap = proc_reg_mmap,
.get_unmapped_area = proc_reg_get_unmapped_area,
.open = proc_reg_open, .open = proc_reg_open,
.release = proc_reg_release, .release = proc_reg_release,
}; };
......
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