Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64-bit container case #111

Open
derekbruening opened this issue Nov 28, 2014 · 12 comments
Open

64-bit container case #111

derekbruening opened this issue Nov 28, 2014 · 12 comments

Comments

@derekbruening
Copy link
Contributor

From derek.br...@gmail.com on December 10, 2010 17:57:41

PR 408518

filing a container case to cover 64-bit porting of Dr. Memory.
the major task is re-designing the shadow memory structure and
rewriting all of the hand-coded machine instruction sequences for
accessing shadow memory. we'll need more indirection with
some kind of page-table-style structure, and may end up needing
caches to achieve good performance: much more complex than 32-bit.

xref PR 575713

Original issue: http://code.google.com/p/drmemory/issues/detail?id=111

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on May 16, 2012 08:45:59

issue #889 covers porting pattern mode to 64-bit

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on June 17, 2012 14:13:10

filling in some notes:


from years ago:

On Linux need to maintain 128-byte stack redzone marked as undefined as stack pointer moves around


frontend notes from recent discussion:

there are 3 approaches:

  1. one is DR's approach, which makes you run bin32/drrun or bin64/drrun.
    although can use -32 or -64 params to override.
  2. another is valgrind, which auto-detects bitwidth from one frontend.
  3. 3rd is to have some flag (btw I would not use "lib64": why "lib"?).

autodetect is by far the most usable for users. for scripts, assume native
kernel bitwidth.

note that we have to automatically detect on child injection anyway (xref
DRi#147 on clients registering both 32 and 64 and DR picking the right one on
cross-arch child)

maybe we should solve DRi#147 first. if the soln there is to make DR
auto-detect then we don't have to do anything: could specify both
bitwidths to DR and frontend is done

problem: frontend is used with -results or -nudge where no app is specified
and thus there's no easy way for the front-end to know the bitwidth.
(-results could read file I guess, and -nudge could could go examine /proc/pid/)


and more xrefs: issue #825 issue #906 issue #916 issue #917 issue #919

Labels: -Priority-Low -Type-Defect Priority-Medium Type-Enhancement OpSys-x64

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on July 19, 2012 11:12:26

issue #945 issue #946

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on February 04, 2013 08:41:00

we'll need 64-bit nudges from DR: https://code.google.com/p/dynamorio/issues/detail?id=119

Owner: zhao...@google.com

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on May 01, 2013 12:22:51

issue #1205 split out

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on May 21, 2013 10:51:09

** TODO how shadow registers

for byte-to-byte, plus additional 8 GPR's, we'd need 16 slots instead of
the current 2 for GPR's!

options:

  • steal a register?
  • use space at end of x64 TEB? a full half-page there now, though it will
    slowly shrink w/ each new windows version.
    could anyone else by using this space?
    for DRi#1163 I'm implementing the use of this space as drmem is out of
    TLS slots on win8. it needs more testing, but this is my tentative plan
    for now for shadowing GPR's.

xref DRi#1163: out of TLS slots in win8 as it is

xref issue #471 : need to shadow floating-point regs too -- but these are too big
to expect to fit in TLS. I think we just live w/ indirection here. I
don't think giving up granularity is a good idea for cases where data is
moved in and out.

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on August 01, 2014 10:54:45

Taking over

Owner: bruen...@google.com

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on September 18, 2014 07:36:08

byte-to-byte split out as issue #1632 as the initial port will be 1B-2b

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on September 18, 2014 07:42:27

xref issue #1633

@derekbruening
Copy link
Contributor Author

Pattern support is complete and light mode is now officially supported and present in the release package.

#1782 is a blocker for shadow modes

@derekbruening
Copy link
Contributor Author

Recent commits that did not include a proper xref for auto-linking:
3c0371c i#111 x64: heap mismatch generalization (#2026)
3d8834e i#111 x64: 64-bit shadow slowpath (#2024)
e521af6 i#111 x64: stack slowpath and redzone handling (#2023)

derekbruening added a commit that referenced this issue Aug 27, 2017
Generalizes the full mode fastpath to handle 2-byte shadows and scratch
registers.  Defines the top 32 bits of 32-bit written registers.  Includes
numerous other miscellaneous fixes.

