Commit 0db2812a authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile

Pull arch/tile updates from Chris Metcalf:
 "Note that one of the changes converts my old cmetcalf@tilera.com email
  in MAINTAINERS to the cmetcalf@ezchip.com 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()
parents eb64c3c6 c47b15c4
...@@ -9614,7 +9614,7 @@ F: include/uapi/linux/tipc*.h ...@@ -9614,7 +9614,7 @@ F: include/uapi/linux/tipc*.h
F: net/tipc/ F: net/tipc/
TILE ARCHITECTURE TILE ARCHITECTURE
M: Chris Metcalf <cmetcalf@tilera.com> M: Chris Metcalf <cmetcalf@ezchip.com>
W: http://www.tilera.com/scm/ W: http://www.tilera.com/scm/
S: Supported S: Supported
F: arch/tile/ F: arch/tile/
......
...@@ -463,6 +463,7 @@ int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context, ...@@ -463,6 +463,7 @@ int gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context,
(uint64_t)ts->tv_nsec, (uint64_t)ts->tv_nsec,
(uint64_t)cycles); (uint64_t)cycles);
} }
EXPORT_SYMBOL_GPL(gxio_mpipe_set_timestamp);
int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context, int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
struct timespec *ts) struct timespec *ts)
...@@ -485,11 +486,13 @@ int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context, ...@@ -485,11 +486,13 @@ int gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context,
} }
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(gxio_mpipe_get_timestamp);
int gxio_mpipe_adjust_timestamp(gxio_mpipe_context_t *context, int64_t delta) int gxio_mpipe_adjust_timestamp(gxio_mpipe_context_t *context, int64_t delta)
{ {
return gxio_mpipe_adjust_timestamp_aux(context, 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 /* Get our internal context used for link name access. This context is
* special in that it is not associated with an mPIPE service domain. * special in that it is not associated with an mPIPE service domain.
...@@ -542,6 +545,7 @@ int gxio_mpipe_link_instance(const char *link_name) ...@@ -542,6 +545,7 @@ int gxio_mpipe_link_instance(const char *link_name)
return gxio_mpipe_info_instance_aux(context, 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) int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac)
{ {
......
...@@ -396,8 +396,7 @@ extern void ioport_unmap(void __iomem *addr); ...@@ -396,8 +396,7 @@ extern void ioport_unmap(void __iomem *addr);
static inline long ioport_panic(void) static inline long ioport_panic(void)
{ {
#ifdef __tilegx__ #ifdef __tilegx__
panic("PCI IO space support is disabled. Configure the kernel with" panic("PCI IO space support is disabled. Configure the kernel with CONFIG_TILE_PCI_IO to enable it");
" CONFIG_TILE_PCI_IO to enable it");
#else #else
panic("inb/outb and friends do not exist on tile"); panic("inb/outb and friends do not exist on tile");
#endif #endif
...@@ -406,7 +405,7 @@ static inline long ioport_panic(void) ...@@ -406,7 +405,7 @@ static inline long ioport_panic(void)
static inline void __iomem *ioport_map(unsigned long port, unsigned int len) 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; return NULL;
} }
......
...@@ -235,9 +235,9 @@ static inline void __pte_clear(pte_t *ptep) ...@@ -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_donemigrate(x) hv_pte_set_present(hv_pte_clear_migrating(x))
#define pte_ERROR(e) \ #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) \ #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. */ /* 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); int va_to_cpa_and_pte(void *va, phys_addr_t *cpa, pte_t *pte);
......
...@@ -86,7 +86,7 @@ static inline int pud_huge_page(pud_t pud) ...@@ -86,7 +86,7 @@ static inline int pud_huge_page(pud_t pud)
} }
#define pmd_ERROR(e) \ #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) static inline void pud_clear(pud_t *pudp)
{ {
......
...@@ -52,12 +52,16 @@ typedef uint_reg_t pt_reg_t; ...@@ -52,12 +52,16 @@ typedef uint_reg_t pt_reg_t;
* system call or exception. "struct sigcontext" has the same shape. * system call or exception. "struct sigcontext" has the same shape.
*/ */
struct pt_regs { struct pt_regs {
/* Saved main processor registers; 56..63 are special. */ union {
/* tp, sp, and lr must immediately follow regs[] for aliasing. */ /* Saved main processor registers; 56..63 are special. */
pt_reg_t regs[53]; pt_reg_t regs[56];
pt_reg_t tp; /* aliases regs[TREG_TP] */ struct {
pt_reg_t sp; /* aliases regs[TREG_SP] */ pt_reg_t __regs[53];
pt_reg_t lr; /* aliases regs[TREG_LR] */ 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. */ /* Saved special registers. */
pt_reg_t pc; /* stored in EX_CONTEXT_K_0 */ pt_reg_t pc; /* stored in EX_CONTEXT_K_0 */
......
...@@ -24,10 +24,16 @@ ...@@ -24,10 +24,16 @@
* but is simplified since we know the fault is from userspace. * but is simplified since we know the fault is from userspace.
*/ */
struct sigcontext { struct sigcontext {
__uint_reg_t gregs[53]; /* General-purpose registers. */ __extension__ union {
__uint_reg_t tp; /* Aliases gregs[TREG_TP]. */ /* General-purpose registers. */
__uint_reg_t sp; /* Aliases gregs[TREG_SP]. */ __uint_reg_t gregs[56];
__uint_reg_t lr; /* Aliases gregs[TREG_LR]. */ __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 pc; /* Program counter. */
__uint_reg_t ics; /* In Interrupt Critical Section? */ __uint_reg_t ics; /* In Interrupt Critical Section? */
__uint_reg_t faultnum; /* Fault number. */ __uint_reg_t faultnum; /* Fault number. */
......
...@@ -365,8 +365,7 @@ void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num) ...@@ -365,8 +365,7 @@ void __kprobes do_hardwall_trap(struct pt_regs* regs, int fault_num)
* to quiesce. * to quiesce.
*/ */
if (rect->teardown_in_progress) { if (rect->teardown_in_progress) {
pr_notice("cpu %d: detected %s hardwall violation %#lx" pr_notice("cpu %d: detected %s hardwall violation %#lx while teardown already in progress\n",
" while teardown already in progress\n",
cpu, hwt->name, cpu, hwt->name,
(long)mfspr_XDN(hwt, DIRECTION_PROTECT)); (long)mfspr_XDN(hwt, DIRECTION_PROTECT));
goto done; goto done;
...@@ -630,8 +629,7 @@ static void _hardwall_deactivate(struct hardwall_type *hwt, ...@@ -630,8 +629,7 @@ static void _hardwall_deactivate(struct hardwall_type *hwt,
struct thread_struct *ts = &task->thread; struct thread_struct *ts = &task->thread;
if (cpumask_weight(&task->cpus_allowed) != 1) { if (cpumask_weight(&task->cpus_allowed) != 1) {
pr_err("pid %d (%s) releasing %s hardwall with" pr_err("pid %d (%s) releasing %s hardwall with an affinity mask containing %d cpus!\n",
" an affinity mask containing %d cpus!\n",
task->pid, task->comm, hwt->name, task->pid, task->comm, hwt->name,
cpumask_weight(&task->cpus_allowed)); cpumask_weight(&task->cpus_allowed));
BUG(); BUG();
......
...@@ -107,9 +107,8 @@ void tile_dev_intr(struct pt_regs *regs, int intnum) ...@@ -107,9 +107,8 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
{ {
long sp = stack_pointer - (long) current_thread_info(); long sp = stack_pointer - (long) current_thread_info();
if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) { if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
pr_emerg("tile_dev_intr: " pr_emerg("%s: stack overflow: %ld\n",
"stack overflow: %ld\n", __func__, sp - sizeof(struct thread_info));
sp - sizeof(struct thread_info));
dump_stack(); dump_stack();
} }
} }
......
...@@ -125,9 +125,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) ...@@ -125,9 +125,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
void void
sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task) sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
{ {
int reg;
struct pt_regs *thread_regs; struct pt_regs *thread_regs;
unsigned long *ptr = gdb_regs;
if (task == NULL) if (task == NULL)
return; return;
...@@ -136,9 +134,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task) ...@@ -136,9 +134,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
memset(gdb_regs, 0, NUMREGBYTES); memset(gdb_regs, 0, NUMREGBYTES);
thread_regs = task_pt_regs(task); thread_regs = task_pt_regs(task);
for (reg = 0; reg <= TREG_LAST_GPR; reg++) memcpy(gdb_regs, thread_regs, TREG_LAST_GPR * sizeof(unsigned long));
*(ptr++) = thread_regs->regs[reg];
gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc; gdb_regs[TILEGX_PC_REGNUM] = thread_regs->pc;
gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum; gdb_regs[TILEGX_FAULTNUM_REGNUM] = thread_regs->faultnum;
} }
......
...@@ -90,8 +90,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) ...@@ -90,8 +90,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
return -EINVAL; return -EINVAL;
if (insn_has_control(*p->addr)) { if (insn_has_control(*p->addr)) {
pr_notice("Kprobes for control instructions are not " pr_notice("Kprobes for control instructions are not supported\n");
"supported\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -77,16 +77,13 @@ void machine_crash_shutdown(struct pt_regs *regs) ...@@ -77,16 +77,13 @@ void machine_crash_shutdown(struct pt_regs *regs)
int machine_kexec_prepare(struct kimage *image) int machine_kexec_prepare(struct kimage *image)
{ {
if (num_online_cpus() > 1) { if (num_online_cpus() > 1) {
pr_warning("%s: detected attempt to kexec " pr_warn("%s: detected attempt to kexec with num_online_cpus() > 1\n",
"with num_online_cpus() > 1\n", __func__);
__func__);
return -ENOSYS; return -ENOSYS;
} }
if (image->type != KEXEC_TYPE_DEFAULT) { if (image->type != KEXEC_TYPE_DEFAULT) {
pr_warning("%s: detected attempt to kexec " pr_warn("%s: detected attempt to kexec with unsupported type: %d\n",
"with unsupported type: %d\n", __func__, image->type);
__func__,
image->type);
return -ENOSYS; return -ENOSYS;
} }
return 0; return 0;
...@@ -131,8 +128,8 @@ static unsigned char *kexec_bn2cl(void *pg) ...@@ -131,8 +128,8 @@ static unsigned char *kexec_bn2cl(void *pg)
*/ */
csum = ip_compute_csum(pg, bhdrp->b_size); csum = ip_compute_csum(pg, bhdrp->b_size);
if (csum != 0) { if (csum != 0) {
pr_warning("%s: bad checksum %#x (size %d)\n", pr_warn("%s: bad checksum %#x (size %d)\n",
__func__, csum, bhdrp->b_size); __func__, csum, bhdrp->b_size);
return 0; return 0;
} }
...@@ -160,8 +157,7 @@ static unsigned char *kexec_bn2cl(void *pg) ...@@ -160,8 +157,7 @@ static unsigned char *kexec_bn2cl(void *pg)
while (*desc != '\0') { while (*desc != '\0') {
desc++; desc++;
if (((unsigned long)desc & PAGE_MASK) != (unsigned long)pg) { if (((unsigned long)desc & PAGE_MASK) != (unsigned long)pg) {
pr_info("%s: ran off end of page\n", pr_info("%s: ran off end of page\n", __func__);
__func__);
return 0; return 0;
} }
} }
...@@ -195,20 +191,18 @@ static void kexec_find_and_set_command_line(struct kimage *image) ...@@ -195,20 +191,18 @@ static void kexec_find_and_set_command_line(struct kimage *image)
} }
if (command_line != 0) { if (command_line != 0) {
pr_info("setting new command line to \"%s\"\n", pr_info("setting new command line to \"%s\"\n", command_line);
command_line);
hverr = hv_set_command_line( hverr = hv_set_command_line(
(HV_VirtAddr) command_line, strlen(command_line)); (HV_VirtAddr) command_line, strlen(command_line));
kunmap_atomic(command_line); kunmap_atomic(command_line);
} else { } else {
pr_info("%s: no command line found; making empty\n", pr_info("%s: no command line found; making empty\n", __func__);
__func__);
hverr = hv_set_command_line((HV_VirtAddr) command_line, 0); hverr = hv_set_command_line((HV_VirtAddr) command_line, 0);
} }
if (hverr) if (hverr)
pr_warning("%s: hv_set_command_line returned error: %d\n", pr_warn("%s: hv_set_command_line returned error: %d\n",
__func__, hverr); __func__, hverr);
} }
/* /*
......
...@@ -59,9 +59,8 @@ void hv_message_intr(struct pt_regs *regs, int intnum) ...@@ -59,9 +59,8 @@ void hv_message_intr(struct pt_regs *regs, int intnum)
{ {
long sp = stack_pointer - (long) current_thread_info(); long sp = stack_pointer - (long) current_thread_info();
if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) { if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
pr_emerg("hv_message_intr: " pr_emerg("%s: stack overflow: %ld\n",
"stack overflow: %ld\n", __func__, sp - sizeof(struct thread_info));
sp - sizeof(struct thread_info));
dump_stack(); dump_stack();
} }
} }
......
...@@ -96,8 +96,8 @@ void module_free(struct module *mod, void *module_region) ...@@ -96,8 +96,8 @@ void module_free(struct module *mod, void *module_region)
static int validate_hw2_last(long value, struct module *me) static int validate_hw2_last(long value, struct module *me)
{ {
if (((value << 16) >> 16) != value) { if (((value << 16) >> 16) != value) {
pr_warning("module %s: Out of range HW2_LAST value %#lx\n", pr_warn("module %s: Out of range HW2_LAST value %#lx\n",
me->name, value); me->name, value);
return 0; return 0;
} }
return 1; return 1;
...@@ -210,10 +210,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, ...@@ -210,10 +210,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
value -= (unsigned long) location; /* pc-relative */ value -= (unsigned long) location; /* pc-relative */
value = (long) value >> 3; /* count by instrs */ value = (long) value >> 3; /* count by instrs */
if (!validate_jumpoff(value)) { if (!validate_jumpoff(value)) {
pr_warning("module %s: Out of range jump to" pr_warn("module %s: Out of range jump to %#llx at %#llx (%p)\n",
" %#llx at %#llx (%p)\n", me->name, me->name,
sym->st_value + rel[i].r_addend, sym->st_value + rel[i].r_addend,
rel[i].r_offset, location); rel[i].r_offset, location);
return -ENOEXEC; return -ENOEXEC;
} }
MUNGE(create_JumpOff_X1); MUNGE(create_JumpOff_X1);
......
...@@ -178,8 +178,8 @@ int __init tile_pci_init(void) ...@@ -178,8 +178,8 @@ int __init tile_pci_init(void)
continue; continue;
hv_cfg_fd1 = tile_pcie_open(i, 1); hv_cfg_fd1 = tile_pcie_open(i, 1);
if (hv_cfg_fd1 < 0) { if (hv_cfg_fd1 < 0) {
pr_err("PCI: Couldn't open config fd to HV " pr_err("PCI: Couldn't open config fd to HV for controller %d\n",
"for controller %d\n", i); i);
goto err_cont; goto err_cont;
} }
...@@ -423,8 +423,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -423,8 +423,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
r = &dev->resource[i]; r = &dev->resource[i];
if (r->flags & IORESOURCE_UNSET) { if (r->flags & IORESOURCE_UNSET) {
pr_err("PCI: Device %s not available " pr_err("PCI: Device %s not available because of resource collisions\n",
"because of resource collisions\n",
pci_name(dev)); pci_name(dev));
return -EINVAL; return -EINVAL;
} }
......
...@@ -131,8 +131,7 @@ static int tile_irq_cpu(int irq) ...@@ -131,8 +131,7 @@ static int tile_irq_cpu(int irq)
count = cpumask_weight(&intr_cpus_map); count = cpumask_weight(&intr_cpus_map);
if (unlikely(count == 0)) { if (unlikely(count == 0)) {
pr_warning("intr_cpus_map empty, interrupts will be" pr_warn("intr_cpus_map empty, interrupts will be delievered to dataplane tiles\n");
" delievered to dataplane tiles\n");
return irq % (smp_height * smp_width); return irq % (smp_height * smp_width);
} }
...@@ -197,16 +196,16 @@ static int tile_pcie_open(int trio_index) ...@@ -197,16 +196,16 @@ static int tile_pcie_open(int trio_index)
/* Get the properties of the PCIe ports on this TRIO instance. */ /* Get the properties of the PCIe ports on this TRIO instance. */
ret = gxio_trio_get_port_property(context, &pcie_ports[trio_index]); ret = gxio_trio_get_port_property(context, &pcie_ports[trio_index]);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: PCIE_GET_PORT_PROPERTY failure, error %d," pr_err("PCI: PCIE_GET_PORT_PROPERTY failure, error %d, on TRIO %d\n",
" on TRIO %d\n", ret, trio_index); ret, trio_index);
goto get_port_property_failure; goto get_port_property_failure;
} }
context->mmio_base_mac = context->mmio_base_mac =
iorpc_ioremap(context->fd, 0, HV_TRIO_CONFIG_IOREMAP_SIZE); iorpc_ioremap(context->fd, 0, HV_TRIO_CONFIG_IOREMAP_SIZE);
if (context->mmio_base_mac == NULL) { if (context->mmio_base_mac == NULL) {
pr_err("PCI: TRIO config space mapping failure, error %d," pr_err("PCI: TRIO config space mapping failure, error %d, on TRIO %d\n",
" on TRIO %d\n", ret, trio_index); ret, trio_index);
ret = -ENOMEM; ret = -ENOMEM;
goto trio_mmio_mapping_failure; goto trio_mmio_mapping_failure;
...@@ -622,9 +621,8 @@ static void fixup_read_and_payload_sizes(struct pci_controller *controller) ...@@ -622,9 +621,8 @@ static void fixup_read_and_payload_sizes(struct pci_controller *controller)
dev_control.max_read_req_sz, dev_control.max_read_req_sz,
mac); mac);
if (err < 0) { if (err < 0) {
pr_err("PCI: PCIE_CONFIGURE_MAC_MPS_MRS failure, " pr_err("PCI: PCIE_CONFIGURE_MAC_MPS_MRS failure, MAC %d on TRIO %d\n",
"MAC %d on TRIO %d\n", mac, controller->trio_index);
mac, controller->trio_index);
} }
} }
...@@ -720,27 +718,24 @@ int __init pcibios_init(void) ...@@ -720,27 +718,24 @@ int __init pcibios_init(void)
reg_offset); reg_offset);
if (!port_status.dl_up) { if (!port_status.dl_up) {
if (rc_delay[trio_index][mac]) { if (rc_delay[trio_index][mac]) {
pr_info("Delaying PCIe RC TRIO init %d sec" pr_info("Delaying PCIe RC TRIO init %d sec on MAC %d on TRIO %d\n",
" on MAC %d on TRIO %d\n",
rc_delay[trio_index][mac], mac, rc_delay[trio_index][mac], mac,
trio_index); trio_index);
msleep(rc_delay[trio_index][mac] * 1000); msleep(rc_delay[trio_index][mac] * 1000);
} }
ret = gxio_trio_force_rc_link_up(trio_context, mac); ret = gxio_trio_force_rc_link_up(trio_context, mac);
if (ret < 0) if (ret < 0)
pr_err("PCI: PCIE_FORCE_LINK_UP failure, " pr_err("PCI: PCIE_FORCE_LINK_UP failure, MAC %d on TRIO %d\n",
"MAC %d on TRIO %d\n", mac, trio_index); mac, trio_index);
} }
pr_info("PCI: Found PCI controller #%d on TRIO %d MAC %d\n", i, pr_info("PCI: Found PCI controller #%d on TRIO %d MAC %d\n",
trio_index, controller->mac); i, trio_index, controller->mac);
/* Delay the bus probe if needed. */ /* Delay the bus probe if needed. */
if (rc_delay[trio_index][mac]) { if (rc_delay[trio_index][mac]) {
pr_info("Delaying PCIe RC bus enumerating %d sec" pr_info("Delaying PCIe RC bus enumerating %d sec on MAC %d on TRIO %d\n",
" on MAC %d on TRIO %d\n", rc_delay[trio_index][mac], mac, trio_index);
rc_delay[trio_index][mac], mac,
trio_index);
msleep(rc_delay[trio_index][mac] * 1000); msleep(rc_delay[trio_index][mac] * 1000);
} else { } else {
/* /*
...@@ -758,11 +753,10 @@ int __init pcibios_init(void) ...@@ -758,11 +753,10 @@ int __init pcibios_init(void)
if (pcie_ports[trio_index].ports[mac].removable) { if (pcie_ports[trio_index].ports[mac].removable) {
pr_info("PCI: link is down, MAC %d on TRIO %d\n", pr_info("PCI: link is down, MAC %d on TRIO %d\n",
mac, trio_index); mac, trio_index);
pr_info("This is expected if no PCIe card" pr_info("This is expected if no PCIe card is connected to this link\n");
" is connected to this link\n");
} else } else
pr_err("PCI: link is down, MAC %d on TRIO %d\n", pr_err("PCI: link is down, MAC %d on TRIO %d\n",
mac, trio_index); mac, trio_index);
continue; continue;
} }
...@@ -829,8 +823,8 @@ int __init pcibios_init(void) ...@@ -829,8 +823,8 @@ int __init pcibios_init(void)
/* Alloc a PIO region for PCI config access per MAC. */ /* Alloc a PIO region for PCI config access per MAC. */
ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0); ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: PCI CFG PIO alloc failure for mac %d " pr_err("PCI: PCI CFG PIO alloc failure for mac %d on TRIO %d, give up\n",
"on TRIO %d, give up\n", mac, trio_index); mac, trio_index);
continue; continue;
} }
...@@ -842,8 +836,8 @@ int __init pcibios_init(void) ...@@ -842,8 +836,8 @@ int __init pcibios_init(void)
trio_context->pio_cfg_index[mac], trio_context->pio_cfg_index[mac],
mac, 0, HV_TRIO_PIO_FLAG_CONFIG_SPACE); mac, 0, HV_TRIO_PIO_FLAG_CONFIG_SPACE);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: PCI CFG PIO init failure for mac %d " pr_err("PCI: PCI CFG PIO init failure for mac %d on TRIO %d, give up\n",
"on TRIO %d, give up\n", mac, trio_index); mac, trio_index);
continue; continue;
} }
...@@ -865,7 +859,7 @@ int __init pcibios_init(void) ...@@ -865,7 +859,7 @@ int __init pcibios_init(void)
(TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT - 1))); (TRIO_TILE_PIO_REGION_SETUP_CFG_ADDR__MAC_SHIFT - 1)));
if (trio_context->mmio_base_pio_cfg[mac] == NULL) { if (trio_context->mmio_base_pio_cfg[mac] == NULL) {
pr_err("PCI: PIO map failure for mac %d on TRIO %d\n", pr_err("PCI: PIO map failure for mac %d on TRIO %d\n",
mac, trio_index); mac, trio_index);
continue; continue;
} }
...@@ -925,9 +919,8 @@ int __init pcibios_init(void) ...@@ -925,9 +919,8 @@ int __init pcibios_init(void)
/* Alloc a PIO region for PCI memory access for each RC port. */ /* Alloc a PIO region for PCI memory access for each RC port. */
ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0); ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: MEM PIO alloc failure on TRIO %d mac %d, " pr_err("PCI: MEM PIO alloc failure on TRIO %d mac %d, give up\n",
"give up\n", controller->trio_index, controller->trio_index, controller->mac);
controller->mac);
continue; continue;
} }
...@@ -944,9 +937,8 @@ int __init pcibios_init(void) ...@@ -944,9 +937,8 @@ int __init pcibios_init(void)
0, 0,
0); 0);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: MEM PIO init failure on TRIO %d mac %d, " pr_err("PCI: MEM PIO init failure on TRIO %d mac %d, give up\n",
"give up\n", controller->trio_index, controller->trio_index, controller->mac);
controller->mac);
continue; continue;
} }
...@@ -957,9 +949,8 @@ int __init pcibios_init(void) ...@@ -957,9 +949,8 @@ int __init pcibios_init(void)
*/ */
ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0); ret = gxio_trio_alloc_pio_regions(trio_context, 1, 0, 0);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: I/O PIO alloc failure on TRIO %d mac %d, " pr_err("PCI: I/O PIO alloc failure on TRIO %d mac %d, give up\n",
"give up\n", controller->trio_index, controller->trio_index, controller->mac);
controller->mac);
continue; continue;
} }
...@@ -976,9 +967,8 @@ int __init pcibios_init(void) ...@@ -976,9 +967,8 @@ int __init pcibios_init(void)
0, 0,
HV_TRIO_PIO_FLAG_IO_SPACE); HV_TRIO_PIO_FLAG_IO_SPACE);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: I/O PIO init failure on TRIO %d mac %d, " pr_err("PCI: I/O PIO init failure on TRIO %d mac %d, give up\n",
"give up\n", controller->trio_index, controller->trio_index, controller->mac);
controller->mac);
continue; continue;
} }
...@@ -997,10 +987,9 @@ int __init pcibios_init(void) ...@@ -997,10 +987,9 @@ int __init pcibios_init(void)
ret = gxio_trio_alloc_memory_maps(trio_context, 1, 0, ret = gxio_trio_alloc_memory_maps(trio_context, 1, 0,
0); 0);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: Mem-Map alloc failure on TRIO %d " pr_err("PCI: Mem-Map alloc failure on TRIO %d mac %d for MC %d, give up\n",
"mac %d for MC %d, give up\n", controller->trio_index, controller->mac,
controller->trio_index, j);
controller->mac, j);
goto alloc_mem_map_failed; goto alloc_mem_map_failed;
} }
...@@ -1030,10 +1019,9 @@ int __init pcibios_init(void) ...@@ -1030,10 +1019,9 @@ int __init pcibios_init(void)
j, j,
GXIO_TRIO_ORDER_MODE_UNORDERED); GXIO_TRIO_ORDER_MODE_UNORDERED);
if (ret < 0) { if (ret < 0) {
pr_err("PCI: Mem-Map init failure on TRIO %d " pr_err("PCI: Mem-Map init failure on TRIO %d mac %d for MC %d, give up\n",
"mac %d for MC %d, give up\n", controller->trio_index, controller->mac,
controller->trio_index, j);
controller->mac, j);
goto alloc_mem_map_failed; goto alloc_mem_map_failed;
} }
...@@ -1510,9 +1498,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) ...@@ -1510,9 +1498,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
* Most PCIe endpoint devices do support 64-bit message addressing. * Most PCIe endpoint devices do support 64-bit message addressing.
*/ */
if (desc->msi_attrib.is_64 == 0) { if (desc->msi_attrib.is_64 == 0) {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "64-bit MSI message address not supported, falling back to legacy interrupts\n");
"64-bit MSI message address not supported, "
"falling back to legacy interrupts.\n");
ret = -ENOMEM; ret = -ENOMEM;
goto is_64_failure; goto is_64_failure;
...@@ -1549,11 +1535,8 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) ...@@ -1549,11 +1535,8 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
/* SQ regions are out, allocate from map mem regions. */ /* SQ regions are out, allocate from map mem regions. */
mem_map = gxio_trio_alloc_memory_maps(trio_context, 1, 0, 0); mem_map = gxio_trio_alloc_memory_maps(trio_context, 1, 0, 0);
if (mem_map < 0) { if (mem_map < 0) {
dev_printk(KERN_INFO, &pdev->dev, dev_info(&pdev->dev, "%s Mem-Map alloc failure - failed to initialize MSI interrupts - falling back to legacy interrupts\n",
"%s Mem-Map alloc failure. " desc->msi_attrib.is_msix ? "MSI-X" : "MSI");
"Failed to initialize MSI interrupts. "
"Falling back to legacy interrupts.\n",
desc->msi_attrib.is_msix ? "MSI-X" : "MSI");
ret = -ENOMEM; ret = -ENOMEM;
goto msi_mem_map_alloc_failure; goto msi_mem_map_alloc_failure;
} }
...@@ -1580,7 +1563,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) ...@@ -1580,7 +1563,7 @@ int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
mem_map, mem_map_base, mem_map_limit, mem_map, mem_map_base, mem_map_limit,
trio_context->asid); trio_context->asid);
if (ret < 0) { if (ret < 0) {
dev_printk(KERN_INFO, &pdev->dev, "HV MSI config failed.\n"); dev_info(&pdev->dev, "HV MSI config failed\n");
goto hv_msi_config_failure; goto hv_msi_config_failure;
} }
......
...@@ -52,7 +52,7 @@ static int __init idle_setup(char *str) ...@@ -52,7 +52,7 @@ static int __init idle_setup(char *str)
return -EINVAL; return -EINVAL;
if (!strcmp(str, "poll")) { if (!strcmp(str, "poll")) {
pr_info("using polling idle threads.\n"); pr_info("using polling idle threads\n");
cpu_idle_poll_ctrl(true); cpu_idle_poll_ctrl(true);
return 0; return 0;
} else if (!strcmp(str, "halt")) { } else if (!strcmp(str, "halt")) {
...@@ -547,27 +547,25 @@ void show_regs(struct pt_regs *regs) ...@@ -547,27 +547,25 @@ void show_regs(struct pt_regs *regs)
struct task_struct *tsk = validate_current(); struct task_struct *tsk = validate_current();
int i; int i;
pr_err("\n");
if (tsk != &corrupt_current) if (tsk != &corrupt_current)
show_regs_print_info(KERN_ERR); show_regs_print_info(KERN_ERR);
#ifdef __tilegx__ #ifdef __tilegx__
for (i = 0; i < 17; i++) for (i = 0; i < 17; i++)
pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT" r%-2d: "REGFMT"\n", pr_err(" r%-2d: " REGFMT " r%-2d: " REGFMT " r%-2d: " REGFMT "\n",
i, regs->regs[i], i+18, regs->regs[i+18], i, regs->regs[i], i+18, regs->regs[i+18],
i+36, regs->regs[i+36]); i+36, regs->regs[i+36]);
pr_err(" r17: "REGFMT" r35: "REGFMT" tp : "REGFMT"\n", pr_err(" r17: " REGFMT " r35: " REGFMT " tp : " REGFMT "\n",
regs->regs[17], regs->regs[35], regs->tp); regs->regs[17], regs->regs[35], regs->tp);
pr_err(" sp : "REGFMT" lr : "REGFMT"\n", regs->sp, regs->lr); pr_err(" sp : " REGFMT " lr : " REGFMT "\n", regs->sp, regs->lr);
#else #else
for (i = 0; i < 13; i++) for (i = 0; i < 13; i++)
pr_err(" r%-2d: "REGFMT" r%-2d: "REGFMT pr_err(" r%-2d: " REGFMT " r%-2d: " REGFMT " r%-2d: " REGFMT " r%-2d: " REGFMT "\n",
" r%-2d: "REGFMT" r%-2d: "REGFMT"\n",
i, regs->regs[i], i+14, regs->regs[i+14], i, regs->regs[i], i+14, regs->regs[i+14],
i+27, regs->regs[i+27], i+40, regs->regs[i+40]); i+27, regs->regs[i+27], i+40, regs->regs[i+40]);
pr_err(" r13: "REGFMT" tp : "REGFMT" sp : "REGFMT" lr : "REGFMT"\n", pr_err(" r13: " REGFMT " tp : " REGFMT " sp : " REGFMT " lr : " REGFMT "\n",
regs->regs[13], regs->tp, regs->sp, regs->lr); regs->regs[13], regs->tp, regs->sp, regs->lr);
#endif #endif
pr_err(" pc : "REGFMT" ex1: %ld faultnum: %ld\n", pr_err(" pc : " REGFMT " ex1: %ld faultnum: %ld\n",
regs->pc, regs->ex1, regs->faultnum); regs->pc, regs->ex1, regs->faultnum);
dump_stack_regs(regs); dump_stack_regs(regs);
......
...@@ -130,7 +130,7 @@ static int __init setup_maxmem(char *str) ...@@ -130,7 +130,7 @@ static int __init setup_maxmem(char *str)
maxmem_pfn = (maxmem >> HPAGE_SHIFT) << (HPAGE_SHIFT - PAGE_SHIFT); maxmem_pfn = (maxmem >> HPAGE_SHIFT) << (HPAGE_SHIFT - PAGE_SHIFT);
pr_info("Forcing RAM used to no more than %dMB\n", pr_info("Forcing RAM used to no more than %dMB\n",
maxmem_pfn >> (20 - PAGE_SHIFT)); maxmem_pfn >> (20 - PAGE_SHIFT));
return 0; return 0;
} }
early_param("maxmem", setup_maxmem); early_param("maxmem", setup_maxmem);
...@@ -149,7 +149,7 @@ static int __init setup_maxnodemem(char *str) ...@@ -149,7 +149,7 @@ static int __init setup_maxnodemem(char *str)
maxnodemem_pfn[node] = (maxnodemem >> HPAGE_SHIFT) << maxnodemem_pfn[node] = (maxnodemem >> HPAGE_SHIFT) <<
(HPAGE_SHIFT - PAGE_SHIFT); (HPAGE_SHIFT - PAGE_SHIFT);
pr_info("Forcing RAM used on node %ld to no more than %dMB\n", pr_info("Forcing RAM used on node %ld to no more than %dMB\n",
node, maxnodemem_pfn[node] >> (20 - PAGE_SHIFT)); node, maxnodemem_pfn[node] >> (20 - PAGE_SHIFT));
return 0; return 0;
} }
early_param("maxnodemem", setup_maxnodemem); early_param("maxnodemem", setup_maxnodemem);
...@@ -417,8 +417,7 @@ static void __init setup_memory(void) ...@@ -417,8 +417,7 @@ static void __init setup_memory(void)
range.start = (start_pa + HPAGE_SIZE - 1) & HPAGE_MASK; range.start = (start_pa + HPAGE_SIZE - 1) & HPAGE_MASK;
range.size -= (range.start - start_pa); range.size -= (range.start - start_pa);
range.size &= HPAGE_MASK; range.size &= HPAGE_MASK;
pr_err("Range not hugepage-aligned: %#llx..%#llx:" pr_err("Range not hugepage-aligned: %#llx..%#llx: now %#llx-%#llx\n",
" now %#llx-%#llx\n",
start_pa, start_pa + orig_size, start_pa, start_pa + orig_size,
range.start, range.start + range.size); range.start, range.start + range.size);
} }
...@@ -437,8 +436,8 @@ static void __init setup_memory(void) ...@@ -437,8 +436,8 @@ static void __init setup_memory(void)
if (PFN_DOWN(range.size) > maxnodemem_pfn[i]) { if (PFN_DOWN(range.size) > maxnodemem_pfn[i]) {
int max_size = maxnodemem_pfn[i]; int max_size = maxnodemem_pfn[i];
if (max_size > 0) { if (max_size > 0) {
pr_err("Maxnodemem reduced node %d to" pr_err("Maxnodemem reduced node %d to %d pages\n",
" %d pages\n", i, max_size); i, max_size);
range.size = PFN_PHYS(max_size); range.size = PFN_PHYS(max_size);
} else { } else {
pr_err("Maxnodemem disabled node %d\n", i); pr_err("Maxnodemem disabled node %d\n", i);
...@@ -490,8 +489,8 @@ static void __init setup_memory(void) ...@@ -490,8 +489,8 @@ static void __init setup_memory(void)
NR_CPUS * (PFN_UP(per_cpu_size) >> PAGE_SHIFT); NR_CPUS * (PFN_UP(per_cpu_size) >> PAGE_SHIFT);
if (end < pci_reserve_end_pfn + percpu_pages) { if (end < pci_reserve_end_pfn + percpu_pages) {
end = pci_reserve_start_pfn; end = pci_reserve_start_pfn;
pr_err("PCI mapping region reduced node %d to" pr_err("PCI mapping region reduced node %d to %ld pages\n",
" %ld pages\n", i, end - start); i, end - start);
} }
} }
#endif #endif
...@@ -555,10 +554,9 @@ static void __init setup_memory(void) ...@@ -555,10 +554,9 @@ static void __init setup_memory(void)
MAXMEM_PFN : mappable_physpages; MAXMEM_PFN : mappable_physpages;
highmem_pages = (long) (physpages - lowmem_pages); highmem_pages = (long) (physpages - lowmem_pages);
pr_notice("%ldMB HIGHMEM available.\n", pr_notice("%ldMB HIGHMEM available\n",
pages_to_mb(highmem_pages > 0 ? highmem_pages : 0)); pages_to_mb(highmem_pages > 0 ? highmem_pages : 0));
pr_notice("%ldMB LOWMEM available.\n", pr_notice("%ldMB LOWMEM available\n", pages_to_mb(lowmem_pages));
pages_to_mb(lowmem_pages));
#else #else
/* Set max_low_pfn based on what node 0 can directly address. */ /* Set max_low_pfn based on what node 0 can directly address. */
max_low_pfn = node_end_pfn[0]; max_low_pfn = node_end_pfn[0];
...@@ -571,8 +569,8 @@ static void __init setup_memory(void) ...@@ -571,8 +569,8 @@ static void __init setup_memory(void)
max_pfn = MAXMEM_PFN; max_pfn = MAXMEM_PFN;
node_end_pfn[0] = MAXMEM_PFN; node_end_pfn[0] = MAXMEM_PFN;
} else { } else {
pr_notice("%ldMB memory available.\n", pr_notice("%ldMB memory available\n",
pages_to_mb(node_end_pfn[0])); pages_to_mb(node_end_pfn[0]));
} }
for (i = 1; i < MAX_NUMNODES; ++i) { for (i = 1; i < MAX_NUMNODES; ++i) {
node_start_pfn[i] = 0; node_start_pfn[i] = 0;
...@@ -587,8 +585,7 @@ static void __init setup_memory(void) ...@@ -587,8 +585,7 @@ static void __init setup_memory(void)
if (pages) if (pages)
high_memory = pfn_to_kaddr(node_end_pfn[i]); high_memory = pfn_to_kaddr(node_end_pfn[i]);
} }
pr_notice("%ldMB memory available.\n", pr_notice("%ldMB memory available\n", pages_to_mb(lowmem_pages));
pages_to_mb(lowmem_pages));
#endif #endif
#endif #endif
} }
...@@ -1535,8 +1532,7 @@ static void __init pcpu_fc_populate_pte(unsigned long addr) ...@@ -1535,8 +1532,7 @@ static void __init pcpu_fc_populate_pte(unsigned long addr)
BUG_ON(pgd_addr_invalid(addr)); BUG_ON(pgd_addr_invalid(addr));
if (addr < VMALLOC_START || addr >= VMALLOC_END) if (addr < VMALLOC_START || addr >= VMALLOC_END)
panic("PCPU addr %#lx outside vmalloc range %#lx..%#lx;" panic("PCPU addr %#lx outside vmalloc range %#lx..%#lx; try increasing CONFIG_VMALLOC_RESERVE\n",
" try increasing CONFIG_VMALLOC_RESERVE\n",
addr, VMALLOC_START, VMALLOC_END); addr, VMALLOC_START, VMALLOC_END);
pgd = swapper_pg_dir + pgd_index(addr); pgd = swapper_pg_dir + pgd_index(addr);
...@@ -1591,8 +1587,8 @@ void __init setup_per_cpu_areas(void) ...@@ -1591,8 +1587,8 @@ void __init setup_per_cpu_areas(void)
lowmem_va = (unsigned long)pfn_to_kaddr(pfn); lowmem_va = (unsigned long)pfn_to_kaddr(pfn);
ptep = virt_to_kpte(lowmem_va); ptep = virt_to_kpte(lowmem_va);
if (pte_huge(*ptep)) { if (pte_huge(*ptep)) {
printk(KERN_DEBUG "early shatter of huge page" printk(KERN_DEBUG "early shatter of huge page at %#lx\n",
" at %#lx\n", lowmem_va); lowmem_va);
shatter_pmd((pmd_t *)ptep); shatter_pmd((pmd_t *)ptep);
ptep = virt_to_kpte(lowmem_va); ptep = virt_to_kpte(lowmem_va);
BUG_ON(pte_huge(*ptep)); BUG_ON(pte_huge(*ptep));
......
...@@ -45,8 +45,7 @@ ...@@ -45,8 +45,7 @@
int restore_sigcontext(struct pt_regs *regs, int restore_sigcontext(struct pt_regs *regs,
struct sigcontext __user *sc) struct sigcontext __user *sc)
{ {
int err = 0; int err;
int i;
/* Always make any pending restarted system calls return -EINTR */ /* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall; current_thread_info()->restart_block.fn = do_no_restart_syscall;
...@@ -57,9 +56,7 @@ int restore_sigcontext(struct pt_regs *regs, ...@@ -57,9 +56,7 @@ int restore_sigcontext(struct pt_regs *regs,
*/ */
BUILD_BUG_ON(sizeof(struct sigcontext) != sizeof(struct pt_regs)); BUILD_BUG_ON(sizeof(struct sigcontext) != sizeof(struct pt_regs));
BUILD_BUG_ON(sizeof(struct sigcontext) % 8 != 0); BUILD_BUG_ON(sizeof(struct sigcontext) % 8 != 0);
err = __copy_from_user(regs, sc, sizeof(*regs));
for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
err |= __get_user(regs->regs[i], &sc->gregs[i]);
/* Ensure that the PL is always set to USER_PL. */ /* Ensure that the PL is always set to USER_PL. */
regs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(regs->ex1)); regs->ex1 = PL_ICS_EX1(USER_PL, EX1_ICS(regs->ex1));
...@@ -110,12 +107,7 @@ SYSCALL_DEFINE0(rt_sigreturn) ...@@ -110,12 +107,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs) int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs)
{ {
int i, err = 0; return __copy_to_user(sc, regs, sizeof(*regs));
for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
err |= __put_user(regs->regs[i], &sc->gregs[i]);
return err;
} }
/* /*
...@@ -345,7 +337,6 @@ static void dump_mem(void __user *address) ...@@ -345,7 +337,6 @@ static void dump_mem(void __user *address)
int i, j, k; int i, j, k;
int found_readable_mem = 0; int found_readable_mem = 0;
pr_err("\n");
if (!access_ok(VERIFY_READ, address, 1)) { if (!access_ok(VERIFY_READ, address, 1)) {
pr_err("Not dumping at address 0x%lx (kernel address)\n", pr_err("Not dumping at address 0x%lx (kernel address)\n",
(unsigned long)address); (unsigned long)address);
...@@ -367,7 +358,7 @@ static void dump_mem(void __user *address) ...@@ -367,7 +358,7 @@ static void dump_mem(void __user *address)
(unsigned long)address); (unsigned long)address);
found_readable_mem = 1; found_readable_mem = 1;
} }
j = sprintf(line, REGFMT":", (unsigned long)addr); j = sprintf(line, REGFMT ":", (unsigned long)addr);
for (k = 0; k < bytes_per_line; ++k) for (k = 0; k < bytes_per_line; ++k)
j += sprintf(&line[j], " %02x", buf[k]); j += sprintf(&line[j], " %02x", buf[k]);
pr_err("%s\n", line); pr_err("%s\n", line);
...@@ -411,8 +402,7 @@ void trace_unhandled_signal(const char *type, struct pt_regs *regs, ...@@ -411,8 +402,7 @@ void trace_unhandled_signal(const char *type, struct pt_regs *regs,
case SIGFPE: case SIGFPE:
case SIGSEGV: case SIGSEGV:
case SIGBUS: case SIGBUS:
pr_err("User crash: signal %d," pr_err("User crash: signal %d, trap %ld, address 0x%lx\n",
" trap %ld, address 0x%lx\n",
sig, regs->faultnum, address); sig, regs->faultnum, address);
show_regs(regs); show_regs(regs);
dump_mem((void __user *)address); dump_mem((void __user *)address);
......
...@@ -222,11 +222,9 @@ static tilepro_bundle_bits rewrite_load_store_unaligned( ...@@ -222,11 +222,9 @@ static tilepro_bundle_bits rewrite_load_store_unaligned(
} }
if (unaligned_printk || unaligned_fixup_count == 0) { if (unaligned_printk || unaligned_fixup_count == 0) {
pr_info("Process %d/%s: PC %#lx: Fixup of" pr_info("Process %d/%s: PC %#lx: Fixup of unaligned %s at %#lx\n",
" unaligned %s at %#lx.\n",
current->pid, current->comm, regs->pc, current->pid, current->comm, regs->pc,
(mem_op == MEMOP_LOAD || mem_op == MEMOP_LOAD || mem_op == MEMOP_LOAD_POSTINCR ?
mem_op == MEMOP_LOAD_POSTINCR) ?
"load" : "store", "load" : "store",
(unsigned long)addr); (unsigned long)addr);
if (!unaligned_printk) { if (!unaligned_printk) {
......
...@@ -127,8 +127,7 @@ static __init int reset_init_affinity(void) ...@@ -127,8 +127,7 @@ static __init int reset_init_affinity(void)
{ {
long rc = sched_setaffinity(current->pid, &init_affinity); long rc = sched_setaffinity(current->pid, &init_affinity);
if (rc != 0) if (rc != 0)
pr_warning("couldn't reset init affinity (%ld)\n", pr_warn("couldn't reset init affinity (%ld)\n", rc);
rc);
return 0; return 0;
} }
late_initcall(reset_init_affinity); late_initcall(reset_init_affinity);
...@@ -174,7 +173,7 @@ static void start_secondary(void) ...@@ -174,7 +173,7 @@ static void start_secondary(void)
/* Indicate that we're ready to come up. */ /* Indicate that we're ready to come up. */
/* Must not do this before we're ready to receive messages */ /* Must not do this before we're ready to receive messages */
if (cpumask_test_and_set_cpu(cpuid, &cpu_started)) { if (cpumask_test_and_set_cpu(cpuid, &cpu_started)) {
pr_warning("CPU#%d already started!\n", cpuid); pr_warn("CPU#%d already started!\n", cpuid);
for (;;) for (;;)
local_irq_enable(); local_irq_enable();
} }
......
...@@ -387,9 +387,7 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers) ...@@ -387,9 +387,7 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers)
* then bust_spinlocks() spit out a space in front of us * then bust_spinlocks() spit out a space in front of us
* and it will mess up our KERN_ERR. * and it will mess up our KERN_ERR.
*/ */
pr_err("\n"); pr_err("Starting stack dump of tid %d, pid %d (%s) on cpu %d at cycle %lld\n",
pr_err("Starting stack dump of tid %d, pid %d (%s)"
" on cpu %d at cycle %lld\n",
kbt->task->pid, kbt->task->tgid, kbt->task->comm, kbt->task->pid, kbt->task->tgid, kbt->task->comm,
raw_smp_processor_id(), get_cycles()); raw_smp_processor_id(), get_cycles());
} }
...@@ -411,8 +409,7 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers) ...@@ -411,8 +409,7 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers)
i++, address, namebuf, (unsigned long)(kbt->it.sp)); i++, address, namebuf, (unsigned long)(kbt->it.sp));
if (i >= 100) { if (i >= 100) {
pr_err("Stack dump truncated" pr_err("Stack dump truncated (%d frames)\n", i);
" (%d frames)\n", i);
break; break;
} }
} }
......
...@@ -98,8 +98,8 @@ void __init calibrate_delay(void) ...@@ -98,8 +98,8 @@ void __init calibrate_delay(void)
{ {
loops_per_jiffy = get_clock_rate() / HZ; loops_per_jiffy = get_clock_rate() / HZ;
pr_info("Clock rate yields %lu.%02lu BogoMIPS (lpj=%lu)\n", pr_info("Clock rate yields %lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy/(500000/HZ), loops_per_jiffy / (500000 / HZ),
(loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy); (loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
} }
/* Called fairly late in init/main.c, but before we go smp. */ /* Called fairly late in init/main.c, but before we go smp. */
......
...@@ -46,9 +46,9 @@ static int __init setup_unaligned_fixup(char *str) ...@@ -46,9 +46,9 @@ static int __init setup_unaligned_fixup(char *str)
return 0; return 0;
pr_info("Fixups for unaligned data accesses are %s\n", pr_info("Fixups for unaligned data accesses are %s\n",
unaligned_fixup >= 0 ? unaligned_fixup >= 0 ?
(unaligned_fixup ? "enabled" : "disabled") : (unaligned_fixup ? "enabled" : "disabled") :
"completely disabled"); "completely disabled");
return 1; return 1;
} }
__setup("unaligned_fixup=", setup_unaligned_fixup); __setup("unaligned_fixup=", setup_unaligned_fixup);
...@@ -305,8 +305,8 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num, ...@@ -305,8 +305,8 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num,
case INT_ILL: case INT_ILL:
if (copy_from_user(&instr, (void __user *)regs->pc, if (copy_from_user(&instr, (void __user *)regs->pc,
sizeof(instr))) { sizeof(instr))) {
pr_err("Unreadable instruction for INT_ILL:" pr_err("Unreadable instruction for INT_ILL: %#lx\n",
" %#lx\n", regs->pc); regs->pc);
do_exit(SIGKILL); do_exit(SIGKILL);
return; return;
} }
......
...@@ -969,8 +969,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle, ...@@ -969,8 +969,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
unaligned_fixup_count++; unaligned_fixup_count++;
if (unaligned_printk) { if (unaligned_printk) {
pr_info("%s/%d. Unalign fixup for kernel access " pr_info("%s/%d - Unalign fixup for kernel access to userspace %lx\n",
"to userspace %lx.",
current->comm, current->pid, regs->regs[ra]); current->comm, current->pid, regs->regs[ra]);
} }
...@@ -985,7 +984,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle, ...@@ -985,7 +984,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
.si_addr = (unsigned char __user *)0 .si_addr = (unsigned char __user *)0
}; };
if (unaligned_printk) if (unaligned_printk)
pr_info("Unalign bundle: unexp @%llx, %llx", pr_info("Unalign bundle: unexp @%llx, %llx\n",
(unsigned long long)regs->pc, (unsigned long long)regs->pc,
(unsigned long long)bundle); (unsigned long long)bundle);
...@@ -1370,8 +1369,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle, ...@@ -1370,8 +1369,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
frag.bundle = bundle; frag.bundle = bundle;
if (unaligned_printk) { if (unaligned_printk) {
pr_info("%s/%d, Unalign fixup: pc=%lx " pr_info("%s/%d, Unalign fixup: pc=%lx bundle=%lx %d %d %d %d %d %d %d %d\n",
"bundle=%lx %d %d %d %d %d %d %d %d.",
current->comm, current->pid, current->comm, current->pid,
(unsigned long)frag.pc, (unsigned long)frag.pc,
(unsigned long)frag.bundle, (unsigned long)frag.bundle,
...@@ -1380,8 +1378,8 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle, ...@@ -1380,8 +1378,8 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
(int)y1_lr, (int)y1_br, (int)x1_add); (int)y1_lr, (int)y1_br, (int)x1_add);
for (k = 0; k < n; k += 2) for (k = 0; k < n; k += 2)
pr_info("[%d] %016llx %016llx", k, pr_info("[%d] %016llx %016llx\n",
(unsigned long long)frag.insn[k], k, (unsigned long long)frag.insn[k],
(unsigned long long)frag.insn[k+1]); (unsigned long long)frag.insn[k+1]);
} }
...@@ -1402,7 +1400,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle, ...@@ -1402,7 +1400,7 @@ void jit_bundle_gen(struct pt_regs *regs, tilegx_bundle_bits bundle,
.si_addr = (void __user *)&jit_code_area[idx] .si_addr = (void __user *)&jit_code_area[idx]
}; };
pr_warn("Unalign fixup: pid=%d %s jit_code_area=%llx", pr_warn("Unalign fixup: pid=%d %s jit_code_area=%llx\n",
current->pid, current->comm, current->pid, current->comm,
(unsigned long long)&jit_code_area[idx]); (unsigned long long)&jit_code_area[idx]);
...@@ -1485,7 +1483,7 @@ void do_unaligned(struct pt_regs *regs, int vecnum) ...@@ -1485,7 +1483,7 @@ void do_unaligned(struct pt_regs *regs, int vecnum)
/* If exception came from kernel, try fix it up. */ /* If exception came from kernel, try fix it up. */
if (fixup_exception(regs)) { if (fixup_exception(regs)) {
if (unaligned_printk) if (unaligned_printk)
pr_info("Unalign fixup: %d %llx @%llx", pr_info("Unalign fixup: %d %llx @%llx\n",
(int)unaligned_fixup, (int)unaligned_fixup,
(unsigned long long)regs->ex1, (unsigned long long)regs->ex1,
(unsigned long long)regs->pc); (unsigned long long)regs->pc);
...@@ -1519,7 +1517,7 @@ void do_unaligned(struct pt_regs *regs, int vecnum) ...@@ -1519,7 +1517,7 @@ void do_unaligned(struct pt_regs *regs, int vecnum)
}; };
if (unaligned_printk) if (unaligned_printk)
pr_info("Unalign fixup: %d %llx @%llx", pr_info("Unalign fixup: %d %llx @%llx\n",
(int)unaligned_fixup, (int)unaligned_fixup,
(unsigned long long)regs->ex1, (unsigned long long)regs->ex1,
(unsigned long long)regs->pc); (unsigned long long)regs->pc);
...@@ -1579,14 +1577,14 @@ void do_unaligned(struct pt_regs *regs, int vecnum) ...@@ -1579,14 +1577,14 @@ void do_unaligned(struct pt_regs *regs, int vecnum)
0); 0);
if (IS_ERR((void __force *)user_page)) { if (IS_ERR((void __force *)user_page)) {
pr_err("Out of kernel pages trying do_mmap.\n"); pr_err("Out of kernel pages trying do_mmap\n");
return; return;
} }
/* Save the address in the thread_info struct */ /* Save the address in the thread_info struct */
info->unalign_jit_base = user_page; info->unalign_jit_base = user_page;
if (unaligned_printk) if (unaligned_printk)
pr_info("Unalign bundle: %d:%d, allocate page @%llx", pr_info("Unalign bundle: %d:%d, allocate page @%llx\n",
raw_smp_processor_id(), current->pid, raw_smp_processor_id(), current->pid,
(unsigned long long)user_page); (unsigned long long)user_page);
} }
......
...@@ -169,8 +169,7 @@ static void wait_for_migration(pte_t *pte) ...@@ -169,8 +169,7 @@ static void wait_for_migration(pte_t *pte)
while (pte_migrating(*pte)) { while (pte_migrating(*pte)) {
barrier(); barrier();
if (++retries > bound) if (++retries > bound)
panic("Hit migrating PTE (%#llx) and" panic("Hit migrating PTE (%#llx) and page PFN %#lx still migrating",
" page PFN %#lx still migrating",
pte->val, pte_pfn(*pte)); pte->val, pte_pfn(*pte));
} }
} }
...@@ -292,11 +291,10 @@ static int handle_page_fault(struct pt_regs *regs, ...@@ -292,11 +291,10 @@ static int handle_page_fault(struct pt_regs *regs,
*/ */
stack_offset = stack_pointer & (THREAD_SIZE-1); stack_offset = stack_pointer & (THREAD_SIZE-1);
if (stack_offset < THREAD_SIZE / 8) { if (stack_offset < THREAD_SIZE / 8) {
pr_alert("Potential stack overrun: sp %#lx\n", pr_alert("Potential stack overrun: sp %#lx\n", stack_pointer);
stack_pointer);
show_regs(regs); show_regs(regs);
pr_alert("Killing current process %d/%s\n", pr_alert("Killing current process %d/%s\n",
tsk->pid, tsk->comm); tsk->pid, tsk->comm);
do_group_exit(SIGKILL); do_group_exit(SIGKILL);
} }
...@@ -421,7 +419,7 @@ static int handle_page_fault(struct pt_regs *regs, ...@@ -421,7 +419,7 @@ static int handle_page_fault(struct pt_regs *regs,
} else if (write) { } else if (write) {
#ifdef TEST_VERIFY_AREA #ifdef TEST_VERIFY_AREA
if (!is_page_fault && regs->cs == KERNEL_CS) if (!is_page_fault && regs->cs == KERNEL_CS)
pr_err("WP fault at "REGFMT"\n", regs->eip); pr_err("WP fault at " REGFMT "\n", regs->eip);
#endif #endif
if (!(vma->vm_flags & VM_WRITE)) if (!(vma->vm_flags & VM_WRITE))
goto bad_area; goto bad_area;
...@@ -519,16 +517,15 @@ static int handle_page_fault(struct pt_regs *regs, ...@@ -519,16 +517,15 @@ static int handle_page_fault(struct pt_regs *regs,
pte_t *pte = lookup_address(address); pte_t *pte = lookup_address(address);
if (pte && pte_present(*pte) && !pte_exec_kernel(*pte)) if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
pr_crit("kernel tried to execute" pr_crit("kernel tried to execute non-executable page - exploit attempt? (uid: %d)\n",
" non-executable page - exploit attempt?" current->uid);
" (uid: %d)\n", current->uid);
} }
#endif #endif
if (address < PAGE_SIZE) if (address < PAGE_SIZE)
pr_alert("Unable to handle kernel NULL pointer dereference\n"); pr_alert("Unable to handle kernel NULL pointer dereference\n");
else else
pr_alert("Unable to handle kernel paging request\n"); pr_alert("Unable to handle kernel paging request\n");
pr_alert(" at virtual address "REGFMT", pc "REGFMT"\n", pr_alert(" at virtual address " REGFMT ", pc " REGFMT "\n",
address, regs->pc); address, regs->pc);
show_regs(regs); show_regs(regs);
...@@ -575,9 +572,10 @@ static int handle_page_fault(struct pt_regs *regs, ...@@ -575,9 +572,10 @@ static int handle_page_fault(struct pt_regs *regs,
#ifndef __tilegx__ #ifndef __tilegx__
/* We must release ICS before panicking or we won't get anywhere. */ /* We must release ICS before panicking or we won't get anywhere. */
#define ics_panic(fmt, ...) do { \ #define ics_panic(fmt, ...) \
__insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 0); \ do { \
panic(fmt, __VA_ARGS__); \ __insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 0); \
panic(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
/* /*
...@@ -615,8 +613,7 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num, ...@@ -615,8 +613,7 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num,
fault_num != INT_DTLB_ACCESS)) { fault_num != INT_DTLB_ACCESS)) {
unsigned long old_pc = regs->pc; unsigned long old_pc = regs->pc;
regs->pc = pc; regs->pc = pc;
ics_panic("Bad ICS page fault args:" ics_panic("Bad ICS page fault args: old PC %#lx, fault %d/%d at %#lx",
" old PC %#lx, fault %d/%d at %#lx\n",
old_pc, fault_num, write, address); old_pc, fault_num, write, address);
} }
...@@ -669,8 +666,8 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num, ...@@ -669,8 +666,8 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num,
#endif #endif
fixup = search_exception_tables(pc); fixup = search_exception_tables(pc);
if (!fixup) if (!fixup)
ics_panic("ICS atomic fault not in table:" ics_panic("ICS atomic fault not in table: PC %#lx, fault %d",
" PC %#lx, fault %d", pc, fault_num); pc, fault_num);
regs->pc = fixup->fixup; regs->pc = fixup->fixup;
regs->ex1 = PL_ICS_EX1(KERNEL_PL, 0); regs->ex1 = PL_ICS_EX1(KERNEL_PL, 0);
} }
...@@ -826,8 +823,7 @@ void do_page_fault(struct pt_regs *regs, int fault_num, ...@@ -826,8 +823,7 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
set_thread_flag(TIF_ASYNC_TLB); set_thread_flag(TIF_ASYNC_TLB);
if (async->fault_num != 0) { if (async->fault_num != 0) {
panic("Second async fault %d;" panic("Second async fault %d; old fault was %d (%#lx/%ld)",
" old fault was %d (%#lx/%ld)",
fault_num, async->fault_num, fault_num, async->fault_num,
address, write); address, write);
} }
......
...@@ -152,12 +152,10 @@ void flush_remote(unsigned long cache_pfn, unsigned long cache_control, ...@@ -152,12 +152,10 @@ void flush_remote(unsigned long cache_pfn, unsigned long cache_control,
cpumask_scnprintf(cache_buf, sizeof(cache_buf), &cache_cpumask_copy); cpumask_scnprintf(cache_buf, sizeof(cache_buf), &cache_cpumask_copy);
cpumask_scnprintf(tlb_buf, sizeof(tlb_buf), &tlb_cpumask_copy); cpumask_scnprintf(tlb_buf, sizeof(tlb_buf), &tlb_cpumask_copy);
pr_err("hv_flush_remote(%#llx, %#lx, %p [%s]," pr_err("hv_flush_remote(%#llx, %#lx, %p [%s], %#lx, %#lx, %#lx, %p [%s], %p, %d) = %d\n",
" %#lx, %#lx, %#lx, %p [%s], %p, %d) = %d\n",
cache_pa, cache_control, cache_cpumask, cache_buf, cache_pa, cache_control, cache_cpumask, cache_buf,
(unsigned long)tlb_va, tlb_length, tlb_pgsize, (unsigned long)tlb_va, tlb_length, tlb_pgsize,
tlb_cpumask, tlb_buf, tlb_cpumask, tlb_buf, asids, asidcount, rc);
asids, asidcount, rc);
panic("Unsafe to continue."); panic("Unsafe to continue.");
} }
......
...@@ -284,22 +284,21 @@ static __init int __setup_hugepagesz(unsigned long ps) ...@@ -284,22 +284,21 @@ static __init int __setup_hugepagesz(unsigned long ps)
int level, base_shift; int level, base_shift;
if ((1UL << log_ps) != ps || (log_ps & 1) != 0) { if ((1UL << log_ps) != ps || (log_ps & 1) != 0) {
pr_warn("Not enabling %ld byte huge pages;" pr_warn("Not enabling %ld byte huge pages; must be a power of four\n",
" must be a power of four.\n", ps); ps);
return -EINVAL; return -EINVAL;
} }
if (ps > 64*1024*1024*1024UL) { if (ps > 64*1024*1024*1024UL) {
pr_warn("Not enabling %ld MB huge pages;" pr_warn("Not enabling %ld MB huge pages; largest legal value is 64 GB\n",
" largest legal value is 64 GB .\n", ps >> 20); ps >> 20);
return -EINVAL; return -EINVAL;
} else if (ps >= PUD_SIZE) { } else if (ps >= PUD_SIZE) {
static long hv_jpage_size; static long hv_jpage_size;
if (hv_jpage_size == 0) if (hv_jpage_size == 0)
hv_jpage_size = hv_sysconf(HV_SYSCONF_PAGE_SIZE_JUMBO); hv_jpage_size = hv_sysconf(HV_SYSCONF_PAGE_SIZE_JUMBO);
if (hv_jpage_size != PUD_SIZE) { if (hv_jpage_size != PUD_SIZE) {
pr_warn("Not enabling >= %ld MB huge pages:" pr_warn("Not enabling >= %ld MB huge pages: hypervisor reports size %ld\n",
" hypervisor reports size %ld\n",
PUD_SIZE >> 20, hv_jpage_size); PUD_SIZE >> 20, hv_jpage_size);
return -EINVAL; return -EINVAL;
} }
...@@ -320,14 +319,13 @@ static __init int __setup_hugepagesz(unsigned long ps) ...@@ -320,14 +319,13 @@ static __init int __setup_hugepagesz(unsigned long ps)
int shift_val = log_ps - base_shift; int shift_val = log_ps - base_shift;
if (huge_shift[level] != 0) { if (huge_shift[level] != 0) {
int old_shift = base_shift + huge_shift[level]; int old_shift = base_shift + huge_shift[level];
pr_warn("Not enabling %ld MB huge pages;" pr_warn("Not enabling %ld MB huge pages; already have size %ld MB\n",
" already have size %ld MB.\n",
ps >> 20, (1UL << old_shift) >> 20); ps >> 20, (1UL << old_shift) >> 20);
return -EINVAL; return -EINVAL;
} }
if (hv_set_pte_super_shift(level, shift_val) != 0) { if (hv_set_pte_super_shift(level, shift_val) != 0) {
pr_warn("Not enabling %ld MB huge pages;" pr_warn("Not enabling %ld MB huge pages; no hypervisor support\n",
" no hypervisor support.\n", ps >> 20); ps >> 20);
return -EINVAL; return -EINVAL;
} }
printk(KERN_DEBUG "Enabled %ld MB huge pages\n", ps >> 20); printk(KERN_DEBUG "Enabled %ld MB huge pages\n", ps >> 20);
......
...@@ -357,11 +357,11 @@ static int __init setup_ktext(char *str) ...@@ -357,11 +357,11 @@ static int __init setup_ktext(char *str)
cpulist_scnprintf(buf, sizeof(buf), &ktext_mask); cpulist_scnprintf(buf, sizeof(buf), &ktext_mask);
if (cpumask_weight(&ktext_mask) > 1) { if (cpumask_weight(&ktext_mask) > 1) {
ktext_small = 1; ktext_small = 1;
pr_info("ktext: using caching neighborhood %s " pr_info("ktext: using caching neighborhood %s with small pages\n",
"with small pages\n", buf); buf);
} else { } else {
pr_info("ktext: caching on cpu %s with one huge page\n", pr_info("ktext: caching on cpu %s with one huge page\n",
buf); buf);
} }
} }
...@@ -413,19 +413,16 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) ...@@ -413,19 +413,16 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
int rc, i; int rc, i;
if (ktext_arg_seen && ktext_hash) { if (ktext_arg_seen && ktext_hash) {
pr_warning("warning: \"ktext\" boot argument ignored" pr_warn("warning: \"ktext\" boot argument ignored if \"kcache_hash\" sets up text hash-for-home\n");
" if \"kcache_hash\" sets up text hash-for-home\n");
ktext_small = 0; ktext_small = 0;
} }
if (kdata_arg_seen && kdata_hash) { if (kdata_arg_seen && kdata_hash) {
pr_warning("warning: \"kdata\" boot argument ignored" pr_warn("warning: \"kdata\" boot argument ignored if \"kcache_hash\" sets up data hash-for-home\n");
" if \"kcache_hash\" sets up data hash-for-home\n");
} }
if (kdata_huge && !hash_default) { if (kdata_huge && !hash_default) {
pr_warning("warning: disabling \"kdata=huge\"; requires" pr_warn("warning: disabling \"kdata=huge\"; requires kcache_hash=all or =allbutstack\n");
" kcache_hash=all or =allbutstack\n");
kdata_huge = 0; kdata_huge = 0;
} }
...@@ -470,8 +467,8 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) ...@@ -470,8 +467,8 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
pte[pte_ofs] = pfn_pte(pfn, prot); pte[pte_ofs] = pfn_pte(pfn, prot);
} else { } else {
if (kdata_huge) if (kdata_huge)
printk(KERN_DEBUG "pre-shattered huge" printk(KERN_DEBUG "pre-shattered huge page at %#lx\n",
" page at %#lx\n", address); address);
for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE; for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE;
pfn++, pte_ofs++, address += PAGE_SIZE) { pfn++, pte_ofs++, address += PAGE_SIZE) {
pgprot_t prot = init_pgprot(address); pgprot_t prot = init_pgprot(address);
...@@ -501,8 +498,8 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) ...@@ -501,8 +498,8 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
pr_info("ktext: not using unavailable cpus %s\n", buf); pr_info("ktext: not using unavailable cpus %s\n", buf);
} }
if (cpumask_empty(&ktext_mask)) { if (cpumask_empty(&ktext_mask)) {
pr_warning("ktext: no valid cpus; caching on %d.\n", pr_warn("ktext: no valid cpus; caching on %d\n",
smp_processor_id()); smp_processor_id());
cpumask_copy(&ktext_mask, cpumask_copy(&ktext_mask,
cpumask_of(smp_processor_id())); cpumask_of(smp_processor_id()));
} }
...@@ -798,11 +795,9 @@ void __init mem_init(void) ...@@ -798,11 +795,9 @@ void __init mem_init(void)
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
/* check that fixmap and pkmap do not overlap */ /* check that fixmap and pkmap do not overlap */
if (PKMAP_ADDR(LAST_PKMAP-1) >= FIXADDR_START) { if (PKMAP_ADDR(LAST_PKMAP-1) >= FIXADDR_START) {
pr_err("fixmap and kmap areas overlap" pr_err("fixmap and kmap areas overlap - this will crash\n");
" - this will crash\n");
pr_err("pkstart: %lxh pkend: %lxh fixstart %lxh\n", pr_err("pkstart: %lxh pkend: %lxh fixstart %lxh\n",
PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP-1), PKMAP_BASE, PKMAP_ADDR(LAST_PKMAP-1), FIXADDR_START);
FIXADDR_START);
BUG(); BUG();
} }
#endif #endif
...@@ -926,8 +921,7 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end) ...@@ -926,8 +921,7 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end)
unsigned long addr = (unsigned long) begin; unsigned long addr = (unsigned long) begin;
if (kdata_huge && !initfree) { if (kdata_huge && !initfree) {
pr_warning("Warning: ignoring initfree=0:" pr_warn("Warning: ignoring initfree=0: incompatible with kdata=huge\n");
" incompatible with kdata=huge\n");
initfree = 1; initfree = 1;
} }
end = (end + PAGE_SIZE - 1) & PAGE_MASK; end = (end + PAGE_SIZE - 1) & PAGE_MASK;
......
...@@ -44,9 +44,7 @@ void show_mem(unsigned int filter) ...@@ -44,9 +44,7 @@ void show_mem(unsigned int filter)
{ {
struct zone *zone; struct zone *zone;
pr_err("Active:%lu inactive:%lu dirty:%lu writeback:%lu unstable:%lu" pr_err("Active:%lu inactive:%lu dirty:%lu writeback:%lu unstable:%lu free:%lu\n slab:%lu mapped:%lu pagetables:%lu bounce:%lu pagecache:%lu swap:%lu\n",
" free:%lu\n slab:%lu mapped:%lu pagetables:%lu bounce:%lu"
" pagecache:%lu swap:%lu\n",
(global_page_state(NR_ACTIVE_ANON) + (global_page_state(NR_ACTIVE_ANON) +
global_page_state(NR_ACTIVE_FILE)), global_page_state(NR_ACTIVE_FILE)),
(global_page_state(NR_INACTIVE_ANON) + (global_page_state(NR_INACTIVE_ANON) +
......
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