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