From 4e52789c6db91cd292e2de933c7c797e24fa870f Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 14 May 2013 16:02:45 +0200 Subject: [PATCH] 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. --- src/cpu/kvm/BaseKvmCPU.py | 1 + src/cpu/kvm/base.cc | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cpu/kvm/BaseKvmCPU.py b/src/cpu/kvm/BaseKvmCPU.py index a8356ac5b..796a7794b 100644 --- a/src/cpu/kvm/BaseKvmCPU.py +++ b/src/cpu/kvm/BaseKvmCPU.py @@ -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") diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc index 7435d4364..bc650aee9 100644 --- a/src/cpu/kvm/base.cc +++ b/src/cpu/kvm/base.cc @@ -133,6 +133,9 @@ BaseKvmCPU::init() void BaseKvmCPU::startup() { + const BaseKvmCPUParams * const p( + dynamic_cast(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)); -- 2.30.2