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

Widen modidx field in offline_entry_t. #2969

Merged
merged 9 commits into from
Apr 28, 2018

Conversation

snehasish
Copy link
Contributor

Extend the modidx field from 12 bits to 16. The 4 bits are claimed from
the instr_count field which records the number of instructions in the
basic block. The number of instructions is controlled by a command line
parameter. We check that the max_bb_instr is set to number lower than
what we can accomodate in the bitfield.

Fixes #2956

Extend the modidx field from 12 bits to 16. The 4 bits are claimed from
the instr_count field which records the number of instructions in the
basic block. The number of instructions is controlled by a command line
parameter. We check that the max_bb_instr is set to number lower than
what we can accomodate in the bitfield.

Fixes DynamoRIO#2956
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from
the instr_count field which records the number of instructions in the
basic block. The number of instructions is controlled by a command line
parameter. We check that the max_bb_instr is set to number lower than
what we can accomodate in the bitfield.

Fixes DynamoRIO#2956
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from
the instr_count field which records the number of instructions in the
basic block. The number of instructions is controlled by a command line
parameter. We check that the max_bb_instr is set to number lower than
what we can accomodate in the bitfield.

Fixes DynamoRIO#2956
Extend the modidx field from 12 bits to 16. The 4 bits are claimed from
the instr_count field which records the number of instructions in the
basic block. The number of instructions is controlled by a command line
parameter. We check that the max_bb_instr is set to number lower than
what we can accomodate in the bitfield.

Fixes DynamoRIO#2956
uint64_t modidx:12;
uint64_t instr_count:16;
uint64_t modidx:16;
uint64_t instr_count:12;
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest either a comment here advising that a change here needs to also update the hardcoded sizes in the 2 other files, or to use named constants (as is done with EXT_VALUE_A_BITS, e.g.) -- I would vote for the named constants.

uint64_t modoffs = dr_app_pc_as_jump_target(instr_get_isa_mode(where), pc) - modbase;
// Check that the values we want to assign to the bitfields in offline_entry_t do not
// overflow. In i#2956 we observed an overflow for the modidx field.
DR_ASSERT(modoffs < uint64_t(1) << 34);
Copy link
Contributor

Choose a reason for hiding this comment

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

These should all be the bitfield size, not +1

Use named constants for the bit widths. Fix bug in bit width check.
@snehasish
Copy link
Contributor Author

PTAL. Thanks!

@derekbruening derekbruening merged commit 476407c into DynamoRIO:master Apr 28, 2018
snehasish added a commit to snehasish/dynamorio that referenced this pull request Apr 29, 2018
This reverts commit 48db566 which
reverted the changes in PR DynamoRIO#2940. The changes pushed caused some apps to
overflow the modidx field (issue DynamoRIO#2956). PR DynamoRIO#2969 increased the width of
the modidx field. We can now safely revert the revert.
derekbruening pushed a commit that referenced this pull request Apr 29, 2018
This reverts commit 48db566 which
reverted the changes in PR #2940. The changes pushed caused some apps to
overflow the modidx field (issue #2956). PR #2969 increased the width of
the modidx field. We can now safely revert the revert.

Issue: #2006, #2939, #2956
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.

2 participants