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

Support mutable globals during x86 verification #712

Merged
merged 5 commits into from
May 20, 2020
Merged

Conversation

chameco
Copy link
Contributor

@chameco chameco commented May 15, 2020

To facilitate this, I've refactored a bunch of functions to use a MonadState rather than passing many arguments / returning large tuples. This makes the diff unpleasantly large, but the only "real" changes are in initialState, setupGlobals, and executePointsTo.

@chameco chameco requested a review from andreistefanescu May 15, 2020 18:15
Copy link
Contributor

@andreistefanescu andreistefanescu left a comment

Choose a reason for hiding this comment

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

Let's split this in two commits: one that introduces X86Sim, and does not make any other changes, and one that builds on top of that to add support for mutable globals.

src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Show resolved Hide resolved
@chameco chameco force-pushed the x86-mutable-globals branch from fb3c58c to 74e26cb Compare May 15, 2020 19:13
Copy link
Contributor

@andreistefanescu andreistefanescu left a comment

Choose a reason for hiding this comment

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

Looks good now! Would it be complicated to add a test?

src/SAWScript/Crucible/LLVM/X86.hs Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
src/SAWScript/Crucible/LLVM/X86.hs Outdated Show resolved Hide resolved
Mem {- ^ The state of memory before simulation -} ->
Regs {- ^ The state of the registers before simulation -} ->
X86Sim ()
assertPost env premem preregs = do
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is very easy to review, github highlights the liftIO 👍

Just LeqProof -> do
off' <- W4.bvZext sym (knownNat @64) off
X86Sim ()
setArgs env tyenv nameEnv args
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is not easy to review, because of the format changes, which is why I don't like where

@chameco chameco merged commit 3f8566d into master May 20, 2020
@RyanGlScott RyanGlScott added the subsystem: x86 Issues related to verifying x86 binaries via Macaw label Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: x86 Issues related to verifying x86 binaries via Macaw
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants