memory: init virt to phys mapping after binding memory to node

Binding may cause memory to move, so initialize the page map after it is done.
This commit is contained in:
Avi Kivity
2015-01-22 12:38:22 +02:00
parent d0ec99317d
commit a8054e5aae

View File

@@ -837,9 +837,6 @@ void configure(std::vector<resource::memory> m,
cpu_mem.replace_memory_backing(sys_alloc);
}
cpu_mem.resize(total, sys_alloc);
if (hugetlbfs_path) {
cpu_mem.init_virt_to_phys_map();
}
size_t pos = 0;
for (auto&& x : m) {
#ifdef HAVE_NUMA
@@ -852,6 +849,9 @@ void configure(std::vector<resource::memory> m,
#endif
pos += x.bytes;
}
if (hugetlbfs_path) {
cpu_mem.init_virt_to_phys_map();
}
}
statistics stats() {