diff options
author | 2025-03-17 16:22:35 +0100 | |
---|---|---|
committer | 2025-03-18 17:13:51 +0100 | |
commit | 0dafe9968ac7c78c67ee6bb2d970d413fb493b95 (patch) | |
tree | 59330732deed22efe980035096e3c26e6e4887b2 /drivers | |
parent | s390/kfence: Split kfence pool into 4k mappings in arch_kfence_init_pool() (diff) | |
download | wireguard-linux-0dafe9968ac7c78c67ee6bb2d970d413fb493b95.tar.xz wireguard-linux-0dafe9968ac7c78c67ee6bb2d970d413fb493b95.zip |
s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies
Use asm_inline for all inline assemblies which make use of the EX_TABLE or
ALTERNATIVE macros.
These macros expand to many lines and the compiler assumes the number of
lines within an inline assembly is the same as the number of instructions
within an inline assembly. This has an effect on inlining and loop
unrolling decisions.
In order to avoid incorrect assumptions use asm_inline, which tells the
compiler that an inline assembly has the smallest possible size.
In order to avoid confusion when asm_inline should be used or not, since a
couple of inline assemblies are quite large: the rule is to always use
asm_inline whenever the EX_TABLE or ALTERNATIVE macro is used. In specific
cases there may be reasons to not follow this guideline, but that should
be documented with the corresponding code.
Using the inline qualifier everywhere has only a small effect on the kernel
image size:
add/remove: 0/10 grow/shrink: 19/8 up/down: 1492/-1858 (-366)
The only location where this seems to matter is load_unaligned_zeropad()
from word-at-a-time.h where the compiler inlines more functions within the
dcache code, which is indeed code where performance matters.
Suggested-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Juergen Christ <jchrist@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/block/dasd_diag.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/diag_ftp.c | 2 | ||||
-rw-r--r-- | drivers/s390/char/sclp.h | 2 | ||||
-rw-r--r-- | drivers/s390/cio/ioasm.c | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index 8b39803cf94c..56f1af8a7ddd 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -76,7 +76,7 @@ static inline int __dia250(void *iob, int cmd) } addr_type; exception = 1; - asm volatile( + asm_inline volatile( " diag %[rx],%[cmd],0x250\n" "0: lhi %[exc],0\n" "1:\n" diff --git a/drivers/s390/char/diag_ftp.c b/drivers/s390/char/diag_ftp.c index 9418a9270d03..711f6982438e 100644 --- a/drivers/s390/char/diag_ftp.c +++ b/drivers/s390/char/diag_ftp.c @@ -106,7 +106,7 @@ static int diag_ftp_2c4(struct diag_ftp_ldfpl *fpl, int rc; diag_stat_inc(DIAG_STAT_X2C4); - asm volatile( + asm_inline volatile( " diag %[addr],%[cmd],0x2c4\n" "0: j 2f\n" "1: la %[rc],%[err]\n" diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h index f7ca6e2f6d18..b31a680e0871 100644 --- a/drivers/s390/char/sclp.h +++ b/drivers/s390/char/sclp.h @@ -318,7 +318,7 @@ static inline int sclp_service_call(sclp_cmdw_t command, void *sccb) int cc, exception; exception = 1; - asm volatile( + asm_inline volatile( "0: .insn rre,0xb2200000,%[cmd],%[sccb]\n" /* servc */ "1: lhi %[exc],0\n" "2:\n" diff --git a/drivers/s390/cio/ioasm.c b/drivers/s390/cio/ioasm.c index 5ff1e51cddf3..a540045b64a6 100644 --- a/drivers/s390/cio/ioasm.c +++ b/drivers/s390/cio/ioasm.c @@ -22,7 +22,7 @@ static inline int __stsch(struct subchannel_id schid, struct schib *addr) int ccode, exception; exception = 1; - asm volatile( + asm_inline volatile( " lgr 1,%[r1]\n" " stsch %[addr]\n" "0: lhi %[exc],0\n" @@ -52,7 +52,7 @@ static inline int __msch(struct subchannel_id schid, struct schib *addr) int ccode, exception; exception = 1; - asm volatile( + asm_inline volatile( " lgr 1,%[r1]\n" " msch %[addr]\n" "0: lhi %[exc],0\n" @@ -106,7 +106,7 @@ static inline int __ssch(struct subchannel_id schid, union orb *addr) int ccode, exception; exception = 1; - asm volatile( + asm_inline volatile( " lgr 1,%[r1]\n" " ssch %[addr]\n" "0: lhi %[exc],0\n" @@ -178,7 +178,7 @@ int chsc(void *chsc_area) int cc, exception; exception = 1; - asm volatile( + asm_inline volatile( " .insn rre,0xb25f0000,%[chsc_area],0\n" "0: lhi %[exc],0\n" "1:\n" |