All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary
@ 2011-03-30 22:00 Scott Wood
  2011-03-31  6:21 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offse Kumar Gala
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Scott Wood @ 2011-03-30 22:00 UTC (permalink / raw)
  To: kvm-ppc

This allows reuse for saving/restoring KVM SPE state.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
v4 of patchset, first version of this patch

Kumar, please ack (or comment).

 arch/powerpc/include/asm/ppc_asm.h   |   28 ++++++++++++++++------------
 arch/powerpc/kernel/head_fsl_booke.S |    6 +++---
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 9821006..ba0cd33 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -150,18 +150,22 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 #define REST_16VSRSU(n,b,base)	REST_8VSRSU(n,b,base); REST_8VSRSU(n+8,b,base)
 #define REST_32VSRSU(n,b,base)	REST_16VSRSU(n,b,base); REST_16VSRSU(n+16,b,base)
 
-#define SAVE_EVR(n,s,base)	evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base)
-#define SAVE_2EVRS(n,s,base)	SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base)
-#define SAVE_4EVRS(n,s,base)	SAVE_2EVRS(n,s,base); SAVE_2EVRS(n+2,s,base)
-#define SAVE_8EVRS(n,s,base)	SAVE_4EVRS(n,s,base); SAVE_4EVRS(n+4,s,base)
-#define SAVE_16EVRS(n,s,base)	SAVE_8EVRS(n,s,base); SAVE_8EVRS(n+8,s,base)
-#define SAVE_32EVRS(n,s,base)	SAVE_16EVRS(n,s,base); SAVE_16EVRS(n+16,s,base)
-#define REST_EVR(n,s,base)	lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n
-#define REST_2EVRS(n,s,base)	REST_EVR(n,s,base); REST_EVR(n+1,s,base)
-#define REST_4EVRS(n,s,base)	REST_2EVRS(n,s,base); REST_2EVRS(n+2,s,base)
-#define REST_8EVRS(n,s,base)	REST_4EVRS(n,s,base); REST_4EVRS(n+4,s,base)
-#define REST_16EVRS(n,s,base)	REST_8EVRS(n,s,base); REST_8EVRS(n+8,s,base)
-#define REST_32EVRS(n,s,base)	REST_16EVRS(n,s,base); REST_16EVRS(n+16,s,base)
+/*
+ * b = base register for addressing, o = base offset from register of 1st EVR
+ * n = first EVR, s = scratch
+ */
+#define SAVE_EVR(n,s,b,o)	evmergehi s,s,n; stw s,o+4*(n)(b)
+#define SAVE_2EVRS(n,s,b,o)	SAVE_EVR(n,s,b,o); SAVE_EVR(n+1,s,b,o)
+#define SAVE_4EVRS(n,s,b,o)	SAVE_2EVRS(n,s,b,o); SAVE_2EVRS(n+2,s,b,o)
+#define SAVE_8EVRS(n,s,b,o)	SAVE_4EVRS(n,s,b,o); SAVE_4EVRS(n+4,s,b,o)
+#define SAVE_16EVRS(n,s,b,o)	SAVE_8EVRS(n,s,b,o); SAVE_8EVRS(n+8,s,b,o)
+#define SAVE_32EVRS(n,s,b,o)	SAVE_16EVRS(n,s,b,o); SAVE_16EVRS(n+16,s,b,o)
+#define REST_EVR(n,s,b,o)	lwz s,o+4*(n)(b); evmergelo n,s,n
+#define REST_2EVRS(n,s,b,o)	REST_EVR(n,s,b,o); REST_EVR(n+1,s,b,o)
+#define REST_4EVRS(n,s,b,o)	REST_2EVRS(n,s,b,o); REST_2EVRS(n+2,s,b,o)
+#define REST_8EVRS(n,s,b,o)	REST_4EVRS(n,s,b,o); REST_4EVRS(n+4,s,b,o)
+#define REST_16EVRS(n,s,b,o)	REST_8EVRS(n,s,b,o); REST_8EVRS(n+8,s,b,o)
+#define REST_32EVRS(n,s,b,o)	REST_16EVRS(n,s,b,o); REST_16EVRS(n+16,s,b,o)
 
 /* Macros to adjust thread priority for hardware multithreading */
 #define HMT_VERY_LOW	or	31,31,31	# very low priority
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index b84fc5e..e234153 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -656,7 +656,7 @@ load_up_spe:
 	cmpi	0,r4,0
 	beq	1f
 	addi	r4,r4,THREAD	/* want THREAD of last_task_used_spe */
