From: Janosch Frank <frankja@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com,
nrb@linux.ibm.com
Subject: [kvm-unit-tests RFC 2/2] lib: s390x: css: Name inline assembly arguments and clean them up
Date: Thu, 1 Feb 2024 14:23:56 +0000 [thread overview]
Message-ID: <20240201142356.534783-3-frankja@linux.ibm.com> (raw)
In-Reply-To: <20240201142356.534783-1-frankja@linux.ibm.com>
Less need to count the operands makes the code easier to read.
For ssch and msch the second addr argument which was unused was removed.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
lib/s390x/css.h | 76 ++++++++++++++++++++++++-------------------------
1 file changed, 38 insertions(+), 38 deletions(-)
diff --git a/lib/s390x/css.h b/lib/s390x/css.h
index 504b3f14..e4311124 100644
--- a/lib/s390x/css.h
+++ b/lib/s390x/css.h
@@ -135,11 +135,11 @@ static inline int ssch(unsigned long schid, struct orb *addr)
int cc;
asm volatile(
- " ssch 0(%2)\n"
- " ipm %0\n"
- " srl %0,28\n"
- : "=d" (cc)
- : "d" (reg1), "a" (addr), "m" (*addr)
+ " ssch 0(%[addr])\n"
+ " ipm %[cc]\n"
+ " srl %[cc],28\n"
+ : [cc] "=d" (cc)
+ : "d" (reg1), [addr] "a" (addr)
: "cc", "memory");
return cc;
}
@@ -152,11 +152,11 @@ static inline int stsch(unsigned long schid, struct schib *addr)
asm volatile(
" tmll %[bogus_cc],3\n"
- " stsch 0(%3)\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc), "=m" (*addr)
- : "d" (reg1), "a" (addr), [bogus_cc] "d" (bogus_cc)
+ " stsch 0(%[addr])\n"
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc), "=m" (*addr)
+ : "d" (reg1), [addr] "a" (addr), [bogus_cc] "d" (bogus_cc)
: "cc");
return cc;
}
@@ -167,11 +167,11 @@ static inline int msch(unsigned long schid, struct schib *addr)
int cc;
asm volatile(
- " msch 0(%3)\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc)
- : "d" (reg1), "m" (*addr), "a" (addr)
+ " msch 0(%[addr])\n"
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc)
+ : "d" (reg1), [addr] "a" (addr)
: "cc");
return cc;
}
@@ -184,11 +184,11 @@ static inline int tsch(unsigned long schid, struct irb *addr)
asm volatile(
" tmll %[bogus_cc],3\n"
- " tsch 0(%3)\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc), "=m" (*addr)
- : "d" (reg1), "a" (addr), [bogus_cc] "d" (bogus_cc)
+ " tsch 0(%[addr])\n"
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc), "=m" (*addr)
+ : "d" (reg1), [addr] "a" (addr), [bogus_cc] "d" (bogus_cc)
: "cc");
return cc;
}
@@ -200,9 +200,9 @@ static inline int hsch(unsigned long schid)
asm volatile(
" hsch\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc)
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc)
: "d" (reg1)
: "cc");
return cc;
@@ -215,9 +215,9 @@ static inline int xsch(unsigned long schid)
asm volatile(
" xsch\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc)
+ " ipm %[cc]\n"
+ " srl %cc,28"
+ : [cc] "=d" (cc)
: "d" (reg1)
: "cc");
return cc;
@@ -230,9 +230,9 @@ static inline int csch(unsigned long schid)
asm volatile(
" csch\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc)
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc)
: "d" (reg1)
: "cc");
return cc;
@@ -245,9 +245,9 @@ static inline int rsch(unsigned long schid)
asm volatile(
" rsch\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc)
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc)
: "d" (reg1)
: "cc");
return cc;
@@ -262,9 +262,9 @@ static inline int rchp(unsigned long chpid)
asm volatile(
" tmll %[bogus_cc],3\n"
" rchp\n"
- " ipm %0\n"
- " srl %0,28"
- : "=d" (cc)
+ " ipm %[cc]\n"
+ " srl %[cc],28"
+ : [cc] "=d" (cc)
: "d" (reg1), [bogus_cc] "d" (bogus_cc)
: "cc");
return cc;
@@ -369,9 +369,9 @@ static inline int _chsc(void *p)
int cc;
asm volatile(" .insn rre,0xb25f0000,%2,0\n"
- " ipm %0\n"
- " srl %0,28\n"
- : "=d" (cc), "=m" (p)
+ " ipm %[cc]\n"
+ " srl %[cc],28\n"
+ : [cc] "=d" (cc), "=m" (p)
: "d" (p), "m" (p)
: "cc");
--
2.40.1
next prev parent reply other threads:[~2024-02-01 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 14:23 [kvm-unit-tests RFC 0/2] lib: s390x: Inline asm cleanup Janosch Frank
2024-02-01 14:23 ` [kvm-unit-tests RFC 1/2] lib: s390x: sigp: Name inline assembly arguments Janosch Frank
2024-02-01 17:52 ` Claudio Imbrenda
2024-02-01 14:23 ` Janosch Frank [this message]
2024-04-22 7:43 ` [kvm-unit-tests RFC 2/2] lib: s390x: css: Name inline assembly arguments and clean them up Nico Boehr
2024-04-22 10:57 ` Heiko Carstens
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=20240201142356.534783-3-frankja@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=david@redhat.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=thuth@redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).