Revision 5579c7f3 kvm-all.c
b/kvm-all.c | ||
---|---|---|
101 | 101 |
mem.slot = slot->slot; |
102 | 102 |
mem.guest_phys_addr = slot->start_addr; |
103 | 103 |
mem.memory_size = slot->memory_size; |
104 |
mem.userspace_addr = (unsigned long)phys_ram_base + slot->phys_offset;
|
|
104 |
mem.userspace_addr = (unsigned long)qemu_get_ram_ptr(slot->phys_offset);
|
|
105 | 105 |
mem.flags = slot->flags; |
106 | 106 |
|
107 | 107 |
return kvm_vm_ioctl(s, KVM_SET_USER_MEMORY_REGION, &mem); |
... | ... | |
329 | 329 |
|
330 | 330 |
/* initially, KVM allocated its own memory and we had to jump through |
331 | 331 |
* hooks to make phys_ram_base point to this. Modern versions of KVM |
332 |
* just use a user allocated buffer so we can use phys_ram_base
|
|
332 |
* just use a user allocated buffer so we can use regular pages
|
|
333 | 333 |
* unmodified. Make sure we have a sufficiently modern version of KVM. |
334 | 334 |
*/ |
335 | 335 |
ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY); |
Also available in: Unified diff