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 instruction and memref. #7058

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ivankyluk
Copy link
Contributor

@ivankyluk ivankyluk commented Oct 28, 2024

Change the implementation to remove instructions and memrefs preempted by kernel events.

Interruption by RSEQ ABORT follows by KERNEL EVENT is already handled by handle_kernel_interrupt_and_markers().
Unit test test_rseq_rollback_legacy covers this case.

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
@@ -13,7 +13,7 @@ Total counts:
.* total data loads
Copy link
Contributor

Choose a reason for hiding this comment

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

I looked back at the details and I really do not understand what is happening with this. Could you explain how this scenario occurred? I wrote some of my confusion at #7050 (comment).

Putting aside the fact that a regular asynch signal should not cause this kind of thing: if there were some real preempt from say thread relocation, why isn't raw2trace filling in the rest of the instructions in the block? How is the handler code running already? That makes it sound like raw2trace is already truncating the rest of the block and somehow solving #5790? On that note is this PR as written solving #5790?

Copy link
Contributor

Choose a reason for hiding this comment

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

What is in the raw trace records? What is the instruction count for the shl block? What is the exact raw trace order of the branch's block PC, shl block PC, shl address, and signal marker?

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