ecos: stack-protection eval

Change-Id: I576c2ef3834f61bb9017af37541afc7639672782
This commit is contained in:
Horst Schirmeier
2013-05-16 15:23:46 +02:00
parent de754c5f27
commit f3c36e70ef
3 changed files with 25 additions and 7 deletions

View File

@ -20,11 +20,13 @@ using namespace fail;
#if BASELINE_ASSESSMENT
const std::string EcosKernelTestCampaign::dir_prerequisites("prerequisites-baseline");
const std::string EcosKernelTestCampaign::dir_images("images-baseline");
#elif STACKPROTECTION
const std::string EcosKernelTestCampaign::dir_prerequisites("prerequisites-stackprotection");
const std::string EcosKernelTestCampaign::dir_images("images-stackprotection");
#else
const std::string EcosKernelTestCampaign::dir_prerequisites("prerequisites");
const std::string EcosKernelTestCampaign::dir_images("images");
#endif
const std::string EcosKernelTestCampaign::dir_results("results");
bool EcosKernelTestCampaign::writeTraceInfo(unsigned instr_counter, unsigned timeout,
unsigned mem1_low, unsigned mem1_high, // < 1M
@ -134,12 +136,18 @@ std::string EcosKernelTestCampaign::filename_elf(const std::string& variant, con
typedef std::map<address_t, int> AddrLastaccessMap;
char const *variants[] = {
#if !STACKPROTECTION
"bitmap_vanilla",
"bitmap_SUM+DMR",
"bitmap_CRC",
"bitmap_CRC+DMR",
"bitmap_TMR",
// "bitmap_Hamming"
// "bitmap_Hamming",
#elif STACKPROTECTION
"bitmap_min_stacks_baseline",
"bitmap_min_stacks_detection",
"bitmap_min_stacks_protected",
#endif
0
};
@ -152,8 +160,13 @@ char const *benchmarks[] = {
/*"clocktruth",*/ "cnt_sem1", "except1", "flag1", /*"kill",*/ "mqueue1", "mutex1",
"mutex2", /*"mutex3",*/ "release", "sched1", "sync2", "sync3", "thread0",
"thread1", "thread2",
#elif 0 // clocktruth, mutex3, kill; sync2, bin_sem2; clockcnv
"bin_sem0", "bin_sem1", /*"bin_sem2",*/ "bin_sem3", "clock1", "clockcnv",
/**"clocktruth",*/ "cnt_sem1", "except1", "flag1", /**"kill",*/ "mqueue1", "mutex1",
"mutex2", /**"mutex3",*/ "release", "sched1", /*"sync2",*/ "sync3", "thread0",
"thread1", "thread2",
#elif 0
"sync2",
"thread1",
#endif
0
};

View File

@ -60,7 +60,7 @@ using namespace fail;
#if PREREQUISITES
bool EcosKernelTestExperiment::retrieveGuestAddresses(guest_address_t addr_finish, guest_address_t addr_data_start, guest_address_t addr_data_end) {
#if BASELINE_ASSESSMENT
#if BASELINE_ASSESSMENT || STACKPROTECTION
log << "STEP 0: creating memory map spanning all of DATA and BSS" << endl;
MemoryMap mm;
mm.add(addr_data_start, addr_data_end - addr_data_start);
@ -246,7 +246,7 @@ bool EcosKernelTestExperiment::performTrace(guest_address_t addr_entry, guest_ad
}
unsigned long long estimated_timeout_overflow_check =
simulator.getTimerTicks() - time_start + 10000;
simulator.getTimerTicks() - time_start + 55000; // 1s/18.2
unsigned estimated_timeout =
(unsigned) (estimated_timeout_overflow_check * 1000000 / simulator.getTimerTicksPerSecond());
@ -400,6 +400,10 @@ bool EcosKernelTestExperiment::faultInjection() {
bit_offset = 8; // enforce loop termination
} else if (!param.msg.has_faultmodel() || param.msg.faultmodel() == param.msg.SINGLEBITFLIP) {
newdata = data ^ (1 << bit_offset);
} else {
// Won't happen with current campaign implementation. Keeps
// compiler happy.
newdata = data;
}
mm.setByte(mem_addr, newdata);
// note at what IP we did it

View File

@ -1,5 +1,6 @@
#pragma once
#define BASELINE_ASSESSMENT 1
#define BASELINE_ASSESSMENT 0
#define STACKPROTECTION 1
#define PREREQUISITES 0
#define ECOS_FAULTMODEL_BURST 0
#define ECOS_FAULTMODEL_BURST 1