Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Browse files Browse the repository at this point in the history
Pull arch/tile updates from Chris Metcalf:
 "Note that one of the changes converts my old [email protected] email
  in MAINTAINERS to the [email protected] email that you see on this
  email"

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile: update MAINTAINERS email to EZchip
  tile: avoid undefined behavior with regs[TREG_TP] etc
  arch: tile: kernel: kgdb.c: Use memcpy() instead of pointer copy one by one
  tile: Use the more common pr_warn instead of pr_warning
  arch: tile: gxio: Export symbols for module using in 'mpipe.c'
  arch: tile: kernel: signal.c: Use __copy_from/to_user() instead of __get/put_user()
  • Loading branch information
torvalds committed Dec 16, 2014
2 parents eb64c3c + c47b15c commit 0db2812
Show file tree
Hide file tree
Showing 30 changed files with 187 additions and 247 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9614,7 +9614,7 @@ F: include/uapi/linux/tipc*.h
F: net/tipc/

TILE ARCHITECTURE
M: Chris Metcalf <cmetcalf@tilera.com>
M: Chris Metcalf <cmetcalf@ezchip.com>
W: http://www.tilera.com/scm/
S: Supported
F: arch/tile/
Expand Down
4 changes: 4 additions & 0 deletions arch/tile/gxio/mpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context,
(uint64_t)ts->tv_nsec,
(uint64_t)cycles);
}
EXPORT_SYMBOL_GPL(gxio_mpipe_set_timestamp);

int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
struct timespec *ts)
Expand All @@ -485,11 +486,13 @@ int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
}
return ret;
}
EXPORT_SYMBOL_GPL(gxio_mpipe_get_timestamp);

int gxio_mpipe_adjust_timestamp(gxio_mpipe_context_t *context, int64_t delta)
{
return gxio_mpipe_adjust_timestamp_aux(context, delta);
}
EXPORT_SYMBOL_GPL(gxio_mpipe_adjust_timestamp);

/* Get our internal context used for link name access. This context is
* special in that it is not associated with an mPIPE service domain.
Expand Down Expand Up @@ -542,6 +545,7 @@ int gxio_mpipe_link_instance(const char *link_name)

return gxio_mpipe_info_instance_aux(context, name);
}
EXPORT_SYMBOL_GPL(gxio_mpipe_link_instance);

int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac)
{
Expand Down
5 changes: 2 additions & 3 deletions arch/tile/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ extern void ioport_unmap(void __iomem *addr);
static inline long ioport_panic(void)
{
#ifdef __tilegx__
panic("PCI IO space support is disabled. Configure the kernel with"
" CONFIG_TILE_PCI_IO to enable it");
panic("PCI IO space support is disabled. Configure the kernel with CONFIG_TILE_PCI_IO to enable it");
#else
panic("inb/outb and friends do not exist on tile");
#endif
Expand All @@ -406,7 +405,7 @@ static inline long ioport_panic(void)

static inline void __iomem *ioport_map(unsigned long port, unsigned int len)
{
pr_info("ioport_map: mapping IO resources is unsupported on tile.\n");
pr_info("ioport_map: mapping IO resources is unsupported on tile\n");
return NULL;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/tile/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ static inline void __pte_clear(pte_t *ptep)
#define pte_donemigrate(x) hv_pte_set_present(hv_pte_clear_migrating(x))

#define pte_ERROR(e) \
pr_err("%s:%d: bad pte 0x%016llx.\n", __FILE__, __LINE__, pte_val(e))
pr_err("%s:%d: bad pte 0x%016llx\n", __FILE__, __LINE__, pte_val(e))
#define pgd_ERROR(e) \
pr_err("%s:%d: bad pgd 0x%016llx.\n", __FILE__, __LINE__, pgd_val(e))
pr_err("%s:%d: bad pgd 0x%016llx\n", __FILE__, __LINE__, pgd_val(e))

/* Return PA and protection info for a given kernel VA. */
int va_to_cpa_and_pte(void *va, phys_addr_t *cpa, pte_t *pte);
Expand Down
2 changes: 1 addition & 1 deletion arch/tile/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static inline int pud_huge_page(pud_t pud)
}

#define pmd_ERROR(e) \
pr_err("%s:%d: bad pmd 0x%016llx.\n", __FILE__, __LINE__, pmd_val(e))
pr_err("%s:%d: bad pmd 0x%016llx\n", __FILE__, __LINE__, pmd_val(e))

