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

Issue 310700043: i#1569 AArch64: Handle self-modifying programs. (Closed)

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

Description

Commit log for first patchset: --------------- i#1569 AArch64: Handle self-modifying programs. IC IVAU, Xt is mangled into 7-14 instructions including a call to icache_op_ic_ivau_asm, which records contiguous invalidated icache lines in icache_op_struct. ISB is mangled into 11-20 instructions including a conditional branch to icache_op_isb_asm, which calls dr_flush_region, then dr_redirect_execution. ---------------

Patch Set 1 #

Patch Set 2 : Use fcache_return #

Total comments: 50

Patch Set 3 : Addressed everything #

Total comments: 14

Patch Set 4 : Code moved and removed #

Patch Set 5 : Committed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+425 lines, -8 lines) Patch
M core/arch/aarch64/aarch64.asm View 1 2 3 4 2 chunks +231 lines, -2 lines 0 comments Download
M core/arch/aarch64/instr.c View 1 2 1 chunk +15 lines, -0 lines 0 comments Download
M core/arch/aarchxx/mangle.c View 1 2 3 4 2 chunks +120 lines, -0 lines 0 comments Download
M core/arch/arch.h View 1 2 3 4 3 chunks +10 lines, -0 lines 0 comments Download
M core/arch/arch_exports.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M core/arch/instr.h View 1 chunk +5 lines, -0 lines 0 comments Download
M core/arch/mangle_shared.c View 1 2 3 4 2 chunks +9 lines, -0 lines 0 comments Download
M core/arch/x86/mangle.c View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M core/dispatch.c View 1 2 3 4 2 chunks +10 lines, -1 line 0 comments Download
M core/link.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M core/link.c View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M suite/tests/CMakeLists.txt View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download

Messages

