linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Commits added to powerpc.git master and powerpc-next branches
@ 2008-07-01  0:20 Paul Mackerras
  2008-07-01  1:27 ` Paul Mackerras
                   ` (4 more replies)
  0 siblings, 5 replies; 23+ messages in thread
From: Paul Mackerras @ 2008-07-01  0:20 UTC (permalink / raw)
  To: linuxppc-dev

The following commits have been added to the master and powerpc-next
branches of the powerpc.git repository.  This includes patches pulled
from Kumar's and Josh's trees.

Paul.

Adrian Bunk (3):
      drivers/macintosh: Various cleanups
      powerpc: Don't export asm/asm-compat.h to userspace
      powerpc: asm/elf.h: Reduce userspace header

Andrew Lewis (1):
      powerpc: Prevent memory corruption due to cache invalidation of unaligned DMA buffer

Andy Whitcroft (1):
      powerpc: Add 64 bit version of huge_ptep_set_wrprotect

Anton Vorontsov (9):
      powerpc/sysdev: implement FSL GTM support
      powerpc/QE: add support for QE USB clocks routing
      powerpc/QE: prepare QE PIO code for GPIO LIB support
      powerpc/QE: implement support for the GPIO LIB API
      powerpc/83xx: new board support: MPC8360E-RDK
      powerpc/QE: switch to the cpm_muram implementation
      powerpc/QE: qe_reset should be __init
      powerpc/QE: use arch_initcall to probe QUICC Engine GPIOs
      powerpc: Implement OF PCI address accessors stubs for CONFIG_PCI=n

Arnd Bergmann (4):
      powerpc: Provide dummy crash_shutdown_register
      powerpc/pseries: Call pseries_kexec_setup only on pseries
      powerpc/cell: Disable ptcal in case of crash kdump
      powerpc: Increase CRASH_HANDLER_MAX

Bart Van Assche (1):
      powerpc: Make sure that include/asm-powerpc/spinlock.h does not trigger compilation warnings

Becky Bruce (3):
      powerpc: Silly spelling fix in pgtable-ppc32
      powerpc: Change BAT code to use phys_addr_t
      powerpc: Get rid of bitfields in ppc_bat struct

Benjamin Herrenschmidt (1):
      powerpc: Free a PTE bit on ppc64 with 64K pages

Bernhard Walle (1):
      powerpc: Remove experimental status of kdump on 64-bit powerpc

Daniel Walker (2):
      macintosh/therm_windtunnel: Convert semaphore to mutex
      macintosh/media bay: Convert semaphore to mutex

Dave Kleikamp (1):
      powerpc: hash_huge_page() should get the WIMG bits from the lpte

Giuseppe Coviello (2):
      powerpc/4xx: Sam440ep support
      powerpc/4xx: Convert Sam440ep DTS to dts-v1

Imre Kaloz (1):
      powerpc/4xx: MTD support for the AMCC Taishan Board

Jerone Young (1):
      powerpc/booke: Fix definitions for dbcr[1-2] and dbsr registers

Joel Schopp (2):
      powerpc: Add cputable entry for Power7 architected mode
      powerpc: Tell firmware we support architecture V2.06

Josh Boyer (2):
      Revert "[POWERPC] 4xx: Fix 460GT support to not enable FPU"
      powerpc/4xx: Workaround for PPC440EPx/GRx PCI_28 Errata

Julia Lawall (1):
      drivers/macintosh/smu.c: Improve error handling

Kumar Gala (12):
      powerpc/booke: Fix some comments related to debug level exceptions
      powerpc/booke: Add support for new e500mc core
      powerpc/85xx: add DOZE/NAP support for e500 core
      powerpc/e500mc: flush L2 on NAP for e500mc
      cpm_uart: fix whitespace issues
      cpm_uart: Remove !CONFIG_PPC_CPM_NEW_BINDING code
      powerpc/cpm: Remove !CONFIG_PPC_CPM_NEW_BINDING code
      powerpc/kprobes: Some minor fixes
      powerpc/booke: Add kprobes support for booke style processors
      powerpc: Add dma nodes to 83xx, 85xx and 86xx boards
      powerpc: Move common module code into its own file
      powerpc/bootwrapper: Pad .dtb by default

Michael Ellerman (14):
      powerpc: Move code patching code into arch/powerpc/lib/code-patching.c
      powerpc: Allow create_branch() to return errors
      powerpc: Make create_branch() return errors if the branch target is too large
      powerpc: Add ppc_function_entry() which gets the entry point for a function
      powerpc: Add new code patching routines
      powerpc: Add tests of the code patching routines
      powerpc: Add PPC_NOP_INSTR, a hash define for the preferred nop instruction
      powerpc: Split out do_feature_fixups() from cputable.c
      powerpc: Consolidate CPU and firmware feature fixup macros
      powerpc: Consolidate feature fixup macros for 64/32 bit
      powerpc: Introduce infrastructure for feature sections with alternatives
      powerpc: Add logic to patch alternative feature sections
      powerpc: Add self-tests of the feature fixup code
      powerpc: Use an alternative feature section in entry_64.S

Michael Neuling (10):
      powerpc: Add cputable entry for POWER7
      powerpc: Fix MSR setting in 32 bit signal code
      powerpc: Add macros to access floating point registers in thread_struct.
      powerpc: Move altivec_unavailable
      powerpc: Make load_up_fpu and load_up_altivec callable
      powerpc: Introduce VSX thread_struct and CONFIG_VSX
      powerpc: Add VSX CPU feature
      powerpc: Add VSX assembler code macros
      powerpc: Add VSX context save/restore, ptrace and signal support
      powerpc: Add CONFIG_VSX config option

Nick Piggin (2):
      powerpc: Optimise smp_wmb on 64-bit processors
      spufs: Convert nopfn to fault

Paul Mackerras (1):
      powerpc: Only demote individual slices rather than whole process

Scott Wood (1):
      powerpc: Fix copy-and-paste error in clrsetbits_le16

Segher Boessenkool (1):
      powerpc: Get rid of CROSS32{AS,LD,OBJCOPY}

Stefan Roese (1):
      powerpc/4xx: PCIe driver now detects if a port is disabled via the dev-tree

Stephen Rothwell (7):
      viotape: Use unlocked_ioctl
      pasemi-rng: Use linux/of_platform.h instead of asm
      hwmon: Use linux/of_platform.h instead of asm
      macintosh: Use linux/of_{device,platform}.h instead of asm
      drivers/net: Use linux/of_{device,platform}.h instead of asm
      pcmcia: Use linux/of_{device,platform}.h instead of asm
      powerpc: Explicitly copy elements of pt_regs

Tony Breeds (1):
      powerpc: Change the default link address for pSeries zImage kernels

Valentine Barshak (1):
      powerpc/4xx: Fix resource issue in warp-nand.c

Vitaly Bordug (1):
      powerpc/85xx: Update pin setup for 8560ads

Wolfgang Grandegger (4):
      powerpc/85xx: correct vendor prefix in DTS files for TQM85xx modules
      powerpc/85xx: add board support for the TQM8548 modules
      powerpc/85xx: support for the TQM8548 module using the big Flash
      powerpc/85xx: add local bus nodes for Flash and CAN to tqm8560.dts

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  0:20 Commits added to powerpc.git master and powerpc-next branches Paul Mackerras
@ 2008-07-01  1:27 ` Paul Mackerras
  2008-07-01  1:45   ` Benjamin Herrenschmidt
  2008-07-01  2:01   ` Paul Mackerras
  2008-07-01  4:01 ` [PATCH 0/2] powerpc: Update VSX support Michael Neuling
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 23+ messages in thread
From: Paul Mackerras @ 2008-07-01  1:27 UTC (permalink / raw)
  To: linuxppc-dev

Paul Mackerras writes:

> The following commits have been added to the master and powerpc-next
> branches of the powerpc.git repository.  This includes patches pulled
> from Kumar's and Josh's trees.

Hold off from pulling this for now, everyone...  I inadvertently broke
builds with 64k pages by leaving in some stuff that was purely for
testing in my "Only demote individual slices rather than whole
process" patch.  I'll re-do the tree in order to avoid breaking
bisection.

Paul.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  1:27 ` Paul Mackerras
@ 2008-07-01  1:45   ` Benjamin Herrenschmidt
  2008-07-01  2:30     ` Josh Boyer
  2008-07-01  2:01   ` Paul Mackerras
  1 sibling, 1 reply; 23+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-01  1:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

On Tue, 2008-07-01 at 11:27 +1000, Paul Mackerras wrote:
> Paul Mackerras writes:
> 
> > The following commits have been added to the master and powerpc-next
> > branches of the powerpc.git repository.  This includes patches pulled
> > from Kumar's and Josh's trees.
> 
> Hold off from pulling this for now, everyone...  I inadvertently broke
> builds with 64k pages by leaving in some stuff that was purely for
> testing in my "Only demote individual slices rather than whole
> process" patch.  I'll re-do the tree in order to avoid breaking
> bisection.

Any chance to get my 4xx PTE rework in too ?

Cheers,
Ben.
 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  1:27 ` Paul Mackerras
  2008-07-01  1:45   ` Benjamin Herrenschmidt
@ 2008-07-01  2:01   ` Paul Mackerras
  1 sibling, 0 replies; 23+ messages in thread
From: Paul Mackerras @ 2008-07-01  2:01 UTC (permalink / raw)
  To: linuxppc-dev

I wrote:

> Hold off from pulling this for now, everyone...  I inadvertently broke
> builds with 64k pages by leaving in some stuff that was purely for
> testing in my "Only demote individual slices rather than whole
> process" patch.  I'll re-do the tree in order to avoid breaking
> bisection.

I have redone the tree now.  If you have pulled within the last one
and a half hours, you'll need to do a git pull -f.  Sorry about that.

Paul.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  1:45   ` Benjamin Herrenschmidt
@ 2008-07-01  2:30     ` Josh Boyer
  2008-07-01  2:44       ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 23+ messages in thread
From: Josh Boyer @ 2008-07-01  2:30 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, Paul Mackerras

On Tue, 01 Jul 2008 11:45:10 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Tue, 2008-07-01 at 11:27 +1000, Paul Mackerras wrote:
> > Paul Mackerras writes:
> > 
> > > The following commits have been added to the master and powerpc-next
> > > branches of the powerpc.git repository.  This includes patches pulled
> > > from Kumar's and Josh's trees.
> > 
> > Hold off from pulling this for now, everyone...  I inadvertently broke
> > builds with 64k pages by leaving in some stuff that was purely for
> > testing in my "Only demote individual slices rather than whole
> > process" patch.  I'll re-do the tree in order to avoid breaking
> > bisection.
> 
> Any chance to get my 4xx PTE rework in too ?

I asked you about that 2 weeks ago.  I also asked you to spin a v2 with
the comments Kumar asked for.  I got nothing back.

If you want it in 2.6.27, do that soon please :)

josh

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  2:30     ` Josh Boyer
@ 2008-07-01  2:44       ` Benjamin Herrenschmidt
  2008-07-01  4:05         ` Kumar Gala
  0 siblings, 1 reply; 23+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-01  2:44 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, Paul Mackerras


> > Any chance to get my 4xx PTE rework in too ?
> 
> I asked you about that 2 weeks ago.  I also asked you to spin a v2 with
> the comments Kumar asked for.  I got nothing back.
> 
> If you want it in 2.6.27, do that soon please :)

Oops... though I did it. Let me check what I have ...

Ben.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 0/2] powerpc: Update VSX support
  2008-07-01  0:20 Commits added to powerpc.git master and powerpc-next branches Paul Mackerras
  2008-07-01  1:27 ` Paul Mackerras
@ 2008-07-01  4:01 ` Michael Neuling
  2008-07-01  4:01   ` [PATCH 2/2] powerpc: Update for VSX core file and ptrace Michael Neuling
  2008-07-01  4:01   ` [PATCH 1/2] powerpc: Fix compile error for CONFIG_VSX Michael Neuling
  2008-07-01  7:00 ` [PATCH] powerpc: fix compile warning in init_thread Michael Neuling
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 23+ messages in thread
From: Michael Neuling @ 2008-07-01  4:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Below are a couple of fixes for VSX.  

Signed-off-by: Michael Neuling <mikey@neuling.org>
--- 
Paulus: please apply to your powerpc-next tree

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 2/2] powerpc: Update for VSX core file and ptrace
  2008-07-01  4:01 ` [PATCH 0/2] powerpc: Update VSX support Michael Neuling
@ 2008-07-01  4:01   ` Michael Neuling
  2008-07-01  4:01   ` [PATCH 1/2] powerpc: Fix compile error for CONFIG_VSX Michael Neuling
  1 sibling, 0 replies; 23+ messages in thread
From: Michael Neuling @ 2008-07-01  4:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This correctly hooks the VSX dump into Roland McGrath core file
infrastructure.  It adds the VSX dump information as an additional elf
note in the core file (after talking more to the tool chain/gdb guys).
This also ensures the formats are consistent between signals, ptrace
and core files.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---

 arch/powerpc/kernel/process.c |   19 +------------------
 arch/powerpc/kernel/ptrace.c  |   21 +++++++++++++--------
 include/asm-powerpc/elf.h     |    4 ++--
 include/linux/elf.h           |    1 +
 4 files changed, 17 insertions(+), 28 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/process.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/process.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/process.c
@@ -162,7 +162,7 @@ void flush_altivec_to_thread(struct task
 	}
 }
 
-int dump_task_altivec(struct task_struct *tsk, elf_vrreg_t *vrregs)
+int dump_task_altivec(struct task_struct *tsk, elf_vrregset_t *vrregs)
 {
 	/* ELF_NVRREG includes the VSCR and VRSAVE which we need to save
 	 * separately, see below */
@@ -249,23 +249,6 @@ int dump_task_vsx(struct task_struct *ts
 }
 #endif /* CONFIG_VSX */
 
-int dump_task_vector(struct task_struct *tsk, elf_vrregset_t *vrregs)
-{
-	int rc = 0;
-	elf_vrreg_t *regs = (elf_vrreg_t *)vrregs;
-#ifdef CONFIG_ALTIVEC
-	rc = dump_task_altivec(tsk, regs);
-	if (rc)
-		return rc;
-	regs += ELF_NVRREG;
-#endif
-
-#ifdef CONFIG_VSX
-	rc = dump_task_vsx(tsk, regs);
-#endif
-	return rc;
-}
-
 #ifdef CONFIG_SPE
 
 void enable_kernel_spe(void)
Index: linux-2.6-ozlabs/arch/powerpc/kernel/ptrace.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/ptrace.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/ptrace.c
@@ -368,13 +368,15 @@ static int vsr_get(struct task_struct *t
 		   unsigned int pos, unsigned int count,
 		   void *kbuf, void __user *ubuf)
 {
-	int ret;
+	double buf[32];
+	int ret, i;
 
 	flush_vsx_to_thread(target);
 
+	for (i = 0; i < 32 ; i++)
+		buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
 	ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
-				  target->thread.fpr, 0,
-				  32 * sizeof(vector128));
+				  buf, 0, 32 * sizeof(double));
 
 	return ret;
 }
@@ -383,13 +385,16 @@ static int vsr_set(struct task_struct *t
 		   unsigned int pos, unsigned int count,
 		   const void *kbuf, const void __user *ubuf)
 {
-	int ret;
+	double buf[32];
+	int ret,i;
 
 	flush_vsx_to_thread(target);
 
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-				 target->thread.fpr, 0,
-				 32 * sizeof(vector128));
+				 buf, 0, 32 * sizeof(double));
+	for (i = 0; i < 32 ; i++)
+		current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
+
 
 	return ret;
 }
@@ -499,8 +504,8 @@ static const struct user_regset native_r
 #endif
 #ifdef CONFIG_VSX
 	[REGSET_VSX] = {
-		.n = 32,
-		.size = sizeof(vector128), .align = sizeof(vector128),
+		.core_note_type = NT_PPC_VSX, .n = 32,
+		.size = sizeof(double), .align = sizeof(double),
 		.active = vsr_active, .get = vsr_get, .set = vsr_set
 	},
 #endif
Index: linux-2.6-ozlabs/include/asm-powerpc/elf.h
===================================================================
--- linux-2.6-ozlabs.orig/include/asm-powerpc/elf.h
+++ linux-2.6-ozlabs/include/asm-powerpc/elf.h
@@ -221,8 +221,8 @@ extern int dump_task_fpu(struct task_str
 typedef elf_vrregset_t elf_fpxregset_t;
 
 #ifdef CONFIG_ALTIVEC
-extern int dump_task_vector(struct task_struct *, elf_vrregset_t *vrregs);
-#define ELF_CORE_COPY_XFPREGS(tsk, regs) dump_task_vector(tsk, regs)
+extern int dump_task_altivec(struct task_struct *, elf_vrregset_t *vrregs);
+#define ELF_CORE_COPY_XFPREGS(tsk, regs) dump_task_altivec(tsk, regs)
 #define ELF_CORE_XFPREG_TYPE NT_PPC_VMX
 #endif
 
Index: linux-2.6-ozlabs/include/linux/elf.h
===================================================================
--- linux-2.6-ozlabs.orig/include/linux/elf.h
+++ linux-2.6-ozlabs/include/linux/elf.h
@@ -358,6 +358,7 @@ typedef struct elf64_shdr {
 #define NT_PRXFPREG     0x46e62b7f      /* copied from gdb5.1/include/elf/common.h */
 #define NT_PPC_VMX	0x100		/* PowerPC Altivec/VMX registers */
 #define NT_PPC_SPE	0x101		/* PowerPC SPE/EVR registers */
+#define NT_PPC_VSX	0x102		/* PowerPC VSX registers */
 #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
 
 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 1/2] powerpc: Fix compile error for CONFIG_VSX
  2008-07-01  4:01 ` [PATCH 0/2] powerpc: Update VSX support Michael Neuling
  2008-07-01  4:01   ` [PATCH 2/2] powerpc: Update for VSX core file and ptrace Michael Neuling
@ 2008-07-01  4:01   ` Michael Neuling
  2008-07-01  4:51     ` Michael Neuling
  1 sibling, 1 reply; 23+ messages in thread
From: Michael Neuling @ 2008-07-01  4:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Fix compile error when CONFIG_VSX is enabled.

arch/powerpc/kernel/signal_64.c: In function 'restore_sigcontext':
arch/powerpc/kernel/signal_64.c:241: error: 'i' undeclared (first use in this function)

Signed-off-by: Michael Neuling <mikey@neuling.org>
---

 arch/powerpc/kernel/signal_64.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal_64.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
@@ -167,6 +167,7 @@ static long restore_sigcontext(struct pt
 #endif
 #ifdef CONFIG_VSX
 	double buf[FP_REGS_SIZE];
+	int i;
 #endif
 	unsigned long err = 0;
 	unsigned long save_r13 = 0;

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  2:44       ` Benjamin Herrenschmidt
@ 2008-07-01  4:05         ` Kumar Gala
  0 siblings, 0 replies; 23+ messages in thread
From: Kumar Gala @ 2008-07-01  4:05 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, Paul Mackerras


On Jun 30, 2008, at 9:44 PM, Benjamin Herrenschmidt wrote:

>
>>> Any chance to get my 4xx PTE rework in too ?
>>
>> I asked you about that 2 weeks ago.  I also asked you to spin a v2  
>> with
>> the comments Kumar asked for.  I got nothing back.
>>
>> If you want it in 2.6.27, do that soon please :)
>
> Oops... though I did it. Let me check what I have ...

I've you post a new version I'll look at getting the changes for FSL  
Book-E MMU that match it.

- k

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] powerpc: Fix compile error for CONFIG_VSX
  2008-07-01  4:01   ` [PATCH 1/2] powerpc: Fix compile error for CONFIG_VSX Michael Neuling
@ 2008-07-01  4:51     ` Michael Neuling
  0 siblings, 0 replies; 23+ messages in thread
From: Michael Neuling @ 2008-07-01  4:51 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev



In message <20080701040139.A6196702C9@localhost.localdomain> you wrote:
> Fix compile error when CONFIG_VSX is enabled.
> 
> arch/powerpc/kernel/signal_64.c: In function 'restore_sigcontext':
> arch/powerpc/kernel/signal_64.c:241: error: 'i' undeclared (first use in this
 function)

FYI.. this was caused by a merge conflict with sfr's patch
fcbc5a976b1cafe2e866871c86d239d57503bfd5

Mikey

> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> 
>  arch/powerpc/kernel/signal_64.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal_64.c
> +++ linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
> @@ -167,6 +167,7 @@ static long restore_sigcontext(struct pt
>  #endif
>  #ifdef CONFIG_VSX
>  	double buf[FP_REGS_SIZE];
> +	int i;
>  #endif
>  	unsigned long err = 0;
>  	unsigned long save_r13 = 0;
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] powerpc: fix compile warning in init_thread
  2008-07-01  0:20 Commits added to powerpc.git master and powerpc-next branches Paul Mackerras
  2008-07-01  1:27 ` Paul Mackerras
  2008-07-01  4:01 ` [PATCH 0/2] powerpc: Update VSX support Michael Neuling
@ 2008-07-01  7:00 ` Michael Neuling
  2008-07-01  9:07   ` Benjamin Herrenschmidt
  2008-07-01  8:49 ` Commits added to powerpc.git master and powerpc-next branches Laurent Pinchart
  2008-07-02  1:56 ` [PATCH] powerpc: cleanup copy_to/from_user for vsx and fpr Michael Neuling
  4 siblings, 1 reply; 23+ messages in thread
From: Michael Neuling @ 2008-07-01  7:00 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

arch/powerpc/kernel/init_task.c:33: warning: missing braces around initializer
arch/powerpc/kernel/init_task.c:33: warning: (near initialization for 'init_task.thread.fpr[0]')

Noticed by SFR.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---

 include/asm-powerpc/processor.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-ozlabs/include/asm-powerpc/processor.h
===================================================================
--- linux-2.6-ozlabs.orig/include/asm-powerpc/processor.h
+++ linux-2.6-ozlabs/include/asm-powerpc/processor.h
@@ -222,7 +222,7 @@ struct thread_struct {
 	.ksp_limit = INIT_SP_LIMIT, \
 	.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
 	.fs = KERNEL_DS, \
-	.fpr = {0}, \
+	.fpr = {{0}}, \
 	.fpscr = { .val = 0, }, \
 	.fpexc_mode = 0, \
 }

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  0:20 Commits added to powerpc.git master and powerpc-next branches Paul Mackerras
                   ` (2 preceding siblings ...)
  2008-07-01  7:00 ` [PATCH] powerpc: fix compile warning in init_thread Michael Neuling
@ 2008-07-01  8:49 ` Laurent Pinchart
  2008-07-01 15:54   ` Jochen Friedrich
  2008-07-02  7:41   ` Kumar Gala
  2008-07-02  1:56 ` [PATCH] powerpc: cleanup copy_to/from_user for vsx and fpr Michael Neuling
  4 siblings, 2 replies; 23+ messages in thread
From: Laurent Pinchart @ 2008-07-01  8:49 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

Hi Paul,

On Tuesday 01 July 2008, Paul Mackerras wrote:
> The following commits have been added to the master and powerpc-next
> branches of the powerpc.git repository.  This includes patches pulled
> from Kumar's and Josh's trees.

Any change of getting the following patches into 2.6.27 ? They have either been acked and not picked, or just ignored so far :-/

[PATCHv2] fs_enet: restore promiscuous and multicast settings in restart()
	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19228
[PATCH 2/2] fs_enet: MDIO on GPIO support
	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=18693
[PATCHv3 1/2] [POWERPC] CPM2: Implement GPIO LIB API on CPM2 Freescale SoC.
	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19045
[PATCH] powerpc: Modem control lines support for the cpm_uart driver
	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=17928
[PATCH] cpm_uart: Support uart_wait_until_sent()
	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19233

Best regards,

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] powerpc: fix compile warning in init_thread
  2008-07-01  7:00 ` [PATCH] powerpc: fix compile warning in init_thread Michael Neuling
@ 2008-07-01  9:07   ` Benjamin Herrenschmidt
  2008-07-01 11:02     ` Michael Neuling
  0 siblings, 1 reply; 23+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-01  9:07 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev, Paul Mackerras

On Tue, 2008-07-01 at 17:00 +1000, Michael Neuling wrote:
> arch/powerpc/kernel/init_task.c:33: warning: missing braces around initializer
> arch/powerpc/kernel/init_task.c:33: warning: (near initialization for 'init_task.thread.fpr[0]')
> 
> Noticed by SFR.
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>

That's when fpr is part of the union but what if CONFIG_VSX is off ?

Ben.

> ---
> 
>  include/asm-powerpc/processor.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6-ozlabs/include/asm-powerpc/processor.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/include/asm-powerpc/processor.h
> +++ linux-2.6-ozlabs/include/asm-powerpc/processor.h
> @@ -222,7 +222,7 @@ struct thread_struct {
>  	.ksp_limit = INIT_SP_LIMIT, \
>  	.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
>  	.fs = KERNEL_DS, \
> -	.fpr = {0}, \
> +	.fpr = {{0}}, \
>  	.fpscr = { .val = 0, }, \
>  	.fpexc_mode = 0, \
>  }
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] powerpc: fix compile warning in init_thread
  2008-07-01  9:07   ` Benjamin Herrenschmidt
