Helge Deller | 19 May 2013 00:21
Picon
Picon

[PATCH] parisc: use arch_spinlock_t instead of raw_spinlock_t in irqstacks

We need to use arch_spinlock_t spinlocks instead of raw_spinlock_t
spinlocks for irqstack protection else we will hit the "trylock failure
on UP" error message with CONFIG_SMP=n and CONFIG_DEBUG_SPINLOCK=y.

Since we can be called recursive here even on UP (we are in the irq
handler which handles even irq bh) this spinlock error message is just
wrong.

Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index cfbc439..b2dca96 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
 <at>  <at>  -69,7 +69,7  <at>  <at> 

 union irq_stack_union {
 	unsigned long stack[IRQ_STACK_SIZE/sizeof(unsigned long)];
-	raw_spinlock_t lock;
+	arch_spinlock_t lock;
 };

 DECLARE_PER_CPU(union irq_stack_union, irq_stack_union);
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 55237a7..9ba8e5a 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
 <at>  <at>  -443,14 +451,14  <at>  <at>  panic_check:

 #ifdef CONFIG_IRQSTACKS
(Continue reading)

Helge Deller | 18 May 2013 21:35
Picon
Picon

[PATCH] parisc: show number of FPE and unaligned access handler calls in /proc/interrupts

Show number of floating point assistant and unaligned access fixup
handler in /proc/interrupts file. 

Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/include/asm/hardirq.h b/arch/parisc/include/asm/hardirq.h
index c19f713..4c6dd8d 100644
--- a/arch/parisc/include/asm/hardirq.h
+++ b/arch/parisc/include/asm/hardirq.h
 <at>  <at>  -28,6 +28,8  <at>  <at>  typedef struct {
 	unsigned int irq_resched_count;
 	unsigned int irq_call_count;
 #endif
+	unsigned int irq_unaligned_count;
+	unsigned int irq_fpassist_count;
 	unsigned int irq_tlb_count;
 } ____cacheline_aligned irq_cpustat_t;

diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 55237a7..9c2d953 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
 <at>  <at>  -188,6 +188,14  <at>  <at>  int arch_show_interrupts(struct seq_file *p, int prec)
 		seq_printf(p, "%10u ", irq_stats(j)->irq_call_count);
 	seq_puts(p, "  Function call interrupts\n");
 #endif
+	seq_printf(p, "%*s: ", prec, "UAH");
+	for_each_online_cpu(j)
+		seq_printf(p, "%10u ", irq_stats(j)->irq_unaligned_count);
+	seq_puts(p, "  Unaligned access handler traps\n");
(Continue reading)

Helge Deller | 16 May 2013 23:00
Picon
Picon

[PATCH] parisc: add additional parisc git tree to MAINTAINERS file

Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/MAINTAINERS b/MAINTAINERS
index 3d7782b..c0aab68 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
 <at>  <at>  -6069,6 +6069,7  <at>  <at>  L:	linux-parisc <at> vger.kernel.org
 W:	http://www.parisc-linux.org/
 Q:	http://patchwork.kernel.org/project/linux-parisc/list/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6.git
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git
 S:	Maintained
 F:	arch/parisc/
 F:	drivers/parisc/
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Helge Deller | 16 May 2013 22:51
Picon
Picon

[PATCH] parisc: use PAGE_SHIFT instead of hardcoded value 12 in pacache.S

additionally clean up some whitespaces & tabs.

Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
index 5e1de60..36d7f40 100644
--- a/arch/parisc/kernel/pacache.S
+++ b/arch/parisc/kernel/pacache.S
 <at>  <at>  -605,14 +605,14  <at>  <at>  ENTRY(copy_user_page_asm)
 	convert_phys_for_tlb_insert20 %r26	/* convert phys addr to tlb insert format */
 	convert_phys_for_tlb_insert20 %r23	/* convert phys addr to tlb insert format */
 	depd		%r24,63,22, %r28	/* Form aliased virtual address 'to' */
-	depdi		0, 63,PAGE_SHIFT, %r28  /* Clear any offset bits */
+	depdi		0, 63,PAGE_SHIFT, %r28	/* Clear any offset bits */
 	copy		%r28, %r29
 	depdi		1, 41,1, %r29		/* Form aliased virtual address 'from' */
 #else
 	extrw,u		%r26, 24,25, %r26	/* convert phys addr to tlb insert format */
 	extrw,u		%r23, 24,25, %r23	/* convert phys addr to tlb insert format */
 	depw		%r24, 31,22, %r28	/* Form aliased virtual address 'to' */
