[Qemu-devel] [PULL 12/27] postcopy: Transmit ram size summary word

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Replace the host page-size in the 'advise' command by a pagesize summary bitmap; if the VM is just using normal RAM then this will be exactly the same as before, however if they're using huge pages they'll be different, and thus: a)

[Qemu-devel] [PULL 20/27] postcopy: Load huge pages in one go

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The existing postcopy RAM load loop already ensures that it glues together whole host-pages from the target page size chunks sent over the wire. Modify the definition of host page that it uses to be the RAM block page size and thus be huge

[Qemu-devel] [PULL 24/27] postcopy: Update userfaultfd.h header

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Just the userfaultfd.h update from Paolo's header update run; * Drop this patch after Paolo's update goes in * Signed-off-by: Dr. David Alan Gilbert Message-Id: <20170224182844.32452-14-dgilb...@redhat.com>

[Qemu-devel] [PULL 26/27] postcopy: Add doc about hugepages and postcopy

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Laurent Vivier Message-Id: <20170224182844.32452-16-dgilb...@redhat.com> Signed-off-by: Dr. David

[Qemu-devel] [PULL 14/27] postcopy: Chunk discards for hugepages

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" At the start of the postcopy phase, partially sent huge pages must be discarded. The code for dealing with host page sizes larger than the target page size can be reused for this case. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PULL 04/27] migration/vmstate: fix array of ptr with nullptrs

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: Halil Pasic Make VMS_ARRAY_OF_POINTER cope with null pointers. Previously the reward for trying to migrate an array with some null pointers in it was an illegal memory access, that is a swift and painless death of the process. Let's make vmstate cope with this

[Qemu-devel] [PULL 02/27] migration/vmstate: renames in (load|save)_state

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: Halil Pasic The vmstate_(load|save)_state start out with an a void *opaque pointing to some struct, and manipulate one or more elements of one field within that struct. First the field within the struct is pinpointed as opaque + offset, then if this is a pointer

[Qemu-devel] [PULL 17/27] postcopy: Record largest page size

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Record the largest page size in use; we'll need it soon for allocating temporary buffers. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Laurent Vivier

[Qemu-devel] [PULL 06/27] tests/test-vmstate.c: test array of ptr to primitive

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: Halil Pasic Let's have a test for ptr arrays to some primitive type with some not-null and null ptrs intermixed. Signed-off-by: Halil Pasic Reviewed-by: Dr. David Alan Gilbert Message-Id:

[Qemu-devel] [PULL 13/27] postcopy: Transmit and compare individual page sizes

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When using postcopy with hugepages, we require the source and destination page sizes for any RAMBlock to match; note that different RAMBlocks in the same VM can have different page sizes. Transmit them as part of the RAM information header and

[Qemu-devel] [PULL 22/27] postcopy: Send whole huge pages

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The RAM save code uses ram_save_host_page to send whole host pages at a time; change this to use the host page size associated with the RAM Block which may be a huge page. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PULL 16/27] postcopy: enhance ram_block_discard_range for hugepages

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Unfortunately madvise DONTNEED doesn't work on hugepagetlb so use fallocate(FALLOC_FL_PUNCH_HOLE) qemu_fd_getpagesize only sets the page based off a file if the file is from hugetlbfs. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PULL 11/27] migration: fix use-after-free of to_dst_file

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: Vladimir Sementsov-Ogievskiy hmp_savevm calls qemu_savevm_state(f), which sets to_dst_file=f in global migration state. Then hmp_savevm closes f (g_free called). Next access to to_dst_file in migration state (for example, qmp_migrate_set_speed) will use it after

[Qemu-devel] [PULL 05/27] tests/test-vmstate.c: test array of ptr with null

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: Halil Pasic Add test for VMSTATE_ARRAY_OF_POINTER_TO_STRUCT with an array containing some null pointer. Signed-off-by: Halil Pasic Reviewed-by: Dr. David Alan Gilbert Message-Id:

[Qemu-devel] [PULL 23/27] postcopy: Allow hugepages

2017-02-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow huge pages in postcopy. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Laurent Vivier Message-Id:

[Qemu-devel] [PATCH v2 5/5] vmstateify tsc210x

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Note: I know nothing about this hardware. I'm now saving all 3 of the pll entries; only 2 were saved before. There are a couple of times that were previously stored as offsets from 'now' calculated before saving; with vmstate it's

[Qemu-devel] [PATCH v2 0/5] vmstateify a bunch of rare devices [for 2.8]

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" In an effort to nibble away at register_savevm users, this set removes 5 more and converts them to vmstate. The ssd0323 seems to test OK with Peter's Stellaris test. The rc4030 has a tested-by from Hervé. The other 3 I'm less sure of; the

[Qemu-devel] [PATCH v2 1/5] vmstateify ssd0323 display

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Bumps version number because we now use the VMSTATE_SSI_SLAVE that only uses a byte rather than a 32bit (for saving a bool 'cs'). Signed-off-by: Dr. David Alan Gilbert --- hw/display/ssd0323.c | 102

[Qemu-devel] [PATCH v2 2/5] vmstateify rc4030

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" rc4030 seems to be part of a MIPS chipset; this converts it to VMState. Note: a) It builds but I've not found a way to boot a MIPS Jazz image to test it. b) It was saving 0..<15 on the 16 entry rem_speed array; I've not got a clue

[Qemu-devel] [PATCH v2 3/5] vmstateify ssi-sd

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Changed a few types to fixed sized types in the ssi_sd_state Now saving/loading a byte for the cmdarg/response bytes that were previously saved as uint32 Bumped version number to deal with those changes. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH v2 4/5] vmstateify tsc2005

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I've converted the fields in it's main data structure to fixed size types in ways that look sane, but I don't actually know the details of this hardware. Signed-off-by: Dr. David Alan Gilbert --- hw/input/tsc2005.c | 154

[Qemu-devel] [PATCH 2/2] qom: Implement qom-get HMP command

2016-08-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Reimplement it based on qmp_qom_get() to avoid converting QObjects back to strings. Inspired-by: Paolo Bonzini Signed-off-by: Andreas Färber Slight fix for bit-rot: Signed-off-by: Dr. David Alan

[Qemu-devel] [PATCH 0/2] qom-get [for 2.8]

2016-08-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, I'd noticed a while ago the lack of qom-get and was about to implement it, when I noticed Andreas had implemented it back in March 2015 as part of the larger patch series 'qom: HMP commands to supersede info qtree' (

[Qemu-devel] [PATCH 1/2] qapi: Stub out StringOutputVisitor struct support

2016-08-25 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Avoid a segfault when visiting, e.g., the QOM rtc-time property, by implementing the struct callbacks and raising an Error. Signed-off-by: Andreas Färber Updated for changed interface: Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH v2] qom: Implement qom-get HMP command

2016-09-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This started off as Andreas Färber's implementation from March 2015, but after feedback from Paolo morphed into using the json output which handles structs reasonably. Use with qom-list to find the members of an object. (qemu) qom-get

[Qemu-devel] [PATCH] migration: Fix seg with missing port

2016-09-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The command : migrate tcp:localhost: currently segs; fix it so it now says: error parsing address 'localhost:' and the same for -incoming. (We know that errp is non-null; callers use a local_err). Signed-off-by: Dr. David Alan

[Qemu-devel] [PATCH] x86/lapic: Load LAPIC state at post_load

2016-09-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Load the LAPIC state during post_load (rather than when the CPU starts). This allows an interrupt to be delivered from the ioapic to the lapic prior to cpu loading, in particular the RTC that starts ticking as soon as we load it's state.

[Qemu-devel] [PATCH v2] migration: Fix seg with missing port

2016-09-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The command : migrate tcp:localhost: currently segs; fix it so it now says: error parsing address 'localhost:' and the same for -incoming. Signed-off-by: Dr. David Alan Gilbert -- v2 More Error *

[Qemu-devel] [PATCH 0/2] Migration/postcopy disallow huge pages

