Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/cpuinfo: show facilities as reported by stfle

Add a new line to /proc/cpuinfo which shows all available facilities
as reported by the stfle instruction:

> cat /proc/cpuinfo
...
facilities : 0 1 2 3 4 6 7 ...
...

Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
157467ba 09214545

+14
+14
arch/s390/kernel/processor.c
··· 7 7 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 8 8 9 9 #include <linux/cpufeature.h> 10 + #include <linux/bitops.h> 10 11 #include <linux/kernel.h> 11 12 #include <linux/sched/mm.h> 12 13 #include <linux/init.h> ··· 92 91 } 93 92 EXPORT_SYMBOL(cpu_have_feature); 94 93 94 + static void show_facilities(struct seq_file *m) 95 + { 96 + unsigned int bit; 97 + long *facilities; 98 + 99 + facilities = (long *)&S390_lowcore.stfle_fac_list; 100 + seq_puts(m, "facilities :"); 101 + for_each_set_bit_inv(bit, facilities, MAX_FACILITY_BIT) 102 + seq_printf(m, " %d", bit); 103 + seq_putc(m, '\n'); 104 + } 105 + 95 106 static void show_cpu_summary(struct seq_file *m, void *v) 96 107 { 97 108 static const char *hwcap_str[] = { ··· 129 116 if (int_hwcap_str[i] && (int_hwcap & (1UL << i))) 130 117 seq_printf(m, "%s ", int_hwcap_str[i]); 131 118 seq_puts(m, "\n"); 119 + show_facilities(m); 132 120 show_cacheinfo(m); 133 121 for_each_online_cpu(cpu) { 134 122 struct cpuid *id = &per_cpu(cpu_info.cpu_id, cpu);