Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(16310)

Issue 301080043: i#1569 AArch64: Add new API funcs dr_insert_{save,restore}_stack_pointer. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 9 months ago by Edmund.Grimley.Evans
Modified:
7 years, 9 months ago
Reviewers:
bruening, Kevin Zhou
CC:
dynamorio-devs_googlegroups.com
Visibility:
Public.

Description

Commit log for first patchset: --------------- i#1569 AArch64: Add new API funcs dr_insert_{save,restore}_stack_pointer. These functions are required on AArch64, where it is not possible to directly load or save the stack pointer. ---------------

Patch Set 1 #

Total comments: 2

Patch Set 2 : with test #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -8 lines) Patch
M core/lib/instrument.h View 1 chunk +22 lines, -0 lines 0 comments Download
M core/lib/instrument.c View 1 1 chunk +100 lines, -0 lines 5 comments Download
M suite/tests/CMakeLists.txt View 1 1 chunk +1 line, -0 lines 0 comments Download
A + suite/tests/client-interface/move-stack.c View 1 1 chunk +27 lines, -8 lines 3 comments Download
A suite/tests/client-interface/move-stack.expect View 1 1 chunk +2 lines, -0 lines 0 comments Download
A suite/tests/client-interface/move-stack.dll.c View 1 1 chunk +132 lines, -0 lines 8 comments Download
M suite/tests/tools.h View 1 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 17
Edmund.Grimley.Evans
7 years, 9 months ago (2016-06-27 16:30:52 UTC) #1
bruening
Please add a test for any new feature. However, I'm not sure what the use ...
7 years, 9 months ago (2016-06-27 17:31:42 UTC) #2
Edmund.Grimley.Evans
On 2016/06/27 17:31:42, bruening wrote: > Please add a test for any new feature. > ...
7 years, 9 months ago (2016-06-27 19:16:51 UTC) #3
Kevin Zhou
On 2016/06/27 17:31:42, bruening wrote: > Please add a test for any new feature. > ...
7 years, 9 months ago (2016-06-28 10:36:54 UTC) #4
bruening
OK, but please add a regression test to suite/tests/client-interface/ https://codereview.appspot.com/301080043/diff/1/core/lib/instrument.c File core/lib/instrument.c (right): https://codereview.appspot.com/301080043/diff/1/core/lib/instrument.c#newcode5590 core/lib/instrument.c:5590: ...
7 years, 9 months ago (2016-07-01 00:30:00 UTC) #5
Kevin Zhou
When I was trying to implement a regression test for dr_insert_{save,restore}_stack_pointer, I found that the ...
7 years, 9 months ago (2016-07-01 11:22:25 UTC) #6
bruening
Maybe I'm mis-understanding, but it does not sound like a good idea to change the ...
7 years, 9 months ago (2016-07-01 18:44:13 UTC) #7
Edmund.Grimley.Evans
On 2016/07/01 18:44:13, bruening wrote: > Maybe I'm mis-understanding, but it does not sound like ...
7 years, 9 months ago (2016-07-01 20:59:18 UTC) #8
bruening
On 2016/07/01 20:59:18, Edmund.Grimley.Evans wrote: > On 2016/07/01 18:44:13, bruening wrote: > > Maybe I'm ...
7 years, 9 months ago (2016-07-01 21:48:53 UTC) #9
edmund.grimley.evans_gmail.com
> I'm still confused: If an addressing mode is not present in the ISA, it ...
7 years, 9 months ago (2016-07-02 08:48:34 UTC) #10
bruening
On 2016/07/02 08:48:34, edmund.grimley.evans_gmail.com wrote: > It is always more painful and complex to have ...
7 years, 9 months ago (2016-07-03 17:08:58 UTC) #11
Kevin Zhou
Users can have the freedom to use either XINST_CREATE_load or a general API provided by ...
7 years, 9 months ago (2016-07-04 09:00:34 UTC) #12
Edmund.Grimley.Evans
Commit log for latest patchset: --------------- i#1569 AArch64: Add new API funcs dr_insert_{save,restore}_stack_pointer. These functions ...
7 years, 9 months ago (2016-07-05 22:28:08 UTC) #13
bruening
I guess I'm still not sure about these: looking at the test, using these involves ...
7 years, 9 months ago (2016-07-07 15:24:14 UTC) #14
bruening
https://codereview.appspot.com/301080043/diff/20001/core/lib/instrument.c File core/lib/instrument.c (right): https://codereview.appspot.com/301080043/diff/20001/core/lib/instrument.c#newcode5582 core/lib/instrument.c:5582: * be DR_REG_NULL. optional: it is arguably cleaner to ...
7 years, 9 months ago (2016-07-07 15:24:36 UTC) #15
Kevin Zhou
> I guess I'm still not sure about these: looking at the test, using these ...
7 years, 9 months ago (2016-07-07 16:21:23 UTC) #16
bruening
7 years, 9 months ago (2016-07-07 16:55:31 UTC) #17
On 2016/07/07 16:21:23, Kevin Zhou wrote:
> > I guess I'm still not sure about these: looking at the test, using these
> > involves ifdef AARCH64 code to get a scratch register and to pass it in,
with
> > more ifdef code for x86_64 vs other platforms: so the API does not feel like
a
> > cross-platform solution, as the caller is basically special-casing code
> anyway. 
> 
> Yes it is a problem if it is not allowed to pass two scratch regs as
arguments.
> Probably it is easier to just leave in the documentation warning on the
AArch64
> restrictions. Another possible approach is to add an extra wrapper on
> instr_create_Ndst_Msrc such as
> #define XINST_CREATE_load(dcontext, reg, mem)  instr_create_load(dcontext,
reg,
> mem)
> 
> In the wrapper we could put a CLIENT_ASSERT which checks the stack usage. The
> advantage is it could directly reflect the stack trace when debugging instead
of
> checking it in the encoder. It would reflect which function it causes the
> problem, dr_insert_write_tls_field, dr_save_reg ... etc...
> 
> In our local repositories, the dr internals uses this API in the
> {prepare_for,clean_after}_clean_call. It means a bit more ifdefs if we don't
use
> this API.

As internal helper routines these seem fine, as I'm guessing the internal code
already has an extra reg it can pass in.  But to decide whether to make public
API routines, where we should take more care than when adding an internal
helper, seeing some examples of use of the API in ext/ or api/samples/ would
help to decide.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b