Commit Graph

291 Commits

Author SHA1 Message Date
Tristan Ravitch
e3aaf47a50
Tr/update submodules (#105)
The main change here is in macaw-semmc to account for a change to the BVOrBits
operation in Crucible.
2020-01-25 12:25:38 -08:00
Tristan Ravitch
d119a9ed5a
Update submodules (#104)
The main change here is in macaw-semmc to account for a change to the BVOrBits
operation in Crucible.
2020-01-17 16:17:30 -08:00
Tristan Ravitch
b44e8c480f Update the semmc submodule
This brings it up to master.  The submodule has some improvements to synthesis,
but they changed some APIs.
2019-11-21 20:42:05 -08:00
Tristan Ravitch
9e9eb1b770 Fix macaw-ppc compilation
Fixes #80, which removed a type parameter from `IntraJumpBounds`
2019-11-19 17:28:40 -08:00
Tristan Ravitch
4c7a69b11d Update macaw-ppc to account for recent changes in macaw-base
The main changes are:

- `postCallAbsState` was removed from the architecture info
- `mkInitialRegsForBlock` was renamed to `initialBlockRegs` and takes slightly
  different parameters
- There is a new type family and some new functions in the architecture info
  relating to post-block/terminator abstract state construction

PowerPC doesn't need any extra information to compute post-block abstract
states, so we use () as the ArchBlockPrecond type.
2019-11-12 17:27:14 -08:00
Joe Hendrix
494aff6ff0
This makes a number of changes to abstract domains.
The goal is to support a jumptable testcase that is not supported by
the current jump bounds check.  The jump bounds check needs to be
augmented so that it understands equality relationships between stack
values and registers, and bounds on both.

This patch tracks when a register points to a concrete stack offset.

As part of this, we droped the AbsDomain instance for AbsBlockState.
Clients should now likely use `fnStartAbsBlockState` in lieu of `top`.

The other client visible change is that the ClassifyFailure
constructor now has an extra argument with details about why
classification failure occured.
2019-08-21 23:29:16 -07:00
Tristan Ravitch
06f64078df
Wip/ppc no block labels (#66)
Update to API changes in macaw-base in macaw-ppc and macaw-arm

The "block label" abstraction (used during arch-specific disassembly) was removed some time ago in the base macaw library.  This change updates macaw-ppc and macaw-arm to remove uses of block labels.  The major change is that the disassembly function only returns a single block at a time instead of a sequence of blocks.

To facilitate this, the handling of the PowerPC conditional trap instruction (trap doubleword) is now an architecture-specific terminator instruction instead of encoding the logic of conditional trapping.  We will now have to encode the conditional trapping logic in macaw-ppc-symbolic.  Note that we have not done so yet.

This commit also updates the expected results of the PowerPC tests; the number of discovered blocks is different, but not significantly so.  It is hard to tell if this is a regression or an improvement.
2019-08-09 16:11:59 -07:00
Kevin Quick
fb31de230f
Merge branch 'master' into semiring_upd 2019-07-19 13:17:09 -07:00
Kevin Quick
6f76e4bef2
[macaw-ppc] Add test to check the number of blocks found for gzip.
Verifies that the number of blocks found matches what should generally
be expected from this particular executable.

The specific value checked for is not independently verified, it just
happens to be a reasonable-looking value that the discovery process
currently identifies, and encoding it here ensures that if discovery
ever changes that the change will be seen and explicitly accepted or
fixed as needed.
2019-07-11 14:25:13 -07:00
Kevin Quick
f525351621
Handle conversions for Float Mux in macaw-ppc. 2019-07-11 13:55:01 -07:00
Kevin Quick
a89ca13413
[macaw-ppc] Update for semiring changes in What4 Exprs. 2019-07-11 11:24:23 -07:00
Joe Hendrix
fbb3b300ce
Prep work to get building with warning as errors. 2019-03-25 14:39:33 -07:00
Luke Maurer
68ae66bff5 NatRepr changes 2019-02-13 14:21:48 -08:00
Kevin Quick
0f97a86c3e
Added missing pretty-printer import. 2019-02-08 17:29:03 -08:00
Kevin Quick
9f46c9e60b Merge branch 'master' of github.com:GaloisInc/macaw-semmc 2019-02-08 14:37:54 -08:00
Luke Maurer
8d3c501fd0 Coerce PPCTermStmts rather than returning new ones when rewriting
This was eating up a surprising amount of heap space.
2019-01-28 14:48:25 -08:00
Kevin Quick
4e32007436
[ppc] Use pretty representation for IP in error messages. 2019-01-22 23:17:24 -08:00
Tristan Ravitch
7e573101b4 Finish porting macaw-ppc to use the unified PPC architecture tag 2019-01-08 13:27:40 -08:00
Tristan Ravitch
be3bc845f9 Change an 'undefined' to a more informative error 2019-01-08 11:22:55 -08:00
Luke Maurer
dbce1b1265 Refactor to use AnyPPC 2018-12-21 11:47:40 -08:00
Luke Maurer
b5a75832a3 Adapt to and re-export new AnyPPC arch constructor 2018-12-20 16:43:46 -08:00
Kevin Quick
294299a8eb
[macaw-ppc] ArchitecturInfo updates: mkInitialRegsForBlock, checkForReturnAddr. 2018-12-13 22:48:26 -08:00
Daniel Wagner
718467815b fix GaloisInc/semmc/issues/15
We now thread a snapshot of the register state from the beginning of the
instruction evaluation through each instruction's semantics instead of
re-fetching register values each time we need it and potentially seeing
incorrect, partially modified register values.
2018-12-03 17:34:18 -05:00
Tristan Ravitch
72040c023d Fix handling of InstructionStart
The field it contains is supposed to be the instruction offset in its basic
block; overflowing it can cause significant problems during symbolic simulation.
2018-11-28 20:26:58 -08:00
Tristan Ravitch
30b5d2e091 Update macaw-arm and macaw-ppc to emit extra metadata
There is a new metadata statement that tracks the start address of each
instruction.  This is used in the translation to Crucible to provide better
error messages.  The x86 backend was already updated, this commit adds the
metadata to the ARM and PowerPC backends.
2018-11-28 10:22:25 -08:00
Tristan Ravitch
ff79eba6aa ppc: Use the new HasTOC class
This avoids a hard dependency on the exact format of ArchBinaryData for PowerPC
2018-10-30 11:01:46 -07:00
Tristan Ravitch
ebcbbe6c5c Remove the BinaryAddrWidth type family 2018-10-30 10:34:56 -07:00
Kevin Quick
d464403a25
Update tests from deprecated relativeSegmentAddr to segoffAddr. 2018-10-29 15:55:41 -07:00
Kevin Quick
730f855c71
Update to use macaw-loader for uniform binary loading. 2018-10-29 15:51:42 -07:00
Tristan Ravitch
ee58037c2d Make the powerpc tests more verbose when encountering a translation error 2018-10-24 10:26:55 -07:00
Tristan Ravitch
f1ac01edd9 Update to the latest macaw 2018-10-23 11:49:23 -07:00
Andrei Stefanescu
f3f2732663 Fix PPC SBVToFloat translation. 2018-09-19 18:45:50 -07:00
Andrei Stefanescu
1c002f160b Minor fixes. 2018-09-18 21:56:17 -07:00
Andrei Stefanescu
32961d20cb Use name instead of nonce id for uninterpreted functions. 2018-09-14 19:01:27 -07:00
Andrei Stefanescu
85ef5b4f0b Add float le and float round. 2018-09-14 19:01:19 -07:00
Andrei Stefanescu
4b498807fd Handle floating-point rounding. 2018-09-12 11:10:23 -07:00
Andrei Stefanescu
dab4f92ed9 Use BVSelect instead of BVTrunc. 2018-09-06 14:47:37 -07:00
Andrei Stefanescu
2886c86e2b Add floats to Macaw-PPC. 2018-09-06 14:47:37 -07:00
Andrei Stefanescu
fcf39588e1 Update macaw-ppc and macaw-arm to use the latest What4.ExprBuilder. 2018-08-16 20:20:50 -07:00
Tristan Ravitch
f7b87224a4 Update to the latest macaw
In macaw core, the type of the arch-specific 'disassemble' function changed to
no longer take a Memory, and to pass the maximum offset as an Int instead of a
MemWord.  It also removed the jump table entry size (which is no longer
required).

The removal of the Memory parameter required a bit of a change in how the
instruction parsers are structured, but it isn't a huge change (the "memory
contents after an address" can be computed from a MemSegmentOff, too).
2018-08-16 10:26:55 -07:00
Tristan Ravitch
d5cab147e5 Remove some GHC optimization flags
The goal with these flags was to improve compile times by reducing the number of
times that the simplifier runs.  It seems like that sometimes causes compiler
errors (e.g., the register allocator crash we hit sometimes) - presumably the
register allocator makes some assumptions about how much the simplifier is run.
2018-08-14 20:32:57 -07:00
Tristan Ravitch
ff80d7e676 Improve the TH generator for instruction matchers (i.e., execInstruction)
The previous generator put all of the code for each matcher in a single large
case expression.  While there were individual functions broken out for each case
body, they were all still in the same let expression, which created a huge term.

This refactoring lifts all of the semantics definition bodies to the top
level (with NOINLINE pragmas) to give the code generator less to chew on at a
time.

This improves compile times a little, but, more importantly, works around a bug
in the register allocator in GHC 8.4 that caused a crash in the PowerPC
semantics functions.
2018-07-26 17:17:09 -07:00
Tristan Ravitch
981b775c7c Update submodules 2018-07-24 16:57:36 -07:00
Tristan Ravitch
aee4309c85 Merge branch 'master' of github.com:GaloisInc/macaw-semmc into HEAD 2018-07-03 17:53:41 -07:00
Tristan Ravitch
332e85b8b1 ppc: Implement semantics for TD and TDI
The semantics for these instructions cannot be represented in our semantics
language, as they have side effects (i.e., they trap).  This currently means
that we have to implement their semantics by hand in macaw-ppc.
2018-07-03 17:44:40 -07:00
Luke Maurer
7232622bd8 Support defined functions in PPC32; use all defined functions in PPC 2018-07-03 12:24:34 -07:00
Luke Maurer
2b5adeb1c4 Support for defined functions in PPC64 2018-07-03 12:24:34 -07:00
Tristan Ravitch
cad178cd62 ppc: Fix identifyReturn
Some recent semantics fixes broke a fragile pattern in identifyReturn; there is
now an extra shiftR.
2018-06-14 14:57:32 -07:00
Daniel Wagner
04e867bf4b future-proof alignment detection 2018-06-12 14:18:19 -04:00
Daniel Wagner
9874e6db20 IP alignment rulesfor PPC 2018-06-11 10:36:18 -04:00