Total messages: 36
Edmund.Grimley.Evans
7 years, 5 months ago (2016-11-02 15:26:21 UTC) #1
bruening
> ISB is mangled into 11-20 instructions including a conditional branch > to icache_op_isb_asm From ...
7 years, 5 months ago (2016-11-02 17:13:28 UTC) #2
Edmund.Grimley.Evans
On 2016/11/02 17:13:28, bruening wrote: > > ISB is mangled into 11-20 instructions including a ...
7 years, 5 months ago (2016-11-02 17:37:15 UTC) #3
bruening
On 2016/11/02 17:13:28, bruening wrote: > > ISB is mangled into 11-20 instructions including a ...
7 years, 5 months ago (2016-11-04 13:30:30 UTC) #4
bruening
Mostly I'm just talking out loud here, and have not looked at the details, but ...
7 years, 5 months ago (2016-11-04 13:54:07 UTC) #5
Edmund.Grimley.Evans
On 2016/11/04 13:54:07, bruening wrote: > Mostly I'm just talking out loud here, and have ...
7 years, 5 months ago (2016-11-04 14:20:11 UTC) #6
bruening
On 2016/11/04 14:20:11, Edmund.Grimley.Evans wrote: > On 2016/11/04 13:54:07, bruening wrote: > > Mostly I'm ...
7 years, 5 months ago (2016-11-06 00:41:37 UTC) #7
Edmund.Grimley.Evans
> There's no reason the part that is doing the flush shouldn't go back to ...
7 years, 5 months ago (2016-11-09 14:37:27 UTC) #8
bruening
On 2016/11/09 14:37:27, Edmund.Grimley.Evans wrote: > > There's no reason the part that is doing ...
7 years, 5 months ago (2016-11-10 18:51:54 UTC) #9
Edmund.Grimley.Evans
> It matches how everything else works in DR today, which means it is simpler ...
7 years, 5 months ago (2016-11-11 09:12:18 UTC) #10
bruening
On 2016/11/11 09:12:18, Edmund.Grimley.Evans wrote: > > It matches how everything else works in DR ...
7 years, 5 months ago (2016-11-11 16:07:34 UTC) #11
Edmund.Grimley.Evans
Yes, I accept your other points and hope to update this patch some time next ...
7 years, 5 months ago (2016-11-11 16:41:28 UTC) #12
Edmund.Grimley.Evans
I'm not sure how to do a conditional return to dispatch via DR's .text. Any ...
7 years, 5 months ago (2016-11-14 16:03:11 UTC) #13
bruening
All returns from app state in the cache or gencode go through an exit stub ...
7 years, 5 months ago (2016-11-14 16:14:35 UTC) #14
Edmund.Grimley.Evans
On 2016/11/14 16:14:35, bruening wrote: > All returns from app state in the cache or ...
7 years, 5 months ago (2016-11-14 16:45:47 UTC) #15
bruening
On Mon, Nov 14, 2016 at 11:45 AM, <Edmund.Grimley.Evans@gmail.com> wrote: > On 2016/11/14 16:14:35, bruening ...
7 years, 5 months ago (2016-11-15 14:38:31 UTC) #16
Edmund.Grimley.Evans
Commit log for latest patchset: --------------- i#1569 AArch64: Handle self-modifying programs. IC IVAU, Xt is ...
7 years, 4 months ago (2016-11-25 09:56:10 UTC) #17
Edmund.Grimley.Evans
Ping.
7 years, 4 months ago (2016-12-05 09:51:17 UTC) #18
bruening
Sorry, will get to it tomorrow.
7 years, 4 months ago (2016-12-06 05:38:49 UTC) #19
bruening
Having some kind of A64 design doc (maybe in wiki) that discusses tradeoffs and the ...
7 years, 4 months ago (2016-12-07 05:24:30 UTC) #20
bruening
https://codereview.appspot.com/310700043/diff/20001/core/dispatch.c File core/dispatch.c (right): https://codereview.appspot.com/310700043/diff/20001/core/dispatch.c#newcode159 core/dispatch.c:159: dr_flush_region((app_pc)begin, end - begin); On 2016/12/07 05:24:29, bruening wrote: ...
7 years, 4 months ago (2016-12-07 14:50:32 UTC) #21
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/20001/core/arch/aarch64/aarch64.asm File core/arch/aarch64/aarch64.asm (right): https://codereview.appspot.com/310700043/diff/20001/core/arch/aarch64/aarch64.asm#newcode637 core/arch/aarch64/aarch64.asm:637: * been invalidated we tailcall icache_op_isb instead of returning. ...
7 years, 4 months ago (2016-12-07 16:48:52 UTC) #22
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/20001/core/arch/arch_exports.h File core/arch/arch_exports.h (right): https://codereview.appspot.com/310700043/diff/20001/core/arch/arch_exports.h#newcode1206 core/arch/arch_exports.h:1206: * members alignment guarantees that bit 2 of the ...
7 years, 4 months ago (2016-12-07 17:37:19 UTC) #23
bruening
https://codereview.appspot.com/310700043/diff/20001/core/arch/arch_exports.h File core/arch/arch_exports.h (right): https://codereview.appspot.com/310700043/diff/20001/core/arch/arch_exports.h#newcode1206 core/arch/arch_exports.h:1206: * members alignment guarantees that bit 2 of the ...
7 years, 4 months ago (2016-12-07 17:44:19 UTC) #24
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/20001/core/dynamo.c File core/dynamo.c (right): https://codereview.appspot.com/310700043/diff/20001/core/dynamo.c#newcode156 core/dynamo.c:156: dr_redirect_execution(mcontext); On 2016/12/07 05:24:29, bruening wrote: > This is ...
7 years, 4 months ago (2016-12-07 17:57:47 UTC) #25
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/20001/core/arch/arch_exports.h File core/arch/arch_exports.h (right): https://codereview.appspot.com/310700043/diff/20001/core/arch/arch_exports.h#newcode1220 core/arch/arch_exports.h:1220: } icache_op_struct_t; On 2016/12/07 17:44:19, bruening wrote: > On ...
7 years, 4 months ago (2016-12-07 18:23:52 UTC) #26
bruening
https://codereview.appspot.com/310700043/diff/20001/core/link.h File core/link.h (right): https://codereview.appspot.com/310700043/diff/20001/core/link.h#newcode482 core/link.h:482: extern const linkstub_t linkstub_aarch64_selfmod; On 2016/12/07 17:57:46, Edmund.Grimley.Evans wrote: ...
7 years, 4 months ago (2016-12-07 18:40:15 UTC) #27
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/20001/core/link.h File core/link.h (right): https://codereview.appspot.com/310700043/diff/20001/core/link.h#newcode482 core/link.h:482: extern const linkstub_t linkstub_aarch64_selfmod; On 2016/12/07 18:40:15, bruening wrote: ...
7 years, 4 months ago (2016-12-07 21:35:45 UTC) #28
bruening
https://codereview.appspot.com/310700043/diff/20001/core/link.h File core/link.h (right): https://codereview.appspot.com/310700043/diff/20001/core/link.h#newcode482 core/link.h:482: extern const linkstub_t linkstub_aarch64_selfmod; On 2016/12/07 21:35:44, Edmund.Grimley.Evans wrote: ...
7 years, 4 months ago (2016-12-07 21:48:00 UTC) #29
Edmund.Grimley.Evans
Commit log for latest patchset: --------------- i#1569 AArch64: Handle self-modifying programs. IC IVAU, Xt is ...
7 years, 4 months ago (2016-12-09 11:15:19 UTC) #30
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/20001/core/arch/aarch64/aarch64.asm File core/arch/aarch64/aarch64.asm (right): https://codereview.appspot.com/310700043/diff/20001/core/arch/aarch64/aarch64.asm#newcode678 core/arch/aarch64/aarch64.asm:678: ldr x3, [x0, #16] On 2016/12/07 16:48:52, Edmund.Grimley.Evans wrote: ...
7 years, 4 months ago (2016-12-09 11:15:43 UTC) #31
bruening
Looks good except I don't understand the last_exit_deleted() change? https://codereview.appspot.com/310700043/diff/40001/core/arch/aarch64/aarch64.asm File core/arch/aarch64/aarch64.asm (right): https://codereview.appspot.com/310700043/diff/40001/core/arch/aarch64/aarch64.asm#newcode789 core/arch/aarch64/aarch64.asm:789: ...
7 years, 4 months ago (2016-12-11 16:50:22 UTC) #32
Edmund.Grimley.Evans
https://codereview.appspot.com/310700043/diff/40001/core/arch/aarch64/aarch64.asm File core/arch/aarch64/aarch64.asm (right): https://codereview.appspot.com/310700043/diff/40001/core/arch/aarch64/aarch64.asm#newcode789 core/arch/aarch64/aarch64.asm:789: * where we will call dr_flush_region, then dr_redirect_execution. On ...
7 years, 4 months ago (2016-12-12 15:52:15 UTC) #33
Edmund.Grimley.Evans
Commit log for latest patchset: --------------- i#1569 AArch64: Handle self-modifying programs. IC IVAU, Xt is ...
7 years, 4 months ago (2016-12-12 15:59:19 UTC) #34
bruening
LGTM
7 years, 4 months ago (2016-12-12 16:26:14 UTC) #35
Edmund.Grimley.Evans
7 years, 4 months ago (2016-12-13 09:02:48 UTC) #36
Committed as
https://github.com/DynamoRIO/dynamorio/commit/f2a666946b666a296cc4746c1ab24ee...

Final commit log: 
---------------
i#1569 AArch64: Handle self-modifying programs.

IC IVAU, Xt is mangled into 7-14 instructions including a call to
icache_op_ic_ivau_asm, which records contiguous invalidated icache
lines in icache_op_struct.

ISB is mangled into 11-20 instructions including a conditional branch
to icache_op_isb_asm, which returns to dispatch using
linkstub_selfmod.

Review-URL: https://codereview.appspot.com/310700043
---------------
Sign in to reply to this message.

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