diff options
author | David Hashe <david.j.hashe@gmail.com> | 2016-08-22 11:41:05 -0400 |
---|---|---|
committer | David Hashe <david.j.hashe@gmail.com> | 2016-08-22 11:41:05 -0400 |
commit | f3ccaab1e982f4482177aefa95575f7d7dae21f7 (patch) | |
tree | 8797cdd232c0ccafa53d0601bc9da14a16f6db00 /src/cpu | |
parent | d80a613990935dd144a5665a875f91725ee81f78 (diff) | |
download | gem5-f3ccaab1e982f4482177aefa95575f7d7dae21f7.tar.xz |
cpu, mem, sim: Change how KVM maps memory
Only map memories into the KVM guest address space that are
marked as usable by KVM. Create BackingStoreEntry class
containing flags for is_conf_reported, in_addr_map, and
kvm_map.
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/kvm/vm.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cpu/kvm/vm.cc b/src/cpu/kvm/vm.cc index ccf739305..39bce32f4 100644 --- a/src/cpu/kvm/vm.cc +++ b/src/cpu/kvm/vm.cc @@ -341,13 +341,18 @@ KvmVM::cpuStartup() void KvmVM::delayedStartup() { - const std::vector<std::pair<AddrRange, uint8_t*> >&memories( + const std::vector<BackingStoreEntry> &memories( system->getPhysMem().getBackingStore()); DPRINTF(Kvm, "Mapping %i memory region(s)\n", memories.size()); for (int slot(0); slot < memories.size(); ++slot) { - const AddrRange &range(memories[slot].first); - void *pmem(memories[slot].second); + if (!memories[slot].kvmMap) { + DPRINTF(Kvm, "Skipping region marked as not usable by KVM\n"); + continue; + } + + const AddrRange &range(memories[slot].range); + void *pmem(memories[slot].pmem); if (pmem) { DPRINTF(Kvm, "Mapping region: 0x%p -> 0x%llx [size: 0x%llx]\n", |