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

i#7050: Remove preempted and faulting instruction from the drmemtraces. #7058

Merged
merged 33 commits into from
Nov 14, 2024

Conversation

ivankyluk
Copy link
Contributor

@ivankyluk ivankyluk commented Oct 28, 2024

Change the implementation to remove preempted and faulting instructions from drmemtraces. The objective of the change is to remove non-retired instructions and the corresponding memrefs from drmemtraces.

When an instruction is removed, a new marker TRACE_MARKER_TYPE_UNCOMPLETED_INSTRUCTION will be added. Its value is the encoding of the removed instruction up to the size of a pointer.

Renamed handle_kernel_interrupt_and_markers() to handle_rseq_abort_marker() since the function has been modified to handle rseq abort.

In oder to remove preempted instructions and memrefs, a new function preempted_by_kernel_event() is added to look for KERNEL EVENT marker which may be preceded by memrefs. If a KERNEL EVENT marker is found with the same PC, the instruction and any following memrefs are removed.

Add unit tests to cover instruction and memref removed caused by a KERNEL EVENT.

Update offline-legacy-int-offs.templatex, offline-burst_aarch64_sys.templatex and signal_invariants.c to account for removed instructions.

Fixes #7050

…ansfer.

When an instruction is preempted by a kernel transfer, the instruction
is not retired. The trace might not have captured all the read and write
records. To avoid false positive, the invariant checker should reset the
expected read and write record counters.

Fixes #7050
@ivankyluk ivankyluk changed the title I7050 remove preempted instructions I=i#7050 remove preempted instruction and memref. Oct 28, 2024
@ivankyluk ivankyluk changed the title I=i#7050 remove preempted instruction and memref. i#7050 remove preempted instruction and memref. Oct 28, 2024
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.cpp Outdated Show resolved Hide resolved
@ivankyluk ivankyluk changed the title i#7050 remove preempted instruction and memref. i#7050 remove preempted and faulting instruction from the trace. Nov 9, 2024
Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to bump the trace version since this does change the behavior and may cause issues in existing simulators.

clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/raw2trace_unit_tests.cpp Outdated Show resolved Hide resolved
clients/drcachesim/tests/signal_invariants.c Outdated Show resolved Hide resolved
clients/drcachesim/tools/view.cpp Show resolved Hide resolved
clients/drcachesim/tracer/raw2trace.h Outdated Show resolved Hide resolved
@ivankyluk ivankyluk changed the title i#7050 remove preempted and faulting instruction from the trace. i#7050: Remove preempted and faulting instruction from the trace. Nov 11, 2024
api/docs/release.dox Outdated Show resolved Hide resolved
api/docs/release.dox Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
clients/drcachesim/common/trace_entry.h Outdated Show resolved Hide resolved
api/docs/release.dox Outdated Show resolved Hide resolved
clients/drcachesim/docs/drcachesim.dox.in Outdated Show resolved Hide resolved
clients/drcachesim/docs/drcachesim.dox.in Outdated Show resolved Hide resolved
clients/drcachesim/docs/drcachesim.dox.in Show resolved Hide resolved
clients/drcachesim/tools/view.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not seeing anything major, but could you resolve the 19 open comments?

clients/drcachesim/common/trace_entry.h Show resolved Hide resolved
@derekbruening
Copy link
Contributor

Not seeing anything major, but could you resolve the 19 open comments?

I didn't see replies: please reply when resolving so the replies show up in the email and it's clear what the resolution was (even if just "Done" that is helpful vs a silent resolution).

Copy link
Contributor

@derekbruening derekbruening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting the top-level comment here to re-enable the re-request-review:

Not seeing anything major, but could you resolve the 19 open comments?

I didn't see replies: please reply when resolving so the replies show up in the email and it's clear what the resolution was (even if just "Done" that is helpful vs a silent resolution). Please reply to the 19 so it's clear what the current status is.

@ivankyluk ivankyluk merged commit 77b7b2b into master Nov 14, 2024
17 checks passed
@ivankyluk ivankyluk deleted the i7050-remove-preempted-instructions branch November 14, 2024 01:30
ivankyluk added a commit that referenced this pull request Nov 14, 2024
… rseq_aborted. (#7086)

raw2trace_t::handle_rseq_abort_marker() uses different names of the last
parameter. It's interrupted in raw2trace.h
but it is rseq_aborted in raw2trace.cpp.

Change the name from interrupted to rseq_aborted to be consistent with
raw2trace.cpp.

The inconsistency was introduced by PR #7058.

Fixes: #7084
ivankyluk added a commit that referenced this pull request Dec 19, 2024
…RETIRED_INSTRUCTIONS_ONLY. (#7156)

Add a new trace version TRACE_ENTRY_VERSION_RETIRED_INSTRUCTIONS_ONLY
for #7050 and bump the TRACE_ENTRY_VERSION.

Rename OFFLINE_FILE_VERSION_RETIRED_INSTRUCTIONS_ONLY to
OFFLINE_FILE_VERSION_NO_OP since there were no changes in the raw trace
by #7050.

#7058 incorrectly changed the OFFLINE_FILE_VERSION, it should have
changed TRACE_ENTRY_VERSION instead.

Issue: #7050
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tool.drcacheoff.invariant_checker failed with "Missing read/write records"
2 participants