-	SAVE_32EVRS(0,r10,r4)
+	SAVE_32EVRS(0,r10,r4,THREAD_EVR0)
 	evxor	evr10, evr10, evr10	/* clear out evr10 */
 	evmwumiaa evr10, evr10, evr10	/* evr10 <- ACC = 0 * 0 + ACC */
 	li	r5,THREAD_ACC
@@ -676,7 +676,7 @@ load_up_spe:
 	stw	r4,THREAD_USED_SPE(r5)
 	evlddx	evr4,r10,r5
 	evmra	evr4,evr4
-	REST_32EVRS(0,r10,r5)
+	REST_32EVRS(0,r10,r5,THREAD_EVR0)
 #ifndef CONFIG_SMP
 	subi	r4,r5,THREAD
 	stw	r4,last_task_used_spe@l(r3)
@@ -787,7 +787,7 @@ _GLOBAL(giveup_spe)
 	addi	r3,r3,THREAD		/* want THREAD of task */
 	lwz	r5,PT_REGS(r3)
 	cmpi	0,r5,0
-	SAVE_32EVRS(0, r4, r3)
+	SAVE_32EVRS(0, r4, r3, THREAD_EVR0)
 	evxor	evr6, evr6, evr6	/* clear out evr6 */
 	evmwumiaa evr6, evr6, evr6	/* evr6 <- ACC = 0 * 0 + ACC */
 	li	r4,THREAD_ACC
-- 
1.7.1



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

* Re: [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offse
  2011-03-30 22:00 [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary Scott Wood
@ 2011-03-31  6:21 ` Kumar Gala
  2011-04-01 18:46 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register Scott Wood
  2011-04-05 14:57 ` Alexander Graf
  2 siblings, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2011-03-31  6:21 UTC (permalink / raw)
  To: kvm-ppc


On Mar 30, 2011, at 5:00 PM, Scott Wood wrote:

> This allows reuse for saving/restoring KVM SPE state.

Can you update commit comment to include a little about how we accomplish that.  (something about the macro change is all I'm looking for)

[otherwise ACK]

> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> v4 of patchset, first version of this patch
> 
> Kumar, please ack (or comment).
> 
> arch/powerpc/include/asm/ppc_asm.h   |   28 ++++++++++++++++------------
> arch/powerpc/kernel/head_fsl_booke.S |    6 +++---
> 2 files changed, 19 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
> index 9821006..ba0cd33 100644
> --- a/arch/powerpc/include/asm/ppc_asm.h
> +++ b/arch/powerpc/include/asm/ppc_asm.h
> @@ -150,18 +150,22 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
> #define REST_16VSRSU(n,b,base)	REST_8VSRSU(n,b,base); REST_8VSRSU(n+8,b,base)
> #define REST_32VSRSU(n,b,base)	REST_16VSRSU(n,b,base); REST_16VSRSU(n+16,b,base)
> 
> -#define SAVE_EVR(n,s,base)	evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base)
> -#define SAVE_2EVRS(n,s,base)	SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base)
> -#define SAVE_4EVRS(n,s,base)	SAVE_2EVRS(n,s,base); SAVE_2EVRS(n+2,s,base)
> -#define SAVE_8EVRS(n,s,base)	SAVE_4EVRS(n,s,base); SAVE_4EVRS(n+4,s,base)
> -#define SAVE_16EVRS(n,s,base)	SAVE_8EVRS(n,s,base); SAVE_8EVRS(n+8,s,base)
> -#define SAVE_32EVRS(n,s,base)	SAVE_16EVRS(n,s,base); SAVE_16EVRS(n+16,s,base)
> -#define REST_EVR(n,s,base)	lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n
> -#define REST_2EVRS(n,s,base)	REST_EVR(n,s,base); REST_EVR(n+1,s,base)
> -#define REST_4EVRS(n,s,base)	REST_2EVRS(n,s,base); REST_2EVRS(n+2,s,base)
> -#define REST_8EVRS(n,s,base)	REST_4EVRS(n,s,base); REST_4EVRS(n+4,s,base)
> -#define REST_16EVRS(n,s,base)	REST_8EVRS(n,s,base); REST_8EVRS(n+8,s,base)
> -#define REST_32EVRS(n,s,base)	REST_16EVRS(n,s,base); REST_16EVRS(n+16,s,base)
> +/*
> + * b = base register for addressing, o = base offset from register of 1st EVR
> + * n = first EVR, s = scratch
> + */
> +#define SAVE_EVR(n,s,b,o)	evmergehi s,s,n; stw s,o+4*(n)(b)
> +#define SAVE_2EVRS(n,s,b,o)	SAVE_EVR(n,s,b,o); SAVE_EVR(n+1,s,b,o)
> +#define SAVE_4EVRS(n,s,b,o)	SAVE_2EVRS(n,s,b,o); SAVE_2EVRS(n+2,s,b,o)
> +#define SAVE_8EVRS(n,s,b,o)	SAVE_4EVRS(n,s,b,o); SAVE_4EVRS(n+4,s,b,o)
> +#define SAVE_16EVRS(n,s,b,o)	SAVE_8EVRS(n,s,b,o); SAVE_8EVRS(n+8,s,b,o)
> +#define SAVE_32EVRS(n,s,b,o)	SAVE_16EVRS(n,s,b,o); SAVE_16EVRS(n+16,s,b,o)
> +#define REST_EVR(n,s,b,o)	lwz s,o+4*(n)(b); evmergelo n,s,n
> +#define REST_2EVRS(n,s,b,o)	REST_EVR(n,s,b,o); REST_EVR(n+1,s,b,o)
> +#define REST_4EVRS(n,s,b,o)	REST_2EVRS(n,s,b,o); REST_2EVRS(n+2,s,b,o)
> +#define REST_8EVRS(n,s,b,o)	REST_4EVRS(n,s,b,o); REST_4EVRS(n+4,s,b,o)
> +#define REST_16EVRS(n,s,b,o)	REST_8EVRS(n,s,b,o); REST_8EVRS(n+8,s,b,o)
> +#define REST_32EVRS(n,s,b,o)	REST_16EVRS(n,s,b,o); REST_16EVRS(n+16,s,b,o)
> 
> /* Macros to adjust thread priority for hardware multithreading */
> #define HMT_VERY_LOW	or	31,31,31	# very low priority
> diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
> index b84fc5e..e234153 100644
> --- a/arch/powerpc/kernel/head_fsl_booke.S
> +++ b/arch/powerpc/kernel/head_fsl_booke.S
> @@ -656,7 +656,7 @@ load_up_spe:
> 	cmpi	0,r4,0
> 	beq	1f
> 	addi	r4,r4,THREAD	/* want THREAD of last_task_used_spe */
> -	SAVE_32EVRS(0,r10,r4)
> +	SAVE_32EVRS(0,r10,r4,THREAD_EVR0)
> 	evxor	evr10, evr10, evr10	/* clear out evr10 */
> 	evmwumiaa evr10, evr10, evr10	/* evr10 <- ACC = 0 * 0 + ACC */
> 	li	r5,THREAD_ACC
> @@ -676,7 +676,7 @@ load_up_spe:
> 	stw	r4,THREAD_USED_SPE(r5)
> 	evlddx	evr4,r10,r5
> 	evmra	evr4,evr4
> -	REST_32EVRS(0,r10,r5)
> +	REST_32EVRS(0,r10,r5,THREAD_EVR0)
> #ifndef CONFIG_SMP
> 	subi	r4,r5,THREAD
> 	stw	r4,last_task_used_spe@l(r3)
> @@ -787,7 +787,7 @@ _GLOBAL(giveup_spe)
> 	addi	r3,r3,THREAD		/* want THREAD of task */
> 	lwz	r5,PT_REGS(r3)
> 	cmpi	0,r5,0
> -	SAVE_32EVRS(0, r4, r3)
> +	SAVE_32EVRS(0, r4, r3, THREAD_EVR0)
> 	evxor	evr6, evr6, evr6	/* clear out evr6 */
> 	evmwumiaa evr6, evr6, evr6	/* evr6 <- ACC = 0 * 0 + ACC */
> 	li	r4,THREAD_ACC
> -- 
> 1.7.1
> 
> _______________________________________________
> linuxppc-release mailing list
> linuxppc-release@linux.freescale.net
> http://linux.freescale.net/mailman/listinfo/linuxppc-release


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

* Re: [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register
  2011-03-30 22:00 [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary Scott Wood
  2011-03-31  6:21 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offse Kumar Gala
@ 2011-04-01 18:46 ` Scott Wood
  2011-04-05 14:57 ` Alexander Graf
  2 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2011-04-01 18:46 UTC (permalink / raw)
  To: kvm-ppc

On Thu, 31 Mar 2011 01:21:18 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:

> 
> On Mar 30, 2011, at 5:00 PM, Scott Wood wrote:
> 
> > This allows reuse for saving/restoring KVM SPE state.
> 
> Can you update commit comment to include a little about how we accomplish that.  (something about the macro change is all I'm looking for)
> 
> [otherwise ACK]

Is this OK:

    powerpc/e500: SPE register saving: take arbitrary struct offset

    Previously, these macros hardcoded THREAD_EVR0 as the base of the save
    area, relative to the base register passed.  This base offset is now
    passed as a separate macro parameter, allowing reuse with other SPE
    save areas, such as used by KVM.

Also, any comment on http://patchwork.ozlabs.org/patch/88677/?

-scott


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

* Re: [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register
  2011-03-30 22:00 [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary Scott Wood
  2011-03-31  6:21 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offse Kumar Gala
  2011-04-01 18:46 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register Scott Wood
@ 2011-04-05 14:57 ` Alexander Graf
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2011-04-05 14:57 UTC (permalink / raw)
  To: kvm-ppc

On 04/01/2011 08:46 PM, Scott Wood wrote:
> On Thu, 31 Mar 2011 01:21:18 -0500
> Kumar Gala<galak@kernel.crashing.org>  wrote:
>
>> On Mar 30, 2011, at 5:00 PM, Scott Wood wrote:
>>
>>> This allows reuse for saving/restoring KVM SPE state.
>> Can you update commit comment to include a little about how we accomplish that.  (something about the macro change is all I'm looking for)
>>
>> [otherwise ACK]
> Is this OK:
>
>      powerpc/e500: SPE register saving: take arbitrary struct offset
>
>      Previously, these macros hardcoded THREAD_EVR0 as the base of the save
>      area, relative to the base register passed.  This base offset is now
>      passed as a separate macro parameter, allowing reuse with other SPE
>      save areas, such as used by KVM.
>
> Also, any comment on http://patchwork.ozlabs.org/patch/88677/?

Kumar, ping?


Alex


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

end of thread, other threads:[~2011-04-05 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30 22:00 [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary Scott Wood
2011-03-31  6:21 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register saving: take arbitrary struct offse Kumar Gala
2011-04-01 18:46 ` [linuxppc-release] [PATCH v4 2/4] powerpc/e500: SPE register Scott Wood
2011-04-05 14:57 ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.