]> www.infradead.org Git - nvme.git/commit
s390: Use inline qualifier for all EX_TABLE and ALTERNATIVE inline assemblies
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 17 Mar 2025 15:22:35 +0000 (16:22 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 18 Mar 2025 16:13:51 +0000 (17:13 +0100)
commit0dafe9968ac7c78c67ee6bb2d970d413fb493b95
tree59330732deed22efe980035096e3c26e6e4887b2
parentcaa3cd5ccd016cb28294e2b7e21fe08831e9a877
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>
20 files changed:
arch/s390/boot/ipl_parm.c
arch/s390/boot/physmem_info.c
arch/s390/boot/startup.c
arch/s390/include/asm/cpu_mf.h
arch/s390/include/asm/diag.h
arch/s390/include/asm/processor.h
arch/s390/include/asm/uaccess.h
arch/s390/include/asm/word-at-a-time.h
arch/s390/kernel/cert_store.c
arch/s390/kernel/diag/diag.c
arch/s390/kernel/ipl.c
arch/s390/kernel/traps.c
arch/s390/mm/pfault.c
arch/s390/pci/pci_clp.c
arch/s390/pci/pci_insn.c
arch/s390/pci/pci_mmio.c
drivers/s390/block/dasd_diag.c
drivers/s390/char/diag_ftp.c
drivers/s390/char/sclp.h
drivers/s390/cio/ioasm.c