[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/39] migration: Remove qemu_host_page_size
From: |
Richard Henderson |
Subject: |
[PULL 14/39] migration: Remove qemu_host_page_size |
Date: |
Thu, 22 Feb 2024 10:42:58 -1000 |
Replace with the maximum of the real host page size
and the target page size. This is an exact replacement.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Acked-by: Helge Deller <deller@gmx.de>
Message-Id: <20240102015808.132373-12-richard.henderson@linaro.org>
---
migration/ram.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 4649a81204..61c1488352 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2935,7 +2935,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
{
RAMState **rsp = opaque;
RAMBlock *block;
- int ret;
+ int ret, max_hg_page_size;
if (compress_threads_save_setup()) {
return -1;
@@ -2950,6 +2950,12 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
}
(*rsp)->pss[RAM_CHANNEL_PRECOPY].pss_channel = f;
+ /*
+ * ??? Mirrors the previous value of qemu_host_page_size,
+ * but is this really what was intended for the migration?
+ */
+ max_hg_page_size = MAX(qemu_real_host_page_size(), TARGET_PAGE_SIZE);
+
WITH_RCU_READ_LOCK_GUARD() {
qemu_put_be64(f, ram_bytes_total_with_ignored()
| RAM_SAVE_FLAG_MEM_SIZE);
@@ -2958,8 +2964,8 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
qemu_put_byte(f, strlen(block->idstr));
qemu_put_buffer(f, (uint8_t *)block->idstr, strlen(block->idstr));
qemu_put_be64(f, block->used_length);
- if (migrate_postcopy_ram() && block->page_size !=
- qemu_host_page_size) {
+ if (migrate_postcopy_ram() &&
+ block->page_size != max_hg_page_size) {
qemu_put_be64(f, block->page_size);
}
if (migrate_ignore_shared()) {
@@ -3792,6 +3798,7 @@ static int parse_ramblock(QEMUFile *f, RAMBlock *block,
ram_addr_t length)
int ret = 0;
/* ADVISE is earlier, it shows the source has the postcopy capability on */
bool postcopy_advised = migration_incoming_postcopy_advised();
+ int max_hg_page_size;
assert(block);
@@ -3809,9 +3816,16 @@ static int parse_ramblock(QEMUFile *f, RAMBlock *block,
ram_addr_t length)
return ret;
}
}
+
+ /*
+ * ??? Mirrors the previous value of qemu_host_page_size,
+ * but is this really what was intended for the migration?
+ */
+ max_hg_page_size = MAX(qemu_real_host_page_size(), TARGET_PAGE_SIZE);
+
/* For postcopy we need to check hugepage sizes match */
if (postcopy_advised && migrate_postcopy_ram() &&
- block->page_size != qemu_host_page_size) {
+ block->page_size != max_hg_page_size) {
uint64_t remote_page_size = qemu_get_be64(f);
if (remote_page_size != block->page_size) {
error_report("Mismatched RAM page size %s "
--
2.34.1
- [PULL 04/39] accel/tcg: Remove qemu_host_page_size from page_protect/page_unprotect, (continued)
- [PULL 04/39] accel/tcg: Remove qemu_host_page_size from page_protect/page_unprotect, Richard Henderson, 2024/02/22
- [PULL 05/39] linux-user: Adjust SVr4 NULL page mapping, Richard Henderson, 2024/02/22
- [PULL 06/39] linux-user: Remove qemu_host_page_{size, mask} in probe_guest_base, Richard Henderson, 2024/02/22
- [PULL 07/39] linux-user: Remove qemu_host_page_size from create_elf_tables, Richard Henderson, 2024/02/22
- [PULL 08/39] linux-user/hppa: Simplify init_guest_commpage, Richard Henderson, 2024/02/22
- [PULL 09/39] linux-user/nios2: Remove qemu_host_page_size from init_guest_commpage, Richard Henderson, 2024/02/22
- [PULL 10/39] linux-user/arm: Remove qemu_host_page_size from init_guest_commpage, Richard Henderson, 2024/02/22
- [PULL 11/39] linux-user: Remove qemu_host_page_{size, mask} from mmap.c, Richard Henderson, 2024/02/22
- [PULL 12/39] linux-user: Remove REAL_HOST_PAGE_ALIGN from mmap.c, Richard Henderson, 2024/02/22
- [PULL 13/39] linux-user: Remove HOST_PAGE_ALIGN from mmap.c, Richard Henderson, 2024/02/22
- [PULL 14/39] migration: Remove qemu_host_page_size,
Richard Henderson <=
- [PULL 15/39] hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init, Richard Henderson, 2024/02/22
- [PULL 16/39] softmmu/physmem: Remove qemu_host_page_size, Richard Henderson, 2024/02/22
- [PULL 17/39] softmmu/physmem: Remove HOST_PAGE_ALIGN, Richard Henderson, 2024/02/22
- [PULL 18/39] linux-user: Remove qemu_host_page_size from main, Richard Henderson, 2024/02/22
- [PULL 19/39] linux-user: Split out target_mmap__locked, Richard Henderson, 2024/02/22
- [PULL 20/39] linux-user: Move some mmap checks outside the lock, Richard Henderson, 2024/02/22
- [PULL 21/39] linux-user: Fix sub-host-page mmap, Richard Henderson, 2024/02/22
- [PULL 23/39] linux-user: Do early mmap placement only for reserved_va, Richard Henderson, 2024/02/22
- [PULL 22/39] linux-user: Split out mmap_end, Richard Henderson, 2024/02/22
- [PULL 25/39] linux-user: Use do_munmap for target_mmap failure, Richard Henderson, 2024/02/22