Commit 90d9ebd
Virtual Fault Space Abstraction
This is a large change that will break your traces and your database
layouts. However, it repairs a lot of ad-hoc hacks that came into
FAIL* over the years.
What has changed?
=================
The Virtual Fault Space Abstraction
-----------------------------------
Files: sal/faultspace/*
sal/x86/X86Faultspace.*
sal/arm/ArmFaultSpace.*
Instead of mapping registers ad-hoc into the virtual address space in
order to smuggle the bit-packed register-id from import-trace through
prune-trace and DatabaseCampaign to the DatabaseExperiment, we make
this mapping now official and adaptable to more complex architectures.
From now on the data_address field in the database is a fsp_address_t.
These addresses are translated by the FS abstraction within the
importer, which uses the architecture specific description of the
virtual fault space.
Within our whole tool chain, we now only work with fault-space
addresses, which are the Y-axis of our fault space.
When the fault-space address is about to be injected, we decode the
numerical address to a FaultSpaceElement*, which knows how to inject a
fault into itself. Thereby, we can unify the injection over different
types of machine state and support multiple memory types.
Furthermore, this simplifies import-trace and the DatabaseExperiment
significantly.
A detailed description of can be found in Malte Bargholz' Master thesis[1]
Bit-Wise Pruning
----------------
Files: tools/import-trace/Importer.cc
Until now, every state (register/memory) access had to be at least 8
bits wide. While this is good for memory reads, which always access at
least a whole byte, this is not properly working for register
accesses. Especially, for our integration of more complex CPU
architectures (i.e., CHERI), we have to have bit-wise pruning to
inject only single tag bits instead of injecting always 8 tag bits.
Therefore, this change introduces bit-wise pruning for our importer.
Instead of tracking only a single left margin for every fault-space
address, we now track up to 8 different margins that are associated
with an access mask. Thereby, the importer (which is effectively a
def-use pruner) has to handle up to 8 left margins when accessing a
byte with an access mask of 0xff.
A detailed description of can be found in Malte Bargholz' Master thesis[1]
Unification of Disassembler Interface
-------------------------------------
The integration of the capstone disassembler into the RegisterImporter
was more or less a clone-and-own integration. However, as both
disassemblers basically perform the same task, a common interface is
possible.
Furthermore, the *FailTo*Translator* classes are no longer used for
injecting registers as the dissassembler has nothing to do with the
injector. This task is no performed by the virtual fault space.
This change was tested with:
- The integrated test-suite
- The fail-target repo and injection of register,memory,EIP,randomjump
- Both disassemblers
Currently untested:
- Gem5
[1] Quantifying Soft-Error Resilience of Embedded RISC-V Systems with Capability-based Memory Protection
https://www.sra.uni-hannover.de/Theses/2020/bargholz_20_ma.pdf
Co-authored-by: Christian Dietrich <dietrich@sra.uni-hannover.de>
Co-authored-by: Malte Bargholz <malte@screenri.de>1 parent c5f85b2 commit 90d9ebd
65 files changed
Lines changed: 1788 additions & 1607 deletions
File tree
- src/core
- comm
- cpn
- efw
- sal
- arm
- bochs
- faultspace
- x86
- util
- capstonedisassembler
- testing
- llvmdisassembler
- testing
- tools
- import-trace
- prune-trace
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
31 | 29 | | |
32 | | - | |
| 30 | + | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 52 | + | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
| |||
105 | 99 | | |
106 | 100 | | |
107 | 101 | | |
108 | | - | |
| 102 | + | |
109 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
110 | 107 | | |
111 | | - | |
| 108 | + | |
112 | 109 | | |
113 | 110 | | |
114 | 111 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 112 | | |
130 | 113 | | |
131 | 114 | | |
| |||
219 | 202 | | |
220 | 203 | | |
221 | 204 | | |
222 | | - | |
223 | | - | |
224 | 205 | | |
225 | 206 | | |
226 | 207 | | |
| |||
237 | 218 | | |
238 | 219 | | |
239 | 220 | | |
240 | | - | |
| 221 | + | |
241 | 222 | | |
242 | 223 | | |
243 | 224 | | |
| |||
246 | 227 | | |
247 | 228 | | |
248 | 229 | | |
249 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
250 | 235 | | |
251 | 236 | | |
252 | 237 | | |
253 | 238 | | |
254 | 239 | | |
255 | | - | |
| 240 | + | |
256 | 241 | | |
257 | 242 | | |
258 | 243 | | |
| |||
271 | 256 | | |
272 | 257 | | |
273 | 258 | | |
274 | | - | |
275 | | - | |
| 259 | + | |
276 | 260 | | |
277 | 261 | | |
278 | 262 | | |
279 | 263 | | |
280 | 264 | | |
281 | 265 | | |
282 | 266 | | |
283 | | - | |
| 267 | + | |
284 | 268 | | |
285 | 269 | | |
286 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
0 commit comments