adapt experiments to new restore() behavior
This change adapts several experiments, including the DatabaseExperiment framework, to the restore() behavior update from the previous change. Existing traces should continue to be usable. This is not tested yet, mainly because I don't have access to most of the experiment targets / guest systems necessary for testing. Please test your own experiments if possible, or at least leave me a note that you couldn't test it! Especially the cored-voter/experiment.cc update may be broken, but maybe the "FISHY" +2 in there was not OK in the first place. Change-Id: I0c5daeabc8fe6ce0c3ce3e7e13d02195f41340ad
This commit is contained in:
@ -109,19 +109,19 @@ bool DatabaseExperiment::run()
|
||||
|
||||
simulator.clearListeners();
|
||||
|
||||
// Generate an experiment listener, that matches on any IP
|
||||
// event. It is used to forward to the injection
|
||||
// point. The +1 is needed, since even for the zeroth
|
||||
// dynamic instruction we need at least one breakpoint
|
||||
// event.
|
||||
BPSingleListener bp;
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
bp.setCounter(injection_instr + 1);
|
||||
simulator.addListener(&bp);
|
||||
|
||||
if (!this->cb_before_fast_forward()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Do we need to fast-forward at all?
|
||||
if (injection_instr > 0) {
|
||||
// Create a listener that matches any IP event. It is used to
|
||||
// forward to the injection point.
|
||||
BPSingleListener bp;
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
bp.setCounter(injection_instr);
|
||||
simulator.addListener(&bp);
|
||||
|
||||
fail::BaseListener * listener;
|
||||
while (true) {
|
||||
listener = simulator.resume();
|
||||
@ -133,6 +133,7 @@ bool DatabaseExperiment::run()
|
||||
break; // Stop fast forwarding
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this->cb_after_fast_forward(listener)) {
|
||||
continue; // Continue to next injection experiment
|
||||
}
|
||||
|
||||
@ -321,19 +321,23 @@ bool CoredTester::run() {
|
||||
simulator.addListener(&l_fail_trace);
|
||||
|
||||
BPSingleListener bp;
|
||||
fail::BaseListener *listener = 0;
|
||||
bool ok = true;
|
||||
|
||||
// do we have to fast-forward at all?
|
||||
if (injection_instr > 0) {
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
// TODO: why does this need a +1?
|
||||
bp.setCounter(injection_instr+1);
|
||||
bp.setCounter(injection_instr);
|
||||
simulator.addListener(&bp);
|
||||
|
||||
fail::BaseListener * listener = simulator.resume();
|
||||
bool ok = true;
|
||||
listener = simulator.resume();
|
||||
|
||||
while ( ok && (listener == &l_fail_trace) ) {
|
||||
// m_log << "CP IP 0x" << std::hex << simulator.getCPU(0).getInstructionPointer() << std::endl;
|
||||
ok = cpoint.check(s_fail_trace, l_fail_trace.getTriggerInstructionPointer()) == Checkpoint::IDENTICAL;
|
||||
if(ok) listener = simulator.addListenerAndResume(&l_fail_trace);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned experiment_number = cpoint.getCount();
|
||||
|
||||
@ -347,7 +351,7 @@ bool CoredTester::run() {
|
||||
|
||||
break;
|
||||
}
|
||||
if (listener != &bp) {
|
||||
if (listener != &bp && injection_instr > 0) {
|
||||
result = param.msg.add_result();
|
||||
handleEvent(*result, result->NOINJECTION, "WTF");
|
||||
|
||||
|
||||
@ -349,11 +349,11 @@ bool CoredVoter::run() {
|
||||
// Fast forward to injection address
|
||||
m_log << "Trying to inject @ instr #" << dec << injection_instr << endl;
|
||||
|
||||
if ((injection_instr + 2) > 0) {
|
||||
if (injection_instr > 0) {
|
||||
simulator.clearListeners();
|
||||
BPSingleListener bp;
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
bp.setCounter(injection_instr + 2); // FIXME: FISHY!
|
||||
bp.setCounter(injection_instr);
|
||||
simulator.addListener(&bp);
|
||||
|
||||
fail::BaseListener * listener = simulator.resume();
|
||||
|
||||
@ -197,7 +197,7 @@ bool DCIAOKernelStructs::run() {
|
||||
simulator.addListener(&l_time_marker_print);
|
||||
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
bp.setCounter(injection_instr+1);
|
||||
bp.setCounter(injection_instr);
|
||||
simulator.addListener(&bp);
|
||||
|
||||
// Add vport listener
|
||||
|
||||
@ -253,7 +253,7 @@ bool FiascoFailExperiment::faultInjection()
|
||||
if(instr_offset > 0)
|
||||
{
|
||||
bp.setWatchInstructionPointer(ANY_ADDR); // Create new Breakpoint...
|
||||
bp.setCounter(instr_offset + 1); // ...to break when the IP for the fault injection is reached...
|
||||
bp.setCounter(instr_offset); // ...to break when the IP for the fault injection is reached...
|
||||
simulator.addListener(&bp); // ...and add it to the actual listeners
|
||||
|
||||
BaseListener *go = waitIOOrOther(true); // Resume simulation and log VGA-Output
|
||||
|
||||
@ -187,8 +187,7 @@ bool KESOgc::run()
|
||||
BPSingleListener bp;
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
|
||||
// Fix offset by 1 error
|
||||
bp.setCounter(injection_instr + 1);
|
||||
bp.setCounter(injection_instr);
|
||||
|
||||
simulator.addListener(&bp);
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ bool KESOrefs::run()
|
||||
|
||||
BPSingleListener bp;
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
bp.setCounter(injection_instr + 1);
|
||||
bp.setCounter(injection_instr);
|
||||
simulator.addListener(&bp);
|
||||
|
||||
bool inject = true;
|
||||
|
||||
@ -160,8 +160,7 @@ bool VEZSExperiment::run()
|
||||
BPSingleListener bp;
|
||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||
|
||||
// Fix offset by 1 error
|
||||
bp.setCounter(injection_instr + 1);
|
||||
bp.setCounter(injection_instr);
|
||||
|
||||
simulator.addListener(&bp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user