Review Board 2.0.15


kvm: Add support for multicore simulation

Review Request #2186 - Created March 6, 2014 and submitted - Latest diff uploaded

Information
Andreas Sandberg
gem5
default
Reviewers
Default
Changeset 10105:3a25161d3ddf
---------------------------
kvm: Add support for multicore simulation

Simulating a SMP or multicore requires devices to be shared across KVM
vCPUs. This requires locking when accessing devices. This changeset
adds the necessary locking to allow devices to execute correctly.
This is implemented by migrating the temporarily migrating the KVM CPU
to the VM's (and devices) event queue when handling MMIO. Similarly,
the VM migrates to the interrupt controller's event queue when
delivering an interrupt.

The support for fast-forwarding of multicore simulations added by this
changeset assumes that all devices in a system are simulated in the
same thread and each vCPU has its own thread. Special care must be
taken to ensure that devices living under the CPU in the object
hierarchy (e.g., the interrupt controller) do not inherit the parent
CPUs thread and are assigned to device thread. The KvmVM object is
assumed to live in the same thread as the other devices in the system.
x86 regressions pass. Boots Linux in SMP mode.