qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>,
	Peter Xu <peterx@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Michal Privoznik <mprivozn@redhat.com>
Subject: Re: [PATCH v3 7/8] virtio-mem: Migrate immutable properties early
Date: Fri, 13 Jan 2023 14:59:14 +0100	[thread overview]
Message-ID: <fd611830-5686-eafc-444e-4db519afbe46@redhat.com> (raw)
In-Reply-To: <Y8BjGPAuJPDqjFTD@work-vm>

On 12.01.23 20:44, Dr. David Alan Gilbert wrote:
> * David Hildenbrand (david@redhat.com) wrote:
>> The bitmap and the size are immutable while migration is active: see
>> virtio_mem_is_busy(). We can migrate this information early, before
>> migrating any actual RAM content. Further, all information we need for
>> sanity checks is immutable as well.
>>
>> Having this information in place early will, for example, allow for
>> properly preallocating memory before touching these memory locations
>> during RAM migration: this way, we can make sure that all memory was
>> actually preallocated and that any user errors (e.g., insufficient
>> hugetlb pages) can be handled gracefully.
>>
>> In contrast, usable_region_size and requested_size can theoretically
>> still be modified on the source while the VM is running. Keep migrating
>> these properties the usual, late, way.
>>
>> Use a new device property to keep behavior of compat machines
>> unmodified.
> 
> Can you get me a migration file from this? I want to try and understand
> what happens when you have the vmstate_register together with the ->vmsd -
> I'm not quite sure what ends up in the output.  Preferably for a VM with
> two virtio-mem's.

Sure, here is the stripped output from analyze-migration.py:

     "ram (2)": {
         "section sizes": {
             "0000:00:03.0/mem0": "0x0000000780000000",
             "0000:00:04.0/mem1": "0x0000000780000000",
             "pc.ram": "0x0000000100000000",
             "/rom@etc/acpi/tables": "0x0000000000020000",
             "pc.bios": "0x0000000000040000",
             "0000:00:02.0/e1000.rom": "0x0000000000040000",
             "pc.rom": "0x0000000000020000",
             "/rom@etc/table-loader": "0x0000000000001000",
             "/rom@etc/acpi/rsdp": "0x0000000000001000"
         }
     },
     "0000:00:03.0/virtio-mem-device-early (51)": {
         "tmp": "00 00 00 01 40 00 00 00 00 00 00 07 80 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00",
         "size": "0x0000000040000000",
         "bitmap": "ff ff ff ff [...] "
     },
     "0000:00:04.0/virtio-mem-device-early (53)": {
         "tmp": "00 00 00 08 c0 00 00 00 00 00 00 07 80 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00",
         "size": "0x00000001fa400000",
         "bitmap": "ff ff ff ff [...] "
     },
     "timer (0)": {
         "cpu_ticks_offset": "0x00000073f5ba3d28",
         "unused": "00 00 00 00 00 00 00 00",
         "cpu_clock_offset": "0x00000026b744e29c"
     },
[...]
     "serial (50)": {
         "state": {
             "divider": "0x0001",
             "rbr": "0x00",
             "ier": "0x05",
             "iir": "0xc1",
             "lcr": "0x13",
             "mcr": "0x0b",
             "lsr": "0x60",
             "msr": "0xb0",
             "scr": "0x00",
             "fcr_vmstate": "0x81"
         }
     },
     "0000:00:03.0/virtio-mem (52)": {
         "virtio": "00 00 00 02 f4 1a 58 10 07 01 10 00 01 00 ff [...]"
     "0000:00:04.0/virtio-mem (54)": {
         "virtio": "00 00 00 02 f4 1a 58 10 07 01 10 00 01 00 ff [...]"

The data of both "virtio" blobs is extremely large, a lot 0x00 -- no idea what virtio
core stores in there.

Note that vmstate_virtio_mem_device ("virtio-mem-device") will be included by virtio core in the
"virtio" blob.

I can send you a full savevm file privately, just ping me.

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2023-01-13 13:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 16:43 [PATCH v3 0/8] virtio-mem: Handle preallocation with migration David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 1/8] migration/savevm: Move more savevm handling into vmstate_save() David Hildenbrand
2023-01-12 16:58   ` Dr. David Alan Gilbert
2023-01-12 17:49     ` David Hildenbrand
2023-01-12 18:36       ` Dr. David Alan Gilbert
2023-01-13 12:59         ` David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 2/8] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup() David Hildenbrand
2023-01-12 17:43   ` Dr. David Alan Gilbert
2023-01-12 17:47     ` David Hildenbrand
2023-01-12 18:40       ` Dr. David Alan Gilbert
2023-01-12 22:06         ` Peter Xu
2023-01-13 13:01           ` David Hildenbrand
2023-01-13 13:05             ` David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 3/8] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM) David Hildenbrand
2023-01-12 17:56   ` Dr. David Alan Gilbert
2023-01-12 18:21     ` David Hildenbrand
2023-01-12 19:52       ` Dr. David Alan Gilbert
2023-01-12 22:14         ` Peter Xu
2023-01-12 22:28           ` Peter Xu
2023-01-13 13:47             ` David Hildenbrand
2023-01-13 15:20               ` Peter Xu
2023-01-13 15:27                 ` Peter Xu
2023-01-16 10:35                   ` David Hildenbrand
2023-01-16 14:56                     ` Peter Xu
2023-01-16 14:57                       ` David Hildenbrand
2023-01-13 15:28                 ` David Hildenbrand
2023-01-12 16:43 ` [PATCH v3 4/8] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST() David Hildenbrand
2023-01-12 16:44 ` [PATCH v3 5/8] migration/ram: Factor out check for advised postcopy David Hildenbrand
2023-01-12 18:23   ` Dr. David Alan Gilbert
2023-01-12 16:44 ` [PATCH v3 6/8] virtio-mem: Fail if a memory backend with "prealloc=on" is specified David Hildenbrand
2023-01-12 18:33   ` Dr. David Alan Gilbert
2023-01-12 16:44 ` [PATCH v3 7/8] virtio-mem: Migrate immutable properties early David Hildenbrand
2023-01-12 19:44   ` Dr. David Alan Gilbert
2023-01-13 13:59     ` David Hildenbrand [this message]
2023-01-12 16:44 ` [PATCH v3 8/8] virtio-mem: Proper support for preallocation with migration David Hildenbrand
2023-01-12 19:50   ` Dr. David Alan Gilbert
2023-01-12 16:45 ` [PATCH v3 0/8] virtio-mem: Handle " David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd611830-5686-eafc-444e-4db519afbe46@redhat.com \
    --to=david@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).