Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions

2014-07-04 Thread Al Viro
On Sat, Jul 05, 2014 at 02:40:55AM +0100, Al Viro wrote: > d) at least on EV6 and EV67 DNOD *still* trips INV. According to the > manual suppression of INV by DNOD is optional. And while their text > might be interpreted as "INV is suppressed if operation with denorm > wouldn't result in somethin

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: dataplane: notify guest as a batch

2014-07-04 Thread Ming Lei
On Sat, Jul 5, 2014 at 12:09 AM, Paolo Bonzini wrote: > Il 04/07/2014 17:57, Ming Lei ha scritto: > >> But we have two cases to consider: >> >> - one submitted IO includes requests from multi vq(virtio-blk or >> virtio-scsi maybe), >> and each vq has to notify guest >> >> - one submitted IO includ

[Qemu-devel] [PATCH v1 2/2] virtio-blk: dataplane: notify guest as a batch

2014-07-04 Thread Ming Lei
Now requests are submitted as a batch, so it is natural to notify guest as a batch too. This may suppress interrupt notification to VM a lot: - in my test, decreased by ~13K/sec Signed-off-by: Ming Lei --- hw/block/dataplane/virtio-blk.c | 22 -- 1 file changed, 2

[Qemu-devel] [PATCH v1 1/2] virtio-blk: data-plane: fix save/set .complete_request in start

2014-07-04 Thread Ming Lei
The callback has to be saved and reset in virtio_blk_data_plane_start(), otherwise dataplane's requests will be completed in qemu aio context. Signed-off-by: Ming Lei --- hw/block/dataplane/virtio-blk.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/block/datapl

[Qemu-devel] [PATCH v1 0/2] virtio-blk: dataplane: one fix plus one optimization

2014-07-04 Thread Ming Lei
Hi, The first one fixes one problem introduced recently. The second one suppresses notifications to guest a lot. V1: - use BH to suppress notifications to guest as suggested by Paolo Thanks, -- Ming Lei

Re: [Qemu-devel] [PATCH] compile QEMU with Xen support on ARM

2014-07-04 Thread Stefano Stabellini
On Sat, 5 Jul 2014, Peter Maydell wrote: > On 4 July 2014 19:47, Stefano Stabellini > wrote: > > Fixes to build QEMU with Xen support on ARM and ARM64. Most fixes are > > due to the fact that xen_pfn_t is 64-bit sized on arm32, while it is an > > unsigned long on x86_32. > > Although QEMU can be c

Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions

2014-07-04 Thread Al Viro
Denorms fun: a) softfloat.c raises flags we don't care about. So checking that FP_STATUS.float_exception_flags is non-zero is *not* good - we catch false positives that way. b) DNZ has effect *only* for /S insns. Without /S denorm means INV and that's it. FPCR.INV isn't set, at that.

[Qemu-devel] [RFC v3 01/35] pc_piix: Add missing compat code to pc-0.1[0123]

2014-07-04 Thread Eduardo Habkost
pc-0.13 and older were missing some compat code that is present on newer machine-types: * x86_cpu_compat_disable_kvm_features(FEAT_1_ECX, CPUID_EXT_X2APIC); (pc-i440fx-1.7 and older) * x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); (pc-i440fx-1.4 and older) * x86_cpu_comp

[Qemu-devel] [RFC v3 02/35] target-i385: Add kvmclock_enabled static

2014-07-04 Thread Eduardo Habkost
This looks like a step backwards, but it will allow pc-0.1[0123] reuse pc_compat_1_2() instead of duplicating the code from all pc_compat_*() functions. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/i386/

[Qemu-devel] [RFC v3 25/35] pc: Move has_acpi_build to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 8 hw/i386/pc_q35.c | 6 +++--- include/hw/i386/pc.h | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b2f7931..7f44b3b 100644 --- a/hw/i386/pc.

[Qemu-devel] [RFC v3 17/35] pc: Eliminate all *_machine_options() functions

2014-07-04 Thread Eduardo Habkost
Finally eliminate all *_machine_options() functions, and make the class_init functions for older machine-types simply reuse the class_init functions from newer machine-types. To allow compat_props reuse, the the PC_COMPAT_* macros were changed to not nest within the older PC_COMPAT_* macros anymor

[Qemu-devel] [RFC v3 08/35] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13

2014-07-04 Thread Eduardo Habkost
The VGA and vmware-svga rombar compat properties were added by commit 281a26b15b4adcecb8604216738975abd754bea8, but only to pc-0.13 and pc-0.12. This breaks the PC_COMPAT_* nesting pattern we currently follow. The new variables will now be inherited by pc-0.11 and older, but pc-0.11 and pc-0.10 al

[Qemu-devel] [RFC v3 32/35] pc: Create common machine init function

2014-07-04 Thread Eduardo Habkost
This allows us to eliminate all the trivial pc_init_*() functions which just call a compat function followed by pc_init1(), and slowly move duplicate code from piix and q35 init functions into common PC code. Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 12 hw/i386/pc_piix.

[Qemu-devel] [RFC v3 29/35] pc: Move option_rom_has_mr/rom_file_has_mr to MachineClass

2014-07-04 Thread Eduardo Habkost
This way, these settings can be simply set on the class_init function, instead of requiring a separate machine init function just to set global variables. Signed-off-by: Eduardo Habkost --- hw/core/loader.c| 12 +++- hw/core/machine.c | 1 + hw/i386/pc_piix.c | 8 hw/i

[Qemu-devel] [RFC v3 14/35] piix: Eliminate pc_i440fx_machine_options()

2014-07-04 Thread Eduardo Habkost
Instead of calling it on every i440fx class_init function, just register a common parent class for all i440fx machine-types. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 55 +-- 1 file changed, 29 insertions(+), 26 deletions(-) diff

[Qemu-devel] [RFC v3 13/35] pc: Eliminate pc_default_machine_options()

2014-07-04 Thread Eduardo Habkost
The only PC machines that didn't call pc_default_machine_options() were isaps and xenfv. Both were already overwriting max_cpus, and only isapc was not overwriting hot_add_cpu. After making isapc set hot_add_cpu to NULL, we can move the pc_default_machine_options() code the PC common class_init.

[Qemu-devel] [RFC v3 24/35] pc: Move smbios_defaults to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 9 - hw/i386/pc_q35.c | 7 +++ include/hw/i386/pc.h | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index ef4b586..b2f7931 100644 --- a/hw/i386/p

[Qemu-devel] [RFC v3 06/35] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14

2014-07-04 Thread Eduardo Habkost
Those properties were introduced by commit 3827cdb1c3aa17a792d1658161195b9d7173c26b. They were not duplicated into pc-0.13 and older because 0.14 was the first QEMU version supporting qxl. The only problem is that this breaks the PC_COMPAT_* nesting pattern we currently use. So, move the propertie

[Qemu-devel] [RFC v3 33/35] pc: Eliminate empty or trivial compat functions

2014-07-04 Thread Eduardo Habkost
When all a compat function does is to call the previous compat function, we don't need to set compat_func, as the previous class_init function already set it. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 29 + hw/i386/pc_q35.c | 21 + 2

[Qemu-devel] [RFC v3 31/35] piix: Introduce struct PCI440FXMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5fca2c5..01730ea 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -399,6 +399,20 @@ static void pc_xen_h

[Qemu-devel] [RFC v3 30/35] piix: Eliminate pc_init_pci()

2014-07-04 Thread Eduardo Habkost
Now pc_init1() can be called directly. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 18ac698..5fca2c5 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc

[Qemu-devel] [RFC v3 27/35] pc: Move gigabyte_align to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 11 +++ hw/i386/pc_q35.c | 9 ++--- include/hw/i386/pc.h | 5 + 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7f44b3b..3fe5764 100644 -

[Qemu-devel] [RFC v3 26/35] pc: Move has_pci_info to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Interestingly, no existing code sets has_pci_info=true at all. A has_pci_info=false line was added to isapc class_init, just in case we enable it on the other PC machine-types one day. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 6 ++ hw/i386/pc_q35.c | 4 +--- include/hw/

[Qemu-devel] [RFC v3 20/35] pc: Move pci_enabled parameter to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 11 +++ include/hw/i386/pc.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7a6aa66..465efee 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -16

