Commit 488253ce authored by Andreas Krebbel's avatar Andreas Krebbel Committed by Martin Schwidefsky

[S390] Add hwcap flag for the etf3 enhancement facility

The Extended Translation Facility 3 (ETF3) added instructions which
allow conversions between different unicode character maps (UTF-8,
UTF-32 ...).  These instructions got enhanced with a later version of
the ETF3 allowing malformed multibyte chars to be recognized and
reported correctly.  The attached patch reserves bit 8 in the elf
hwcaps vector for the enhanced version of ETF3. The bit corresponds to
the stfle bits 22 and 30 and will only be set if both of the stfle
bits are set.
Signed-off-by: default avatarAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 7e9b580e
...@@ -31,9 +31,9 @@ void __cpuinit print_cpu_info(void) ...@@ -31,9 +31,9 @@ void __cpuinit print_cpu_info(void)
static int show_cpuinfo(struct seq_file *m, void *v) static int show_cpuinfo(struct seq_file *m, void *v)
{ {
static const char *hwcap_str[8] = { static const char *hwcap_str[9] = {
"esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp",
"edat" "edat", "etf3eh"
}; };
struct _lowcore *lc; struct _lowcore *lc;
unsigned long n = (unsigned long) v - 1; unsigned long n = (unsigned long) v - 1;
...@@ -48,7 +48,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -48,7 +48,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
num_online_cpus(), loops_per_jiffy/(500000/HZ), num_online_cpus(), loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ))%100); (loops_per_jiffy/(5000/HZ))%100);
seq_puts(m, "features\t: "); seq_puts(m, "features\t: ");
for (i = 0; i < 8; i++) for (i = 0; i < 9; i++)
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");
......
...@@ -696,15 +696,22 @@ static void __init setup_hwcaps(void) ...@@ -696,15 +696,22 @@ static void __init setup_hwcaps(void)
* Bit 17: the message-security assist is installed * Bit 17: the message-security assist is installed
* Bit 19: the long-displacement facility is installed * Bit 19: the long-displacement facility is installed
* Bit 21: the extended-immediate facility is installed * Bit 21: the extended-immediate facility is installed
* Bit 22: extended-translation facility 3 is installed
* Bit 30: extended-translation facility 3 enhancement facility
* These get translated to: * These get translated to:
* HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1, * HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1,
* HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3, * HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3,
* HWCAP_S390_LDISP bit 4, and HWCAP_S390_EIMM bit 5. * HWCAP_S390_LDISP bit 4, HWCAP_S390_EIMM bit 5 and
* HWCAP_S390_ETF3EH bit 8 (22 && 30).
*/ */
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
if (facility_list & (1UL << (31 - stfl_bits[i]))) if (facility_list & (1UL << (31 - stfl_bits[i])))
elf_hwcap |= 1UL << i; elf_hwcap |= 1UL << i;
if ((facility_list & (1UL << (31 - 22)))
&& (facility_list & (1UL << (31 - 30))))
elf_hwcap |= 1UL << 8;
/* /*
* Check for additional facilities with store-facility-list-extended. * Check for additional facilities with store-facility-list-extended.
* stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0 * stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0
...@@ -716,7 +723,7 @@ static void __init setup_hwcaps(void) ...@@ -716,7 +723,7 @@ static void __init setup_hwcaps(void)
* Bit 42: decimal floating point facility is installed * Bit 42: decimal floating point facility is installed
* Bit 44: perform floating point operation facility is installed * Bit 44: perform floating point operation facility is installed
* translated to: * translated to:
* HWCAP_S390_DFP bit 6. * HWCAP_S390_DFP bit 6 (42 && 44).
*/ */
if ((elf_hwcap & (1UL << 2)) && if ((elf_hwcap & (1UL << 2)) &&
__stfle(&facility_list_extended, 1) > 0) { __stfle(&facility_list_extended, 1) > 0) {
......
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