@ 2008-07-01 11:02     ` Michael Neuling
  0 siblings, 0 replies; 23+ messages in thread
From: Michael Neuling @ 2008-07-01 11:02 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, Paul Mackerras



In message <1214903256.20711.123.camel@pasglop> you wrote:
> On Tue, 2008-07-01 at 17:00 +1000, Michael Neuling wrote:
> > arch/powerpc/kernel/init_task.c:33: warning: missing braces around initiali
zer
> > arch/powerpc/kernel/init_task.c:33: warning: (near initialization for 'init
_task.thread.fpr[0]')
> > 
> > Noticed by SFR.
> > 
> > Signed-off-by: Michael Neuling <mikey@neuling.org>
> 
> That's when fpr is part of the union but what if CONFIG_VSX is off ?

It's not a union anymore.  It's a 2D array irrespective of CONFIG_VSX.

	double		fpr[32][TS_FPRWIDTH];

Mikey

> 
> Ben.
> 
> > ---
> > 
> >  include/asm-powerpc/processor.h |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: linux-2.6-ozlabs/include/asm-powerpc/processor.h
> > ===================================================================
> > --- linux-2.6-ozlabs.orig/include/asm-powerpc/processor.h
> > +++ linux-2.6-ozlabs/include/asm-powerpc/processor.h
> > @@ -222,7 +222,7 @@ struct thread_struct {
> >  	.ksp_limit = INIT_SP_LIMIT, \
> >  	.regs = (struct pt_regs *)INIT_SP - 1, /* XXX bogus, I think */ \
> >  	.fs = KERNEL_DS, \
> > -	.fpr = {0}, \
> > +	.fpr = {{0}}, \
> >  	.fpscr = { .val = 0, }, \
> >  	.fpexc_mode = 0, \
> >  }
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  8:49 ` Commits added to powerpc.git master and powerpc-next branches Laurent Pinchart
@ 2008-07-01 15:54   ` Jochen Friedrich
  2008-07-02  7:42     ` Kumar Gala
  2008-07-02  7:41   ` Kumar Gala
  1 sibling, 1 reply; 23+ messages in thread
From: Jochen Friedrich @ 2008-07-01 15:54 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev, Paul Mackerras

Hi Paul,

On Tuesday 01 July 2008, Paul Mackerras wrote:

> The following commits have been added to the master and powerpc-next
> branches of the powerpc.git repository.  This includes patches pulled
> from Kumar's and Josh's trees.

Now that the I2C driver for CPM1/CPM2 boards is in the i2c tree, is there
any chance to get this one into 2.6.27?

[POWERPC] Add i2c pins to dts and board setup
  http://patchwork.ozlabs.org/linuxppc/patch?person=1023&id=18603

Thanks,
Jochen

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] powerpc: cleanup copy_to/from_user for vsx and fpr
  2008-07-01  0:20 Commits added to powerpc.git master and powerpc-next branches Paul Mackerras
                   ` (3 preceding siblings ...)
  2008-07-01  8:49 ` Commits added to powerpc.git master and powerpc-next branches Laurent Pinchart
@ 2008-07-02  1:56 ` Michael Neuling
  2008-07-02  4:06   ` Michael Neuling
  4 siblings, 1 reply; 23+ messages in thread
From: Michael Neuling @ 2008-07-02  1:56 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This merges and cleans up some of the ugly copy/to from user code
which is required for the new fpr and vsx layout in the thread_struct.

Also fixes some hard coded buffer sizes and removes a redundant
fpr_flush_to_thread.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---

 arch/powerpc/kernel/signal.h    |   10 +++
 arch/powerpc/kernel/signal_32.c |   40 ++------------
 arch/powerpc/kernel/signal_64.c |  112 ++++++++++++++++++++++++++++------------
 3 files changed, 96 insertions(+), 66 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal.h
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal.h
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal.h
@@ -24,6 +24,16 @@ extern int handle_rt_signal32(unsigned l
 			      siginfo_t *info, sigset_t *oldset,
 			      struct pt_regs *regs);
 
+extern unsigned long copy_fpr_to_user(void __user *to,
+				      struct task_struct *task);
+extern unsigned long copy_fpr_from_user(struct task_struct *task,
+					void __user *from);
+#ifdef CONFIG_VSX
+extern unsigned long copy_vsx_to_user(void __user *to,
+				      struct task_struct *task);
+extern unsigned long copy_vsx_from_user(struct task_struct *task,
+					void __user *from);
+#endif
 
 #ifdef CONFIG_PPC64
 
Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal_32.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal_32.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal_32.c
@@ -337,10 +337,6 @@ static int save_user_regs(struct pt_regs
 		int sigret)
 {
 	unsigned long msr = regs->msr;
-#ifdef CONFIG_VSX
-	double buf[32];
-	int i;
-#endif
 
 	/* Make sure floating point registers are stored in regs */
 	flush_fp_to_thread(current);
@@ -370,14 +366,9 @@ static int save_user_regs(struct pt_regs
 	if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
-	/* save FPR copy to local buffer then write to the thread_struct */
-	flush_fp_to_thread(current);
-	for (i = 0; i < 32 ; i++)
-		buf[i] = current->thread.TS_FPR(i);
-	memcpy(&buf[i], &current->thread.fpscr, sizeof(double));
-	if (__copy_to_user(&frame->mc_fregs, buf, ELF_NFPREG * sizeof(double)))
+	if (copy_fpr_to_user(&frame->mc_fregs, current))
 		return 1;
+#ifdef CONFIG_VSX
 	/*
 	 * Copy VSR 0-31 upper half from thread_struct to local
 	 * buffer, then write that to userspace.  Also set MSR_VSX in
@@ -386,18 +377,10 @@ static int save_user_regs(struct pt_regs
 	 */
 	if (current->thread.used_vsr) {
 		flush_vsx_to_thread(current);
-		for (i = 0; i < 32 ; i++)
-			buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
-		if (__copy_to_user(&frame->mc_vsregs, buf,
-				   ELF_NVSRHALFREG  * sizeof(double)))
+		if (copy_vsx_to_user(&frame->mc_vsregs, current))
 			return 1;
 		msr |= MSR_VSX;
 	}
-#else
-	/* save floating-point registers */
-	if (__copy_to_user(&frame->mc_fregs, current->thread.fpr,
-		    ELF_NFPREG * sizeof(double)))
-		return 1;
 #endif /* CONFIG_VSX */
 #ifdef CONFIG_SPE
 	/* save spe registers */
@@ -442,7 +425,6 @@ static long restore_user_regs(struct pt_
 	unsigned int save_r2 = 0;
 	unsigned long msr;
 #ifdef CONFIG_VSX
-	double buf[32];
 	int i;
 #endif
 
@@ -490,13 +472,10 @@ static long restore_user_regs(struct pt_
 	if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
+	if (copy_fpr_from_user(current, &sr->mc_fregs))
+		return 1;
 
 #ifdef CONFIG_VSX
-	if (__copy_from_user(buf, &sr->mc_fregs,sizeof(sr->mc_fregs)))
-		return 1;
-	for (i = 0; i < 32 ; i++)
-		current->thread.TS_FPR(i) = buf[i];
-	memcpy(&current->thread.fpscr, &buf[i], sizeof(double));
 	/*
 	 * Force the process to reload the VSX registers from
 	 * current->thread when it next does VSX instruction.
@@ -507,18 +486,11 @@ static long restore_user_regs(struct pt_
 		 * Restore altivec registers from the stack to a local
 		 * buffer, then write this out to the thread_struct
 		 */
-		if (__copy_from_user(buf, &sr->mc_vsregs,
-				     sizeof(sr->mc_vsregs)))
+		if (copy_vsx_from_user(current, &sr->mc_vsregs))
 			return 1;
-		for (i = 0; i < 32 ; i++)
-			current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
 	} else if (current->thread.used_vsr)
 		for (i = 0; i < 32 ; i++)
 			current->thread.fpr[i][TS_VSRLOWOFFSET] = 0;
-#else
-	if (__copy_from_user(current->thread.fpr, &sr->mc_fregs,
-			     sizeof(sr->mc_fregs)))
-		return 1;
 #endif /* CONFIG_VSX */
 	/*
 	 * force the process to reload the FP registers from
Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal_64.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
@@ -69,6 +69,75 @@ static const char fmt32[] = KERN_INFO \
 static const char fmt64[] = KERN_INFO \
 	"%s[%d]: bad frame in %s: %016lx nip %016lx lr %016lx\n";
 
+#ifdef CONFIG_VSX
+unsigned long copy_fpr_to_user(void __user *to,
+			       struct task_struct *task)
+{
+	double buf[ELF_NFPREG];
+	int i;
+
+	/* save FPR copy to local buffer then write to the thread_struct */
+	for (i = 0; i < (ELF_NFPREG - 1) ; i++)
+		buf[i] = task->thread.TS_FPR(i);
+	memcpy(&buf[i], &task->thread.fpscr, sizeof(double));
+	return __copy_to_user(to, buf, ELF_NFPREG * sizeof(double));
+}
+
+unsigned long copy_fpr_from_user(struct task_struct *task,
+				 void __user *from)
+{
+	double buf[ELF_NFPREG];
+	int i;
+
+	if (__copy_from_user(buf, from, ELF_NFPREG * sizeof(double)))
+		return 1;
+	for (i = 0; i < (ELF_NFPREG - 1) ; i++)
+		task->thread.TS_FPR(i) = buf[i];
+	memcpy(&task->thread.fpscr, &buf[i], sizeof(double));
+
+	return 0;
+}
+
+unsigned long copy_vsx_to_user(void __user *to,
+			       struct task_struct *task)
+{
+	double buf[ELF_NVSRHALFREG];
+	int i;
+
+	/* save FPR copy to local buffer then write to the thread_struct */
+	for (i = 0; i < ELF_NVSRHALFREG; i++)
+		buf[i] = task->thread.fpr[i][TS_VSRLOWOFFSET];
+	return __copy_to_user(to, buf, ELF_NVSRHALFREG * sizeof(double));
+}
+
+unsigned long copy_vsx_from_user(struct task_struct *task,
+				 void __user *from)
+{
+	double buf[ELF_NVSRHALFREG];
+	int i;
+
+	if (__copy_from_user(buf, from, ELF_NVSRHALFREG * sizeof(double)))
+		return 1;
+	for (i = 0; i < ELF_NVSRHALFREG ; i++)
+		task->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
+	return 0;
+}
+#else
+inline unsigned long copy_fpr_to_user(void __user *to,
+				      struct task_struct *task)
+{
+	return __copy_to_user(to, task->thread.fpr,
+			      ELF_NFPREG * sizeof(double));
+}
+
+inline unsigned long copy_fpr_from_user(struct task_struct *task,
+					void __user *from)
+{
+	return __copy_from_user(task->thread.fpr, from,
+			      ELF_NFPREG * sizeof(double));
+}
+#endif
+
 /*
  * Set up the sigcontext for the signal frame.
  */
@@ -89,10 +158,6 @@ static long setup_sigcontext(struct sigc
 #endif
 	unsigned long msr = regs->msr;
 	long err = 0;
-#ifdef CONFIG_VSX
-	double buf[FP_REGS_SIZE];
-	int i;
-#endif
 
 	flush_fp_to_thread(current);
 
@@ -117,12 +182,9 @@ static long setup_sigcontext(struct sigc
 	err |= __put_user(0, &sc->v_regs);
 #endif /* CONFIG_ALTIVEC */
 	flush_fp_to_thread(current);
+	/* copy fpr regs and fpscr */
+	err |= copy_fpr_to_user(&sc->fp_regs, current);
 #ifdef CONFIG_VSX
-	/* Copy FP to local buffer then write that out */
-	for (i = 0; i < 32 ; i++)
-		buf[i] = current->thread.TS_FPR(i);
-	memcpy(&buf[i], &current->thread.fpscr, sizeof(double));
-	err |= __copy_to_user(&sc->fp_regs, buf, FP_REGS_SIZE);
 	/*
 	 * Copy VSX low doubleword to local buffer for formatting,
 	 * then out to userspace.  Update v_regs to point after the
@@ -131,17 +193,12 @@ static long setup_sigcontext(struct sigc
 	if (current->thread.used_vsr) {
 		flush_vsx_to_thread(current);
 		v_regs += ELF_NVRREG;
-		for (i = 0; i < 32 ; i++)
-			buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
-		err |= __copy_to_user(v_regs, buf, 32 * sizeof(double));
+		err |= copy_vsx_to_user(v_regs, current);
 		/* set MSR_VSX in the MSR value in the frame to
 		 * indicate that sc->vs_reg) contains valid data.
 		 */
 		msr |= MSR_VSX;
 	}
-#else /* CONFIG_VSX */
-	/* copy fpr regs and fpscr */
-	err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
 #endif /* CONFIG_VSX */
 	err |= __put_user(&sc->gp_regs, &sc->regs);
 	WARN_ON(!FULL_REGS(regs));
@@ -165,13 +222,12 @@ static long restore_sigcontext(struct pt
 #ifdef CONFIG_ALTIVEC
 	elf_vrreg_t __user *v_regs;
 #endif
-#ifdef CONFIG_VSX
-	double buf[FP_REGS_SIZE];
-	int i;
-#endif
 	unsigned long err = 0;
 	unsigned long save_r13 = 0;
 	unsigned long msr;
+#ifdef CONFIG_VSX
+	int i;
+#endif
 
 	/* If this is not a signal return, we preserve the TLS in r13 */
 	if (!sig)
@@ -234,15 +290,9 @@ static long restore_sigcontext(struct pt
 	else
 		current->thread.vrsave = 0;
 #endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
 	/* restore floating point */
-	err |= __copy_from_user(buf, &sc->fp_regs, FP_REGS_SIZE);
-	if (err)
-		return err;
-	for (i = 0; i < 32 ; i++)
-		current->thread.TS_FPR(i) = buf[i];
-	memcpy(&current->thread.fpscr, &buf[i], sizeof(double));
-
+	err |= copy_fpr_from_user(current, &sc->fp_regs);
+#ifdef CONFIG_VSX
 	/*
 	 * Get additional VSX data. Update v_regs to point after the
 	 * VMX data.  Copy VSX low doubleword from userspace to local
@@ -250,14 +300,12 @@ static long restore_sigcontext(struct pt
 	 */
 	v_regs += ELF_NVRREG;
 	if ((msr & MSR_VSX) != 0)
-		err |= __copy_from_user(buf, v_regs, 32 * sizeof(double));
+		err |= copy_vsx_from_user(current, v_regs);
 	else
-		memset(buf, 0, 32 * sizeof(double));
+		for (i = 0; i < 32 ; i++)
+			current->thread.fpr[i][TS_VSRLOWOFFSET] = 0;
 
-	for (i = 0; i < 32 ; i++)
-		current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
 #else
-	err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
 #endif
 	return err;
 }

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH] powerpc: cleanup copy_to/from_user for vsx and fpr
  2008-07-02  1:56 ` [PATCH] powerpc: cleanup copy_to/from_user for vsx and fpr Michael Neuling
@ 2008-07-02  4:06   ` Michael Neuling
  0 siblings, 0 replies; 23+ messages in thread
From: Michael Neuling @ 2008-07-02  4:06 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This merges and cleans up some of the ugly copy/to from user code
which is required for the new fpr and vsx layout in the thread_struct.

Also fixes some hard coded buffer sizes and removes a redundant
fpr_flush_to_thread.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
Sorry, the last version broke 32bit kernel builds

 signal.h    |   10 +++++
 signal_32.c |  109 +++++++++++++++++++++++++++++++++++++++++-------------------
 signal_64.c |   43 ++++++-----------------
 3 files changed, 96 insertions(+), 66 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal.h
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal.h
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal.h
@@ -24,6 +24,16 @@ extern int handle_rt_signal32(unsigned l
 			      siginfo_t *info, sigset_t *oldset,
 			      struct pt_regs *regs);
 
+extern unsigned long copy_fpr_to_user(void __user *to,
+				      struct task_struct *task);
+extern unsigned long copy_fpr_from_user(struct task_struct *task,
+					void __user *from);
+#ifdef CONFIG_VSX
+extern unsigned long copy_vsx_to_user(void __user *to,
+				      struct task_struct *task);
+extern unsigned long copy_vsx_from_user(struct task_struct *task,
+					void __user *from);
+#endif
 
 #ifdef CONFIG_PPC64
 
Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal_32.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal_32.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal_32.c
@@ -328,6 +328,75 @@ struct rt_sigframe {
 	int			abigap[56];
 };
 
+#ifdef CONFIG_VSX
+unsigned long copy_fpr_to_user(void __user *to,
+			       struct task_struct *task)
+{
+	double buf[ELF_NFPREG];
+	int i;
+
+	/* save FPR copy to local buffer then write to the thread_struct */
+	for (i = 0; i < (ELF_NFPREG - 1) ; i++)
+		buf[i] = task->thread.TS_FPR(i);
+	memcpy(&buf[i], &task->thread.fpscr, sizeof(double));
+	return __copy_to_user(to, buf, ELF_NFPREG * sizeof(double));
+}
+
+unsigned long copy_fpr_from_user(struct task_struct *task,
+				 void __user *from)
+{
+	double buf[ELF_NFPREG];
+	int i;
+
+	if (__copy_from_user(buf, from, ELF_NFPREG * sizeof(double)))
+		return 1;
+	for (i = 0; i < (ELF_NFPREG - 1) ; i++)
+		task->thread.TS_FPR(i) = buf[i];
+	memcpy(&task->thread.fpscr, &buf[i], sizeof(double));
+
+	return 0;
+}
+
+unsigned long copy_vsx_to_user(void __user *to,
+			       struct task_struct *task)
+{
+	double buf[ELF_NVSRHALFREG];
+	int i;
+
+	/* save FPR copy to local buffer then write to the thread_struct */
+	for (i = 0; i < ELF_NVSRHALFREG; i++)
+		buf[i] = task->thread.fpr[i][TS_VSRLOWOFFSET];
+	return __copy_to_user(to, buf, ELF_NVSRHALFREG * sizeof(double));
+}
+
+unsigned long copy_vsx_from_user(struct task_struct *task,
+				 void __user *from)
+{
+	double buf[ELF_NVSRHALFREG];
+	int i;
+
+	if (__copy_from_user(buf, from, ELF_NVSRHALFREG * sizeof(double)))
+		return 1;
+	for (i = 0; i < ELF_NVSRHALFREG ; i++)
+		task->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
+	return 0;
+}
+#else
+inline unsigned long copy_fpr_to_user(void __user *to,
+				      struct task_struct *task)
+{
+	return __copy_to_user(to, task->thread.fpr,
+			      ELF_NFPREG * sizeof(double));
+}
+
+inline unsigned long copy_fpr_from_user(struct task_struct *task,
+					void __user *from)
+{
+	return __copy_from_user(task->thread.fpr, from,
+			      ELF_NFPREG * sizeof(double));
+}
+#endif
+
 /*
  * Save the current user registers on the user stack.
  * We only save the altivec/spe registers if the process has used
@@ -337,10 +406,6 @@ static int save_user_regs(struct pt_regs
 		int sigret)
 {
 	unsigned long msr = regs->msr;
-#ifdef CONFIG_VSX
-	double buf[32];
-	int i;
-#endif
 
 	/* Make sure floating point registers are stored in regs */
 	flush_fp_to_thread(current);
@@ -370,14 +435,9 @@ static int save_user_regs(struct pt_regs
 	if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
-	/* save FPR copy to local buffer then write to the thread_struct */
-	flush_fp_to_thread(current);
-	for (i = 0; i < 32 ; i++)
-		buf[i] = current->thread.TS_FPR(i);
-	memcpy(&buf[i], &current->thread.fpscr, sizeof(double));
-	if (__copy_to_user(&frame->mc_fregs, buf, ELF_NFPREG * sizeof(double)))
+	if (copy_fpr_to_user(&frame->mc_fregs, current))
 		return 1;
+#ifdef CONFIG_VSX
 	/*
 	 * Copy VSR 0-31 upper half from thread_struct to local
 	 * buffer, then write that to userspace.  Also set MSR_VSX in
@@ -386,18 +446,10 @@ static int save_user_regs(struct pt_regs
 	 */
 	if (current->thread.used_vsr) {
 		flush_vsx_to_thread(current);
-		for (i = 0; i < 32 ; i++)
-			buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
-		if (__copy_to_user(&frame->mc_vsregs, buf,
-				   ELF_NVSRHALFREG  * sizeof(double)))
+		if (copy_vsx_to_user(&frame->mc_vsregs, current))
 			return 1;
 		msr |= MSR_VSX;
 	}
-#else
-	/* save floating-point registers */
-	if (__copy_to_user(&frame->mc_fregs, current->thread.fpr,
-		    ELF_NFPREG * sizeof(double)))
-		return 1;
 #endif /* CONFIG_VSX */
 #ifdef CONFIG_SPE
 	/* save spe registers */
@@ -442,7 +494,6 @@ static long restore_user_regs(struct pt_
 	unsigned int save_r2 = 0;
 	unsigned long msr;
 #ifdef CONFIG_VSX
-	double buf[32];
 	int i;
 #endif
 
@@ -490,13 +541,10 @@ static long restore_user_regs(struct pt_
 	if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
+	if (copy_fpr_from_user(current, &sr->mc_fregs))
+		return 1;
 
 #ifdef CONFIG_VSX
-	if (__copy_from_user(buf, &sr->mc_fregs,sizeof(sr->mc_fregs)))
-		return 1;
-	for (i = 0; i < 32 ; i++)
-		current->thread.TS_FPR(i) = buf[i];
-	memcpy(&current->thread.fpscr, &buf[i], sizeof(double));
 	/*
 	 * Force the process to reload the VSX registers from
 	 * current->thread when it next does VSX instruction.
@@ -507,18 +555,11 @@ static long restore_user_regs(struct pt_
 		 * Restore altivec registers from the stack to a local
 		 * buffer, then write this out to the thread_struct
 		 */
-		if (__copy_from_user(buf, &sr->mc_vsregs,
-				     sizeof(sr->mc_vsregs)))
+		if (copy_vsx_from_user(current, &sr->mc_vsregs))
 			return 1;
-		for (i = 0; i < 32 ; i++)
-			current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
 	} else if (current->thread.used_vsr)
 		for (i = 0; i < 32 ; i++)
 			current->thread.fpr[i][TS_VSRLOWOFFSET] = 0;
-#else
-	if (__copy_from_user(current->thread.fpr, &sr->mc_fregs,
-			     sizeof(sr->mc_fregs)))
-		return 1;
 #endif /* CONFIG_VSX */
 	/*
 	 * force the process to reload the FP registers from
Index: linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/signal_64.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/signal_64.c
@@ -89,10 +89,6 @@ static long setup_sigcontext(struct sigc
 #endif
 	unsigned long msr = regs->msr;
 	long err = 0;
-#ifdef CONFIG_VSX
-	double buf[FP_REGS_SIZE];
-	int i;
-#endif
 
 	flush_fp_to_thread(current);
 
@@ -117,12 +113,9 @@ static long setup_sigcontext(struct sigc
 	err |= __put_user(0, &sc->v_regs);
 #endif /* CONFIG_ALTIVEC */
 	flush_fp_to_thread(current);
+	/* copy fpr regs and fpscr */
+	err |= copy_fpr_to_user(&sc->fp_regs, current);
 #ifdef CONFIG_VSX
-	/* Copy FP to local buffer then write that out */
-	for (i = 0; i < 32 ; i++)
-		buf[i] = current->thread.TS_FPR(i);
-	memcpy(&buf[i], &current->thread.fpscr, sizeof(double));
-	err |= __copy_to_user(&sc->fp_regs, buf, FP_REGS_SIZE);
 	/*
 	 * Copy VSX low doubleword to local buffer for formatting,
 	 * then out to userspace.  Update v_regs to point after the
@@ -131,17 +124,12 @@ static long setup_sigcontext(struct sigc
 	if (current->thread.used_vsr) {
 		flush_vsx_to_thread(current);
 		v_regs += ELF_NVRREG;
-		for (i = 0; i < 32 ; i++)
-			buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
-		err |= __copy_to_user(v_regs, buf, 32 * sizeof(double));
+		err |= copy_vsx_to_user(v_regs, current);
 		/* set MSR_VSX in the MSR value in the frame to
 		 * indicate that sc->vs_reg) contains valid data.
 		 */
 		msr |= MSR_VSX;
 	}
-#else /* CONFIG_VSX */
-	/* copy fpr regs and fpscr */
-	err |= __copy_to_user(&sc->fp_regs, &current->thread.fpr, FP_REGS_SIZE);
 #endif /* CONFIG_VSX */
 	err |= __put_user(&sc->gp_regs, &sc->regs);
 	WARN_ON(!FULL_REGS(regs));
@@ -165,13 +153,12 @@ static long restore_sigcontext(struct pt
 #ifdef CONFIG_ALTIVEC
 	elf_vrreg_t __user *v_regs;
 #endif
-#ifdef CONFIG_VSX
-	double buf[FP_REGS_SIZE];
-	int i;
-#endif
 	unsigned long err = 0;
 	unsigned long save_r13 = 0;
 	unsigned long msr;
+#ifdef CONFIG_VSX
+	int i;
+#endif
 
 	/* If this is not a signal return, we preserve the TLS in r13 */
 	if (!sig)
@@ -234,15 +221,9 @@ static long restore_sigcontext(struct pt
 	else
 		current->thread.vrsave = 0;
 #endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
 	/* restore floating point */
-	err |= __copy_from_user(buf, &sc->fp_regs, FP_REGS_SIZE);
-	if (err)
-		return err;
-	for (i = 0; i < 32 ; i++)
-		current->thread.TS_FPR(i) = buf[i];
-	memcpy(&current->thread.fpscr, &buf[i], sizeof(double));
-
+	err |= copy_fpr_from_user(current, &sc->fp_regs);
+#ifdef CONFIG_VSX
 	/*
 	 * Get additional VSX data. Update v_regs to point after the
 	 * VMX data.  Copy VSX low doubleword from userspace to local
@@ -250,14 +231,12 @@ static long restore_sigcontext(struct pt
 	 */
 	v_regs += ELF_NVRREG;
 	if ((msr & MSR_VSX) != 0)
-		err |= __copy_from_user(buf, v_regs, 32 * sizeof(double));
+		err |= copy_vsx_from_user(current, v_regs);
 	else
-		memset(buf, 0, 32 * sizeof(double));
+		for (i = 0; i < 32 ; i++)
+			current->thread.fpr[i][TS_VSRLOWOFFSET] = 0;
 
-	for (i = 0; i < 32 ; i++)
-		current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
 #else
-	err |= __copy_from_user(&current->thread.fpr, &sc->fp_regs, FP_REGS_SIZE);
 #endif
 	return err;
 }

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01  8:49 ` Commits added to powerpc.git master and powerpc-next branches Laurent Pinchart
  2008-07-01 15:54   ` Jochen Friedrich
@ 2008-07-02  7:41   ` Kumar Gala
  2008-07-02  8:41     ` Laurent Pinchart
  1 sibling, 1 reply; 23+ messages in thread
From: Kumar Gala @ 2008-07-02  7:41 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linuxppc-dev, Paul Mackerras


On Jul 1, 2008, at 3:49 AM, Laurent Pinchart wrote:

> Hi Paul,
>
> On Tuesday 01 July 2008, Paul Mackerras wrote:
>> The following commits have been added to the master and powerpc-next
>> branches of the powerpc.git repository.  This includes patches pulled
>> from Kumar's and Josh's trees.
>
> Any change of getting the following patches into 2.6.27 ? They have  
> either been acked and not picked, or just ignored so far :-/
>
> [PATCHv2] fs_enet: restore promiscuous and multicast settings in  
> restart()
> 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19228

Should go via netdev unless jgarizk says otherwise

> [PATCH 2/2] fs_enet: MDIO on GPIO support
> 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=18693

ditto

> [PATCHv3 1/2] [POWERPC] CPM2: Implement GPIO LIB API on CPM2  
> Freescale SoC.
> 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19045

I'll look at this one

> [PATCH] powerpc: Modem control lines support for the cpm_uart driver
> 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=17928

this seems to depend on the previous patch.

> [PATCH] cpm_uart: Support uart_wait_until_sent()
> 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19233


applied

- k

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-01 15:54   ` Jochen Friedrich
@ 2008-07-02  7:42     ` Kumar Gala
  2008-07-02 12:35       ` Jochen Friedrich
  0 siblings, 1 reply; 23+ messages in thread
From: Kumar Gala @ 2008-07-02  7:42 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: linuxppc-dev, Paul Mackerras


On Jul 1, 2008, at 10:54 AM, Jochen Friedrich wrote:

> Hi Paul,
>
> On Tuesday 01 July 2008, Paul Mackerras wrote:
>
>> The following commits have been added to the master and powerpc-next
>> branches of the powerpc.git repository.  This includes patches pulled
>> from Kumar's and Josh's trees.
>
> Now that the I2C driver for CPM1/CPM2 boards is in the i2c tree, is  
> there
> any chance to get this one into 2.6.27?
>
> [POWERPC] Add i2c pins to dts and board setup
>  http://patchwork.ozlabs.org/linuxppc/patch?person=1023&id=18603

Will we always want defconfig updates to enable the driver?

- k

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-02  7:41   ` Kumar Gala
@ 2008-07-02  8:41     ` Laurent Pinchart
  0 siblings, 0 replies; 23+ messages in thread
From: Laurent Pinchart @ 2008-07-02  8:41 UTC (permalink / raw)
  To: Kumar Gala, Jeff Garzik; +Cc: linuxppc-dev, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 2316 bytes --]

On Wednesday 02 July 2008, Kumar Gala wrote:
> 
> On Jul 1, 2008, at 3:49 AM, Laurent Pinchart wrote:
> 
> > Hi Paul,
> >
> > On Tuesday 01 July 2008, Paul Mackerras wrote:
> >> The following commits have been added to the master and powerpc-next
> >> branches of the powerpc.git repository.  This includes patches pulled
> >> from Kumar's and Josh's trees.
> >
> > Any change of getting the following patches into 2.6.27 ? They have  
> > either been acked and not picked, or just ignored so far :-/
> >
> > [PATCHv2] fs_enet: restore promiscuous and multicast settings in  
> > restart()
> > 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19228
> 
> Should go via netdev unless jgarizk says otherwise

On 2008-06-18, Jeff wrote:

"My general rule is, anytime I see 80%+ of the patch dealing with 
arch-specific API functions (such as OF resource stuff), I tend to 
prefer that goes via an arch tree.

If it's a networking change, of course I'd prefer it came in my direction."

Jeff, could you please tell us if you want to pick this one or if it should go through the powerpc tree ? The patch has been posted to both the linuxppc-dev and netdev lists, and I haven't received any comment from the netdev folks.

> > [PATCH 2/2] fs_enet: MDIO on GPIO support
> > 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=18693
> 
> ditto

Jeff, same question :-)

> > [PATCHv3 1/2] [POWERPC] CPM2: Implement GPIO LIB API on CPM2  
> > Freescale SoC.
> > 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19045
> 
> I'll look at this one

Thanks.

> > [PATCH] powerpc: Modem control lines support for the cpm_uart driver
> > 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=17928
> 
> this seems to depend on the previous patch.

It doesn't strictly depend on the previous one. You will need GPIO LIB API on CPM2 to use the modem control lines, but the cpm_uart driver will fall back to the current behaviour if no GPIO LIB support is present.

> > [PATCH] cpm_uart: Support uart_wait_until_sent()
> > 	http://patchwork.ozlabs.org/linuxppc/patch?person=968&id=19233
> 
> 
> applied

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussee de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-02  7:42     ` Kumar Gala
@ 2008-07-02 12:35       ` Jochen Friedrich
  2008-07-02 15:10         ` Kumar Gala
  0 siblings, 1 reply; 23+ messages in thread
From: Jochen Friedrich @ 2008-07-02 12:35 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras

Hi Kumar,

>> any chance to get this one into 2.6.27?
>>
>> [POWERPC] Add i2c pins to dts and board setup
>>  http://patchwork.ozlabs.org/linuxppc/patch?person=1023&id=18603
> 
> Will we always want defconfig updates to enable the driver?

Good question. Maybe not, as the i2c bus seems to be unused on these
boards unless someone connects some i2c devices.

I'll resubmit just the booting-without-of part then.

Thanks,
Jochen

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: Commits added to powerpc.git master and powerpc-next branches
  2008-07-02 12:35       ` Jochen Friedrich
@ 2008-07-02 15:10         ` Kumar Gala
  0 siblings, 0 replies; 23+ messages in thread
From: Kumar Gala @ 2008-07-02 15:10 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: linuxppc-dev, Paul Mackerras


On Jul 2, 2008, at 7:35 AM, Jochen Friedrich wrote:

> Hi Kumar,
>
>>> any chance to get this one into 2.6.27?
>>>
>>> [POWERPC] Add i2c pins to dts and board setup
>>> http://patchwork.ozlabs.org/linuxppc/patch?person=1023&id=18603
>>
>> Will we always want defconfig updates to enable the driver?
>
> Good question. Maybe not, as the i2c bus seems to be unused on these
> boards unless someone connects some i2c devices.
>
> I'll resubmit just the booting-without-of part then.

Actually, if that's the case I'd prefer to leave the patch is as and  
just make a note about the fact that the I2C bus isn't connected to  
anything on the board in the commit message.  The code is a good  
example of setting everything else up and I'd like to have that in the  
tree.

- k

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-07-02 15:10 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01  0:20 Commits added to powerpc.git master and powerpc-next branches Paul Mackerras
2008-07-01  1:27 ` Paul Mackerras
2008-07-01  1:45   ` Benjamin Herrenschmidt
2008-07-01  2:30     ` Josh Boyer
2008-07-01  2:44       ` Benjamin Herrenschmidt
2008-07-01  4:05         ` Kumar Gala
2008-07-01  2:01   ` Paul Mackerras
2008-07-01  4:01 ` [PATCH 0/2] powerpc: Update VSX support Michael Neuling
2008-07-01  4:01   ` [PATCH 2/2] powerpc: Update for VSX core file and ptrace Michael Neuling
2008-07-01  4:01   ` [PATCH 1/2] powerpc: Fix compile error for CONFIG_VSX Michael Neuling
2008-07-01  4:51     ` Michael Neuling
2008-07-01  7:00 ` [PATCH] powerpc: fix compile warning in init_thread Michael Neuling
2008-07-01  9:07   ` Benjamin Herrenschmidt
2008-07-01 11:02     ` Michael Neuling
2008-07-01  8:49 ` Commits added to powerpc.git master and powerpc-next branches Laurent Pinchart
2008-07-01 15:54   ` Jochen Friedrich
2008-07-02  7:42     ` Kumar Gala
2008-07-02 12:35       ` Jochen Friedrich
2008-07-02 15:10         ` Kumar Gala
2008-07-02  7:41   ` Kumar Gala
2008-07-02  8:41     ` Laurent Pinchart
2008-07-02  1:56 ` [PATCH] powerpc: cleanup copy_to/from_user for vsx and fpr Michael Neuling
2008-07-02  4:06   ` Michael Neuling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).