sim-se,cpu-kvm: Fix SE workload setup on KVM CPUs (#956)

This PR fixes #948 in which running KVM CPUs through the updated gem5
interface in SE mode causes an immediate crash.

To fix this, I added a check to set_se_binary_workload that checks if
any of the cores are KVM, and if so, sets a couple of knobs for the
board and process that are required to make KVM work. The depecated
se.py script, which sets these knobs, is able to run KVM in SE mode just
fine, so doing the same here fixed the bug.
This commit is contained in:
Carson Molder
2024-03-23 17:15:11 -05:00
committed by GitHub
parent 1e743fd85a
commit dd5a30d41e

View File

@@ -120,6 +120,15 @@ class SEBinaryWorkload:
if env_list is not None:
process.env = env_list
if any(
core.is_kvm_core() for core in self.get_processor().get_cores()
):
# Running KVM in SE mode requires special flags to be set for the
# process.
self.m5ops_base = max(0xFFFF0000, self.get_memory().get_size())
process.kvmInSE = True
process.useArchPT = True
if isinstance(self.get_processor(), SwitchableProcessor):
# This is a hack to get switchable processors working correctly in
# SE mode. The "get_cores" API for processors only gets the current