2016-09-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We've not got support for huge pages in postcopy yet, and it will error when it tries to use the userfaultfd on the hugepage, however the kernel is going to gain support for userfault so make sure we fail with a nice error on the new kernel

[Qemu-devel] [PATCH 1/2] RAMBlocks: Store page size

2016-09-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Store the page size in each RAMBlock, we need it later. Signed-off-by: Dr. David Alan Gilbert --- exec.c| 17 +++-- include/exec/cpu-common.h | 1 + include/exec/ram_addr.h | 1 + 3

[Qemu-devel] [PATCH 2/2] migration/postcopy: Explicitly disallow huge pages

2016-09-29 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" At the moment postcopy will fail as soon as qemu tries to register userfault on the RAMBlock pages that are backed by hugepages. However, the kernel is going to get userfault support for hugepage at some point, and we've not got the rest of the

[Qemu-devel] [PULL 0/1] HMP queue

2016-10-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The following changes since commit bbc4c3f4f3c624e2de64fdcb79f4dd8c1a508e9d: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2016-10-04 14:25:08 +0100) are available in the git repository at:

[Qemu-devel] [PULL 1/1] hmp: fix qemu crash due to ioapic state dump w/ split irqchip

2016-10-04 Thread Dr. David Alan Gilbert (git)
From: Wanpeng Li The qemu will crash when info ioapic through hmp if irqchip is split. Below message is splat: KVM_GET_IRQCHIP failed: Unknown error -6 This patch fix it by dumping the ioapic state from the qemu emulated ioapic if irqchip is split. Cc: Paolo Bonzini

[Qemu-devel] [PATCH 3/3] migration/rdma: Don't flag an error when we've been told about one

2016-09-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If the other side tells us there's been an error and we fail the migration, we don't need to signal that failure to the other side because it already knew. Signed-off-by: Dr. David Alan Gilbert --- migration/rdma.c | 6

[Qemu-devel] [PATCH] Add more APIC state to dump

2016-09-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add the rest of the APIC state to the 'info lapic' dump, since it is of course state that wasn't printed that I'd messed up. You now have output like: (qemu) info lapic dumping local APIC state for CPU 1 apicbase 0xfee00c00 ID 1 Version 20

[Qemu-devel] [PATCH 2/3] migration: Make failed migration load set file error

2016-09-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If an error occurs in a section load, set the file error flag so that the transport can get notified to do a cleanup. Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 19 --- 1 file changed,

[Qemu-devel] [PATCH 1/3] migration/rdma: Pass qemu_file errors across link

2016-09-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" If we fail for some reason (e.g. a mismatched RAMBlock) and it's set the qemu_file error flag, pass that error back to the peer so it can clean up rather than waiting for some higher level progress. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 0/3] RDMA error handling

2016-09-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" lp: https://bugs.launchpad.net/qemu/+bug/1545052 The RDMA code tends to hang if the destination dies in the wrong place; this series doesn't completely fix that, but in cases where the destination knows there's been an error, it makes sure it

[Qemu-devel] [PATCH] Postcopy vs xbzrle: Don't send xbzrle pages once in postcopy [for 2.8]

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" xbzrle relies on reading pages that have already been sent to the destination and then applying the modifications; we can't do that in postcopy because the destination may well have modified the page already or the page has been discarded. I

[Qemu-devel] [RFC 1/6] migration: report an error giving the failed field

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When a field fails to load (typically due to a limit check, or a call to a get/put) report the device and field to give an indication of the cause. Signed-off-by: Dr. David Alan Gilbert --- migration/vmstate.c | 2 ++ 1

[Qemu-devel] [RFC 6/6] virtio/migration: Migrate virtio-net to VMState

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Only lightly smoke-tested so far Signed-off-by: Dr. David Alan Gilbert --- hw/net/virtio-net.c| 256 - include/hw/virtio/virtio-net.h | 10 +- 2 files changed, 157

[Qemu-devel] [RFC 4/6] virtio/migration: Add VMStateDescription to VirtioDeviceClass

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Provide a vmsd pointer for VirtIO devices to use instead of the load/save methods. We'll eventually kill off the load/save methods. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/virtio.c | 11 +++

[Qemu-devel] [RFC 5/6] virtio/migration: Migrate balloon to VMState

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Replace the load/save with a vmsd. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/virtio-balloon.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git

[Qemu-devel] [RFC 2/6] migration: Report values for comparisons

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Report the values when a comparison fails; together with the previous patch that prints the device and field names this should give a good idea of why loading the migration failed. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [RFC 3/6] migration: Add VMSTATE_UNUSED_VARRAY_UINT32

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VMSTATE_UNUSED_VARRAY_UINT32 is used to skip a chunk of the stream that's an n-element array; note the array size and the dynamic value read never get multiplied so there's no overflow risk. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [RFC 0/6] converting some of virtio to VMState

2016-08-24 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This series converts two parts of virtio to VMState - the device load/save for virtio-balloon and virtio-net. It's only been smoke tested (which it passes); but if anyone has a good suggestion for testing virtio-net migration I'd be

[Qemu-devel] [PATCH v3 2/2] vmstateify tsc210x

2016-09-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I'm now saving all 3 of the pll entries; only 2 were saved before. There are a couple of times that were previously stored as offsets from 'now' calculated before saving; with vmstate it's easier to store the 'now' and fix it up on reload.

[Qemu-devel] [PATCH v3 1/2] vmstateify tsc2005

2016-09-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I've converted the fields in it's main data structure to fixed size types in ways that look sane. Signed-off-by: Dr. David Alan Gilbert --- Note I haven't got one of these devices to compare with or know much about them.

[Qemu-devel] [PATCH v3 0/2] vmstateify a bunch of rare devices

2016-09-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Two more register_savevm users converted to vmstate. This is split out from an earlier series where some of the others have gone in. Note I've not been able to test the changes (other than build); I've not got any model that uses them that

[Qemu-devel] [PATCH 2/2] migration: Report values for comparisons

2016-09-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Report the values when a comparison fails; together with the previous patch that prints the device and field names this should give a good idea of why loading the migration failed. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 0/2] Add error reporting in migration

2016-09-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" At the moment if you use a VMSTATE_*_EQUAL macro and the value doesn't match you just get an error about the section that failed e.g. qemu-system-ppc64: error while loading state for instance 0x0 of device 'cpu' qemu-system-ppc64: load of

[Qemu-devel] [PATCH 1/2] migration: report an error giving the failed field

2016-09-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When a field fails to load (typically due to a limit check, or a call to a get/put) report the device and field to give an indication of the cause. Signed-off-by: Dr. David Alan Gilbert --- migration/vmstate.c | 2 ++ 1

[Qemu-devel] [PATCH 2/8] add QEMU_BUILD_BUG_EXPR

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Glib's GLIB_STATIC_ASSERT_EXPR can't be used in an array initialisation where as this rune can. Signed-off-by: Dr. David Alan Gilbert --- include/qemu/compiler.h | 5 + 1 file changed, 5 insertions(+) diff --git

[Qemu-devel] [PATCH 4/8] tests/migration: Add test for VMSTATE_WITH_TMP

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a test for VMSTATE_WITH_TMP to tests/test-vmstate.c Signed-off-by: Dr. David Alan Gilbert --- tests/test-vmstate.c | 97 +--- 1 file changed, 93 insertions(+), 4

[Qemu-devel] [PATCH 2/2] virtio/migration: Migrate balloon to VMState

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Replace the load/save with a vmsd. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/virtio-balloon.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git

[Qemu-devel] [PATCH 1/2] tests/stubs: Add a dummy, silent monitor

2016-10-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We need an easy way to silence error_report's that come up in meant-to-fail test cases. The easiest way to do that is to create a monitor instance, and since our stubbed monitor_printf's are slent this causes the errors to disappear.

[Qemu-devel] [PATCH 2/2] test-vmstate: Silence expected errors

2016-10-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" test-vmstate has some expected failure tests (from explicitly truncating an input stream); these trigger errors in the migration code that are now reported; silence these errors. Signed-off-by: Dr. David Alan Gilbert ---

