You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(30) |
2
(8) |
3
(5) |
4
(5) |
|
5
(3) |
6
(9) |
7
(5) |
8
(14) |
9
(17) |
10
(27) |
11
(10) |
|
12
(6) |
13
(10) |
14
(7) |
15
(16) |
16
(9) |
17
(14) |
18
(8) |
|
19
(5) |
20
(13) |
21
(21) |
22
(13) |
23
(4) |
24
(1) |
25
(4) |
|
26
(2) |
27
(7) |
28
(4) |
29
(5) |
30
(12) |
|
|
|
From: Florian K. <fl...@ei...> - 2015-04-18 18:30:24
|
I noticed that the do_clone function in syswrap-tilegx-linux.c
does its own stack guessing and registration instead of using
the generic ML_(guess_and_register_stack) function which is
used by all other archs for that purpose. If at all possible
we should strive to use the generic code unless there is a *really*
good reason not to..
Looking at your code I see some subtle differences and am wondering
whether those are correct:
tilegx code:
ctst->client_stack_highest_byte = (Addr) VG_PGROUNDUP (sp);
ctst->client_stack_szB = ctst->client_stack_highest_byte - seg->start;
generic code:
tst->client_stack_highest_byte = (Addr)VG_PGROUNDUP(sp)-1;
tst->client_stack_szB = tst->client_stack_highest_byte - seg->start + 1;
That looks like an off-by-one error to me. Could you elaborate?
I'm thinking about the patch below.
Florian
Index: coregrind/m_syswrap/syswrap-tilegx-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-tilegx-linux.c (revision 15111)
+++ coregrind/m_syswrap/syswrap-tilegx-linux.c (working copy)
@@ -337,7 +337,6 @@
ThreadState * ctst = VG_ (get_ThreadState) (ctid);
Long ret = 0;
Long * stack;
- NSegment const *seg;
SysRes res;
vki_sigset_t blockall, savedmask;
@@ -372,23 +371,8 @@
See #226116. */
ctst->os_state.threadgroup = ptst->os_state.threadgroup;
- seg = VG_ (am_find_nsegment) ((Addr) sp);
+ ML_(guess_and_register_stack) (sp, ctst);
- if (seg && seg->kind != SkResvn) {
- ctst->client_stack_highest_byte = (Addr) VG_PGROUNDUP (sp);
- ctst->client_stack_szB = ctst->client_stack_highest_byte - seg->start;
- VG_ (register_stack) (seg->start, ctst->client_stack_highest_byte);
- if (debug)
- VG_ (printf) ("tid %d: guessed client stack range %#lx-%#lx\n",
-
- ctid, seg->start, VG_PGROUNDUP (sp));
- } else {
- VG_ (message) (Vg_UserMsg,
- "!? New thread %d starts with sp+%#lx) unmapped\n",
- ctid, sp);
- ctst->client_stack_szB = 0;
- }
-
VG_TRACK (pre_thread_ll_create, ptid, ctid);
if (flags & VKI_CLONE_SETTLS) {
if (debug)
|
|
From: <sv...@va...> - 2015-04-18 17:45:42
|
Author: florian
Date: Sat Apr 18 18:45:34 2015
New Revision: 15111
Log:
Remove a few unneeded header files.
Modified:
trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
trunk/coregrind/m_syswrap/syswrap-arm-linux.c
trunk/coregrind/m_syswrap/syswrap-arm64-linux.c
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-linux-variants.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/m_syswrap/syswrap-main.c
trunk/coregrind/m_syswrap/syswrap-mips32-linux.c
trunk/coregrind/m_syswrap/syswrap-mips64-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
trunk/coregrind/m_syswrap/syswrap-s390x-linux.c
trunk/coregrind/m_syswrap/syswrap-tilegx-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-darwin.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
trunk/coregrind/m_syswrap/syswrap-xen.c
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-darwin.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "config.h" // DARWIN_VERS
#include "pub_core_basics.h"
#include "pub_core_vki.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_xarray.h"
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-amd64-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -49,7 +48,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-arm-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-arm-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-arm-linux.c Sat Apr 18 18:45:34 2015
@@ -35,7 +35,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -51,7 +50,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "pub_core_transtab.h" // VG_(discard_translations)
#include "priv_types_n_macros.h"
Modified: trunk/coregrind/m_syswrap/syswrap-arm64-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-arm64-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-arm64-linux.c Sat Apr 18 18:45:34 2015
@@ -33,29 +33,22 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
-//ZZ #include "pub_core_debuglog.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
-//ZZ #include "pub_core_libcproc.h"
#include "pub_core_libcsignal.h"
#include "pub_core_options.h"
#include "pub_core_scheduler.h"
#include "pub_core_sigframe.h" // For VG_(sigframe_destroy)()
-//ZZ #include "pub_core_signals.h"
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
-//ZZ #include "pub_core_transtab.h" // VG_(discard_translations)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
#include "priv_syswrap-linux.h" /* for decls of linux-ish wrappers */
-//ZZ #include "priv_syswrap-main.h"
/* ---------------------------------------------------------------------
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_xarray.h"
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c Sat Apr 18 18:45:34 2015
@@ -35,7 +35,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
#include "pub_core_aspacemgr.h"
Modified: trunk/coregrind/m_syswrap/syswrap-linux-variants.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux-variants.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux-variants.c Sat Apr 18 18:45:34 2015
@@ -48,7 +48,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-main.c Sat Apr 18 18:45:34 2015
@@ -34,7 +34,6 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
Modified: trunk/coregrind/m_syswrap/syswrap-mips32-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-mips32-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-mips32-linux.c Sat Apr 18 18:45:34 2015
@@ -32,7 +32,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -48,7 +47,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "pub_core_transtab.h" // VG_(discard_translations)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-mips64-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-mips64-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-mips64-linux.c Sat Apr 18 18:45:34 2015
@@ -32,7 +32,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" /* to keep _threadstate.h happy */
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -48,7 +47,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" /* VG_(register_stack) */
#include "pub_core_transtab.h" /* VG_(discard_translations) */
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -49,7 +48,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -49,7 +48,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-s390x-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-s390x-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-s390x-linux.c Sat Apr 18 18:45:34 2015
@@ -34,7 +34,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -51,7 +50,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-tilegx-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-tilegx-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-tilegx-linux.c Sat Apr 18 18:45:34 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
Modified: trunk/coregrind/m_syswrap/syswrap-x86-darwin.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-darwin.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-x86-darwin.c Sat Apr 18 18:45:34 2015
@@ -32,7 +32,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_xarray.h"
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-x86-linux.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c Sat Apr 18 18:45:34 2015
@@ -38,7 +38,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuglog.h"
@@ -55,7 +54,6 @@
#include "pub_core_syscall.h"
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
-#include "pub_core_stacks.h" // VG_(register_stack)
#include "priv_types_n_macros.h"
#include "priv_syswrap-generic.h" /* for decls of generic wrappers */
Modified: trunk/coregrind/m_syswrap/syswrap-xen.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-xen.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-xen.c Sat Apr 18 18:45:34 2015
@@ -34,7 +34,6 @@
#if defined(ENABLE_XEN)
#include "pub_core_vkiscnums.h"
-#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_debuginfo.h" // VG_(di_notify_*)
|
|
From: <sv...@va...> - 2015-04-18 17:41:38
|
Author: florian
Date: Sat Apr 18 18:41:31 2015
New Revision: 15110
Log:
Fix a comment.
Modified:
trunk/coregrind/pub_core_threadstate.h
Modified: trunk/coregrind/pub_core_threadstate.h
==============================================================================
--- trunk/coregrind/pub_core_threadstate.h (original)
+++ trunk/coregrind/pub_core_threadstate.h Sat Apr 18 18:41:31 2015
@@ -42,7 +42,7 @@
#include "pub_tool_threadstate.h"
#include "pub_core_libcsetjmp.h" // VG_MINIMAL_JMP_BUF
#include "pub_core_vki.h" // vki_sigset_t
-#include "pub_core_guest.h" // VexGuestAMD64State etc.
+#include "pub_core_guest.h" // VexGuestArchState
#include "libvex.h" // LibVEX_N_SPILL_BYTES
|
|
From: Florian K. <fl...@ei...> - 2015-04-18 10:47:29
|
On 17.04.2015 17:57, Patrick J. LoPresti wrote: > On Thu, Apr 16, 2015 at 11:31 AM, Carl E. Love <ce...@us...> wrote: >> >> >> There is nothing that can be done at the source code level to eliminate the notice from the compiler. > > Really? Glancing through the GCC source, it looks like: > > #pragma GCC diagnostic ignored "-Wpsabi" > > ...should do the trick. Or just pass "-Wno-psabi" on the command line. > (Or am I missing something?) > > Probably should be conditional on GCC version, of course. What you describe would work but require additional configury. And that is something I would like to avoid. We already have 3000 lines of it. If will be less work to simply modify the test to not pass these values as function arguments. Perhaps just pass a pointer instead or bundle the function arguments in a struct and pass a pointer to that or ..... Florian |
|
From: Florian K. <fl...@ei...> - 2015-04-18 10:35:36
|
On 17.04.2015 12:57, Julian Seward wrote: > On 17/04/15 12:47, Florian Krohm wrote: > >> Now, looking at the linux side of things: >> >> VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB, >> size + VG_STACK_REDZONE_SZB, tid ); >> >> With your above argument (which is platform neutral), this does not look >> right either. > > I agree. It might be one of those things which has always been wrong, but > which nobody really noticed until now. > > If you're amenable to it, I'd suggest to use simply |size| in the new > merged-up version. If we get it wrong somehow, the worst that can happen > is that we'll get flooded with false positive errors in signal handlers > and we'll soon know something isn't right. So it's a low-risk change IMO. > r15109. Regtested on x86-64, s390, ppc64 Florian |
|
From: <sv...@va...> - 2015-04-18 10:34:03
|
Author: florian
Date: Sat Apr 18 11:33:54 2015
New Revision: 15109
Log:
Factor out the 'extend' function. We only need one version for Linux and
one for Darwin. Down from 11.
Carve out a new function 'track_frame_memory' that communicates to the
tool the allocation of a new stack frame. This was slightly different on
Linux and Darwin but should be the same on both platforms.
New files: priv_sigframe.h and sigframe-common.c
Added:
trunk/coregrind/m_sigframe/priv_sigframe.h
trunk/coregrind/m_sigframe/sigframe-common.c
Modified:
trunk/coregrind/Makefile.am
trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c
trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
trunk/coregrind/m_sigframe/sigframe-arm-linux.c
trunk/coregrind/m_sigframe/sigframe-arm64-linux.c
trunk/coregrind/m_sigframe/sigframe-mips32-linux.c
trunk/coregrind/m_sigframe/sigframe-mips64-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
trunk/coregrind/m_sigframe/sigframe-s390x-linux.c
trunk/coregrind/m_sigframe/sigframe-tilegx-linux.c
trunk/coregrind/m_sigframe/sigframe-x86-darwin.c
trunk/coregrind/m_sigframe/sigframe-x86-linux.c
Modified: trunk/coregrind/Makefile.am
==============================================================================
--- trunk/coregrind/Makefile.am (original)
+++ trunk/coregrind/Makefile.am Sat Apr 18 11:33:54 2015
@@ -243,6 +243,7 @@
m_scheduler/priv_sema.h \
m_scheduler/priv_sched-lock.h \
m_scheduler/priv_sched-lock-impl.h \
+ m_sigframe/priv_sigframe.h \
m_syswrap/priv_types_n_macros.h \
m_syswrap/priv_syswrap-generic.h \
m_syswrap/priv_syswrap-linux.h \
@@ -377,6 +378,7 @@
m_scheduler/sema.c \
m_scheduler/sched-lock.c \
m_scheduler/sched-lock-generic.c \
+ m_sigframe/sigframe-common.c \
m_sigframe/sigframe-x86-linux.c \
m_sigframe/sigframe-amd64-linux.c \
m_sigframe/sigframe-ppc32-linux.c \
Added: trunk/coregrind/m_sigframe/priv_sigframe.h
==============================================================================
--- trunk/coregrind/m_sigframe/priv_sigframe.h (added)
+++ trunk/coregrind/m_sigframe/priv_sigframe.h Sat Apr 18 11:33:54 2015
@@ -0,0 +1,46 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
+
+/*--------------------------------------------------------------------*/
+/*--- Module-local header file for m_sigframe. ---*/
+/*--- priv_sigframe.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2015-2015 Florian Krohm
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PRIV_SIGFRAME_H
+#define __PRIV_SIGFRAME_H
+
+#include "pub_core_basics.h" // types
+#include "pub_core_threadstate.h" // ThreadState
+
+/* --------------- Implemented in sigframe-common.c ---------------*/
+
+Bool ML_(sf_extend_stack)( const ThreadState *tst, Addr addr, SizeT size );
+
+#endif // __PRIV_SIGFRAME_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-darwin.c Sat Apr 18 11:33:54 2015
@@ -82,19 +82,6 @@
};
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
- return True;
-}
-
-
/* Create a signal frame for thread 'tid'. Make a 3-arg frame
regardless of whether the client originally requested a 1-arg
version (no SA_SIGINFO) or a 3-arg one (SA_SIGINFO) since in the
@@ -122,7 +109,7 @@
entry to a function. */
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, rsp, sp_top_of_frame - rsp))
+ if (! ML_(sf_extend_stack)(tst, rsp, sp_top_of_frame - rsp))
return;
vg_assert(VG_IS_16_ALIGNED(rsp+8));
Modified: trunk/coregrind/m_sigframe/sigframe-amd64-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-amd64-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-amd64-linux.c Sat Apr 18 11:33:54 2015
@@ -45,6 +45,7 @@
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
#include "pub_core_sigframe.h" /* self */
+#include "priv_sigframe.h"
/* This module creates and removes signal frames for signal deliveries
on amd64-linux.
@@ -372,50 +373,6 @@
}
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment\n");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes\n");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
-
-
/* Build the Valgrind-specific part of a signal frame. */
static void build_vg_sigframe(struct vg_sigframe *frame,
@@ -455,7 +412,7 @@
rsp = VG_ROUNDDN(rsp, 16) - 8;
frame = (struct rt_sigframe *)rsp;
- if (!extend(tst, rsp, sizeof(*frame)))
+ if (! ML_(sf_extend_stack)(tst, rsp, sizeof(*frame)))
return rsp_top_of_frame;
/* retaddr, siginfo, uContext fields are to be written */
Modified: trunk/coregrind/m_sigframe/sigframe-arm-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-arm-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-arm-linux.c Sat Apr 18 11:33:54 2015
@@ -50,7 +50,7 @@
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
-#include "pub_core_transtab.h" // VG_(discard_translations)
+#include "priv_sigframe.h"
/* This uses the hack of dumping the vex guest state along with both
@@ -81,44 +81,6 @@
struct sigframe sig;
};
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
static void synth_ucontext( ThreadId tid, const vki_siginfo_t *si,
UWord trapno, UWord err, const vki_sigset_t *set,
@@ -223,7 +185,7 @@
sp -= size;
sp = VG_ROUNDDN(sp, 16);
- if(!extend(tst, sp, size))
+ if(! ML_(sf_extend_stack)(tst, sp, size))
I_die_here; // XXX Incorrect behavior
Modified: trunk/coregrind/m_sigframe/sigframe-arm64-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-arm64-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-arm64-linux.c Sat Apr 18 11:33:54 2015
@@ -33,7 +33,6 @@
#include "pub_core_basics.h"
#include "pub_core_vki.h"
-//ZZ #include "pub_core_vkiscnums.h"
#include "pub_core_libcsetjmp.h" // to keep _threadstate.h happy
#include "pub_core_threadstate.h"
#include "pub_core_aspacemgr.h"
@@ -46,7 +45,7 @@
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
-//ZZ #include "pub_core_transtab.h" // VG_(discard_translations)
+#include "priv_sigframe.h"
/* This uses the hack of dumping the vex guest state along with both
@@ -79,44 +78,6 @@
struct sigframe sig;
};
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
static void synth_ucontext( ThreadId tid, const vki_siginfo_t *si,
UWord trapno, UWord err, const vki_sigset_t *set,
@@ -212,7 +173,7 @@
sp -= size;
sp = VG_ROUNDDN(sp, 16);
- if (!extend(tst, sp, size))
+ if (! ML_(sf_extend_stack)(tst, sp, size))
return; // Give up. No idea if this is correct
struct rt_sigframe *rsf = (struct rt_sigframe *)sp;
Added: trunk/coregrind/m_sigframe/sigframe-common.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-common.c (added)
+++ trunk/coregrind/m_sigframe/sigframe-common.c Sat Apr 18 11:33:54 2015
@@ -0,0 +1,110 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
+
+/*--------------------------------------------------------------------*/
+/*--- Signal frames handling: stuff common to most/all platforms ---*/
+/*--- ---*/
+/*--- sigframe-common.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2013 Nicholas Nethercote
+ nj...@va...
+ Copyright (C) 2006-2013 OpenWorks Ltd
+ in...@op...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_aspacemgr.h" // VG_(am_find_nsegment)
+#include "pub_core_signals.h" // VG_(extend_stack)
+#include "pub_core_libcprint.h" // VG_(umsg)
+#include "pub_core_tooliface.h" // VG_TRACK
+#include "pub_core_machine.h" // VG_STACK_REDZONE_SZB
+#include "priv_sigframe.h" // self
+
+
+/* For tracking memory events, indicate the entire frame has been
+ allocated. Except, don't mess with the area which
+ overlaps the previous frame's redzone. */
+static void track_frame_memory ( Addr addr, SizeT size, ThreadId tid )
+{
+ VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB, size, tid );
+}
+
+#if defined(VGO_linux)
+
+/* Extend the stack segment downwards if needed so as to ensure the
+ new signal frames are mapped to something. Return a Bool
+ indicating whether or not the operation was successful. */
+Bool ML_(sf_extend_stack) ( const ThreadState *tst, Addr addr, SizeT size )
+{
+ ThreadId tid = tst->tid;
+ const NSegment *stackseg = NULL;
+
+ if (VG_(extend_stack)(tid, addr)) {
+ stackseg = VG_(am_find_nsegment)(addr);
+ if (0 && stackseg)
+ VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
+ addr, stackseg->start, stackseg->end);
+ }
+
+ if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
+ VG_(umsg)("Can't extend stack to %#lx during signal delivery for "
+ "thread %d:\n", addr, tid);
+ if (stackseg == NULL)
+ VG_(umsg)(" no stack segment\n");
+ else
+ VG_(umsg)(" too small or bad protection modes\n");
+
+ /* set SIGSEGV to default handler */
+ VG_(set_default_handler)(VKI_SIGSEGV);
+ VG_(synth_fault_mapping)(tid, addr);
+
+ /* The whole process should be about to die, since the default
+ action of SIGSEGV to kill the whole process. */
+ return False;
+ }
+
+ /* Tell the tool about the new memory */
+ track_frame_memory(addr, size, tid);
+
+ return True;
+}
+
+#elif defined(VGO_darwin)
+
+/* Extend the stack segment downwards if needed so as to ensure the
+ new signal frames are mapped to something. Return a Bool
+ indicating whether or not the operation was successful. */
+Bool ML_(sf_extend_stack) ( const ThreadState *tst, Addr addr, SizeT size )
+{
+ /* Tell the tool about the new memory */
+ track_frame_memory(addr, size, tst->tid);
+ return True;
+}
+
+#else
+#error unknown OS
+#endif
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_sigframe/sigframe-mips32-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-mips32-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-mips32-linux.c Sat Apr 18 11:33:54 2015
@@ -46,7 +46,7 @@
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
-#include "pub_core_transtab.h" // VG_(discard_translations)
+#include "priv_sigframe.h"
struct vg_sig_private
{
@@ -74,45 +74,6 @@
struct vg_sig_private priv;
};
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW)
- {
- VG_(message)(Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid );
- if (stackseg == NULL)
- VG_(message)( Vg_UserMsg, " no stack segment\n" );
- else
- VG_(message)( Vg_UserMsg, " too small or bad protection modes\n" );
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)( VKI_SIGSEGV );
- VG_(synth_fault_mapping)( tid, addr );
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
static
void setup_sigcontext2 ( ThreadState* tst, struct vki_sigcontext **sc1,
@@ -187,7 +148,7 @@
}
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, sp, sp_top_of_frame - sp))
+ if (! ML_(sf_extend_stack)(tst, sp, sp_top_of_frame - sp))
return;
vg_assert(VG_IS_8_ALIGNED(sp));
Modified: trunk/coregrind/m_sigframe/sigframe-mips64-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-mips64-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-mips64-linux.c Sat Apr 18 11:33:54 2015
@@ -46,7 +46,7 @@
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
-#include "pub_core_transtab.h" /* VG_(discard_translations) */
+#include "priv_sigframe.h"
struct vg_sig_private {
UInt magicPI;
@@ -71,44 +71,6 @@
struct vg_sig_private priv;
};
-/* Extend the stack segment downwards if needed so as to ensure the new signal
- frames are mapped to something. Return a Bool indicating whether or not the
- operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment\n");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes\n");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK(new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid);
-
- return True;
-}
static void setup_sigcontext ( ThreadState* tst, struct vki_sigcontext **sc1,
const vki_siginfo_t *si)
@@ -173,7 +135,7 @@
sp = sp_top_of_frame - sizeof(struct rt_sigframe);
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, sp, sp_top_of_frame - sp))
+ if (! ML_(sf_extend_stack)(tst, sp, sp_top_of_frame - sp))
return;
sp = VG_ROUNDDN(sp, 16);
Modified: trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-ppc32-linux.c Sat Apr 18 11:33:54 2015
@@ -49,7 +49,7 @@
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
#include "pub_core_transtab.h" // VG_(discard_translations)
-
+#include "priv_sigframe.h"
/* This module creates and removes signal frames for signal deliveries
on ppc32-linux.
@@ -502,48 +502,6 @@
//.. Vg_CoreSignal, zztid, VG_O_STACK_PTR, sizeof(Addr))
*/
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment\n");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes\n");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
//.. /* Build the Valgrind-specific part of a signal frame. */
//..
@@ -692,7 +650,7 @@
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, sp, sp_top_of_frame - sp))
+ if (! ML_(sf_extend_stack)(tst, sp, sp_top_of_frame - sp))
return;
vg_assert(VG_IS_16_ALIGNED(sp));
Modified: trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c Sat Apr 18 11:33:54 2015
@@ -49,7 +49,7 @@
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
#include "pub_core_transtab.h" // VG_(discard_translations)
-
+#include "priv_sigframe.h"
/* This module creates and removes signal frames for signal deliveries
on ppc64-linux.
@@ -132,49 +132,6 @@
} while (0)
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment\n");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes\n");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
-
/* EXPORTED */
void VG_(sigframe_create)( ThreadId tid,
@@ -201,7 +158,7 @@
sp = sp_top_of_frame - sizeof(struct rt_sigframe);
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, sp, sp_top_of_frame - sp))
+ if (! ML_(sf_extend_stack)(tst, sp, sp_top_of_frame - sp))
return;
vg_assert(VG_IS_16_ALIGNED(sp));
Modified: trunk/coregrind/m_sigframe/sigframe-s390x-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-s390x-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-s390x-linux.c Sat Apr 18 11:33:54 2015
@@ -45,6 +45,7 @@
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
+#include "priv_sigframe.h"
#if defined(VGA_s390x)
@@ -258,49 +259,6 @@
tst->arch.vex.guest_IA = sigregs->regs.psw.addr;
}
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment\n");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes\n");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
-
/* Build the Valgrind-specific part of a signal frame. */
@@ -340,7 +298,7 @@
sp -= sizeof(*frame);
frame = (struct sigframe *)sp;
- if (!extend(tst, sp, sizeof(*frame)))
+ if (! ML_(sf_extend_stack)(tst, sp, sizeof(*frame)))
return sp_top_of_frame;
/* retcode, sigNo, sc, sregs fields are to be written */
@@ -400,7 +358,7 @@
sp -= sizeof(*frame);
frame = (struct rt_sigframe *)sp;
- if (!extend(tst, sp, sizeof(*frame)))
+ if (! ML_(sf_extend_stack)(tst, sp, sizeof(*frame)))
return sp_top_of_frame;
/* retcode, sigNo, sc, sregs fields are to be written */
Modified: trunk/coregrind/m_sigframe/sigframe-tilegx-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-tilegx-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-tilegx-linux.c Sat Apr 18 11:33:54 2015
@@ -47,7 +47,7 @@
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
-#include "pub_core_transtab.h" // VG_(discard_translations)
+#include "priv_sigframe.h"
struct vg_sig_private
{
@@ -67,44 +67,6 @@
struct vg_sig_private priv;
};
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr))
- stackseg = VG_(am_find_nsegment)(addr);
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW)
- {
- VG_(message)(Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid );
- if (stackseg == NULL)
- VG_(message)( Vg_UserMsg, " no stack segment\n" );
- else
- VG_(message)( Vg_UserMsg, " too small or bad protection modes\n" );
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)( VKI_SIGSEGV );
- VG_(synth_fault_mapping)( tid, addr );
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
static
void setup_sigcontext2 ( ThreadState* tst, struct vki_sigcontext **sc1,
@@ -196,7 +158,7 @@
sp = sp_top_of_frame - sizeof(struct rt_sigframe);
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, sp, sizeof(struct rt_sigframe)))
+ if (! ML_(sf_extend_stack)(tst, sp, sizeof(struct rt_sigframe)))
return;
vg_assert(VG_IS_8_ALIGNED(sp));
Modified: trunk/coregrind/m_sigframe/sigframe-x86-darwin.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-x86-darwin.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-x86-darwin.c Sat Apr 18 11:33:54 2015
@@ -85,25 +85,6 @@
};
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- /* For tracking memory events, indicate the entire frame has been
- allocated. Except, don't mess with the area which
- overlaps the previous frame's redzone. */
- /* XXX is the following call really right? compared with the
- amd64-linux version, this doesn't appear to handle the redzone
- in the same way. */
- VG_TRACK( new_mem_stack_signal,
- addr - VG_STACK_REDZONE_SZB, size, tid );
- return True;
-}
-
-
/* Create a signal frame for thread 'tid'. Make a 3-arg frame
regardless of whether the client originally requested a 1-arg
version (no SA_SIGINFO) or a 3-arg one (SA_SIGINFO) since in the
@@ -131,7 +112,7 @@
entry to a function. */
tst = VG_(get_ThreadState)(tid);
- if (!extend(tst, esp, sp_top_of_frame - esp))
+ if (! ML_(sf_extend_stack)(tst, esp, sp_top_of_frame - esp))
return;
vg_assert(VG_IS_16_ALIGNED(esp+4));
Modified: trunk/coregrind/m_sigframe/sigframe-x86-linux.c
==============================================================================
--- trunk/coregrind/m_sigframe/sigframe-x86-linux.c (original)
+++ trunk/coregrind/m_sigframe/sigframe-x86-linux.c Sat Apr 18 11:33:54 2015
@@ -45,7 +45,7 @@
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
#include "pub_core_sigframe.h" /* self */
-
+#include "priv_sigframe.h"
/* This module creates and removes signal frames for signal deliveries
on x86-linux.
@@ -393,50 +393,6 @@
}
-/* Extend the stack segment downwards if needed so as to ensure the
- new signal frames are mapped to something. Return a Bool
- indicating whether or not the operation was successful.
-*/
-static Bool extend ( ThreadState *tst, Addr addr, SizeT size )
-{
- ThreadId tid = tst->tid;
- NSegment const* stackseg = NULL;
-
- if (VG_(extend_stack)(tid, addr)) {
- stackseg = VG_(am_find_nsegment)(addr);
- if (0 && stackseg)
- VG_(printf)("frame=%#lx seg=%#lx-%#lx\n",
- addr, stackseg->start, stackseg->end);
- }
-
- if (stackseg == NULL || !stackseg->hasR || !stackseg->hasW) {
- VG_(message)(
- Vg_UserMsg,
- "Can't extend stack to %#lx during signal delivery for thread %d:\n",
- addr, tid);
- if (stackseg == NULL)
- VG_(message)(Vg_UserMsg, " no stack segment\n");
- else
- VG_(message)(Vg_UserMsg, " too small or bad protection modes\n");
-
- /* set SIGSEGV to default handler */
- VG_(set_default_handler)(VKI_SIGSEGV);
- VG_(synth_fault_mapping)(tid, addr);
-
- /* The whole process should be about to die, since the default
- action of SIGSEGV to kill the whole process. */
- return False;
- }
-
- /* For tracking memory events, indicate the entire frame has been
- allocated. */
- VG_TRACK( new_mem_stack_signal, addr - VG_STACK_REDZONE_SZB,
- size + VG_STACK_REDZONE_SZB, tid );
-
- return True;
-}
-
-
/* Build the Valgrind-specific part of a signal frame. */
static void build_vg_sigframe(struct vg_sigframe *frame,
@@ -478,7 +434,7 @@
esp = VG_ROUNDDN(esp, 16);
frame = (struct sigframe *)esp;
- if (!extend(tst, esp, sizeof(*frame)))
+ if (! ML_(sf_extend_stack)(tst, esp, sizeof(*frame)))
return esp_top_of_frame;
/* retaddr, sigNo, siguContext fields are to be written */
@@ -535,7 +491,7 @@
esp = VG_ROUNDDN(esp, 16);
frame = (struct rt_sigframe *)esp;
- if (!extend(tst, esp, sizeof(*frame)))
+ if (! ML_(sf_extend_stack)(tst, esp, sizeof(*frame)))
return esp_top_of_frame;
/* retaddr, sigNo, pSiginfo, puContext fields are to be written */
|
|
From: <sv...@va...> - 2015-04-18 09:15:55
|
Author: florian
Date: Sat Apr 18 10:15:47 2015
New Revision: 15108
Log:
Add missing header file.
Modified:
trunk/Makefile.vex.am
Modified: trunk/Makefile.vex.am
==============================================================================
--- trunk/Makefile.vex.am (original)
+++ trunk/Makefile.vex.am Sat Apr 18 10:15:47 2015
@@ -57,6 +57,7 @@
priv/host_arm_defs.h \
priv/host_arm64_defs.h \
priv/host_s390_defs.h \
+ priv/host_tilegx_defs.h \
priv/s390_disasm.h \
priv/s390_defs.h \
priv/host_mips_defs.h \
|
|
From: <sv...@va...> - 2015-04-18 00:02:08
|
Author: carll
Date: Sat Apr 18 01:01:58 2015
New Revision: 15107
Log:
Forgot to add the new files in memcheck/tests/ppc32 and memcheck/tests/ppc32.
They should have been part of the previous commit 15106.
--------------------------------------------------------------------
Add support for the lbarx, lharx, stbcx and sthcs instructions.
The instructions are part of the ISA 2.06 but were not implemented
in all versions of hardware. The four instructions are all supported
in ISA 2.07. The instructions were put under the ISA 2.07 category
of supported instructions in this patch.
The VEX commit for this fix is r3137.
The bugzilla for this issue is 346324.
Added:
trunk/memcheck/tests/ppc32/power_ISA2_07.c
trunk/memcheck/tests/ppc32/power_ISA2_07.stderr.exp
trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp
trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp-LE
trunk/memcheck/tests/ppc32/power_ISA2_07.vgtest
trunk/memcheck/tests/ppc64/power_ISA2_07.c
trunk/memcheck/tests/ppc64/power_ISA2_07.stderr.exp
trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp
trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp-LE
trunk/memcheck/tests/ppc64/power_ISA2_07.vgtest
Added: trunk/memcheck/tests/ppc32/power_ISA2_07.c
==============================================================================
--- trunk/memcheck/tests/ppc32/power_ISA2_07.c (added)
+++ trunk/memcheck/tests/ppc32/power_ISA2_07.c Sat Apr 18 01:01:58 2015
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <config.h>
+
+double foo = -1.0;
+double FRT1;
+double FRT2;
+
+#ifdef HAS_ISA_2_07
+
+/* b0 may be non-zero in lwarx/ldarx Power6 instrs */
+void test_reservation()
+{
+
+ unsigned RT;
+ unsigned base;
+ unsigned offset;
+ unsigned arrB[] = { 0x00112233U, 0x44556677U, 0x8899aabbU, 0xccddeeffU };
+ int arrH[] __attribute__ ((aligned (2))) = { 0xdeadbeef, 0xbad0beef, 0xbeefdead, 0xbeef0bad };
+
+ /* The lbarx and lharx instructions were "phased in" in ISA 2.06. That
+ * means it they may show up in some implementations but not others. They
+ * are in all ISA 2.08 implementations.
+ */
+ base = (unsigned) &arrB;
+ offset = ((unsigned ) &arrB[1]) - base;
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
+ __asm__ volatile ("lbarx %0, 20, 21, 1":"=r" (RT));
+ printf("lbarx => 0x%x\n", RT);
+
+ base = (unsigned) &arrH;
+ offset = ((unsigned) &arrH[1]) - base;
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
+ __asm__ volatile ("lharx %0, 20, 21, 1":"=r" (RT));
+ printf("lharx => 0x%x\n", RT);
+
+}
+#endif
+
+int main(void)
+{
+#ifdef HAS_ISA_2_07
+ (void) test_reservation();
+#endif
+
+ return 0;
+}
Added: trunk/memcheck/tests/ppc32/power_ISA2_07.stderr.exp
==============================================================================
--- trunk/memcheck/tests/ppc32/power_ISA2_07.stderr.exp (added)
+++ trunk/memcheck/tests/ppc32/power_ISA2_07.stderr.exp Sat Apr 18 01:01:58 2015
@@ -0,0 +1,10 @@
+
+
+HEAP SUMMARY:
+ in use at exit: 0 bytes in 0 blocks
+ total heap usage: 0 allocs, 0 frees, 0 bytes allocated
+
+For a detailed leak analysis, rerun with: --leak-check=full
+
+For counts of detected and suppressed errors, rerun with: -v
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Added: trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp
==============================================================================
--- trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp (added)
+++ trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp Sat Apr 18 01:01:58 2015
@@ -0,0 +1,2 @@
+lbarx => 0x44
+lharx => 0xbad0
Added: trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp-LE
==============================================================================
--- trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp-LE (added)
+++ trunk/memcheck/tests/ppc32/power_ISA2_07.stdout.exp-LE Sat Apr 18 01:01:58 2015
@@ -0,0 +1,2 @@
+lbarx => 0x77
+lharx => 0xbeef
Added: trunk/memcheck/tests/ppc32/power_ISA2_07.vgtest
==============================================================================
--- trunk/memcheck/tests/ppc32/power_ISA2_07.vgtest (added)
+++ trunk/memcheck/tests/ppc32/power_ISA2_07.vgtest Sat Apr 18 01:01:58 2015
@@ -0,0 +1,3 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: power_ISA2_07
+vgopts:
Added: trunk/memcheck/tests/ppc64/power_ISA2_07.c
==============================================================================
--- trunk/memcheck/tests/ppc64/power_ISA2_07.c (added)
+++ trunk/memcheck/tests/ppc64/power_ISA2_07.c Sat Apr 18 01:01:58 2015
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <config.h>
+
+double foo = -1.0;
+double FRT1;
+double FRT2;
+
+#ifdef HAS_ISA_2_07
+
+/* b0 may be non-zero in lwarx/ldarx Power6 instrs */
+void test_reservation()
+{
+
+ unsigned long RT;
+ unsigned long base;
+ unsigned long offset;
+ unsigned arrB[] = { 0x00112233U, 0x44556677U, 0x8899aabbU, 0xccddeeffU };
+ int arrH[] __attribute__ ((aligned (2))) = { 0xdeadbeef, 0xbad0beef, 0xbeefdead, 0xbeef0bad };
+
+ /* The lbarx and lharx instructions were "phased in" in ISA 2.06. That
+ * means it they may show up in some implementations but not others. They
+ * are in all ISA 2.08 implementations.
+ */
+ base = (unsigned long) &arrB;
+ offset = ((unsigned long) &arrB[1]) - base;
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
+ __asm__ volatile ("lbarx %0, 20, 21, 1":"=r" (RT));
+ printf("lbarx => 0x%lx\n", RT);
+
+ base = (unsigned long) &arrH;
+ offset = ((unsigned long) &arrH[1]) - base;
+ __asm__ volatile ("ori 20, %0, 0"::"r" (base));
+ __asm__ volatile ("ori 21, %0, 0"::"r" (offset));
+ __asm__ volatile ("lharx %0, 20, 21, 1":"=r" (RT));
+ printf("lharx => 0x%lx\n", RT);
+}
+#endif
+
+int main(void)
+{
+#ifdef HAS_ISA_2_07
+ (void) test_reservation();
+#endif
+
+ return 0;
+}
Added: trunk/memcheck/tests/ppc64/power_ISA2_07.stderr.exp
==============================================================================
--- trunk/memcheck/tests/ppc64/power_ISA2_07.stderr.exp (added)
+++ trunk/memcheck/tests/ppc64/power_ISA2_07.stderr.exp Sat Apr 18 01:01:58 2015
@@ -0,0 +1,10 @@
+
+
+HEAP SUMMARY:
+ in use at exit: 0 bytes in 0 blocks
+ total heap usage: 0 allocs, 0 frees, 0 bytes allocated
+
+For a detailed leak analysis, rerun with: --leak-check=full
+
+For counts of detected and suppressed errors, rerun with: -v
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Added: trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp
==============================================================================
--- trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp (added)
+++ trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp Sat Apr 18 01:01:58 2015
@@ -0,0 +1,2 @@
+lbarx => 0x44
+lharx => 0xbad0
Added: trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp-LE
==============================================================================
--- trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp-LE (added)
+++ trunk/memcheck/tests/ppc64/power_ISA2_07.stdout.exp-LE Sat Apr 18 01:01:58 2015
@@ -0,0 +1,2 @@
+lbarx => 0x77
+lharx => 0xbeef
Added: trunk/memcheck/tests/ppc64/power_ISA2_07.vgtest
==============================================================================
--- trunk/memcheck/tests/ppc64/power_ISA2_07.vgtest (added)
+++ trunk/memcheck/tests/ppc64/power_ISA2_07.vgtest Sat Apr 18 01:01:58 2015
@@ -0,0 +1,3 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: power_ISA2_07
+vgopts:
|