kvm: Shutdown KVM and disconnect performance counters on fork
authorAndreas Sandberg <andreas@sandberg.pp.se>
Fri, 27 Nov 2015 14:52:10 +0000 (14:52 +0000)
committerAndreas Sandberg <andreas@sandberg.pp.se>
Fri, 27 Nov 2015 14:52:10 +0000 (14:52 +0000)
commit4f303785dc3001a8c952f19540e16a9b437278f2
treeb03d09b88d2c5d5db402f4f6631976e0a82fda57
parenta91c1e69a880dd6eec3cc980801ea18ddcbe7c31
kvm: Shutdown KVM and disconnect performance counters on fork

We can't/shouldn't use KVM after a fork since the child and parent
probably point to the same VM. Knowing the exact effects of this is
hard, but they are likely to be messy. We also disconnect the
performance counters attached to the guest. This works around what
seems to be a kernel bug where spurious SIGIOs get delivered to the
forked child process.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
[sascha.bischoff@arm.com: Rebased patches onto a newer gem5 version]
Signed-off-by: Sascha Bischoff <sascha.bischoff@arm.com>
[andreas.sandberg@arm.com: Fatal if entering KVM in child process ]
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
src/cpu/kvm/base.cc
src/cpu/kvm/base.hh
src/cpu/kvm/vm.cc
src/cpu/kvm/vm.hh
src/cpu/kvm/x86_cpu.cc