Thursday, February 2, 2012

Major Bug fixe and -Wall flag

Recently we have pushed many changes related to bug fixes and code cleanup. Normally I don't blog about releasing bug-fixes patch on any branch but these ones deserve a special post.

The first big fix is related to CPU ticks and clock value when simulation is started. When we switch to simulation mode we slow down the cpu ticks and clock based on simulation speed and user configured machine speed (using -corefreq parameter). During the switching we store the current cpu ticks and clock offset and based on sim_cycle (number of simulated cycles) we report the CPU ticks when 'rdtsc' is executed. But by default MARSS was not setting the cpu ticks offset correctly and due to this when a CPU context is restored from a checkpoint sometimes clock value is much lower or too higher than previous ticks and it crashes the VM kernel. After the fix now we restore correct cpu ticks and clock offset to prevent such kernel crashes. You can find the patch here.

Second big fix is not related to any specific bug but its more related to code cleanup. Now we have enabled -Wall compilation flag by default in simulator code. After enabling this flag gcc produced thousands of lines of warning in simulator code. We have removed all the warnings and clean up the code to be more reliable. After the cleanup I ran some simulations that were crashing earlier in VM mode, and they are now running without any issue!! By eliminating compiler warnings we have removed bugs that were really difficult to hunt (and we never knew they existed). This fix is a series of patches applied on 'features', 'qemu' and 'mt-sim' branches. Please pull the changes from any of this branch and merge with your local repository.

We encourage you to test out these changes and report any issues. We are running sanity check on 'features' branch and once we are confidence about these changes we will release 0.3 version soon.

PS: We have also added support for two new instructions INS and OUTS.

No comments:

Post a Comment