[Qemu-devel] [RFC v3 35/35] pc: Move {ram, pci, rom}_memory variables to PCMachineState

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- Changes v2: * Use PCMachineState fields inside pc_memory_init() too --- hw/i386/pc.c | 8 +++- hw/i386/pc_piix.c| 19 --- hw/i386/pc_q35.c | 22 +- include/hw/i386/pc.h | 5 +++-- 4 files changed, 23 ins

[Qemu-devel] [RFC v3 19/35] pc: Rename pc_machine variable to pcms

2014-07-04 Thread Eduardo Habkost
"pcms" being the initials of "PCMachineState". The variable will be used a lot, so it's better to make it short. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 10 +- hw/i386/pc_q35.c | 10 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/i386/pc_pi

[Qemu-devel] [RFC v3 34/35] piix: Move compat/init functions closer to corresponding class_init

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 92 +++ 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 94e9dfe..3716f98 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@

[Qemu-devel] [RFC v3 16/35] q35: Eliminate pc_q35_1_4_machine_options()

2014-07-04 Thread Eduardo Habkost
The function was used only in a single place. Signed-off-by: Eduardo Habkost --- hw/i386/pc_q35.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index bf85c17..9eeeac6 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -449,11 +

[Qemu-devel] [RFC v3 22/35] pc: Move kvmclock_enabled to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 6 +++--- include/hw/i386/pc.h | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 465efee..ef4b586 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1663,6 +16

[Qemu-devel] [RFC v3 28/35] pc: Move has_reserved_memory to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 8 +++- hw/i386/pc_q35.c | 6 ++ include/hw/i386/pc.h | 1 + 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3fe5764..571d47b 100644 --- a/hw/i386/pc.

[Qemu-devel] [RFC v3 18/35] machine: Eliminate QEMUMachine.compat_props

2014-07-04 Thread Eduardo Habkost
The only user of QEMUMachine.compat_props was the PC code, that was already converted to QOM. We don't need that field anymore. Signed-off-by: Eduardo Habkost --- include/hw/boards.h | 1 - vl.c| 3 --- 2 files changed, 4 deletions(-) diff --git a/include/hw/boards.h b/include/h

[Qemu-devel] [RFC v3 15/35] q35: Eliminate pc_q35_machine_options()

2014-07-04 Thread Eduardo Habkost
Instead of calling it on every q35 class_init function, just register a common parent class for all q35 machine-types. Signed-off-by: Eduardo Habkost --- hw/i386/pc_q35.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/i386/pc_q35.c b/h

[Qemu-devel] [RFC v3 23/35] pc: Move smbios_legacy_mode to PCMachineClass

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c| 9 + hw/i386/pc_q35.c | 7 --- include/hw/i386/pc.h | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e26fedd..22388c1 100644 --- a/hw/i386/pc_piix.c +++ b/hw

[Qemu-devel] [RFC v3 12/35] pc: Eliminate pc_common_machine_options()

2014-07-04 Thread Eduardo Habkost
The TYPE_PC_MACHINE parent class can initialize the common options for all PC machines. Reviewed-by: Andreas Färber Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 1 + hw/i386/pc_piix.c| 2 -- include/hw/i386/pc.h | 6 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff

[Qemu-devel] [RFC v3 10/35] machine: Make compat_props a linked list

2014-07-04 Thread Eduardo Habkost
This will make it easier to write reusable class_init code which adds properties to MachineClass.compat_props. Signed-off-by: Eduardo Habkost --- hw/core/machine.c| 15 +++ hw/core/qdev-properties.c| 9 + hw/i386/pc.c | 4 +++- include/hw/boa

[Qemu-devel] [RFC v3 21/35] q35: Use PCMachineClass.pci_enabled field

2014-07-04 Thread Eduardo Habkost
Little step towards making the q35 and piix init functions converge, to eliminate duplication. Signed-off-by: Eduardo Habkost --- hw/i386/pc_q35.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 491fee7..d50dd89 100644 --- a/hw/i3

[Qemu-devel] [RFC v3 11/35] pc: Register machine classes directly instead of using QEMUMachine

2014-07-04 Thread Eduardo Habkost
This is a (mostly) blind and mechanical conversion of the PC QEMUMachine definitions to corresponding class registration code. Existing duplication and unnecessary complexity on macro/function reuse is being kept, to keep the conversion simple to review. The complexity and duplication will be grad

[Qemu-devel] [RFC v3 07/35] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13

