Subject: [RFC] powerpc/pseries/hcall: remove the save/restore of CR

From: Lijun Pan <[email-masked]>
Date: Thu, 26 Sep 2019 22:48:46 -0500

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 <[email-masked]>
---
 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