Skip to contentSkip to conversation

qemu_ram_resize: document assumptions

PATCH In review Michael S. Tsirkin 2 participants 4 messages Dec 24, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu_ram_resize: document assumptions

Document that when using qemu_ram_resize for anything mapped into guest address space, it's the job of the resize function to update guest visible state.

---

Adding a comment at dgilbert's request.
This is a separate patch to avoid deferring merging the code itself.

 exec.c | 7 +++++++
 1 file changed, 7 insertions(+)
exec.c +7 -0
index 2427319..9b7e515 100644
@@ -1301,6 +1301,13 @@ static int memory_try_enable_merging(void *addr, size_t len)
     return qemu_madvise(addr, len, QEMU_MADV_MERGEABLE);
 }
 
+/* Only legal before guest might have detected the memory size: e.g. on
+ * incoming migration, or right after reset.
+ *
+ * As memory core doesn't know how is memory accessed, it is up to
+ * resize callback to update device state and/or add assertions to detect
+ * misuse, if necessary.
+ */
 int qemu_ram_resize(ram_addr_t base, ram_addr_t newsize, Error **errp)
 {
     RAMBlock *block = find_ram_block(base);
Signature · 1 line
MST
#1 lore raw
Quoted 10 lines · Michael S. Tsirkin

Document that when using qemu_ram_resize for anything mapped into guest address space, it's the job of the resize function to update guest visible state.

---

Adding a comment at dgilbert's request.
This is a separate patch to avoid deferring merging the code itself.

Wait, I thought the agreement was to first merge Igor's patches to generate the SSDT from C code, and then see if this was still necessary?

Paolo

#2 lore raw
Quoted 10 lines · Paolo Bonzini
Quoted 7 lines · Michael S. Tsirkin

Document that when using qemu_ram_resize for anything mapped into guest address space, it's the job of the resize function to update guest visible state.

---

Quoted 8 lines
Quoted 3 lines

Adding a comment at dgilbert's request.
This is a separate patch to avoid deferring merging the code itself.

Wait, I thought the agreement was to first merge Igor's patches to generate the SSDT from C code, and then see if this was still necessary?

Paolo

To first *review* Igor's patches.

I can't merge more ACPI code until I know how we are handling cross-version migration.

Signature · 1 line
MST
#3 lore raw
Quoted 7 lines · Michael S. Tsirkin
Quoted 2 lines

Wait, I thought the agreement was to first merge Igor's patches to generate the SSDT from C code, and then see if this was still necessary?

To first *review* Igor's patches.

I can't merge more ACPI code until I know how we are handling cross-version migration.

We are "handling" it just by putting a limit of 64K above which things are not guaranteed to work.

Paolo