summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2014-03-03 14:31:39 +0100
committerAndreas Sandberg <andreas@sandberg.pp.se>2014-03-03 14:31:39 +0100
commit739cc0128b666694274b018f303aba452107f8f6 (patch)
tree158d8c2853da4024213ed7afc3bc8eb16093e8a1 /src
parent5cd9dd29bdb56fe496d78fcef0dfb0d6230ddc77 (diff)
downloadgem5-739cc0128b666694274b018f303aba452107f8f6.tar.xz
kvm: Initialize signal handlers from startupThread()
Signal handlers in KVM are controlled per thread and should be initialized from the thread that is going to execute the CPU. This changeset moves the initialization call from startup() to startupThread().
Diffstat (limited to 'src')
-rw-r--r--src/cpu/kvm/base.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc
index 64c1a5e81..26ffe37a5 100644
--- a/src/cpu/kvm/base.cc
+++ b/src/cpu/kvm/base.cc
@@ -138,10 +138,6 @@ BaseKvmCPU::startup()
// point. Initialize virtual CPUs here instead.
vcpuFD = vm.createVCPU(vcpuID);
- // Setup signal handlers. This has to be done after the vCPU is
- // created since it manipulates the vCPU signal mask.
- setupSignalHandler();
-
// Map the KVM run structure */
vcpuMMapSize = kvm.getVCPUMMapSize();
_kvmRun = (struct kvm_run *)mmap(0, vcpuMMapSize,
@@ -182,6 +178,10 @@ BaseKvmCPU::startupThread()
const BaseKvmCPUParams * const p(
dynamic_cast<const BaseKvmCPUParams *>(params()));
+ // Setup signal handlers. This has to be done after the vCPU is
+ // created since it manipulates the vCPU signal mask.
+ setupSignalHandler();
+
setupCounters();
if (p->usePerfOverflow)