diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2017-02-25 06:16:48 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-03-22 03:29:02 -0400 |
commit | 157467ba9fb7e379f0540707dd89111de441e45e (patch) | |
tree | 774aec87c3e1bec2982ae69ce879b7edc8a11cdd | |
parent | 09214545c4a40943ecb6cedc511cd4bd709c85a6 (diff) |
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>
-rw-r--r-- | arch/s390/kernel/processor.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index c73709869447..778cd6536175 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 7 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
8 | 8 | ||
9 | #include <linux/cpufeature.h> | 9 | #include <linux/cpufeature.h> |
10 | #include <linux/bitops.h> | ||
10 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
11 | #include <linux/sched/mm.h> | 12 | #include <linux/sched/mm.h> |
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
@@ -91,6 +92,18 @@ int cpu_have_feature(unsigned int num) | |||
91 | } | 92 | } |
92 | EXPORT_SYMBOL(cpu_have_feature); | 93 | EXPORT_SYMBOL(cpu_have_feature); |
93 | 94 | ||
95 | static void show_facilities(struct seq_file *m) | ||
96 | { | ||
97 | unsigned int bit; | ||
98 | long *facilities; | ||
99 | |||
100 | facilities = (long *)&S390_lowcore.stfle_fac_list; | ||
101 | seq_puts(m, "facilities :"); | ||
102 | for_each_set_bit_inv(bit, facilities, MAX_FACILITY_BIT) | ||
103 | seq_printf(m, " %d", bit); | ||
104 | seq_putc(m, '\n'); | ||
105 | } | ||
106 | |||
94 | static void show_cpu_summary(struct seq_file *m, void *v) | 107 | static void show_cpu_summary(struct seq_file *m, void *v) |
95 | { | 108 | { |
96 | static const char *hwcap_str[] = { | 109 | static const char *hwcap_str[] = { |
@@ -116,6 +129,7 @@ static void show_cpu_summary(struct seq_file *m, void *v) | |||
116 | if (int_hwcap_str[i] && (int_hwcap & (1UL << i))) | 129 | if (int_hwcap_str[i] && (int_hwcap & (1UL << i))) |
117 | seq_printf(m, "%s ", int_hwcap_str[i]); | 130 | seq_printf(m, "%s ", int_hwcap_str[i]); |
118 | seq_puts(m, "\n"); | 131 | seq_puts(m, "\n"); |
132 | show_facilities(m); | ||
119 | show_cacheinfo(m); | 133 | show_cacheinfo(m); |
120 | for_each_online_cpu(cpu) { | 134 | for_each_online_cpu(cpu) { |
121 | struct cpuid *id = &per_cpu(cpu_info.cpu_id, cpu); | 135 | struct cpuid *id = &per_cpu(cpu_info.cpu_id, cpu); |