static inline void pud_clear(pud_t *pudp)
{
Expand Down
16 changes: 10 additions & 6 deletions arch/tile/include/uapi/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ typedef uint_reg_t pt_reg_t;
* system call or exception. "struct sigcontext" has the same shape.
*/
struct pt_regs {
/* Saved main processor registers; 56..63 are special. */
/* tp, sp, and lr must immediately follow regs[] for aliasing. */
pt_reg_t regs[53];
pt_reg_t tp; /* aliases regs[TREG_TP] */
pt_reg_t sp; /* aliases regs[TREG_SP] */
pt_reg_t lr; /* aliases regs[TREG_LR] */
union {
/* Saved main processor registers; 56..63 are special. */
pt_reg_t regs[56];
struct {
pt_reg_t __regs[53];
pt_reg_t tp; /* aliases regs[TREG_TP] */
pt_reg_t sp; /* aliases regs[TREG_SP] */
pt_reg_t lr; /* aliases regs[TREG_LR] */
};
};

/* Saved special registers. */
pt_reg_t pc; /* stored in EX_CONTEXT_K_0 */
Expand Down
14 changes: 10 additions & 4 deletions arch/tile/include/uapi/asm/sigcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@
* but is simplified since we know the fault is from userspace.
*/
struct sigcontext {
__uint_reg_t gregs[53]; /* General-purpose registers. */
__uint_reg_t tp; /* Aliases gregs[TREG_TP]. */
__uint_reg_t sp; /* Aliases gregs[TREG_SP]. */
__uint_reg_t lr; /* Aliases gregs[TREG_LR]. */
__extension__ union {
/* General-purpose registers. */
__uint_reg_t gregs[56];
__extension__ struct {
__uint_reg_t __gregs[53];
__uint_reg_t tp; /* Aliases gregs[TREG_TP]. */
__uint_reg_t sp; /* Aliases gregs[TREG_SP]. */
__uint_reg_t lr; /* Aliases gregs[TREG_LR]. */
};
};
__uint_reg_t pc; /* Program counter. */
__uint_reg_t ics; /* In Interrupt Critical Section? */
__uint_reg_t faultnum; /* Fault number. */
Expand Down
6 changes: 2 additions & 4 deletions arch/tile/kernel/hardwall.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num)
* to quiesce.
*/
if (rect->teardown_in_progress) {
pr_notice("cpu %d: detected %s hardwall violation %#lx"
" while teardown already in progress\n",
pr_notice("cpu %d: detected %s hardwall violation %#lx while teardown already in progress\n",
cpu, hwt->name,
(long)mfspr_XDN(hwt, DIRECTION_PROTECT));
goto done;
Expand Down Expand Up @@ -630,8 +629,7 @@ static void _hardwall_deactivate(struct hardwall_type *hwt,
struct thread_struct *ts = &task->thread;

if (cpumask_weight(&task->cpus_allowed) != 1) {
pr_err("pid %d (%s) releasing %s hardwall with"
" an affinity mask containing %d cpus!\n",
pr_err("pid %d (%s) releasing %s hardwall with an affinity mask containing %d cpus!\n",
task->pid, task->comm, hwt->name,
cpumask_weight(&task->cpus_allowed));
BUG();
Expand Down
5 changes: 2 additions & 3 deletions arch/tile/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
{
long sp = stack_pointer - (long) current_thread_info();
if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
pr_emerg("tile_dev_intr: "
"stack overflow: %ld\n",
sp - sizeof(struct thread_info));
pr_emerg("%s: stack overflow: %ld\n",
__func__, sp - sizeof(struct thread_info));
dump_stack();
}
}
Expand Down
6 changes: 1 addition & 5 deletions arch/tile/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
void
sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
{
int reg;
struct pt_regs *thread_regs;
unsigned long *ptr = gdb_regs;

if (task == NULL)
return;
Expand All @@ -136,9 +134,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
memset(gdb_regs, 0, NUMREGBYTES);

thread_regs = task_pt_regs(task);
for (reg = 0; reg <= TREG_LAST_GPR; reg++)
*(ptr++) = thread_regs->regs[reg];

memcpy(gdb_regs, thread_regs, TREG_LAST_GPR * sizeof(unsigned long));
gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc;
gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum;
}
Expand Down
3 changes: 1 addition & 2 deletions arch/tile/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
return -EINVAL;

if (insn_has_control(*p->addr)) {
pr_notice("Kprobes for control instructions are not "
"supported\n");
pr_notice("Kprobes for control instructions are not supported\n");
return -EINVAL;
}

Expand Down
28 changes: 11 additions & 17 deletions arch/tile/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,13 @@ void machine_crash_shutdown(struct pt_regs *regs)
int machine_kexec_prepare(struct kimage *image)
{
if (num_online_cpus() > 1) {
pr_warning("%s: detected attempt to kexec "
"with num_online_cpus() > 1\n",
__func__);
pr_warn("%s: detected attempt to kexec with num_online_cpus() > 1\n",
__func__);
return -ENOSYS;
}
if (image->type != KEXEC_TYPE_DEFAULT) {
pr_warning("%s: detected attempt to kexec "
"with unsupported type: %d\n",
__func__,
image->type);
pr_warn("%s: detected attempt to kexec with unsupported type: %d\n",
__func__, image->type);
return -ENOSYS;
}
return 0;
Expand Down Expand Up @@ -131,8 +128,8 @@ static unsigned char *kexec_bn2cl(void *pg)
*/
csum = ip_compute_csum(pg, bhdrp->b_size);
if (csum != 0) {
pr_warning("%s: bad checksum %#x (size %d)\n",
__func__, csum, bhdrp->b_size);
pr_warn("%s: bad checksum %#x (size %d)\n",
__func__, csum, bhdrp->b_size);
return 0;
}

Expand Down Expand Up @@ -160,8 +157,7 @@ static unsigned char *kexec_bn2cl(void *pg)
while (*desc != '\0') {
desc++;
if (((unsigned long)desc & PAGE_MASK) != (unsigned long)pg) {
pr_info("%s: ran off end of page\n",
__func__);
pr_info("%s: ran off end of page\n", __func__);
return 0;
}
}
Expand Down Expand Up @@ -195,20 +191,18 @@ static void kexec_find_and_set_command_line(struct kimage *image)
}

if (command_line != 0) {
pr_info("setting new command line to \"%s\"\n",
command_line);
pr_info("setting new command line to \"%s\"\n", command_line);

hverr = hv_set_command_line(
(HV_VirtAddr) command_line, strlen(command_line));
kunmap_atomic(command_line);
} else {
pr_info("%s: no command line found; making empty\n",
__func__);
pr_info("%s: no command line found; making empty\n", __func__);
hverr = hv_set_command_line((HV_VirtAddr) command_line, 0);
}
if (hverr)
pr_warning("%s: hv_set_command_line returned error: %d\n",
__func__, hverr);
pr_warn("%s: hv_set_command_line returned error: %d\n",
__func__, hverr);
}

/*
Expand Down
5 changes: 2 additions & 3 deletions arch/tile/kernel/messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ void hv_message_intr(struct pt_regs *regs, int intnum)
{
long sp = stack_pointer - (long) current_thread_info();
if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
pr_emerg("hv_message_intr: "
"stack overflow: %ld\n",
sp - sizeof(struct thread_info));
pr_emerg("%s: stack overflow: %ld\n",
__func__, sp - sizeof(struct thread_info));
dump_stack();
}
}
Expand Down
12 changes: 6 additions & 6 deletions arch/tile/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ void module_free(struct module *mod, void *module_region)
static int validate_hw2_last(long value, struct module *me)
{
if (((value << 16) >> 16) != value) {
pr_warning("module %s: Out of range HW2_LAST value %#lx\n",
me->name, value);
pr_warn("module %s: Out of range HW2_LAST value %#lx\n",
me->name, value);
return 0;
}
return 1;
Expand Down Expand Up @@ -210,10 +210,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
value -= (unsigned long) location; /* pc-relative */
value = (long) value >> 3; /* count by instrs */
if (!validate_jumpoff(value)) {
pr_warning("module %s: Out of range jump to"
" %#llx at %#llx (%p)\n", me->name,
sym->st_value + rel[i].r_addend,
rel[i].r_offset, location);
pr_warn("module %s: Out of range jump to %#llx at %#llx (%p)\n",
me->name,
sym->st_value + rel[i].r_addend,
rel[i].r_offset, location);
return -ENOEXEC;
}
MUNGE(create_JumpOff_X1);
Expand Down
7 changes: 3 additions & 4 deletions arch/tile/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ int __init tile_pci_init(void)
continue;
hv_cfg_fd1 = tile_pcie_open(i, 1);
if (hv_cfg_fd1 < 0) {
pr_err("PCI: Couldn't open config fd to HV "
"for controller %d\n", i);
pr_err("PCI: Couldn't open config fd to HV for controller %d\n",
i);
goto err_cont;
}

Expand Down Expand Up @@ -423,8 +423,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
for (i = 0; i < 6; i++) {
r = &dev->resource[i];
if (r->flags & IORESOURCE_UNSET) {
pr_err("PCI: Device %s not available "
"because of resource collisions\n",
pr_err("PCI: Device %s not available because of resource collisions\n",
pci_name(dev));
return -EINVAL;
}
Expand Down
Loading

0 comments on commit 0db2812

Please sign in to comment.