diff options
| author | Heiko Carstens <hca@linux.ibm.com> | 2025-02-07 15:48:52 +0100 |
|---|---|---|
| committer | Vasily Gorbik <gor@linux.ibm.com> | 2025-03-04 17:18:05 +0100 |
| commit | 5643195f2626bc7391720b77d9f7c9b068f4fbe0 (patch) | |
| tree | 20a19eb1894d0bca15c1e2d82092e5e54a0d433c /arch/s390/kernel/sysinfo.c | |
| parent | s390/cpufeature: Convert MACHINE_HAS_TLB_LC to cpu_has_tlb_lc() (diff) | |
| download | linux-5643195f2626bc7391720b77d9f7c9b068f4fbe0.tar.gz linux-5643195f2626bc7391720b77d9f7c9b068f4fbe0.zip | |
s390/cpufeature: Convert MACHINE_HAS_TOPOLOGY to cpu_has_topology()
Convert MACHINE_HAS_... to cpu_has_...() which uses test_facility() instead
of testing the machine_flags lowcore member if the feature is present.
test_facility() generates better code since it results in a static branch
without accessing memory. The branch is patched via alternatives by the
decompressor depending on the availability of the required facility.
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/sysinfo.c')
| -rw-r--r-- | arch/s390/kernel/sysinfo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index 88055f58fbda..a74154c6529e 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c @@ -5,6 +5,7 @@ * Martin Schwidefsky <schwidefsky@de.ibm.com>, */ +#include <linux/cpufeature.h> #include <linux/debugfs.h> #include <linux/kernel.h> #include <linux/mm.h> @@ -154,7 +155,7 @@ static void stsi_15_1_x(struct seq_file *m, struct sysinfo_15_1_x *info) int i; seq_putc(m, '\n'); - if (!MACHINE_HAS_TOPOLOGY) + if (!cpu_has_topology()) return; if (stsi(info, 15, 1, topology_max_mnest)) return; @@ -559,7 +560,7 @@ static __init int stsi_init_debugfs(void) sf = &stsi_file[i]; debugfs_create_file(sf->name, 0400, stsi_root, NULL, sf->fops); } - if (IS_ENABLED(CONFIG_SCHED_TOPOLOGY) && MACHINE_HAS_TOPOLOGY) { + if (IS_ENABLED(CONFIG_SCHED_TOPOLOGY) && cpu_has_topology()) { char link_to[10]; sprintf(link_to, "15_1_%d", topology_mnest_limit()); |
