diff mbox series

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

Message ID 20190927034846.73066-1-ljp@linux.ibm.com (mailing list archive)
State New
Headers show
Series [RFC] powerpc/pseries/hcall: remove the save/restore of CR | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch next (6edfc6487b474fe01857dc3f1a9cd701bb9b21c8)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 108 lines checked

Commit Message

Lijun Pan Sept. 27, 2019, 3:48 a.m. UTC
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(-)

Comments

Paul A. Clarke Sept. 27, 2019, 6:48 p.m. UTC | #1
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
diff mbox series

Patch

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 */