[Qemu-devel] [PATCH 0/2] Silence test-vmstate errors

2016-10-20 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" In a1771070e7 I added an error message during migration loading so you could see the field that failed to load. Unfortunately this triggers during the expected-failure case testing in tests/test-vmstate. This silences that error by providing a

[Qemu-devel] [PATCH v2 1/5] slirp: VMState conversion; tcpcb

2016-11-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the migration of the struct tcpcb to use a VMStateDescription, the rest of it will come later. Mostly mechanical, except for conversion of some 'char' to uint8_t to ensure portability. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH v2 4/5] slirp: VMStatify socket level

2016-11-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Working up the stack, this replaces the slirp_socket_load/save with VMState definitions. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 146 ++---

[Qemu-devel] [PATCH v2 3/5] slirp: Common lhost/fhost union

2016-11-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The socket structure has a pair of unions for lhost and fhost addresses; the unions are identical so split them out into a separate union declaration. Signed-off-by: Dr. David Alan Gilbert --- slirp/socket.h | 18

[Qemu-devel] [PATCH v2 0/5] SLIRP VMStatification [ for 2.9 ]

2016-11-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is an update to my previous series that included VMSTATE_WITH_TMP. I've not bothered including the VMSTATE_WITH_TMP set this time; but it's still dependent on it, so we'll wait until it's in first. My main change in this version

[Qemu-devel] [PATCH v2 5/5] slirp: VMStatify remaining except for loop

2016-11-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This converts the remaining components, except for the top level loop, to VMState. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 48 +++- 1 file changed, 19

[Qemu-devel] [PATCH v2 2/5] slirp: VMStatify sbuf

2016-11-23 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the sbuf structure to a VMStateDescription. Note this uses the VMSTATE_WITH_TMP mechanism to calculate and reload the offsets based on the pointers. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: David Gibson

[Qemu-devel] [PATCH 2/2] migration/pcspk: Turn migration of pcspk off for 2.7 and older

2016-11-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" To keep backwards migration compatibility allow us to turn pcspk migration off. Signed-off-by: Dr. David Alan Gilbert --- include/hw/i386/pc.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/hw/i386/pc.h

[Qemu-devel] [PATCH 1/2] migration/pcspk: Add a property to state if pcspk is migrated

2016-11-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow us to turn migration of pcspk off for compatibility. Signed-off-by: Dr. David Alan Gilbert --- hw/audio/pcspk.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c

[Qemu-devel] [PATCH 0/2] pcspk migration compatibility

2016-11-28 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, 39c88f56 added VMState for pcspk but turned it on for all machine types, this breaks backwards compatibility to older machine types. If this is too late for 2.8 then I suggest we take the 1st of these two patches, which just makes it a

[Qemu-devel] [PATCH 3/8] migration: Add VMSTATE_WITH_TMP

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VMSTATE_WITH_TMP is for handling structures where some calculation or rearrangement of the data needs to be performed before the data hits the wire. For example, where the value on the wire is an offset from a non-migrated base, but the data

[Qemu-devel] [PATCH 0/8] VMSTATE_WITH_TMP and it's use in SLIRP

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This set adds the VMSTATE_WITH_TMP macro to allow the allocation of temporary space during migration for cases where the data to be migrated must be derived from the data that's actually in use. The first use of it is in the

[Qemu-devel] [PATCH 5/8] slirp: VMState conversion; tcpcb

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the migration of the struct tcpcb to use a VMStateDescription, the rest of it will come later. Mostly mechanical, except for conversion of some 'char' to uint8_t to ensure portability. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 7/8] slirp: VMStatify socket level

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Working up the stack, this replaces the slirp_socket_load/save with VMState definitions. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 150 +++--

[Qemu-devel] [PATCH 6/8] slirp: VMStatify sbuf

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the sbuf structure to a VMStateDescription. Note this uses the VMSTATE_WITH_TMP mechanism to calculate and reload the offsets based on the pointers. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: David Gibson

