6c0556
From f2e06656d04a9fcb0603802a4f8ce7aa3a1f055e Mon Sep 17 00:00:00 2001
6c0556
From: Stefan Liebler <stli@linux.ibm.com>
6c0556
Date: Tue, 5 Oct 2021 16:14:10 +0200
6c0556
Subject: [PATCH] S390: Add PCI_MIO and SIE HWCAPs
6c0556
6c0556
Both new HWCAPs were introduced in these kernel commits:
6c0556
- 7e8403ecaf884f307b627f3c371475913dd29292
6c0556
  "s390: add HWCAP_S390_PCI_MIO to ELF hwcaps"
6c0556
- 7e82523f2583e9813e4109df3656707162541297
6c0556
  "s390/hwcaps: make sie capability regular hwcap"
6c0556
6c0556
Also note that the kernel commit 511ad531afd4090625def4d9aba1f5227bd44b8e
6c0556
"s390/hwcaps: shorten HWCAP defines" has shortened the prefix of the macros
6c0556
from "HWCAP_S390_" to "HWCAP_".  For compatibility reasons, we do not
6c0556
change the prefix in public glibc header file.
6c0556
---
6c0556
 sysdeps/s390/dl-procinfo.c                | 4 ++--
6c0556
 sysdeps/s390/dl-procinfo.h                | 4 +++-
6c0556
 sysdeps/unix/sysv/linux/s390/bits/hwcap.h | 7 +++++++
6c0556
 3 files changed, 12 insertions(+), 3 deletions(-)
6c0556
6c0556
diff --git a/sysdeps/s390/dl-procinfo.c b/sysdeps/s390/dl-procinfo.c
6c0556
index 7314c31b15..97be34fe9d 100644
6c0556
--- a/sysdeps/s390/dl-procinfo.c
6c0556
+++ b/sysdeps/s390/dl-procinfo.c
6c0556
@@ -45,13 +45,13 @@
6c0556
 #if !defined PROCINFO_DECL && defined SHARED
6c0556
   ._dl_s390_cap_flags
6c0556
 #else
6c0556
-PROCINFO_CLASS const char _dl_s390_cap_flags[21][9]
6c0556
+PROCINFO_CLASS const char _dl_s390_cap_flags[23][9]
6c0556
 #endif
6c0556
 #ifndef PROCINFO_DECL
6c0556
 = {
6c0556
      "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", "edat", "etf3eh",
6c0556
      "highgprs", "te", "vx", "vxd", "vxe", "gs", "vxe2", "vxp", "sort", "dflt",
6c0556
-     "vxp2", "nnpa"
6c0556
+     "vxp2", "nnpa", "pcimio", "sie"
6c0556
   }
6c0556
 #endif
6c0556
 #if !defined SHARED || defined PROCINFO_DECL
6c0556
diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
6c0556
index 2502dd2604..d9a3b264ff 100644
6c0556
--- a/sysdeps/s390/dl-procinfo.h
6c0556
+++ b/sysdeps/s390/dl-procinfo.h
6c0556
@@ -20,7 +20,7 @@
6c0556
 #define _DL_PROCINFO_H	1
6c0556
 #include <ldsodefs.h>
6c0556
 
6c0556
-#define _DL_HWCAP_COUNT 21
6c0556
+#define _DL_HWCAP_COUNT 23
6c0556
 
6c0556
 #define _DL_PLATFORMS_COUNT	10
6c0556
 
6c0556
@@ -62,6 +62,8 @@ enum
6c0556
   HWCAP_S390_DFLT = 1 << 18,
6c0556
   HWCAP_S390_VXRS_PDE2 = 1 << 19,
6c0556
   HWCAP_S390_NNPA = 1 << 20,
6c0556
+  HWCAP_S390_PCI_MIO = 1 << 21,
6c0556
+  HWCAP_S390_SIE = 1 << 22,
6c0556
 };
6c0556
 
6c0556
 #define HWCAP_IMPORTANT (HWCAP_S390_ZARCH | HWCAP_S390_LDISP \
6c0556
diff --git a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
6c0556
index e9bd3684db..00e73a3e3b 100644
6c0556
--- a/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
6c0556
+++ b/sysdeps/unix/sysv/linux/s390/bits/hwcap.h
6c0556
@@ -22,6 +22,11 @@
6c0556
 
6c0556
 /*
6c0556
  * The following must match the kernels asm/elf.h.
6c0556
+ * Note: The kernel commit 511ad531afd4090625def4d9aba1f5227bd44b8e
6c0556
+ * "s390/hwcaps: shorten HWCAP defines" has shortened the prefix of the macros
6c0556
+ * from "HWCAP_S390_" to "HWCAP_".  For compatibility reasons, we do not
6c0556
+ * change the prefix in public glibc header file.
6c0556
+ *
6c0556
  * Note that these are *not* the same as the STORE FACILITY LIST bits.
6c0556
  */
6c0556
 #define HWCAP_S390_ESAN3        1
6c0556
@@ -48,3 +53,5 @@
6c0556
 #define HWCAP_S390_DFLT         262144
6c0556
 #define HWCAP_S390_VXRS_PDE2    524288
6c0556
 #define HWCAP_S390_NNPA         1048576
6c0556
+#define HWCAP_S390_PCI_MIO      2097152
6c0556
+#define HWCAP_S390_SIE          4194304
6c0556
-- 
6c0556
2.31.1
6c0556