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,28 +109,29 @@ bool DatabaseExperiment::run()
|
|||||||
|
|
||||||
simulator.clearListeners();
|
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()) {
|
if (!this->cb_before_fast_forward()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fail::BaseListener * listener;
|
|
||||||
while (true) {
|
// Do we need to fast-forward at all?
|
||||||
listener = simulator.resume();
|
if (injection_instr > 0) {
|
||||||
if (listener == &bp) {
|
// Create a listener that matches any IP event. It is used to
|
||||||
break;
|
// forward to the injection point.
|
||||||
} else {
|
BPSingleListener bp;
|
||||||
bool should_continue = this->cb_during_fast_forward(listener);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
if (!should_continue)
|
bp.setCounter(injection_instr);
|
||||||
break; // Stop fast forwarding
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
|
fail::BaseListener * listener;
|
||||||
|
while (true) {
|
||||||
|
listener = simulator.resume();
|
||||||
|
if (listener == &bp) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
bool should_continue = this->cb_during_fast_forward(listener);
|
||||||
|
if (!should_continue)
|
||||||
|
break; // Stop fast forwarding
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this->cb_after_fast_forward(listener)) {
|
if (!this->cb_after_fast_forward(listener)) {
|
||||||
|
|||||||
@ -321,18 +321,22 @@ bool CoredTester::run() {
|
|||||||
simulator.addListener(&l_fail_trace);
|
simulator.addListener(&l_fail_trace);
|
||||||
|
|
||||||
BPSingleListener bp;
|
BPSingleListener bp;
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
fail::BaseListener *listener = 0;
|
||||||
// TODO: why does this need a +1?
|
|
||||||
bp.setCounter(injection_instr+1);
|
|
||||||
simulator.addListener(&bp);
|
|
||||||
|
|
||||||
fail::BaseListener * listener = simulator.resume();
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
|
|
||||||
while ( ok && (listener == &l_fail_trace) ) {
|
// do we have to fast-forward at all?
|
||||||
// m_log << "CP IP 0x" << std::hex << simulator.getCPU(0).getInstructionPointer() << std::endl;
|
if (injection_instr > 0) {
|
||||||
ok = cpoint.check(s_fail_trace, l_fail_trace.getTriggerInstructionPointer()) == Checkpoint::IDENTICAL;
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
if(ok) listener = simulator.addListenerAndResume(&l_fail_trace);
|
bp.setCounter(injection_instr);
|
||||||
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
|
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();
|
unsigned experiment_number = cpoint.getCount();
|
||||||
@ -347,7 +351,7 @@ bool CoredTester::run() {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (listener != &bp) {
|
if (listener != &bp && injection_instr > 0) {
|
||||||
result = param.msg.add_result();
|
result = param.msg.add_result();
|
||||||
handleEvent(*result, result->NOINJECTION, "WTF");
|
handleEvent(*result, result->NOINJECTION, "WTF");
|
||||||
|
|
||||||
|
|||||||
@ -349,11 +349,11 @@ bool CoredVoter::run() {
|
|||||||
// Fast forward to injection address
|
// Fast forward to injection address
|
||||||
m_log << "Trying to inject @ instr #" << dec << injection_instr << endl;
|
m_log << "Trying to inject @ instr #" << dec << injection_instr << endl;
|
||||||
|
|
||||||
if ((injection_instr + 2) > 0) {
|
if (injection_instr > 0) {
|
||||||
simulator.clearListeners();
|
simulator.clearListeners();
|
||||||
BPSingleListener bp;
|
BPSingleListener bp;
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
bp.setCounter(injection_instr + 2); // FIXME: FISHY!
|
bp.setCounter(injection_instr);
|
||||||
simulator.addListener(&bp);
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
fail::BaseListener * listener = simulator.resume();
|
fail::BaseListener * listener = simulator.resume();
|
||||||
|
|||||||
@ -197,7 +197,7 @@ bool DCIAOKernelStructs::run() {
|
|||||||
simulator.addListener(&l_time_marker_print);
|
simulator.addListener(&l_time_marker_print);
|
||||||
|
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
bp.setCounter(injection_instr+1);
|
bp.setCounter(injection_instr);
|
||||||
simulator.addListener(&bp);
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
// Add vport listener
|
// Add vport listener
|
||||||
|
|||||||
@ -253,7 +253,7 @@ bool FiascoFailExperiment::faultInjection()
|
|||||||
if(instr_offset > 0)
|
if(instr_offset > 0)
|
||||||
{
|
{
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR); // Create new Breakpoint...
|
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
|
simulator.addListener(&bp); // ...and add it to the actual listeners
|
||||||
|
|
||||||
BaseListener *go = waitIOOrOther(true); // Resume simulation and log VGA-Output
|
BaseListener *go = waitIOOrOther(true); // Resume simulation and log VGA-Output
|
||||||
|
|||||||
@ -187,8 +187,7 @@ bool KESOgc::run()
|
|||||||
BPSingleListener bp;
|
BPSingleListener bp;
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
|
|
||||||
// Fix offset by 1 error
|
bp.setCounter(injection_instr);
|
||||||
bp.setCounter(injection_instr + 1);
|
|
||||||
|
|
||||||
simulator.addListener(&bp);
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
|
|||||||
@ -161,7 +161,7 @@ bool KESOrefs::run()
|
|||||||
|
|
||||||
BPSingleListener bp;
|
BPSingleListener bp;
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
bp.setCounter(injection_instr + 1);
|
bp.setCounter(injection_instr);
|
||||||
simulator.addListener(&bp);
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
bool inject = true;
|
bool inject = true;
|
||||||
|
|||||||
@ -160,8 +160,7 @@ bool VEZSExperiment::run()
|
|||||||
BPSingleListener bp;
|
BPSingleListener bp;
|
||||||
bp.setWatchInstructionPointer(ANY_ADDR);
|
bp.setWatchInstructionPointer(ANY_ADDR);
|
||||||
|
|
||||||
// Fix offset by 1 error
|
bp.setCounter(injection_instr);
|
||||||
bp.setCounter(injection_instr + 1);
|
|
||||||
|
|
||||||
simulator.addListener(&bp);
|
simulator.addListener(&bp);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user