Commit Graph

2004 Commits

Author SHA1 Message Date
Tristan Ravitch
7ec8df5e92
aarch32: Two bug fixes
* Fix block size accounting in the disassembler

The value in the early failure combinator is used as the *block size* in the
resulting macaw block.  The code was actually using the offset from the
beginning of the segment, which is wrong.  This produced very large blocks that
didn't reflect the results of code discovery and led to decode errors later in
the pipeline.

* Do not throw an error if concreteIte has a symbolic argument

The `concreteIte` combinator turns formula conditionals with concrete operands
into Haskell-level conditional execution.  It would fail because we believed
that there were no cases that could fail to satisfy that condition.  That
assumption was not true - we need to fall back to generating a mux when we have
a symbolic condition.
2020-06-11 15:28:23 -07:00
Kevin Quick
b82ca35564
Merge pull request #142 from GaloisInc/ghc_8_4
Update for GHC 8.4 type management.
2020-06-04 21:47:48 -07:00
Kevin Quick
2c23067318 Update submodules. 2020-06-03 21:37:37 -07:00
Kevin Quick
c625c2cf92
Update for GHC 8.4 type management.
Under GHC8.4, a let binding is independent of the surrounding context,
so the let statements encountered errors related to type matching on
synthesized internal type parameters that could not be identified as
the same due to rigid skolem type binding inside the let.
2020-06-02 11:35:40 -07:00
Sam Breese
02c6cc3cb5
Handle bitwise operations on stack offset abstract values (#136)
- Generalize handling of bitwise operations to also apply them to stack offsets
- Use the extended bitwise handling on AND
2020-05-28 14:04:06 -04:00
Tristan Ravitch
89fc5a73f7
Tr/full arm intrinsics (#137)
Improve the TH codegen for macaw-semmc

This change lazily translates as much as possible.  It also generates somewhat more compact code. This change also finishes implementing primitives for the aarch32 backend.  Complementing the aarch32 changes, the macaw-semmc interface has been modified to allow macaw-aarch32 to avoid a redundant serialize-deserialize round.

Co-authored-by: Kevin Quick <kquick@galois.com>
2020-05-26 09:24:45 -07:00
Kevin Quick
162d7f0c2c
Merge pull request #138 from GaloisInc/release_2_1_0
Update submodules for parameterized-utils release 2.1.0 compatibility.
2020-05-22 14:57:59 -07:00
Kevin Quick
e78c6ad8b5 Merge branch 'release_2_1_0' of github.com:galoisinc/macaw into release_2_1_0 2020-05-22 14:28:47 -07:00
Kevin Quick
ccda70607a
Remove stack files.
These are currently broken.  If someone is actively interested in
using stack to build then the files could be re-instated from this
position and updated, but it's better to not have them if they are not
used or maintained.
2020-05-22 14:27:49 -07:00
Kevin Quick
4a56736888
Merge branch 'master' into release_2_1_0 2020-05-22 01:31:23 -07:00
Kevin Quick
5c1ca99345
Add a project freeze file for GHC 8.8.3. 2020-05-22 00:06:50 -07:00
Kevin Quick
0f430d1b38
Update dependencies for GHC 8.4 support. 2020-05-21 23:42:41 -07:00
Kevin Quick
b941c1c5cb
No Werror in travis: it extends to all dependencies. 2020-05-21 14:48:53 -07:00
Kevin Quick
9de6ca502a
Misspelling in travis file. 2020-05-21 13:40:18 -07:00
Kevin Quick
dcc240936e
Update desired test targets for travis build. 2020-05-21 13:26:07 -07:00
Kevin Quick
9332d24d63
More travis updates. 2020-05-21 06:10:54 -07:00
Tristan Ravitch
e7cff66577
Fix a failure case in the macaw-ppc disassembler logic (#140)
This code was confusing what "offset" to pass to the `failAt` function.  Some
sites were passing the offset from the beginning of the block (correct), while
others passed the offset from the start of the segment (incorrect).  The
incorrect values were later used as block sizes, which caused some downstream
failures (in renovate).

This commit uniformly fails with the offset from the start of the block.
2020-05-20 23:36:53 -07:00
Kevin Quick
9741c075c4
Fix reference to cabal.project.dist in travis yaml file. 2020-05-20 20:37:47 -07:00
Kevin Quick
75da3580a8
Initial cabal-based travis configuration. 2020-05-19 16:20:42 -07:00
Kevin Quick
d8dbadf6a5
Add QuickCheck 2.4 to stack configurations for travis. 2020-05-18 15:19:24 -07:00
Kevin Quick
3e9ecbaa8e
Update submodules for parameterized-utils release 2.1.0 compatibility. 2020-05-17 22:49:37 -07:00
Kevin Quick
24899bc0d1
Merge pull request #135 from GaloisInc/aarch_bv_upd2
Update bv-sized package constraints.
2020-05-16 17:41:54 -07:00
Kevin Quick
aff97bec6a
Update bv-sized lower constraint to allow parameterized-utils 2.1.0. 2020-05-15 10:25:12 -07:00
Kevin Quick
5da67a8ec1
Update bv-sized package constraints. 2020-05-15 10:22:20 -07:00
Kevin Quick
bf4f9edc5c
Merge pull request #134 from GaloisInc/aarch32_bv_upd
[macaw-aarch32] Update for bv-sized API changes in version 1.0
2020-05-15 10:06:15 -07:00
Kevin Quick
3bee174f5f
[macaw-aarch32] Update for bv-sized API changes in version 1.0 2020-05-14 16:48:54 -07:00
Kevin Quick
d5defe04c2
Merge pull request #133 from GaloisInc/macaw_ppc_testfix
[macaw-ppc] Update test expectations for number of discovered blocks.
2020-05-14 11:22:06 -07:00
Kevin Quick
fb86f7acae
[macaw-ppc] Update test expectations for number of discovered blocks.
This change is probably due to the BitTrie modifications in
dismantle-tablegen.  It's not clear whether the older or newer number
of discovered blocks is correct; testing at this point is focused more
on getting roughly the correct order of magnitude rather than being
refined enough for high precision values.
2020-05-13 21:29:57 -07:00
Ben Selfridge
76868cf457
Fixed buggy rewrite rules involving testBit/shifts (#132)
* Fixed buggy rewrite rule involving testBit/shifts
2020-05-05 15:45:36 -07:00
brianhuffman
3a1396b500
Merge pull request #131 from GaloisInc/fix-warnings
Make code compile without warnings in ghc-8.6 and ghc-8.8.
2020-04-24 15:13:19 -07:00
Brian Huffman
f65c80d7b1 Make code compile without warnings in ghc-8.6 and ghc-8.8. 2020-04-23 20:22:30 -07:00
Tristan Ravitch
02c2fcd96a
Clean up the PowerPC architecture specifications (#130)
This commit reduces duplication in the PowerPC backend.  Instances are now in terms of the generic `AnyPPC` type, rather than having separate instances for 32 and 64 bit.  Shuffling some type parameters also allows us to remove a large number of type equalities that e.g., fix the arch register type to `PPCReg`.
2020-04-19 11:56:42 -07:00
Kevin Quick
8185758781
Merge pull request #128 from GaloisInc/fix_m_semmc_haddocks
Fix haddocks for macaw-semmc.
2020-04-14 15:53:33 -07:00
Kevin Quick
4d5345339a
Fix haddocks for macaw-semmc.
Commented out guard statements look like haddocks and confuse haddock.
2020-04-14 15:53:45 +00:00
Tristan Ravitch
a824fc4051
Tr/warning cleanups (#127)
Warning and style cleanups in macaw-semmc and macaw-aarch32
2020-04-14 00:07:15 -07:00
Kevin Quick
d6de268bbd
Merge pull request #126 from GaloisInc/fix_symbolic_tests
Small fixes to macaw-symbolic tests for recent changes.
2020-04-13 00:40:34 -07:00
Kevin Quick
34c40e086b
Update doctest fix to support older GHC 8.4. 2020-04-13 07:25:54 +00:00
Kevin Quick
dd368540fd
Small fixes to macaw-symbolic tests for recent changes. 2020-04-13 06:59:16 +00:00
Tristan Ravitch
7b804ead2b
Merge pull request #125 from GaloisInc/tr/travis-fix
Fix warnings
2020-04-12 20:47:37 -07:00
Tristan Ravitch
81515c7954 Add a descriptive failure for the trace memory model on x86 2020-04-12 20:32:17 -07:00
Tristan Ravitch
c0717413e5 Fix warnings 2020-04-12 20:15:20 -07:00
Tristan Ravitch
e536e43f1b Introduce macaw-aarch32 and macaw-aarch32-symbolic
These packages replace the old macaw-arm (which has been removed).  The only
change to the core macaw is to introduce a `Lift` instance for the Endianness
data type, which is used in macaw-semmc.

The macaw-aarch32 package uses the official ARM semantics (via the
asl-translator package).  In its current state, macaw-aarch32 seems to handle
the common idioms of simple ARM binaries.  Position independent executables have
not been tested yet.  The semantics and disassemblers for Thumb are present, but
not integrated into code discovery at this time.  There are some tests in
macaw-aarch32.  Compile times are longer than necessarily desired.
macaw-aarch32 can be compiled in two modes: lite mode (cabal flag -fasl-lite),
which uses a restricted set of instructions for testing, and takes less time to
compile.  The full instruction set is the default, though there are a few
undefined functions that are not yet handled for the full set, mostly relating
to floating point operations.

The macaw-aarch32-symbolic package is currently a stub, but is implemented to
provide a few necessary instances.
2020-04-12 19:53:00 -07:00
Tristan Ravitch
938734d1e9 Submodule updates 2020-04-12 19:39:52 -07:00
Tristan Ravitch
73f758544d Update tests and expected outputs
The tests were issuing the exit syscall incorrectly (they didn't set the sycall
number) and were not executable.
2020-04-08 21:21:28 -07:00
Tristan Ravitch
3e1c2aa487 Warning cleanup 2020-04-08 20:27:29 -07:00
Tristan Ravitch
cbe4a9f0c0 Fix the macaw-ppc build 2020-04-08 20:19:33 -07:00
Tristan Ravitch
fabb8799d8 Make tests less chatty 2020-04-08 19:57:26 -07:00
Tristan Ravitch
958aeaa3ed Remove the nested mux match rule from macaw core
We can now do enough rewriting in the ARM backend that it isn't needed.  This
adds extra ARM rewriting rules and a term cache to make matching easier.
2020-04-08 19:46:32 -07:00
Tristan Ravitch
d865811701 In ARM, read the current register value from a snapshot
We were reading partially updated values that were committed to the register
state out-of-order, yielding some bad results.

This commit takes a snapshot of the register state before executing each
instruction and only reads register values from the snapshot.
2020-04-08 11:54:28 -07:00
Tristan Ravitch
36c67eb586 Fix an error introduced during cleanup 2020-04-08 07:27:28 -07:00