linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [RFC] powerpc/pseries/hcall: remove the save/restore of CR
@ 2019-09-27  3:48 Lijun Pan
  2019-09-27 18:48 ` Paul Clarke
  0 siblings, 1 reply; 2+ messages in thread
From: Lijun Pan @ 2019-09-27  3:48 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Lijun Pan

According to the PAPR, hcalls should not modify the Condition
Register fields, hence save/restore the CR is not necessary.

Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/hvCall.S | 36 -------------------------
 1 file changed, 36 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index 2136e42833af..b26a79331994 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -105,13 +105,9 @@ END_FTR_SECTION(0, 1);						\
 _GLOBAL_TOC(plpar_hcall_norets)
 	HMT_MEDIUM
 
-	mfcr	r0
-	stw	r0,8(r1)
 	HCALL_BRANCH(plpar_hcall_norets_trace)
 	HVSC				/* invoke the hypervisor */
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
 	blr				/* return r3 = status */
 
 #ifdef CONFIG_TRACEPOINTS
@@ -119,17 +115,12 @@ plpar_hcall_norets_trace:
 	HCALL_INST_PRECALL(R4)
 	HVSC
 	HCALL_INST_POSTCALL_NORETS
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
 	blr
 #endif
 
 _GLOBAL_TOC(plpar_hcall)
 	HMT_MEDIUM
 
-	mfcr	r0
-	stw	r0,8(r1)
-
 	HCALL_BRANCH(plpar_hcall_trace)
 
 	std     r4,STK_PARAM(R4)(r1)     /* Save ret buffer */
@@ -149,9 +140,6 @@ _GLOBAL_TOC(plpar_hcall)
 	std	r6, 16(r12)
 	std	r7, 24(r12)
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
-
 	blr				/* return r3 = status */
 
 #ifdef CONFIG_TRACEPOINTS
@@ -178,9 +166,6 @@ plpar_hcall_trace:
 
 	HCALL_INST_POSTCALL(r12)
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
-
 	blr
 #endif
 
@@ -193,9 +178,6 @@ plpar_hcall_trace:
 _GLOBAL(plpar_hcall_raw)
 	HMT_MEDIUM
 
-	mfcr	r0
-	stw	r0,8(r1)
-
 	std     r4,STK_PARAM(R4)(r1)     /* Save ret buffer */
 
 	mr	r4,r5
@@ -213,17 +195,11 @@ _GLOBAL(plpar_hcall_raw)
 	std	r6, 16(r12)
 	std	r7, 24(r12)
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
-
 	blr				/* return r3 = status */
 
 _GLOBAL_TOC(plpar_hcall9)
 	HMT_MEDIUM
 
-	mfcr	r0
-	stw	r0,8(r1)
-
 	HCALL_BRANCH(plpar_hcall9_trace)
 
 	std     r4,STK_PARAM(R4)(r1)     /* Save ret buffer */
@@ -252,9 +228,6 @@ _GLOBAL_TOC(plpar_hcall9)
 	std	r11,56(r12)
 	std	r0, 64(r12)
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
-
 	blr				/* return r3 = status */
 
 #ifdef CONFIG_TRACEPOINTS
@@ -290,9 +263,6 @@ plpar_hcall9_trace:
 
 	HCALL_INST_POSTCALL(r12)
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
-
 	blr
 #endif
 
@@ -300,9 +270,6 @@ plpar_hcall9_trace:
 _GLOBAL(plpar_hcall9_raw)
 	HMT_MEDIUM
 
-	mfcr	r0
-	stw	r0,8(r1)
-
 	std     r4,STK_PARAM(R4)(r1)     /* Save ret buffer */
 
 	mr	r4,r5
@@ -329,7 +296,4 @@ _GLOBAL(plpar_hcall9_raw)
 	std	r11,56(r12)
 	std	r0, 64(r12)
 
-	lwz	r0,8(r1)
-	mtcrf	0xff,r0
-
 	blr				/* return r3 = status */
-- 
2.22.0


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

* Re: [RFC] powerpc/pseries/hcall: remove the save/restore of CR
  2019-09-27  3:48 [RFC] powerpc/pseries/hcall: remove the save/restore of CR Lijun Pan
@ 2019-09-27 18:48 ` Paul Clarke
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Clarke @ 2019-09-27 18:48 UTC (permalink / raw)
  To: Lijun Pan, linuxppc-dev

On 9/26/19 10:48 PM, Lijun Pan wrote:
> According to the PAPR, hcalls should not modify the Condition
> Register fields, hence save/restore the CR is not necessary.

Just curious: could you provide a more specific reference?

PC

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

end of thread, other threads:[~2019-09-27 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27  3:48 [RFC] powerpc/pseries/hcall: remove the save/restore of CR Lijun Pan
2019-09-27 18:48 ` Paul Clarke

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).