Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/56183 )
Change subject: cpu-kvm: Make the KvmVM check that all the CPUs are KVM
CPUs.
......................................................................
cpu-kvm: Make the KvmVM check that all the CPUs are KVM CPUs.
That gives us the invariant that if there is a VM, all the CPUs are KVM
CPUs. The KVM CPUs already ensure there is a VM, so this is a
bidirectional implication.
This means to verify that there is a valid KVM environment, we only have
to check if there is a VM object.
Change-Id: I5bec3323af8619d166b47175afc24de57e9e42ba
---
M src/cpu/kvm/vm.cc
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/cpu/kvm/vm.cc b/src/cpu/kvm/vm.cc
index 1347c75..31da201 100644
--- a/src/cpu/kvm/vm.cc
+++ b/src/cpu/kvm/vm.cc
@@ -361,6 +361,12 @@
const std::vector<memory::BackingStoreEntry> &memories(
system->getPhysMem().getBackingStore());
+ for (auto *tc: system->threads) {
+ panic_if(!dynamic_cast<BaseKvmCPU *>(tc->getCpuPtr()),
+ "CPU %s is not a KVM CPU, but using KVM.",
+ tc->getCpuPtr()->name());
+ }
+
DPRINTF(Kvm, "Mapping %i memory region(s)\n", memories.size());
for (int slot(0); slot < memories.size(); ++slot) {
if (!memories[slot].kvmMap) {
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56183
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5bec3323af8619d166b47175afc24de57e9e42ba
Gerrit-Change-Number: 56183
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s