1 From b208108638c4bd3215792415944467c36f5dfd97 Mon Sep 17 00:00:00 2001
2 From: David Hildenbrand <david@redhat.com>
3 Date: Mon, 3 May 2021 14:12:44 +0200
4 Subject: s390: fix detection of vector enhancements facility 1 vs. vector packed decimal facility
6 From: David Hildenbrand <david@redhat.com>
8 commit b208108638c4bd3215792415944467c36f5dfd97 upstream.
11 134: The vector packed decimal facility is installed in the
12 z/Architecture architectural mode. When bit 134 is
13 one, bit 129 is also one.
14 135: The vector enhancements facility 1 is installed in
15 the z/Architecture architectural mode. When bit 135
16 is one, bit 129 is also one.
18 Looks like we confuse the vector enhancements facility 1 ("EXT") with the
19 Vector packed decimal facility ("BCD"). Let's fix the facility checks.
21 Detected while working on QEMU/tcg z14 support and only unlocking
22 the vector enhancements facility 1, but not the vector packed decimal
25 Fixes: 2583b848cad0 ("s390: report new vector facilities")
26 Cc: Vasily Gorbik <gor@linux.ibm.com>
27 Signed-off-by: David Hildenbrand <david@redhat.com>
28 Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
29 Reviewed-by: Cornelia Huck <cohuck@redhat.com>
30 Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
31 Link: https://lore.kernel.org/r/20210503121244.25232-1-david@redhat.com
32 Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
33 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35 arch/s390/kernel/setup.c | 4 ++--
36 1 file changed, 2 insertions(+), 2 deletions(-)
38 --- a/arch/s390/kernel/setup.c
39 +++ b/arch/s390/kernel/setup.c
40 @@ -937,9 +937,9 @@ static int __init setup_hwcaps(void)
42 elf_hwcap |= HWCAP_S390_VXRS;
43 if (test_facility(134))
44 - elf_hwcap |= HWCAP_S390_VXRS_EXT;
45 - if (test_facility(135))
46 elf_hwcap |= HWCAP_S390_VXRS_BCD;
47 + if (test_facility(135))
48 + elf_hwcap |= HWCAP_S390_VXRS_EXT;
49 if (test_facility(148))
50 elf_hwcap |= HWCAP_S390_VXRS_EXT2;
51 if (test_facility(152))