L4Sys: check Bochs AS ID for mem accesses, too

Change-Id: Ifa2b38dc0e762ff4f956dc0b98c78b43f0d139cb
This commit is contained in:
Björn Döbel
2013-09-12 20:29:08 +02:00
parent 6274ddb15f
commit 014684ae1c
3 changed files with 11 additions and 8 deletions

View File

@ -273,6 +273,9 @@ void L4SysExperiment::collectInstructionTrace(fail::BPSingleListener* bp)
curr_addr = ML.getTriggerInstructionPointer();
simulator.addListener(&ML);
++mem;
if (BX_CPU(0)->cr3 != L4SYS_ADDRESS_SPACE) {
continue;
}
} else if (res == bp) {
curr_addr = bp->getTriggerInstructionPointer();
assert(curr_addr == simulator.getCPU(0).getInstructionPointer());

View File

@ -9,13 +9,13 @@
// FUNC_{ENTRY,EXIT} specifies the range that needs to
// be captured to log program output properly
#define L4SYS_FUNC_ENTRY 0x010002a0
#define L4SYS_FUNC_EXIT 0x01000380
#define L4SYS_FUNC_ENTRY 0x01000350
#define L4SYS_FUNC_EXIT 0x010004bd
// FILTER_{ENTRY,EXIT} specifies the range that injections
// should be carried out on (should be a subset of the above)
// and only works with FILTER_INSTRUCTIONS turned on
#define L4SYS_FILTER_ENTRY 0x0100031c
#define L4SYS_FILTER_EXIT 0x01000380
#define L4SYS_FILTER_ENTRY 0x0100042e
#define L4SYS_FILTER_EXIT 0x01000434
// select instruction filtering
// XXX: this should be always on and the code should be
@ -24,8 +24,8 @@
#define L4SYS_FILTER_INSTRUCTIONS 1
// kernel: 2377547, userland: 79405472
#define L4SYS_NUMINSTR 2223
#define L4SYS_TOTINSTR 60214
#define L4SYS_NUMINSTR 2988
#define L4SYS_TOTINSTR 67811
#define L4SYS_BOCHS_IPS 5000000
// several file names used
@ -38,6 +38,6 @@
// flags
// 0 - preparation complete
// >0 - next step to execute
#define PREPARATION_STEP 0
#define PREPARATION_STEP 2
#endif // __L4SYS_EXPERIMENT_INFO_HPP__

View File

@ -68,7 +68,7 @@ void AdvancedMemoryImporter::insert_delayed_entries(bool finalizing)
if (it->branches_before != last_branches_before) {
branchmask = 0;
int pos = std::max(-(signed)BRANCH_WINDOW_SIZE, - (signed) it->branches_before);
int maxpos = std::min(BRANCH_WINDOW_SIZE, branches_taken.size() - it->branches_before);
int maxpos = std::min((signed)BRANCH_WINDOW_SIZE, (signed)(branches_taken.size() - it->branches_before));
for (; pos < maxpos; ++pos) {
branchmask |=
((unsigned) branches_taken[it->branches_before + pos])