Skip to content

Commit b84449d

Browse files
committed
Merge branch 'parisc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fixes from Helge Deller: - Many small fixes to show the real physical addresses of devices instead of hashed addresses. - One important fix to unbreak 32-bit SMP support: We forgot to 16-byte align the spinlocks in the assembler code. - Qemu support: The host will get a chance to sleep when the parisc guest is idle. We use the same mechanism as the power architecture by overlaying the "or %r10,%r10,%r10" instruction which is simply a nop on real hardware. * 'parisc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: qemu idle sleep support parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel parisc: Show unhashed EISA EEPROM address parisc: Show unhashed HPA of Dino chip parisc: Show initial kernel memory layout unhashed parisc: Show unhashed hardware inventory
2 parents 9cfd403 + 310d827 commit b84449d

File tree

8 files changed

+71
-16
lines changed

8 files changed

+71
-16
lines changed

arch/parisc/include/asm/ldcw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
for the semaphore. */
1313

1414
#define __PA_LDCW_ALIGNMENT 16
15+
#define __PA_LDCW_ALIGN_ORDER 4
1516
#define __ldcw_align(a) ({ \
1617
unsigned long __ret = (unsigned long) &(a)->lock[0]; \
1718
__ret = (__ret + __PA_LDCW_ALIGNMENT - 1) \
@@ -29,6 +30,7 @@
2930
ldcd). */
3031

3132
#define __PA_LDCW_ALIGNMENT 4
33+
#define __PA_LDCW_ALIGN_ORDER 2
3234
#define __ldcw_align(a) (&(a)->slock)
3335
#define __LDCW "ldcw,co"
3436

arch/parisc/kernel/drivers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static void print_parisc_device(struct parisc_device *dev)
870870
static int count;
871871

872872
print_pa_hwpath(dev, hw_path);
873-
printk(KERN_INFO "%d. %s at 0x%p [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
873+
printk(KERN_INFO "%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
874874
++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type,
875875
dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
876876

arch/parisc/kernel/entry.S

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <asm/pgtable.h>
3636
#include <asm/signal.h>
3737
#include <asm/unistd.h>
38+
#include <asm/ldcw.h>
3839
#include <asm/thread_info.h>
3940

4041
#include <linux/linkage.h>
@@ -46,6 +47,14 @@
4647
#endif
4748

4849
.import pa_tlb_lock,data
50+
.macro load_pa_tlb_lock reg
51+
#if __PA_LDCW_ALIGNMENT > 4
52+
load32 PA(pa_tlb_lock) + __PA_LDCW_ALIGNMENT-1, \reg
53+
depi 0,31,__PA_LDCW_ALIGN_ORDER, \reg
54+
#else
55+
load32 PA(pa_tlb_lock), \reg
56+
#endif
57+
.endm
4958

5059
/* space_to_prot macro creates a prot id from a space id */
5160

@@ -457,7 +466,7 @@
457466
.macro tlb_lock spc,ptp,pte,tmp,tmp1,fault
458467
#ifdef CONFIG_SMP
459468
cmpib,COND(=),n 0,\spc,2f
460-
load32 PA(pa_tlb_lock),\tmp
469+
load_pa_tlb_lock \tmp
461470
1: LDCW 0(\tmp),\tmp1
462471
cmpib,COND(=) 0,\tmp1,1b
463472
nop
@@ -480,7 +489,7 @@
480489
/* Release pa_tlb_lock lock. */
481490
.macro tlb_unlock1 spc,tmp
482491
#ifdef CONFIG_SMP
483-
load32 PA(pa_tlb_lock),\tmp
492+
load_pa_tlb_lock \tmp
484493
tlb_unlock0 \spc,\tmp
485494
#endif
486495
.endm

arch/parisc/kernel/pacache.S

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <asm/assembly.h>
3737
#include <asm/pgtable.h>
3838
#include <asm/cache.h>
39+
#include <asm/ldcw.h>
3940
#include <linux/linkage.h>
4041

4142
.text
@@ -333,8 +334,12 @@ ENDPROC_CFI(flush_data_cache_local)
333334

334335
.macro tlb_lock la,flags,tmp
335336
#ifdef CONFIG_SMP
336-
ldil L%pa_tlb_lock,%r1
337-
ldo R%pa_tlb_lock(%r1),\la
337+
#if __PA_LDCW_ALIGNMENT > 4
338+
load32 pa_tlb_lock + __PA_LDCW_ALIGNMENT-1, \la
339+
depi 0,31,__PA_LDCW_ALIGN_ORDER, \la
340+
#else
341+
load32 pa_tlb_lock, \la
342+
#endif
338343
rsm PSW_SM_I,\flags
339344
1: LDCW 0(\la),\tmp
340345
cmpib,<>,n 0,\tmp,3f

arch/parisc/kernel/process.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <linux/kernel.h>
4040
#include <linux/mm.h>
4141
#include <linux/fs.h>
42+
#include <linux/cpu.h>
4243
#include <linux/module.h>
4344
#include <linux/personality.h>
4445
#include <linux/ptrace.h>
@@ -183,6 +184,44 @@ int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r)
183184
return 1;
184185
}
185186

187+
/*
188+
* Idle thread support
189+
*
190+
* Detect when running on QEMU with SeaBIOS PDC Firmware and let
191+
* QEMU idle the host too.
192+
*/
193+
194+
int running_on_qemu __read_mostly;
195+
196+
void __cpuidle arch_cpu_idle_dead(void)
197+
{
198+
/* nop on real hardware, qemu will offline CPU. */
199+
asm volatile("or %%r31,%%r31,%%r31\n":::);
200+
}
201+
202+
void __cpuidle arch_cpu_idle(void)
203+
{
204+
local_irq_enable();
205+
206+
/* nop on real hardware, qemu will idle sleep. */
207+
asm volatile("or %%r10,%%r10,%%r10\n":::);
208+
}
209+
210+
static int __init parisc_idle_init(void)
211+
{
212+
const char *marker;
213+
214+
/* check QEMU/SeaBIOS marker in PAGE0 */
215+
marker = (char *) &PAGE0->pad0;
216+
running_on_qemu = (memcmp(marker, "SeaBIOS", 8) == 0);
217+
218+
if (!running_on_qemu)
219+
cpu_idle_poll_ctrl(1);
220+
221+
return 0;
222+
}
223+
arch_initcall(parisc_idle_init);
224+
186225
/*
187226
* Copy architecture-specific thread state
188227
*/

arch/parisc/mm/init.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,11 +631,11 @@ void __init mem_init(void)
631631
mem_init_print_info(NULL);
632632
#ifdef CONFIG_DEBUG_KERNEL /* double-sanity-check paranoia */
633633
printk("virtual kernel memory layout:\n"
634-
" vmalloc : 0x%p - 0x%p (%4ld MB)\n"
635-
" memory : 0x%p - 0x%p (%4ld MB)\n"
636-
" .init : 0x%p - 0x%p (%4ld kB)\n"
637-
" .data : 0x%p - 0x%p (%4ld kB)\n"
638-
" .text : 0x%p - 0x%p (%4ld kB)\n",
634+
" vmalloc : 0x%px - 0x%px (%4ld MB)\n"
635+
" memory : 0x%px - 0x%px (%4ld MB)\n"
636+
" .init : 0x%px - 0x%px (%4ld kB)\n"
637+
" .data : 0x%px - 0x%px (%4ld kB)\n"
638+
" .text : 0x%px - 0x%px (%4ld kB)\n",
639639

640640
(void*)VMALLOC_START, (void*)VMALLOC_END,
641641
(VMALLOC_END - VMALLOC_START) >> 20,

drivers/parisc/dino.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static void dino_mask_irq(struct irq_data *d)
303303
struct dino_device *dino_dev = irq_data_get_irq_chip_data(d);
304304
int local_irq = gsc_find_local_irq(d->irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
305305

306-
DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, d->irq);
306+
DBG(KERN_WARNING "%s(0x%px, %d)\n", __func__, dino_dev, d->irq);
307307

308308
/* Clear the matching bit in the IMR register */
309309
dino_dev->imr &= ~(DINO_MASK_IRQ(local_irq));
@@ -316,7 +316,7 @@ static void dino_unmask_irq(struct irq_data *d)
316316
int local_irq = gsc_find_local_irq(d->irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
317317
u32 tmp;
318318

319-
DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, d->irq);
319+
DBG(KERN_WARNING "%s(0x%px, %d)\n", __func__, dino_dev, d->irq);
320320

321321
/*
322322
** clear pending IRQ bits
@@ -396,7 +396,7 @@ static irqreturn_t dino_isr(int irq, void *intr_dev)
396396
if (mask) {
397397
if (--ilr_loop > 0)
398398
goto ilr_again;
399-
printk(KERN_ERR "Dino 0x%p: stuck interrupt %d\n",
399+
printk(KERN_ERR "Dino 0x%px: stuck interrupt %d\n",
400400
dino_dev->hba.base_addr, mask);
401401
return IRQ_NONE;
402402
}
@@ -553,7 +553,7 @@ dino_fixup_bus(struct pci_bus *bus)
553553
struct pci_dev *dev;
554554
struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge));
555555

556-
DBG(KERN_WARNING "%s(0x%p) bus %d platform_data 0x%p\n",
556+
DBG(KERN_WARNING "%s(0x%px) bus %d platform_data 0x%px\n",
557557
__func__, bus, bus->busn_res.start,
558558
bus->bridge->platform_data);
559559

@@ -854,7 +854,7 @@ static int __init dino_common_init(struct parisc_device *dev,
854854
res->flags = IORESOURCE_IO; /* do not mark it busy ! */
855855
if (request_resource(&ioport_resource, res) < 0) {
856856
printk(KERN_ERR "%s: request I/O Port region failed "
857-
"0x%lx/%lx (hpa 0x%p)\n",
857+
"0x%lx/%lx (hpa 0x%px)\n",
858858
name, (unsigned long)res->start, (unsigned long)res->end,
859859
dino_dev->hba.base_addr);
860860
return 1;

drivers/parisc/eisa_eeprom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int __init eisa_eeprom_init(void)
106106
return retval;
107107
}
108108

109-
printk(KERN_INFO "EISA EEPROM at 0x%p\n", eisa_eeprom_addr);
109+
printk(KERN_INFO "EISA EEPROM at 0x%px\n", eisa_eeprom_addr);
110110
return 0;
111111
}
112112

0 commit comments

Comments
 (0)