Skip to content

Commit 488253c

Browse files
Andreas KrebbelMartin Schwidefsky
authored andcommitted
[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: Andreas Krebbel <krebbel@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 7e9b580 commit 488253c

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎arch/s390/kernel/processor.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ void __cpuinit print_cpu_info(void)
3131

3232
static int show_cpuinfo(struct seq_file *m, void *v)
3333
{
34-
static const char *hwcap_str[8] = {
34+
static const char *hwcap_str[9] = {
3535
"esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp",
36-
"edat"
36+
"edat", "etf3eh"
3737
};
3838
struct _lowcore *lc;
3939
unsigned long n = (unsigned long) v - 1;
@@ -48,7 +48,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
4848
num_online_cpus(), loops_per_jiffy/(500000/HZ),
4949
(loops_per_jiffy/(5000/HZ))%100);
5050
seq_puts(m, "features\t: ");
51-
for (i = 0; i < 8; i++)
51+
for (i = 0; i < 9; i++)
5252
if (hwcap_str[i] && (elf_hwcap & (1UL << i)))
5353
seq_printf(m, "%s ", hwcap_str[i]);
5454
seq_puts(m, "\n");

‎arch/s390/kernel/setup.c‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,15 +696,22 @@ static void __init setup_hwcaps(void)
696696
* Bit 17: the message-security assist is installed
697697
* Bit 19: the long-displacement facility is installed
698698
* Bit 21: the extended-immediate facility is installed
699+
* Bit 22: extended-translation facility 3 is installed
700+
* Bit 30: extended-translation facility 3 enhancement facility
699701
* These get translated to:
700702
* HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1,
701703
* HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3,
702-
* HWCAP_S390_LDISP bit 4, and HWCAP_S390_EIMM bit 5.
704+
* HWCAP_S390_LDISP bit 4, HWCAP_S390_EIMM bit 5 and
705+
* HWCAP_S390_ETF3EH bit 8 (22 && 30).
703706
*/
704707
for (i = 0; i < 6; i++)
705708
if (facility_list & (1UL << (31 - stfl_bits[i])))
706709
elf_hwcap |= 1UL << i;
707710

711+
if ((facility_list & (1UL << (31 - 22)))
712+
&& (facility_list & (1UL << (31 - 30))))
713+
elf_hwcap |= 1UL << 8;
714+
708715
/*
709716
* Check for additional facilities with store-facility-list-extended.
710717
* stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0
@@ -716,12 +723,12 @@ static void __init setup_hwcaps(void)
716723
* Bit 42: decimal floating point facility is installed
717724
* Bit 44: perform floating point operation facility is installed
718725
* translated to:
719-
* HWCAP_S390_DFP bit 6.
726+
* HWCAP_S390_DFP bit 6 (42 && 44).
720727
*/
721728
if ((elf_hwcap & (1UL << 2)) &&
722729
__stfle(&facility_list_extended, 1) > 0) {
723730
if ((facility_list_extended & (1ULL << (63 - 42)))
724-
&& (facility_list_extended & (1ULL << (63 - 44))))
731+
&& (facility_list_extended & (1ULL << (63 - 44))))
725732
elf_hwcap |= 1UL << 6;
726733
}
727734

0 commit comments

Comments
 (0)