Skip to content

Commit 157467b

Browse files
heicarstMartin Schwidefsky
authored andcommitted
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>
1 parent 0921454 commit 157467b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎arch/s390/kernel/processor.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
88

99
#include <linux/cpufeature.h>
10+
#include <linux/bitops.h>
1011
#include <linux/kernel.h>
1112
#include <linux/sched/mm.h>
1213
#include <linux/init.h>
@@ -91,6 +92,18 @@ int cpu_have_feature(unsigned int num)
9192
}
9293
EXPORT_SYMBOL(cpu_have_feature);
9394

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+
94107
static void show_cpu_summary(struct seq_file *m, void *v)
95108
{
96109
static const char *hwcap_str[] = {
@@ -116,6 +129,7 @@ static void show_cpu_summary(struct seq_file *m, void *v)
116129
if (int_hwcap_str[i] && (int_hwcap & (1UL << i)))
117130
seq_printf(m, "%s ", int_hwcap_str[i]);
118131
seq_puts(m, "\n");
132+
show_facilities(m);
119133
show_cacheinfo(m);
120134
for_each_online_cpu(cpu) {
121135
struct cpuid *id = &per_cpu(cpu_info.cpu_id, cpu);

0 commit comments

Comments
 (0)