[Qemu-devel] [PATCH 1/2] virtio/migration: Add VMStateDescription to VirtioDeviceClass

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Provide a vmsd pointer for VirtIO devices to use instead of the load/save methods. We'll eventually kill off the load/save methods. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/virtio.c | 14

[Qemu-devel] [PATCH 0/2] virtio vmstatification

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This contains part of a series I previously posted as an RFC; it contains just the code to add the vmsd hook to virtio and the simple case for balloon. The networking code will have to wait until my VMSTATE_WITH_TMP macros go in and

[Qemu-devel] [PATCH 1/8] migration: extend VMStateInfo

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: Jianjun Duan Current migration code cannot handle some data structures such as QTAILQ in qemu/queue.h. Here we extend the signatures of put/get in VMStateInfo so that customized handling is supported. Signed-off-by: Jianjun Duan ---

[Qemu-devel] [PATCH 8/8] slirp: VMStatify remaining except for loop

2016-10-27 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This converts the remaining components, except for the loop, to VMState. Signed-off-by: Dr. David Alan Gilbert --- slirp/slirp.c | 49 - 1 file changed, 20 insertions(+),

[Qemu-devel] [very-WIP 0/4] Migration: VMSTATE_WITH_TMP

2016-10-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, I'm interested in comments on the idea here, it's certainly not ready to go in yet; and VERY untested. Here I've added a macro, VMSTATE_WITH_TMP which allows you to allocate a temporary structure, transmit that with a

[Qemu-devel] [very-WIP 1/7] migration: Add VMSTATE_WITH_TMP

2016-10-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" VMSTATE_WITH_TMP is for handling structures where some calculation or rearrangement of the data needs to be performed before the data hits the wire. For example, where the value on the wire is an offset from a non-migrated base, but the data

[Qemu-devel] [very-WIP 2/7] tests/migration: Add test for VMSTATE_WITH_TMP

2016-10-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add a test for VMSTATE_WITH_TMP to tests/test-vmstate.c Signed-off-by: Dr. David Alan Gilbert --- tests/test-vmstate.c | 97 +--- 1 file changed, 93 insertions(+), 4

[Qemu-devel] [very-WIP 3/4] slirp: VMStatify sbuf

2016-10-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the sbuf structure to a VMStateDescription. Note this uses the VMSTATE_WITH_TMP mechanism to calculate and reload the offsets based on the pointers. Signed-off-by: Dr. David Alan Gilbert --- slirp/sbuf.h | 4

[Qemu-devel] [very-WIP 4/4] virtio/migration: Migrate virtio-net to VMState

2016-10-11 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Only lightly smoke-tested so far Signed-off-by: Dr. David Alan Gilbert --- hw/net/virtio-net.c| 317 +++-- include/hw/virtio/virtio-net.h | 4 +- 2 files changed, 214

[Qemu-devel] [PATCH 1/1] slirp: VMState conversion; tcpcb

2016-10-13 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Convert the migration of the struct tcpcb to use a VMStateDescription, the rest of it will come later. Mostly mechanical, except for conversion of some 'char' to uint8_t to ensure portability. Tested with -netdev

[Qemu-devel] [for 2.9] balloon: Don't balloon roms

2016-12-16 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" A broken guest can specify physical addresses that correspond to any memory region, but it shouldn't be able to change ROM. Signed-off-by: Dr. David Alan Gilbert --- hw/virtio/trace-events | 2 ++

[Qemu-devel] [PATCH 2/2] vmxnet3: VMStatify rx/tx q_descr and int_state

2016-12-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Fairly simple mechanical conversion of all fields. TODO The problem is vmxnet3-ring size/cell_size/next are declared as size_t but written as 32bit. Signed-off-by: Dr. David Alan Gilbert --- hw/net/vmxnet3.c | 272

[Qemu-devel] [PATCH 0/2] Vmxnet3 VMStatification

