kvm: Add support for disabling coalesced MMIO

Add the option useCoalescedMMIO to the BaseKvmCPU. The default
behavior is to disable coalesced MMIO since this hasn't been heavily
tested.
This commit is contained in:
Andreas Sandberg 2013-05-14 16:02:45 +02:00
parent 3ba93822cc
commit 4e52789c6d
2 changed files with 7 additions and 1 deletions

View file

@ -69,5 +69,6 @@ class BaseKvmCPU(BaseCPU):
return True
kvmVM = Param.KvmVM(Parent.any, 'KVM VM (i.e., shared memory domain)')
useCoalescedMMIO = Param.Bool(False, "Use coalesced MMIO (EXPERIMENTAL)")
usePerfOverflow = Param.Bool(False, "Use perf event overflow counters (EXPERIMENTAL)")
hostFactor = Param.Float(1.0, "Cycle scale factor")

View file

@ -133,6 +133,9 @@ BaseKvmCPU::init()
void
BaseKvmCPU::startup()
{
const BaseKvmCPUParams * const p(
dynamic_cast<const BaseKvmCPUParams *>(params()));
Kvm &kvm(vm.kvm);
BaseCPU::startup();
@ -159,7 +162,9 @@ BaseKvmCPU::startup()
// available. The offset into the KVM's communication page is
// provided by the coalesced MMIO capability.
int mmioOffset(kvm.capCoalescedMMIO());
if (mmioOffset) {
if (!p->useCoalescedMMIO) {
inform("KVM: Coalesced MMIO disabled by config.\n");
} else if (mmioOffset) {
inform("KVM: Coalesced IO available\n");
mmioRing = (struct kvm_coalesced_mmio_ring *)(
(char *)_kvmRun + (mmioOffset * pageSize));