wmoo: 1 job = 8 experiments (all bit positions for one address)
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1098 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -59,6 +59,8 @@ bool WeathermonitorExperiment::run()
|
||||
log << "enabling tracing" << endl;
|
||||
TracingPlugin tp;
|
||||
|
||||
// TODO: record max(ESP)
|
||||
|
||||
// restrict memory access logging to injection target
|
||||
MemoryMap mm;
|
||||
mm.add(WEATHER_DATA_START, WEATHER_DATA_END - WEATHER_DATA_START);
|
||||
@ -123,14 +125,18 @@ bool WeathermonitorExperiment::run()
|
||||
param.msg.set_instr_offset(1000);
|
||||
//param.msg.set_instr_address(12345);
|
||||
param.msg.set_mem_addr(0x00103bdc);
|
||||
param.msg.set_bit_offset(5);
|
||||
#endif
|
||||
|
||||
int id = param.getWorkloadID();
|
||||
int instr_offset = param.msg.instr_offset();
|
||||
int mem_addr = param.msg.mem_addr();
|
||||
int bit_offset = param.msg.bit_offset();
|
||||
log << "job " << id << " instr " << instr_offset << " mem " << mem_addr << "+" << bit_offset << endl;
|
||||
|
||||
// for each job we're actually doing *8* experiments (one for each bit)
|
||||
for (int bit_offset = 0; bit_offset < 8; ++bit_offset) {
|
||||
WeathermonitorProtoMsg_Result *result = param.msg.add_result();
|
||||
result->set_bit_offset(bit_offset);
|
||||
log << std::dec << "job " << id << " instr " << instr_offset
|
||||
<< " mem " << mem_addr << "+" << bit_offset << endl;
|
||||
|
||||
// XXX debug
|
||||
/*
|
||||
@ -171,25 +177,26 @@ bool WeathermonitorExperiment::run()
|
||||
ss << "SANITY CHECK FAILED: " << injection_ip
|
||||
<< " != " << param.msg.instr_address();
|
||||
log << ss.str() << endl;
|
||||
param.msg.set_resulttype(param.msg.UNKNOWN);
|
||||
param.msg.set_latest_ip(injection_ip);
|
||||
param.msg.set_details(ss.str());
|
||||
result->set_resulttype(result->UNKNOWN);
|
||||
result->set_latest_ip(injection_ip);
|
||||
result->set_details(ss.str());
|
||||
result->set_num_iterations(666); // FIXME
|
||||
|
||||
sal::simulator.clearEvents();
|
||||
#if !LOCAL
|
||||
m_jc.sendResult(param);
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
|
||||
// --- aftermath ---
|
||||
// four possible outcomes:
|
||||
// possible outcomes:
|
||||
// - trap, "crash"
|
||||
// - jump outside text segment
|
||||
// - (XXX unaligned jump inside text segment)
|
||||
// - (XXX weird instructions?)
|
||||
// - (XXX results displayed?)
|
||||
// - reaches THE END
|
||||
// additional info:
|
||||
// - (XXX #loop iterations?)
|
||||
// - (XXX "sane" display?)
|
||||
|
||||
// catch traps as "extraordinary" ending
|
||||
fi::TrapEvent ev_trap(fi::ANY_TRAP);
|
||||
@ -213,35 +220,36 @@ bool WeathermonitorExperiment::run()
|
||||
fi::BaseEvent* ev = sal::simulator.waitAny();
|
||||
|
||||
// record latest IP regardless of result
|
||||
param.msg.set_latest_ip(sal::simulator.getRegisterManager().getInstructionPointer());
|
||||
result->set_latest_ip(sal::simulator.getRegisterManager().getInstructionPointer());
|
||||
|
||||
if (ev == &ev_end) {
|
||||
log << "Result FINISHED" << endl;
|
||||
param.msg.set_resulttype(param.msg.FINISHED);
|
||||
result->set_resulttype(result->FINISHED);
|
||||
} else if (ev == &ev_below_text || ev == &ev_beyond_text) {
|
||||
log << "Result OUTSIDE" << endl;
|
||||
param.msg.set_resulttype(param.msg.OUTSIDE);
|
||||
result->set_resulttype(result->OUTSIDE);
|
||||
} else if (ev == &ev_trap) {
|
||||
log << std::dec << "Result TRAP #" << ev_trap.getTriggerNumber() << endl;
|
||||
param.msg.set_resulttype(param.msg.TRAP);
|
||||
result->set_resulttype(result->TRAP);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << ev_trap.getTriggerNumber();
|
||||
param.msg.set_details(ss.str());
|
||||
result->set_details(ss.str());
|
||||
} else {
|
||||
log << "Result WTF?" << endl;
|
||||
param.msg.set_resulttype(param.msg.UNKNOWN);
|
||||
result->set_resulttype(result->UNKNOWN);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "eventid " << ev->getId() << " EIP " << sal::simulator.getRegisterManager().getInstructionPointer();
|
||||
param.msg.set_details(ss.str());
|
||||
result->set_details(ss.str());
|
||||
}
|
||||
}
|
||||
// FIXME do we have exactly 8 results? if (param.msg.
|
||||
#if !LOCAL
|
||||
m_jc.sendResult(param);
|
||||
|
||||
}
|
||||
#endif
|
||||
// XXX
|
||||
|
||||
#endif
|
||||
// Explicitly terminate, or the simulator will continue to run.
|
||||
|
||||
@ -1,21 +1,30 @@
|
||||
message WeathermonitorProtoMsg {
|
||||
// Input: experiment parameters
|
||||
// (client executes 8 experiments, one for each bit at mem_addr)
|
||||
|
||||
// FI at #instructions from experiment start
|
||||
required int32 instr_offset = 1;
|
||||
// the exact IP value at this point in time (from golden run)
|
||||
optional int32 instr_address = 2; // for sanity checks
|
||||
// address of the byte to inject bit-flips
|
||||
required int32 mem_addr = 3;
|
||||
required int32 bit_offset = 4;
|
||||
|
||||
// ----------------------------------------------------
|
||||
|
||||
// Output: experiment results
|
||||
// (make these optional to reduce overhead for server->client communication)
|
||||
|
||||
// instruction pointer where injection was done
|
||||
optional uint32 injection_ip = 5;
|
||||
// IP where we did the injection: for debugging purposes, must be identical
|
||||
// to instr_address
|
||||
optional int32 injection_ip = 4;
|
||||
|
||||
repeated group Result = 5 {
|
||||
// single experiment bit offset
|
||||
required int32 bit_offset = 1;
|
||||
|
||||
// result type:
|
||||
// FINISHED = planned number of instructions were executed
|
||||
// TRAP = premature guest "crash"
|
||||
// OUTSIDE = IP left text segment
|
||||
enum ResultType {
|
||||
FINISHED = 1;
|
||||
TRAP = 2;
|
||||
@ -23,11 +32,15 @@ message WeathermonitorProtoMsg {
|
||||
HALT = 4;
|
||||
UNKNOWN = 5;
|
||||
}
|
||||
optional ResultType resulttype = 6;
|
||||
required ResultType resulttype = 2;
|
||||
|
||||
// especially interesting for TRAP/UNKNOWN: latest IP
|
||||
optional uint32 latest_ip = 7;
|
||||
required uint32 latest_ip = 3;
|
||||
|
||||
// total number of wmoo measuring/displaying iterations seen
|
||||
required uint32 num_iterations = 4;
|
||||
|
||||
// optional textual description of what happened
|
||||
optional string details = 8;
|
||||
optional string details = 5;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user