linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Lijun Pan <ljp@linux.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Lijun Pan <ljp@linux.ibm.com>
Subject: [RFC] powerpc/pseries/hcall: remove the save/restore of CR
Date: Thu, 26 Sep 2019 22:48:46 -0500	[thread overview]
Message-ID: <20190927034846.73066-1-ljp@linux.ibm.com> (raw)

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


             reply	other threads:[~2019-09-27  3:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  3:48 Lijun Pan [this message]
2019-09-27 18:48 ` [RFC] powerpc/pseries/hcall: remove the save/restore of CR Paul Clarke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190927034846.73066-1-ljp@linux.ibm.com \
    --to=ljp@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).