qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu_ram_resize: document assumptions
@ 2014-12-24 11:43 Michael S. Tsirkin
  2014-12-24 11:45 ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2014-12-24 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, dgilbert

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.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

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(+)

diff --git a/exec.c b/exec.c
index 2427319..9b7e515 100644
--- a/exec.c
+++ b/exec.c
@@ -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);
-- 
MST

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu_ram_resize: document assumptions
  2014-12-24 11:43 [Qemu-devel] [PATCH] qemu_ram_resize: document assumptions Michael S. Tsirkin
@ 2014-12-24 11:45 ` Paolo Bonzini
  2014-12-24 12:21   ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2014-12-24 11:45 UTC (permalink / raw)
  To: Michael S. Tsirkin, qemu-devel; +Cc: dgilbert



On 24/12/2014 12:43, Michael S. Tsirkin wrote:
> 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.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu_ram_resize: document assumptions
  2014-12-24 11:45 ` Paolo Bonzini
@ 2014-12-24 12:21   ` Michael S. Tsirkin
  2014-12-24 12:22     ` Paolo Bonzini
  0 siblings, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2014-12-24 12:21 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, dgilbert

On Wed, Dec 24, 2014 at 12:45:47PM +0100, Paolo Bonzini wrote:
> 
> 
> On 24/12/2014 12:43, Michael S. Tsirkin wrote:
> > 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.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> > 
> > 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.

-- 
MST

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu_ram_resize: document assumptions
  2014-12-24 12:21   ` Michael S. Tsirkin
@ 2014-12-24 12:22     ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2014-12-24 12:22 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel, dgilbert



On 24/12/2014 13:21, Michael S. Tsirkin wrote:
> > 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-24 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 11:43 [Qemu-devel] [PATCH] qemu_ram_resize: document assumptions Michael S. Tsirkin
2014-12-24 11:45 ` Paolo Bonzini
2014-12-24 12:21   ` Michael S. Tsirkin
2014-12-24 12:22     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).