Some common instructions are not yet on the fastpath, including push and
pop.

Disables -share_xl8 for now for x64 (i#2025 covers getting to work).
Disables -esp_fastpath for now for x64 (i#2027 covers implementing it).

Does not yet enable tests: that is coming soon.

Issue: #111
derekbruening added a commit that referenced this issue Aug 27, 2017
Generalizes the full mode fastpath to handle 2-byte shadows and scratch
registers.  Defines the top 32 bits of 32-bit written registers.  Includes
numerous other miscellaneous fixes.

Some common instructions are not yet on the fastpath, including push and
pop.

Disables -share_xl8 for now for x64 (i#2025 covers getting to work).
Disables -esp_fastpath for now for x64 (i#2027 covers implementing it).

Does not yet enable tests: that is coming soon.

Issue: #111
derekbruening added a commit that referenced this issue Aug 27, 2017
Generalizes the full mode fastpath to handle 2-byte shadows and scratch
registers.  Defines the top 32 bits of 32-bit written registers.  Includes
numerous other miscellaneous fixes.

Some common instructions are not yet on the fastpath, including push and
pop.

Disables -share_xl8 for now for x64 (i#2025 covers getting to work).
Disables -esp_fastpath for now for x64 (i#2027 covers implementing it).
Disables -zero_stack for UNIX x64 due to redzone incompatibility (#2305 covers fixing).

Does not yet enable tests: that is coming soon.

Issue: #111
derekbruening added a commit that referenced this issue Aug 28, 2017
Fixes some fastpath issues and fixes some issues within tests themselves to
get more tests working.  On the fastpath, adds OR-ing of the eflags top
byte into 32-bit shadow dsts; does a better fix for widening the shadow for
zero-propagation; and casts shadow constants for x64 encoding.

Properly marks the stack near the stack pointer as undef and not just the
redzone.

Ports tests/selfmod.c to x64.
Disables tests/operators OOM test: i#2029 covers fixing for x64.
Disable wrap tests: i#2030 covers re-enabling for x64.

Issue: #111, #2029, #2030
@derekbruening
Copy link
Contributor Author

a83d8f3 enables 64-bit full mode on Linux though we're still missing push/pop and esp fastpaths.

derekbruening added a commit that referenced this issue Mar 9, 2019
Updates the options, tests, and documentation for making full mode the
default for 64-bit Windows.

Issue: #111
derekbruening added a commit that referenced this issue Mar 9, 2019
Updates the options, tests, and documentation for making full mode the
default for 64-bit Windows.

Issue: #111
derekbruening added a commit that referenced this issue Mar 10, 2019
For x64 we do not yet have -esp_fastpath, but we want to support
-leaks_only.  It uses part of the -esp_fastpath path to run a stack
zeroing loop, but it does not actually need the -esp_fastpath gencode,
so we simply remove the option check and route to the fastpath
handler.

Issue: #111, #677
derekbruening added a commit that referenced this issue Mar 10, 2019
For x64 we do not yet have -esp_fastpath, but we want to support
-leaks_only.  It uses part of the -esp_fastpath path to run a stack
zeroing loop, but it does not actually need the -esp_fastpath gencode,
so we simply remove the option check and route to the fastpath
handler.

Issue: #111, #677
derekbruening added a commit that referenced this issue Mar 11, 2019
Adds several recent syscalls to eliminate false positives in the x64
procterm test on Windows.

Issue: #111
derekbruening added a commit that referenced this issue Mar 11, 2019
Adds several recent syscalls to eliminate false positives in the x64
procterm test on Windows.

Issue: #111
derekbruening added a commit that referenced this issue Mar 11, 2019
Disables wrap-malloc tests as we do not support wrapping for 64-bit (i#2030).
Updates the redzone_size parameter to require 16-byte alignment
for 64-bit and changes the redzone8 test to redzone16 for 64-bit.

Issue: #111, #2030
derekbruening added a commit that referenced this issue Mar 11, 2019
Disables wrap-malloc tests as we do not support wrapping for 64-bit (i#2030).

Updates the redzone_size parameter to require 16-byte alignment
for 64-bit and changes the redzone8 test to redzone16 for 64-bit.

Valgrind annotations are not available for 64-bit Windows, so disable the
annotations test.

Issue: #111, #2030
derekbruening added a commit that referenced this issue Mar 12, 2019
Fixes a few of the failing 64-bit Windows full-mode tests:

+ Adds a default suppression for i#2170: what looks like a
  real bug in RtlRestoreContext context copying.
+ Expands registers.res to match both rcx and ecx.
+ Expands runtest.cmake to handle nested %if in a .res file
  for %if UNIX when %endif UNIX is used, for cs2bug.res.

Issue: #111, #2170
derekbruening added a commit that referenced this issue Mar 12, 2019
Fixes a few of the failing 64-bit Windows full-mode tests:

+ Adds a default suppression for i#2170: what looks like a
  real bug in RtlRestoreContext context copying.
+ Expands registers.res to match both rcx and ecx.
+ Expands runtest.cmake to handle nested %if in a .res file
  for %if UNIX when %endif UNIX is used, for cs2bug.res.

Issue: #111, #2170
derekbruening added a commit that referenced this issue Mar 17, 2019
Fixes the following win64 bugs:

+ Fixes the use of %l{d,u} instead of %z{d,u} in symcache and several
  other places.  This caused the symcache files to never match,
  causing delays and timeouts on some tests, especially those using
  /MDd, due to DRi#2175.

+ Changes short jumps to long jumps in several fastpath locations to
  avoid failures to reach due to longer x64 instructions.

+ Generalizes handling of OP_bswap which assumed a maximum size of 4
  bytes.

+ Adds a workaround for DRi#3453 to avoid an assert with
  -verify_sysnums.

Issue: #111
derekbruening added a commit that referenced this issue Mar 17, 2019
Fixes the following win64 bugs:

+ Fixes the use of %l{d,u} instead of %z{d,u} in symcache and several
  other places.  This caused the symcache files to never match,
  causing delays and timeouts on some tests, especially those using
  /MDd, due to DRi#2175.

+ Changes short jumps to long jumps in several fastpath locations to
  avoid failures to reach due to longer x64 instructions.

+ Generalizes handling of OP_bswap which assumed a maximum size of 4
  bytes.

+ Adds a workaround for DRi#3453 to avoid an assert with
  -verify_sysnums.

Issue: #111
derekbruening added a commit that referenced this issue Mar 17, 2019
Fixes tests/operators taking forever on its OOM test by tweaking the
code to avoid compiler warnings on very large allocations.

Fixes x64 bugs in handle stack operations:
+ Handle DR rip-rel mangling when decoding from the cache on
  the esp adjust slowpath.
+ Add an x64 chkstk pattern match.

Expands the i#2170 suppression to match ntdll.dll!RcConsolidateFrames.

Issue: #111, #2170
derekbruening added a commit that referenced this issue Mar 17, 2019
Fixes tests/operators taking forever on its OOM test by tweaking the
code to avoid compiler warnings on very large allocations.

Fixes x64 bugs in handle stack operations:
+ Handle DR rip-rel mangling when decoding from the cache on
  the esp adjust slowpath.
+ Add an x64 chkstk pattern match.

Expands the i#2170 suppression to match ntdll.dll!RcConsolidateFrames.

Suppress the rest of the win64 full mode failing tests to get Appveyor green.

Issue: #111, #2170, #2180
derekbruening added a commit that referenced this issue Jan 16, 2021
Pulls scasq and cmpsq off the fast path to avoid an assert for load2x
with the 2nd operand 8 bytes.  Adding the fastpath support we'd like
long-term is under the general #111.

Adds test cases to asmtest, which reproduce the assert.

Fixes #2183
derekbruening added a commit that referenced this issue Jan 16, 2021
Pulls scasq and cmpsq off the fast path to avoid an assert for load2x
with the 2nd operand 8 bytes.  Adding the fastpath support we'd like
long-term is under the general #111.

Adds test cases to asmtest, which reproduce the assert.

Fixes #2183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant