Rebuilding a the full linux kernel when modifying KVM for the purposes of patching VM exit RDTSC timings is a tedious process. Thankfully, the linux kernel is modular and can be built in pieces and incrementally upgraded.

This can be accomplished relatively safely by following the rough steps outlined below:

  1. Fully build the kernel once, and loading this built kernel.

  2. Compile only KVM as a module.

  3. Kill all running VMs.