2014-07-04 Thread Eduardo Habkost
The compat property was added by commit 9dbcca5aa13cb9ab40788ac4c56bc227d94ca920, and the pc-0.12 and older machine-types were not changed because virtio-9p-pci was introduced on QEMU 0.13 (commit 9f10751365b26b13b8a9b67e0e90536ae3d282df). The only problem is that this breaks the PC_COMPAT_* nestin

[Qemu-devel] [RFC v3 09/35] piix: Move pc-0.11 drive version compat props TO PC_COMPAT_0_11

2014-07-04 Thread Eduardo Habkost
The current code setting ide-drive.ver and scsi-disk.ver on pc-0.11 breaks the PC_COMPAT_* nesting pattern we currently use. As those variables are overwritten in pc-0.10 too, they can be inherited by pc-0.10 with no side-effects at all. Signed-off-by: Eduardo Habkost Cc: Gerd Hoffmann --- hw/

[Qemu-devel] [RFC v3 03/35] pc_piix: Reuse pc_compat_1_2() on pc_init_pci_no_kvmclock()

2014-07-04 Thread Eduardo Habkost
Instead of following a different pattern from all other PC init functions, make pc-0.13 and older reuse pc_compat_1_2() and simply set kvmclock_enabled=false. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 36 1 file changed, 8 insertions(+), 28 delet

[Qemu-devel] [RFC v3 05/35] vl.c: Use qdev_prop_register_global() for single globals

2014-07-04 Thread Eduardo Habkost
Instead of using an array when registering a single global, simply call qdev_prop_register(). Reviewed-by: Andreas Färber Signed-off-by: Eduardo Habkost --- vl.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/vl.c b/vl.c index 6e084

[Qemu-devel] [RFC v3 04/35] pc: Replace tabs with spaces on pc.h

2014-07-04 Thread Eduardo Habkost
Signed-off-by: Eduardo Habkost --- include/hw/i386/pc.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 1c0c382..4a9eb46 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -440,23 +440,23 @@ bool e820_

[Qemu-devel] [RFC v3 00/35] Convert PC machine-types to QOM classes

2014-07-04 Thread Eduardo Habkost
New version, rebased to latest qemu.git master. Git tree: https://github.com/ehabkost/qemu-hacks/tree/pc-machine-class.v3 I would like to get this discussed/reviewed before QEMU 2.1.0 is released, so we can be ready to include the series as soon as we start 2.2 development. My goal is that _

Re: [Qemu-devel] [PATCH] compile QEMU with Xen support on ARM

2014-07-04 Thread Peter Maydell
On 4 July 2014 19:47, Stefano Stabellini wrote: > Fixes to build QEMU with Xen support on ARM and ARM64. Most fixes are > due to the fact that xen_pfn_t is 64-bit sized on arm32, while it is an > unsigned long on x86_32. > Although QEMU can be compiled with full emulation support, on ARM we > only

[Qemu-devel] [PATCH for-2.1] target-i386: Add "kvmclock-stable-bit" feature bit name

2014-07-04 Thread Eduardo Habkost
KVM_FEATURE_CLOCKSOURCE_STABLE_BIT is enabled by default and supported by KVM. But not having a name defined makes QEMU treat it as an unknown and unmigratable feature flag (as any unknown feature may possibly require state to be migrated), and disable it by default on "-cpu host". As a side-effec

[Qemu-devel] [PATCH] PPC: e500: Actually install u-boot.e500

2014-07-04 Thread Cole Robinson
Signed-off-by: Cole Robinson --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1eea0c4..d6b9dc1 100644 --- a/Makefile +++ b/Makefile @@ -344,7 +344,8 @@ multiboot.bin linuxboot.bin kvmvapic.bin \ s390-zipl.rom \ s390-ccw.img \ spapr-rt

[Qemu-devel] [PATCH 42/46] Start up a postcopy/listener thread ready for incoming page data

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The loading of a device state (during postcopy) may access guest memory that's still on the source machine and thus might need a page fill; split off a separate thread that handles the incoming page data so that the original incoming migration code can finish off th

[Qemu-devel] [PATCH 18/46] QEMU_VM_CMD_PACKAGED: Send a packaged chunk of migration stream

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" QEMU_VM_CMD_PACKAGED is a migration command that allows a chunk of migration stream to be sent in one go, and be received by a separate instance of the loadvm loop while not interacting with the migration stream. This is used by postcopy to load device state (from

[Qemu-devel] [PATCH 06/46] Create MigrationIncomingState

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" There are currently lots of pieces of incoming migration state scattered around, and postcopy is adding more, and it seems better to try and keep it together. allocate MIS in process_incoming_migration_co Add MIS to QEMUFile Signed-off-by: Dr. David Alan Gilbert

[Qemu-devel] [PATCH 14/46] ram_debug_dump_bitmap: Dump a migration bitmap as text

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Misses out lines that are all 0 so can be quite compact depending on the circumstance. Signed-off-by: Dr. David Alan Gilbert --- arch_init.c | 39 +++ include/migration/migration.h | 1 + 2 files changed, 40

[Qemu-devel] [PATCH 12/46] Return path: Source handling of return path

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Open a return path, and handle messages that are received upon it. Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 10 +++ migration.c | 142 +- 2 files changed, 151 insertions(+

[Qemu-devel] [PATCH 05/46] Add qemu_get_counted_string to read a string prefixed by a count byte

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" and use it in loadvm_state. Signed-off-by: Dr. David Alan Gilbert --- include/migration/qemu-file.h | 2 ++ qemu-file.c | 15 +++ savevm.c | 18 ++ 3 files changed, 27 insertions(+), 8 deletions(

[Qemu-devel] [PATCH 02/46] Move QEMUFile structure to qemu-file.h

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" This is mostly as an easy way to get to the MigrationIncomingState that I'm hanging off the file. Signed-off-by: Dr. David Alan Gilbert buf_size = pending; len = f->ops->get_buffer(f->opaque, f->buf + pending, f->pos, -IO_BUF_SIZE - p

[Qemu-devel] [PATCH 13/46] qemu_loadvm debug

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add lots of DPRINTF debug in qemu_loadvm* Signed-off-by: Dr. David Alan Gilbert --- savevm.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/savevm.c b/savevm.c index 16b672b..662a910 100644 --- a/savevm.c +++ b/savevm

[Qemu-devel] [PATCH 38/46] postcopy_ram.c: place_page and helpers

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" postcopy_place_page (etc) provide a way for postcopy to place a page into guests memory atomically (using the new remap_anon_pages syscall). Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h| 1 + include/migration/postcopy-ram.h | 23

[Qemu-devel] bootindex dropped from -device virtio-blk, ? output, upsets libvirt

2014-07-04 Thread Cole Robinson
Hi all, qemu-2.1-rc0 upsets some of libvirt's qemu feature introspection, the example I hit is with bootindex support. qemu -device virtio-blk,? no longer lists the bootindex= property, so libvirt thinks that qemu doesn't support it, and fails to launch a VM with per-device boot order configuratio

[Qemu-devel] [PATCH] compile QEMU with Xen support on ARM

2014-07-04 Thread Stefano Stabellini
Fixes to build QEMU with Xen support on ARM and ARM64. Most fixes are due to the fact that xen_pfn_t is 64-bit sized on arm32, while it is an unsigned long on x86_32. Although QEMU can be compiled with full emulation support, on ARM we only care about the PV backends. Signed-off-by: Stefano Stabel

[Qemu-devel] [PATCH 41/46] Handle userfault requests (although userfaultfd not done yet)

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 + postcopy-ram.c| 93 +-- 2 files changed, 90 insertions(+), 4 deletions(-) diff --git a/include/migration/migration.h b/include/

[Qemu-devel] [PATCH 20/46] Allow savevm handlers to state whether they could go into postcopy

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Use that to split the qemu_savevm_state_pending counts into postcopiable and non-postcopiable amounts Signed-off-by: Dr. David Alan Gilbert --- arch_init.c | 7 +++ include/migration/vmstate.h | 2 +- include/sysemu/sysemu.h | 4 +++- m

[Qemu-devel] [PATCH 43/46] postcopy: Wire up loadvm_postcopy_ram_handle_{run, end} commands

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Wire up more of the handlers for the commands on the destination side, in particular loadvm_postcopy_ram_handle_run now has enough to start the guest running. Signed-off-by: Dr. David Alan Gilbert --- savevm.c | 47 ++-

[Qemu-devel] [PATCH 01/46] qemu_ram_foreach_block: pass up error value, and down the ramblock name

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" check the return value of the function it calls and error if it's none-0 Fixup qemu_rdma_init_one_block that is the only current caller, and __qemu_rdma_add_block the only function it calls using it. Pass the name of the ramblock to the function; helps in debuggi

[Qemu-devel] [PATCH 19/46] migrate_init: Call from savevm

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Suspend to file is very much like a migrate, and it makes life easier if we have the Migration state available, so initialise it in the savevm.c code for suspending. Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 + include/qemu/typed

[Qemu-devel] [PATCH 11/46] Return path: Send responses from destination to source

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add migrate_send_rp_message to send a message from destination to source along the return path. (It uses a mutex to let it be called from multiple threads) Add migrate_send_rp_ack to send an 'ack' message Use it in the CMD_REQACK handler Signed-off-by: Dr. Dav

[Qemu-devel] [PATCH 34/46] Page request: Add MIG_RPCOMM_REQPAGES reverse command

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add MIG_RPCOMM_REQPAGES command on Return path for the postcopy destination to request a page from the source. Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 3 ++ migration.c | 75

[Qemu-devel] [PATCH 22/46] Migration parameters: Add qmp/hmp commands for setting/viewing

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add somewhere for the various migration parameters to be set with one command; As suggested in the thread: http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg00243.html There are many existing migration parameters that are scattered over many individual comma

[Qemu-devel] [PATCH 21/46] postcopy: OS support test

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Provide a check to see if the OS we're running on has all the bits needed for postcopy. Creates postcopy-ram.c which will get most of the other helpers we need. Signed-off-by: Dr. David Alan Gilbert --- Makefile.objs| 2 +- include/migratio

[Qemu-devel] [PATCH 40/46] qemu_ram_block_from_host

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Postcopy sends RAMBlock names and offsets over the wire (since it can't rely on the order of ramaddr being the same), and it starts out with HVA fault addresses from the kernel. qemu_ram_block_from_host translates a HVA into a RAMBlock, an offset in the RAMBlock, t

[Qemu-devel] [PATCH 15/46] Rework loadvm path for subloops

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Postcopy needs to have two migration streams loading concurrently; one from memory (with the device state) and the other from the fd with the memory transactions. Split the core of qemu_loadvm_state out so we can use it for both. Allow the inner loadvm loop to qui

[Qemu-devel] [PATCH 17/46] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages.

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add state variable showing current incoming postcopy state. Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 8 ++ include/sysemu/sysemu.h | 23 savevm.c | 313 ++

[Qemu-devel] [PATCH 16/46] Add migration-capability boolean for postcopy-ram.

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 1 + migration.c | 9 + qapi-schema.json | 6 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/migration/migration.h b/inc

[Qemu-devel] [PATCH 39/46] Postcopy: Use helpers to map pages during migration

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" In postcopy, the destination guest is running at the same time as it's receiving pages; as we receive new pages we must put them into the guests address space atomically to avoid a running CPU accessing a partially written page. Use the helpers in postcopy-ram.c to

[Qemu-devel] [PATCH 35/46] Page request: Process incoming page request

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" On receiving MIG_RPCOMM_REQPAGES look up the address and queue the page. Signed-off-by: Dr. David Alan Gilbert --- arch_init.c | 52 +++ include/migration/migration.h | 26 ++ include/q

[Qemu-devel] [PATCH 33/46] Postcopy: Create a fault handler thread before marking the ram as userfault

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 3 +++ postcopy-ram.c| 23 +++ 2 files changed, 26 insertions(+) diff --git a/include/migration/migration.h b/include/migration/migration.h index 397f41

[Qemu-devel] [PATCH 32/46] mig fd_connect: open return path

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- migration.c | 12 1 file changed, 12 insertions(+) diff --git a/migration.c b/migration.c index c73fcfa..c7ba6a1 100644 --- a/migration.c +++ b/migration.c @@ -1164,6 +1164,18 @@ void migrate_fd_connect(Migra

[Qemu-devel] [PATCH 31/46] Postcopy: Rework migration thread for postcopy mode

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Switch to postcopy if: 1) There's still a significant amount to transfer 2) Postcopy is enabled 3) It's taken longer than the time set by the parameter. and change the cleanup at the end of migration to match. Signed-off-by: Dr. David Alan Gilbert --- m

[Qemu-devel] [PATCH 30/46] Postcopy: postcopy_start

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" postcopy_start: Perform all the initialisation associated with starting up postcopy mode from the source. Signed-off-by: Dr. David Alan Gilbert --- migration.c | 85 + 1 file changed, 85 insertions(+)

[Qemu-devel] [PATCH 36/46] Page request: Consume pages off the post-copy queue

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When transmitting RAM pages, consume pages that have been queued by MIG_RPCOMM_REQPAGE commands and send them ahead of normal page scanning. Note: a) After a queued page the linear walk carries on from after the unqueued page; there is a reasonable chance that th

[Qemu-devel] [PATCH 28/46] postcopy: Incoming initialisation

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- arch_init.c | 11 +++ include/migration/migration.h | 1 + migration.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/arch_init.c b/arch_init.c index 134ea7e..fd7399c

[Qemu-devel] [PATCH 29/46] postcopy: ram_enable_notify to switch on userfault

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- include/migration/postcopy-ram.h | 5 + postcopy-ram.c | 36 +++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/include/migration/postcopy-ram.h b/inc

[Qemu-devel] [PATCH 24/46] qemu_savevm_state_complete: Postcopy changes

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" When postcopy calls qemu_savevm_state_complete it's not really the end of migration, so skip: a) Finishing postcopiable iterative devices - they'll carry on b) The termination byte on the end of the stream. We then also add: qemu_savevm_state_postcopy_compl

[Qemu-devel] [PATCH 27/46] postcopy: Add incoming_init/cleanup functions

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Provide functions to be called before the start of a postcopy enabled migration (even if it's not eventually used) and at the end. During the init we must disable huge pages in the RAM that we will receive postcopy data into, since if they start off as hugepage and

[Qemu-devel] [PATCH 25/46] Postcopy: Maintain sentmap during postcopy pre phase

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Where postcopy is preceeded by a period of precopy, the destination will have received pages that may have been dirtied on the source after the page was sent. The destination must throw these pages away before starting it's CPUs. Maintain a 'sentmap' of pages that

[Qemu-devel] [PATCH 45/46] End of migration for postcopy

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Tweak the end of migration cleanup; we don't want to close stuff down at the end of the main stream, since the postcopy is still sending pages on the other thread. Signed-off-by: Dr. David Alan Gilbert --- migration.c | 20 1 file changed, 20

[Qemu-devel] [PATCH 23/46] MIG_STATE_POSTCOPY_ACTIVE: Add new migration state

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" 'MIG_STATE_POSTCOPY_ACTIVE' is entered after the precopy timelimit has expired and migration switches to postcopy. 'migration_postcopy_phase' is provided for other sections to know if they're in postcopy. Signed-off-by: Dr. David Alan Gilbert --- include/migrati

[Qemu-devel] [PATCH 44/46] postcopy: Use userfaultfd

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" userfaultfd is a Linux syscall that gives an fd that receives a stream of notifications of accesses to pages marked as MADV_USERFAULT, and allows the program to acknowledge those stalls and tell the accessing thread to carry on. Signed-off-by: Dr. David Alan Gilber

[Qemu-devel] [PATCH 46/46] Start documenting how postcopy works.

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- docs/migration.txt | 148 + 1 file changed, 148 insertions(+) diff --git a/docs/migration.txt b/docs/migration.txt index 0492a45..dbd5e5f 100644 --- a/docs/migration.txt

[Qemu-devel] [PATCH 10/46] Return path: Control commands

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Add two src->dest commands: * OPENRP - To request that the destination open the return path * REQACK - Request an acknowledge from the destination Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 2 ++ include/sysemu/sysemu.h

[Qemu-devel] [PATCH 09/46] Migration commands

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Create QEMU_VM_COMMAND section type for sending commands from source to destination. These commands are not intended to convey guest state but to control the migration process. For use in postcopy. Signed-off-by: Dr. David Alan Gilbert --- include/migration/mig

[Qemu-devel] [PATCH 08/46] Return path: socket_writev_buffer: Block even on non-blocking fd's

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The return path uses a non-blocking fd so as not to block waiting for the (possibly broken) destination to finish returning a message, however we still want outbound data to behave in the same way and block. Signed-off-by: Dr. David Alan Gilbert --- qemu-file.c |

[Qemu-devel] [PATCH 37/46] Add assertion to check migration_dirty_pages doesn't go -ve; have seen it happen once but not sure why

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Signed-off-by: Dr. David Alan Gilbert --- arch_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch_init.c b/arch_init.c index c006d21..58eccc1 100644 --- a/arch_init.c +++ b/arch_init.c @@ -439,6 +439,7 @@ ram_addr_t migration_bitmap_find_and_reset_di

[Qemu-devel] [PATCH 07/46] Return path: Open a return path on QEMUFile for sockets

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Postcopy needs a method to send messages from the destination back to the source, this is the 'return path'. Wire it up for 'socket' QEMUFile's using a dup'd fd. Signed-off-by: Dr. David Alan Gilbert --- include/migration/qemu-file.h | 8 + qemu-file.c

[Qemu-devel] [PATCH 26/46] Postcopy page-map-incoming (PMI) structure

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The PMI holds the state of each page on the incoming side, so that we can tell if the page is missing, already received or there is a request outstanding for it. Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h| 18 ++ include/migr

[Qemu-devel] [PATCH 03/46] QEMUSizedBuffer/QEMUFile

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Stefan Berger's patch to create a QEMUFile that goes to a memory buffer; from: http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg05036.html Using the QEMUFile interface, this patch adds support functions for operating on in-memory sized buffers that can be w

[Qemu-devel] [PATCH 04/46] improve DPRINTF macros, add to savevm

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Improve the existing DPRINTF macros in migration.c and arch_init by: 1) Making them go to stderr rather than stdout (so you can run with -nographic and redirect your debug to a file) 2) Making them print the ms time with each debug - useful for debugging latency

[Qemu-devel] [PATCH 00/46] Postcopy implementation

2014-07-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" Hi, This is the 1st cut of my version of postcopy; it is designed for use with the Linux kernel additions recently posted by Andrea Arcangeli here: http://lists.gnu.org/archive/html/qemu-devel/2014-07/msg00525.html The current status is: 1) It works - I've

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: dataplane: notify guest as a batch

2014-07-04 Thread Paolo Bonzini
Il 04/07/2014 17:57, Ming Lei ha scritto: But we have two cases to consider: - one submitted IO includes requests from multi vq(virtio-blk or virtio-scsi maybe), and each vq has to notify guest - one submitted IO includes requests from multi bs for scsi device The 2nd case should be easy to ha

Re: [Qemu-devel] [RFC PATCH V3 0/6] icount: Implement delay algorithm between guest and host clocks

2014-07-04 Thread Michael Tokarev
Can we pretty please take me off the list of recepients. I have nothing to do with this, I receive all list emails already, and where I am now it is quite dificult to sort mail, and it costs me quite some time to do so too. When I'm back I'll concider dropping mails sent to list and Cc'd to me.

Re: [Qemu-devel] Atomic instruction.

2014-07-04 Thread Peter Maydell
On 4 July 2014 16:35, Frederic Konrad wrote: > Hi everybody, > > We are experimenting with multi-core QEMU. We have Multiple QEMU cores > running > on multiple host threads and we are now looking at the issue of ‘atomic’ > instructions. > > Our initial thought was to push some sort of set of flags

Re: [Qemu-devel] [PATCH 2/2] virtio-blk: dataplane: notify guest as a batch

2014-07-04 Thread Ming Lei
On Fri, Jul 4, 2014 at 11:48 PM, Paolo Bonzini wrote: > Il 04/07/2014 16:52, Ming Lei ha scritto: > >>> > What you can do is change notify_guest to something like >>> > >>> > qemu_bh_schedule(req->dev->dataplane->notify_guest_bh); >>> > >>> > and do the actual notification in the bottom half.

[Qemu-devel] [PATCH 1/4] block: Make qiov match the request size until EOF

2014-07-04 Thread Kevin Wolf
If a read request goes across EOF, the block driver sees a shortened request that stops at EOF (the rest is memsetted in block.c), however the original qiov was used for this request. This patch makes the qiov size match the request size, avoiding a potential buffer overflow in raw-posix. Signed-

  1   2   >