2016-12-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This patchset converts most of vmxnet3 to VMState; the only bit remaining is the msix section (which is what I'm actually interested in cleaning up since it's one of the last few users of register_savevm - but it'll have to wait). Note a

[Qemu-devel] [PATCH 1/2] vmxnet3: Convert ring values to uint32_t's

2016-12-15 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The index's in the Vmxnet3Ring were migrated as 32bit ints yet are declared as size_t's. They appear to be derived from 32bit values loaded from guest memory, so actually store them as that. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [for 2.9] migration/tracing: Add tracing on save

2016-12-12 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add some tracing to vmstate_subsection_save and vmstate_save_state to help in debugging when you're not sure if a conditional piece of data is being saved. In vmstate_subsection_save I renamed the inner vmsd to avoid the aliasing and be able

[Qemu-devel] [RFC] PCI/migration merge vmstate_pci_device and vmstate_pcie_device

2016-12-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The vmstate_pci_device and vmstate_pcie_devices differ just in the size of one buffer; combine the two using a _TEST macro. I think this is safe as long as everywhere which currently uses either of these two uses the right type. One thing

[Qemu-devel] [PATCH 2/3] migration: Check for ID length

2017-01-09 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The qdev id of a device can be huge if it's on the end of a chain of bridges; in reality such chains shouldn't occur but they can be made to by chaining PCIe bridges together. The migration format has a number of 256 character long format

[Qemu-devel] [PATCH 05/15] postcopy: enhance ram_discard_range for hugepages

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Unfortunately madvise DONTNEED doesn't work on hugepagetlb so use fallocate(FALLOC_FL_PUNCH_HOLE) qemu_fd_getpagesize only sets the page based off a file if the file is from hugetlbfs. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 10/15] postcopy: Mask fault addresses to huge page boundary

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Currently the fault address received by userfault is rounded to the host page boundary and a host page is requested from the source. Use the current RAMBlock page size instead of the general host page size so that for RAMBlocks backed by huge

[Qemu-devel] [PATCH 09/15] postcopy: Load huge pages in one go

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The existing postcopy RAM load loop already ensures that it glues together whole host-pages from the target page size chunks sent over the wire. Modify the definition of host page that it uses to be the RAM block page size and thus be huge

[Qemu-devel] [PATCH 00/15] Postcopy: Hugepage support

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, The existing postcopy code, and the userfault kernel code that supports it, only works for normal anonymous memory. Kernel support for userfault on hugetlbfs is working it's way upstream; it's just gone into the linux-mm tree, You can get

[Qemu-devel] [PATCH 08/15] postcopy: Use temporary for placing zero huge pages

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The kernel can't do UFFDIO_ZEROPAGE for huge pages, so we have to allocate a temporary (always zero) page and use UFFDIO_COPYPAGE on it. Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 +

[Qemu-devel] [PATCH 14/15] postcopy: Check for userfault+hugepage feature

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" We need extra Linux kernel support (~4.9) to support userfaults on hugetlbfs; check for them. Signed-off-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 11 +++ 1 file changed, 11 insertions(+) diff

[Qemu-devel] [PATCH 04/15] Fold postcopy_ram_discard_range into ram_discard_range

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" I'd created this weird pair of: ram_discard_range that lived in migration/ram.c Which is built target-dependent so can access the insides of RAMBlock postcopy_ram_discard_range Which actually does the discard. Flatten

[Qemu-devel] [PATCH 15/15] postcopy: Add doc about hugepages and postcopy

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- docs/migration.txt | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 6503c17..b462ead 100644 ---

[Qemu-devel] [PATCH 12/15] postcopy: Allow hugepages

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Allow huge pages in postcopy. Signed-off-by: Dr. David Alan Gilbert --- migration/postcopy-ram.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/migration/postcopy-ram.c

[Qemu-devel] [PATCH 03/15] postcopy: Chunk discards for hugepages

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" At the start of the postcopy phase, partially sent huge pages must be discarded. The code for dealing with host page sizes larger than the target page size can be reused for this case. Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 02/15] postcopy: Transmit ram size summary word

2017-01-06 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Replace the host page-size in the 'advise' command by a pagesize summary bitmap; if the VM is just using normal RAM then this will be exactly the same as before, however if they're using huge pages they'll be different, and thus: a)

<    5   6   7   8   9   10   11   12   13   14   >