]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bugzilla 423021 - PPC: Add missing ISA 3.0 documentation link and HWCAPS test.
authorCarl Love <cel@us.ibm.com>
Mon, 15 Jun 2020 16:31:16 +0000 (11:31 -0500)
committerCarl Love <cel@us.ibm.com>
Mon, 15 Jun 2020 18:39:19 +0000 (13:39 -0500)
Add the check for the PPC_FEATURE2_ARCH_3_00 setting in the HWCAP2 string.

Add the information on where to find the public IBM ISA 3.0B document.

NEWS
coregrind/m_initimg/initimg-linux.c

diff --git a/NEWS b/NEWS
index e23c449166787355d2f2def5d5e5bb30980cbb10..0ffcb5bf9f522317f6e2191f6d5402f44d1ff281 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,7 @@ where XXXXXX is the bug number as listed below.
 345077  linux syscall execveat support (linux 3.19)
 n-i-bz  helgrind: If hg_cli__realloc fails, return NULL.
 
+423021  PPC:  Add missing ISA 3.0 documentation link and HWCAPS test.
 
 
 Release 3.16.1 (?? June 2020)
index bab8aeca0f9f3c3ec1328b410363964b5f33b12d..e811ff667d600d637f233cac3b2659f1ae9c4252 100644 (file)
@@ -720,6 +720,8 @@ Addr setup_client_stack( void*  init_sp,
 #        if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
          case AT_HWCAP2:  {
             Bool auxv_2_07, hw_caps_2_07;
+            Bool auxv_3_0, hw_caps_3_0;
+
            /* The HWCAP2 field may contain an arch_2_07 entry that indicates
              * if the processor is compliant with the 2.07 ISA. (i.e. Power 8
              * or beyond).  The Valgrind vai.hwcaps value
@@ -752,7 +754,27 @@ Addr setup_client_stack( void*  init_sp,
             * matches the setting in VEX HWCAPS.
             */
             vg_assert(auxv_2_07 == hw_caps_2_07);
-            }
+
+            /*  Power ISA version 3.0B
+                March 29, 2017
+                https://ibm.ent.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv
+
+                https://openpowerfoundation.org/technical/resource-catalog/
+                http://openpowerfoundation.org/wp-content/uploads/resources/leabi/leabi-20170510.pdf
+                64-bit ELF V2 ABI specification for Power.  HWCAP2 bit pattern
+                for ISA 3.0, page 112.
+
+            */
+            /* ISA 3.0 */
+            auxv_3_0 = (auxv->u.a_val & 0x00800000ULL) == 0x00800000ULL;
+            hw_caps_3_0 = (vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA3_0)
+               == VEX_HWCAPS_PPC64_ISA3_0;
+
+            /* Verify the PPC_FEATURE2_ARCH_3_00 setting in HWCAP2
+            * matches the setting in VEX HWCAPS.
+            */
+            vg_assert(auxv_3_0 == hw_caps_3_0);
+         }
 
             break;
 #           endif