|
From: Carl E. L. <ce...@us...> - 2015-03-17 20:42:21
|
Julian:
We had a bug reported against valgrind because the AT_DCACHEBSIZE was
not being passed to the user application. The following patch adds the
AT_DCACHEBSIZE and HWCAP2 to the recognized aux vector entries for PPC64
LE and BE. I am not very familiar with the aux vector stuff so I would
like to get an additional review of the patch.
If an aux vector value is not know, the default is to suppress it. I
was wondering why? I am also wondering if there is something somewhere
else that I am missing when enabling these entries. I didn't find
anything. Also, as noted in the comment, it would be good to verify the
valgrind hwcaps has the 2_07 flag set. I don't see an easy way to do
that, any thoughts on that? Thanks.
Carl Love
---------------------------------------------------------------------
Index: coregrind/m_initimg/initimg-linux.c
===================================================================
--- coregrind/m_initimg/initimg-linux.c (revision 15017)
+++ coregrind/m_initimg/initimg-linux.c (working copy)
@@ -246,6 +246,10 @@
/*=== Setting up the client's stack ===*/
/*====================================================================*/
+#ifndef AT_DCACHEBSIZE
+#define AT_DCACHEBSIZE 19
+#endif /* AT_DCACHEBSIZE */
+
#ifndef AT_ICACHEBSIZE
#define AT_ICACHEBSIZE 20
#endif /* AT_ICACHEBSIZE */
@@ -262,6 +266,10 @@
#define AT_RANDOM 25
#endif /* AT_RANDOM */
+#ifndef AT_HWCAP2
+#define AT_HWCAP2 26
+#endif /* AT_HWCAP2 */
+
#ifndef AT_EXECFN
#define AT_EXECFN 31
#endif /* AT_EXECFN */
@@ -690,8 +698,25 @@
}
# endif
break;
+# if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux)
+ case AT_HWCAP2:
+ /* Do not squash this value for PPC64. The HWCAP2 value has
+ * the entry arch_2_07 which indicates the processor is a
+ * Power 8 or beyond. The Valgrind vai.hwcaps variable
+ * (coregrind/m_machine.c) has the VEX_HWCAPS_PPC64_ISA2_07
+ * flag set so Valgrind knows about Power8. Need to pass the
+ * HWCAP2 value along so the user level programs can detect that
+ * the processor supports ISA 2.07 and beyond.
+ */
+ /* Would be nice to verify that vai.hwcaps has
+ * VEX_HWCAPS_PPC64_ISA2_07 set. Not sure how to access vai.hwcaps
+ * from here.
+ */
+ break;
+# endif
case AT_ICACHEBSIZE:
+ case AT_DCACHEBSIZE:
case AT_UCACHEBSIZE:
# if defined(VGP_ppc32_linux)
/* acquire cache info */
|