[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 1/2] memory: export migration page size
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH v3 1/2] memory: export migration page size |
Date: |
Tue, 13 Aug 2013 01:43:33 +0300 |
Migration code assumes that each RAM block is a multiple of target page
size.
We can fix this in a variety of ways, the simplest way is
exporting the required page size so callers can make regions
large enough.
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
arch_init.c | 6 ++++++
include/exec/memory.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/arch_init.c b/arch_init.c
index 68a7ab7..c62778f 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -150,6 +150,12 @@ int qemu_read_default_config_files(bool userconfig)
return 0;
}
+/* Smallest page size for migrated RAM. */
+uint64_t qemu_migration_page_size(void)
+{
+ return TARGET_PAGE_SIZE;
+}
+
static inline bool is_zero_page(uint8_t *p)
{
return buffer_find_nonzero_offset(p, TARGET_PAGE_SIZE) ==
diff --git a/include/exec/memory.h b/include/exec/memory.h
index ebe0d24..6ffffa2 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1055,6 +1055,7 @@ void *address_space_map(AddressSpace *as, hwaddr addr,
void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
int is_write, hwaddr access_len);
+extern uint64_t qemu_migration_page_size(void);
#endif
--
MST
[Qemu-devel] [PATCH v3 2/2] loader: put FW CFG ROM files into RAM, Michael S. Tsirkin, 2013/08/12