summary refs log tree commit diff stats
path: root/accel/kvm/kvm-all.c
diff options
context:
space:
mode:
authorWilliam Roche <william.roche@oracle.com>2025-02-11 21:27:05 +0000
committerPeter Xu <peterx@redhat.com>2025-02-12 11:33:13 -0500
commitc1cda1c5f8faf18994dacb8c733ad22e22c2318f (patch)
tree8b7cb126774f9ceda7ac50877d0e66f1d3f3c0df /accel/kvm/kvm-all.c
parent1cceedd7726556052d3d3bcf08a07b7762f8aa7c (diff)
downloadfocaccia-qemu-c1cda1c5f8faf18994dacb8c733ad22e22c2318f.tar.gz
focaccia-qemu-c1cda1c5f8faf18994dacb8c733ad22e22c2318f.zip
system/physmem: handle hugetlb correctly in qemu_ram_remap()
The list of hwpoison pages used to remap the memory on reset
is based on the backend real page size.
To correctly handle hugetlb, we must mmap(MAP_FIXED) a complete
hugetlb page; hugetlb pages cannot be partially mapped.

Signed-off-by: William Roche <william.roche@oracle.com>
Co-developed-by: David Hildenbrand <david@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/20250211212707.302391-2-william.roche@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'accel/kvm/kvm-all.c')
-rw-r--r--accel/kvm/kvm-all.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index c65b790433..f89568bfa3 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -1288,7 +1288,7 @@ static void kvm_unpoison_all(void *param)
 
     QLIST_FOREACH_SAFE(page, &hwpoison_page_list, list, next_page) {
         QLIST_REMOVE(page, list);
-        qemu_ram_remap(page->ram_addr, TARGET_PAGE_SIZE);
+        qemu_ram_remap(page->ram_addr);
         g_free(page);
     }
 }