diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2015-02-24 09:54:47 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-11-30 06:47:11 -0500 |
commit | 7f16d7e787b731d9db273b822b4b8069102e57a6 (patch) | |
tree | 0012fd4f28ccb75065f5da8b40dd8235b790665d | |
parent | 8dfd523f8523779210038264259546299a8398e9 (diff) |
s390: show virtualization support in /proc/cpuinfo
This patch exposes the SIE capability (aka virtualization support) via
/proc/cpuinfo -> "features" as "sie".
As we don't want to expose this hwcap via elf, let's add a second,
"internal"/non-elf capability list. The content is simply concatenated
to the existing features when printing /proc/cpuinfo.
We also add the defines to elf.h to keep the hwcap stuff at a common
place.
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/elf.h | 7 | ||||
-rw-r--r-- | arch/s390/kernel/processor.c | 6 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 9 |
3 files changed, 22 insertions, 0 deletions
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index bab6739a1154..08e34a5dc909 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h | |||
@@ -104,6 +104,9 @@ | |||
104 | #define HWCAP_S390_TE 1024 | 104 | #define HWCAP_S390_TE 1024 |
105 | #define HWCAP_S390_VXRS 2048 | 105 | #define HWCAP_S390_VXRS 2048 |
106 | 106 | ||
107 | /* Internal bits, not exposed via elf */ | ||
108 | #define HWCAP_INT_SIE 1UL | ||
109 | |||
107 | /* | 110 | /* |
108 | * These are used to set parameters in the core dumps. | 111 | * These are used to set parameters in the core dumps. |
109 | */ | 112 | */ |
@@ -169,6 +172,10 @@ extern unsigned int vdso_enabled; | |||
169 | extern unsigned long elf_hwcap; | 172 | extern unsigned long elf_hwcap; |
170 | #define ELF_HWCAP (elf_hwcap) | 173 | #define ELF_HWCAP (elf_hwcap) |
171 | 174 | ||
175 | /* Internal hardware capabilities, not exposed via elf */ | ||
176 | |||
177 | extern unsigned long int_hwcap; | ||
178 | |||
172 | /* This yields a string that ld.so will use to load implementation | 179 | /* This yields a string that ld.so will use to load implementation |
173 | specific libraries for optimization. This is more specific in | 180 | specific libraries for optimization. This is more specific in |
174 | intent than poking at uname or /proc/cpuinfo. | 181 | intent than poking at uname or /proc/cpuinfo. |
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 7ce00e7a709a..647128d5b983 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -61,6 +61,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
61 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | 61 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
62 | "edat", "etf3eh", "highgprs", "te", "vx" | 62 | "edat", "etf3eh", "highgprs", "te", "vx" |
63 | }; | 63 | }; |
64 | static const char * const int_hwcap_str[] = { | ||
65 | "sie" | ||
66 | }; | ||
64 | unsigned long n = (unsigned long) v - 1; | 67 | unsigned long n = (unsigned long) v - 1; |
65 | int i; | 68 | int i; |
66 | 69 | ||
@@ -75,6 +78,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
75 | for (i = 0; i < ARRAY_SIZE(hwcap_str); i++) | 78 | for (i = 0; i < ARRAY_SIZE(hwcap_str); i++) |
76 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | 79 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
77 | seq_printf(m, "%s ", hwcap_str[i]); | 80 | seq_printf(m, "%s ", hwcap_str[i]); |
81 | for (i = 0; i < ARRAY_SIZE(int_hwcap_str); i++) | ||
82 | if (int_hwcap_str[i] && (int_hwcap & (1UL << i))) | ||
83 | seq_printf(m, "%s ", int_hwcap_str[i]); | ||
78 | seq_puts(m, "\n"); | 84 | seq_puts(m, "\n"); |
79 | show_cacheinfo(m); | 85 | show_cacheinfo(m); |
80 | } | 86 | } |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index c837bcacf218..dc83ae66a730 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -80,6 +80,8 @@ EXPORT_SYMBOL(console_irq); | |||
80 | unsigned long elf_hwcap __read_mostly = 0; | 80 | unsigned long elf_hwcap __read_mostly = 0; |
81 | char elf_platform[ELF_PLATFORM_SIZE]; | 81 | char elf_platform[ELF_PLATFORM_SIZE]; |
82 | 82 | ||
83 | unsigned long int_hwcap = 0; | ||
84 | |||
83 | int __initdata memory_end_set; | 85 | int __initdata memory_end_set; |
84 | unsigned long __initdata memory_end; | 86 | unsigned long __initdata memory_end; |
85 | unsigned long __initdata max_physmem_end; | 87 | unsigned long __initdata max_physmem_end; |
@@ -793,6 +795,13 @@ static int __init setup_hwcaps(void) | |||
793 | strcpy(elf_platform, "z13"); | 795 | strcpy(elf_platform, "z13"); |
794 | break; | 796 | break; |
795 | } | 797 | } |
798 | |||
799 | /* | ||
800 | * Virtualization support HWCAP_INT_SIE is bit 0. | ||
801 | */ | ||
802 | if (sclp.has_sief2) | ||
803 | int_hwcap |= HWCAP_INT_SIE; | ||
804 | |||
796 | return 0; | 805 | return 0; |
797 | } | 806 | } |
798 | arch_initcall(setup_hwcaps); | 807 | arch_initcall(setup_hwcaps); |