Commit 37b27bd5 authored by Heiko Carstens's avatar Heiko Carstens Committed by Kleber Sacilotto de Souza

s390/cpuinfo: show facilities as reported by stfle

BugLink: http://bugs.launchpad.net/bugs/1744736

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: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
(back ported from commit 157467ba)
Signed-off-by: default avatarJoseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 346aaf21
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
#define KMSG_COMPONENT "cpu" #define KMSG_COMPONENT "cpu"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/bitops.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <asm/diag.h> #include <asm/diag.h>
#include <asm/facility.h>
#include <asm/elf.h> #include <asm/elf.h>
#include <asm/lowcore.h> #include <asm/lowcore.h>
#include <asm/param.h> #include <asm/param.h>
...@@ -52,6 +54,18 @@ int cpu_have_feature(unsigned int num) ...@@ -52,6 +54,18 @@ int cpu_have_feature(unsigned int num)
} }
EXPORT_SYMBOL(cpu_have_feature); EXPORT_SYMBOL(cpu_have_feature);
static void show_facilities(struct seq_file *m)
{
unsigned int bit;
long *facilities;
facilities = (long *)&S390_lowcore.stfle_fac_list;
seq_puts(m, "facilities :");
for_each_set_bit_inv(bit, facilities, MAX_FACILITY_BIT)
seq_printf(m, " %d", bit);
seq_putc(m, '\n');
}
/* /*
* show_cpuinfo - Get information on one CPU for use by procfs. * show_cpuinfo - Get information on one CPU for use by procfs.
*/ */
...@@ -76,6 +90,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -76,6 +90,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
if (hwcap_str[i] && (elf_hwcap & (1UL << i))) if (hwcap_str[i] && (elf_hwcap & (1UL << i)))
seq_printf(m, "%s ", hwcap_str[i]); seq_printf(m, "%s ", hwcap_str[i]);
seq_puts(m, "\n"); seq_puts(m, "\n");
show_facilities(m);
show_cacheinfo(m); show_cacheinfo(m);
} }
get_online_cpus(); get_online_cpus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment