kvm: Basic support for hardware virtualized CPUs
authorAndreas Sandberg <Andreas.Sandberg@ARM.com>
Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)
committerAndreas Sandberg <Andreas.Sandberg@ARM.com>
Mon, 22 Apr 2013 17:20:32 +0000 (13:20 -0400)
commitf485ad190830ab61d58ecdb8eb48621ffeb3008f
tree77eac063f39d519e60fb627fd55409b271bbfff7
parent005616518c5eaa78933eb4d4760bf5243f948139
kvm: Basic support for hardware virtualized CPUs

This changeset introduces the architecture independent parts required
to support KVM-accelerated CPUs. It introduces two new simulation
objects:

KvmVM -- The KVM VM is a component shared between all CPUs in a shared
         memory domain. It is typically instantiated as a child of the
         system object in the simulation hierarchy. It provides access
         to KVM VM specific interfaces.

BaseKvmCPU -- Abstract base class for all KVM-based CPUs. Architecture
      dependent CPU implementations inherit from this class
      and implement the following methods:

                * updateKvmState() -- Update the
                  architecture-dependent KVM state from the gem5
                  thread context associated with the CPU.

                * updateThreadContext() -- Update the thread context
                  from the architecture-dependent KVM state.

                * dump() -- Dump the KVM state using (optional).

      In order to deliver interrupts to the guest, CPU
      implementations typically override the tick() method and
      check for, and deliver, interrupts prior to entering
      KVM.

Hardware-virutalized CPU currently have the following limitations:
 * SE mode is not supported.
 * PC events are not supported.
 * Timing statistics are currently very limited. The current approach
   simply scales the host cycles with a user-configurable factor.
 * The simulated system must not contain any caches.
 * Since cycle counts are approximate, there is no way to request an
   exact number of cycles (or instructions) to be executed by the CPU.
 * Hardware virtualized CPUs and gem5 CPUs must not execute at the
   same time in the same simulator instance.
 * Only single-CPU systems can be simulated.
 * Remote GDB connections to the guest system are not supported.

Additionally, m5ops requires an architecture specific interface and
might not be supported.
12 files changed:
SConstruct
src/cpu/kvm/BaseKvmCPU.py [new file with mode: 0644]
src/cpu/kvm/KvmVM.py [new file with mode: 0644]
src/cpu/kvm/SConscript [new file with mode: 0644]
src/cpu/kvm/base.cc [new file with mode: 0644]
src/cpu/kvm/base.hh [new file with mode: 0644]
src/cpu/kvm/perfevent.cc [new file with mode: 0644]
src/cpu/kvm/perfevent.hh [new file with mode: 0644]
src/cpu/kvm/timer.cc [new file with mode: 0644]
src/cpu/kvm/timer.hh [new file with mode: 0644]
src/cpu/kvm/vm.cc [new file with mode: 0644]
src/cpu/kvm/vm.hh [new file with mode: 0644]