Validating the model by comparing its behavior with a virtual machine
Our virtualization based model validation tool works by loading the state of the machine into KVM, Linux's hardware accelerated virtualization API. This means using it requires a Linux system with support for hardware accelerated virtualization. This has been tested on Intel processors with VMX and (very minimally) on QEMU with its tiny code generator (TCG) backend.
This tool, at a high level, consists of a C program and some ACL2 functions. We use the function dump-virtualizable-state to dump the model's state into a file. Then, we run the C program, which loads the model state from the file into a KVM virtual machine and opens a socket. Then, we call the validate-insts function, which connects to the socket causing the virtual machine to execute some instructions, executes the model until the instruction pointer matches the VM, and then compares the GPRs and RIP.
It should be noted that this tool is very rough around the edges. It was built quickly to help track down bugs when attempting to get Linux to boot on the model. Additionally, it only works in the system-view mode, though if you have userspace Linux binary that you wish to use to test, you can do it by booting-linux and then running the program under Linux on the model. Of course, this won't catch bugs that only occur in app-view. This tool also requires including raw lisp and is unsound. It also requires using CCL.
Before using this tool, you should probably read virtualization-for-validation-limitations. Additionally, if you encounter issues, debugging tips are documented at virtualization-for-validation-debugging.
To use this tool, first compile the C program in
Next, open ACL2 and include the model. Get it into whatever initial
state you wish to use. Then, include the
Finally, in ACL2, execute validate-insts passing it the
number of iterations (number of comparisons with the VM and model) you
wish to execute and the