-	depwi		0, 31,12, %r28		/* Clear any offset bits */
+	depwi		0, 31,PAGE_SHIFT, %r28	/* Clear any offset bits */
 	copy		%r28, %r29
 	depwi		1, 9,1, %r29		/* Form aliased virtual address 'from' */
 #endif
 <at>  <at>  -762,7 +762,7  <at>  <at>  ENTRY(clear_user_page_asm)
 #else
 	extrw,u		%r26, 24,25, %r26	/* convert phys addr to tlb insert format */
 	depw		%r25, 31,22, %r28	/* Form aliased virtual address 'to' */
-	depwi		0, 31,12, %r28		/* Clear any offset bits */
(Continue reading)

Helge Deller | 16 May 2013 22:42
Picon
Picon

[PATCH] parisc: add rp5470 entry to machine database

Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c
index f7752f6..9e2d2e4 100644
--- a/arch/parisc/kernel/hardware.c
+++ b/arch/parisc/kernel/hardware.c
 <at>  <at>  -222,6 +222,7  <at>  <at>  static struct hp_hardware hp_hardware_list[] = {
 	{HPHW_NPROC,0x5DD,0x4,0x81,"Duet W2"},
 	{HPHW_NPROC,0x5DE,0x4,0x81,"Piccolo W+"},
 	{HPHW_NPROC,0x5DF,0x4,0x81,"Cantata W2"},
+	{HPHW_NPROC,0x5DF,0x0,0x00,"Marcato W+? (rp5470)"},
 	{HPHW_NPROC,0x5E0,0x4,0x91,"Cantata DC- W2"},
 	{HPHW_NPROC,0x5E1,0x4,0x91,"Crescendo DC- W2"},
 	{HPHW_NPROC,0x5E2,0x4,0x91,"Crescendo 650 W2"},
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Helge Deller | 16 May 2013 21:28
Picon
Picon

[PATCH] parisc: use long branch in fork_like macro

please add to stable kernel v3.9
upstream commit bbbfde782084b4f0d85ddffb88f1cf4650ff40e4

From: John David Anglin <dave.anglin <at> bell.net>

The "b" branch instruction used in the fork_like macro only can handle
17-bit pc-relative offsets.
This fails with an out of range offset with some .config files.
Rewrite to use the "be" instruction which
can branch to any address in a space.

Signed-off-by: John David Anglin  <dave.anglin <at> bell.net>
Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index aa486e4..36f4f1d 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
 <at>  <at>  -1702,7 +1702,8  <at>  <at>  ENTRY(sys_\name\()_wrapper)
 	ldo	TASK_REGS(%r1),%r1
 	reg_save %r1
 	mfctl	%cr27, %r28
-	b	sys_\name
+	ldil	L%sys_\name, %r31
+	be	R%sys_\name(%sr4,%r31)
 	STREG	%r28, PT_CR27(%r1)
 ENDPROC(sys_\name\()_wrapper)
 	.endm

--
(Continue reading)

Helge Deller | 16 May 2013 21:25
Picon
Picon

[PATCH] parisc: fix SMP races when updating PTE and TLB entries in entry.S

please add to stable kernel v3.9
upstream commit f0a18819e261afc5fdbd8c5c6f9943123c5461ba

From: John David Anglin <dave.anglin <at> bell.net>

Currently, race conditions exist in the handling of TLB interruptions in
entry.S.  In particular, dirty bit updates can be lost if an accessed
interruption occurs just after the dirty bit interruption on a different
cpu.  Lost dirty bit updates result in user pages not being flushed and
general system instability.  This change adds lock and unlock macros to
synchronize all PTE and TLB updates done in entry.S.  As a result,
userspace stability is significantly improved.

Signed-off-by: John David Anglin  <dave.anglin <at> bell.net>
Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 4bb96ad..ae27cb6 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
 <at>  <at>  -452,9 +452,41  <at>  <at> 
 	L2_ptep		\pgd,\pte,\index,\va,\fault
 	.endm

+	/* Acquire pa_dbit_lock lock. */
+	.macro		dbit_lock	spc,tmp,tmp1
+#ifdef CONFIG_SMP
+	cmpib,COND(=),n	0,\spc,2f
+	load32		PA(pa_dbit_lock),\tmp
+1:	LDCW		0(\tmp),\tmp1
(Continue reading)

Helge Deller | 16 May 2013 21:22
Picon
Picon

[PATCH] parisc: only re-enable interrupts if we need to schedule or deliver signals when returning to userspace

please include to stable kernel v3.9 series.
upstream commit c207a76bf155cb5cf24cf849c08f6555e9180594

From: John David Anglin <dave.anglin <at> bell.net>

Helge and I have found that we have a kernel stack overflow problem
which causes a variety of random failures.  Currently, we re-enable
interrupts when returning from an external interrupt incase we need to
schedule or delivery signals.  As a result, a potentially unlimited
number of interrupts can occur while we are running on the kernel stack.
It is very limited in space (currently, 16k).  This change defers
enabling interrupts until we have actually decided to schedule or
delivery signals.  This only occurs when we about to return to
userspace.  This limits the number of interrupts on the kernel stack to
one.  In other cases, interrupts remain disabled until the final return
from interrupt (rfi).

Signed-off-by: John David Anglin  <dave.anglin <at> bell.net>
Signed-off-by: Helge Deller <deller <at> gmx.de>

diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 36f4f1d..3f3326d 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
 <at>  <at>  -833,11 +833,6  <at>  <at>  ENTRY(syscall_exit_rfi)
 	STREG   %r19,PT_SR7(%r16)

 intr_return:
-	/* NOTE: Need to enable interrupts incase we schedule. */
-	ssm     PSW_SM_I, %r0
(Continue reading)

Helge Deller | 13 May 2013 22:48
Picon
Picon

[GIT PULL] parisc updates for v3.10

Hi Linus,

please pull the parisc-for-3.10 branch of 

  git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git parisc-for-3.10

to get the latest bug and build fixes for the parisc architecture.

Thanks,
Helge

---------------------------------------

The second round of parisc updates for 3.10 includes build fixes and
enhancements to utilize irq stacks, fixes SMP races when updating PTE
and TLB entries by proper locking and makes the search for the correct
cross compiler more robust on Debian and Gentoo.

----------------------------------------------------------------
Helge Deller (2):
      parisc: implement irq stacks - part 2 (v2)
      parisc: make default cross compiler search more robust (v3)

John David Anglin (1):
      parisc: fix SMP races when updating PTE and TLB entries in entry.S

 arch/parisc/Kconfig                 |   2 +-
 arch/parisc/Makefile                |  21 +++--
 arch/parisc/include/asm/hardirq.h   |   9 +++
 arch/parisc/include/asm/processor.h |   3 +
(Continue reading)

Helge Deller | 11 May 2013 21:04
Picon
Picon

[PATCH] parisc: make default cross compiler search more robust (v3)

People/distros vary how they prefix the toolchain name for 64bit builds.
Rather than enforce one convention over another, add a for loop which
does a search for all the general prefixes.

For 64bit builds, we now search for (in order):
	hppa64-unknown-linux-gnu
	hppa64-linux-gnu
	hppa64-linux

For 32bit builds, we look for:
	hppa-unknown-linux-gnu
	hppa-linux-gnu
	hppa-linux
	hppa1.1-unknown-linux-gnu
	hppa1.1-linux-gnu
	hppa1.1-linux
	hppa2.0-unknown-linux-gnu
	hppa2.0-linux-gnu
	hppa2.0-linux

This patch was initiated by Mike Frysinger, with feedback from Jeroen
Roovers, John David Anglin and Helge Deller.

Signed-off-by: Helge Deller <deller <at> gmx.de>
CC: Mike Frysinger <vapier <at> gentoo.org>
CC: Jeroen Roovers <jer <at> gentoo.org>
CC: John David Anglin <dave.anglin <at> bell.net>

diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 2f967cc..4e5b7b5 100644
(Continue reading)

John David Anglin | 11 May 2013 01:21

[PATCH] parisc: fix SMP races when updating PTE and TLB entries in entry.S

Currently, race conditions exist in the handling of TLB interruptions  
in entry.S.  In particular, dirty
bit updates can be lost if an accessed interruption occurs just after  
the dirty bit interruption on a
different cpu.  Lost dirty bit updates result in user pages not being  
flushed and general system
instability.  This change adds lock and unlock macros to synchronize  
all PTE and TLB updates
done in entry.S.  As a result, userspace stability is significantly  
improved.

Signed-off-by: John David Anglin  <dave.anglin <at> bell.net>
---

diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index f33201b..471f4e5 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
 <at>  <at>  -444,9 +445,41  <at>  <at> 
 	L2_ptep		\pgd,\pte,\index,\va,\fault
 	.endm

+	/* Acquire pa_dbit_lock lock. */
+	.macro		dbit_lock	spc,tmp,tmp1
+#ifdef CONFIG_SMP
+	cmpib,COND(=),n	0,\spc,2f
+	load32		PA(pa_dbit_lock),\tmp
+1:	LDCW		0(\tmp),\tmp1
(Continue reading)


Gmane