python: Fix switchable processor event queues

This fixes the event queues added to the switchable processor in
ade8c08 to only be added to the KVM cores.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-1086

Change-Id: I74ebc4aa52a44662602b9512c23c8fb8a40101d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50229
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Austin Harris
2021-09-10 15:07:40 -05:00
parent 235dbd3dd0
commit 5eff9b5e9b

View File

@@ -73,6 +73,11 @@ class SwitchableProcessor(AbstractProcessor):
]
if self._prepare_kvm:
if all_cores[0].get_type() != CPUTypes.KVM:
raise Exception(
"When using KVM, the switchable processor must start "
"with the KVM cores."
)
from m5.objects import KvmVM
self.kvm_vm = KvmVM()
@@ -93,7 +98,10 @@ class SwitchableProcessor(AbstractProcessor):
# To get the KVM CPUs to run on different host CPUs
# Specify a different event queue for each CPU
for i, core in enumerate(self.cores):
kvm_cores = [
core for core in self.cores if core.get_type() == CPUTypes.KVM
]
for i, core in enumerate(kvm_cores):
for obj in core.get_simobject().descendants():
obj.eventq_index = 0
core.get_simobject().eventq_index = i + 1