Re: [Qemu-devel] [PATCH v3 04/23] libqtest: Remove qtest_qmp_discard_response() & friends

2018-08-06 Thread Thomas Huth
On 08/06/2018 08:53 AM, Markus Armbruster wrote: > qtest_qmp_discard_response(...) is shorthand for > qobject_unref(qtest_qmp(...), except it's not actually shorter. > Moreover, the presence of these functions encourage sloppy testing. > Remove them from libqtest. Add them as macros to the tests

[Qemu-devel] [PATCH v3 01/23] libqtest: Rename functions to send QMP messages

2018-08-06 Thread Markus Armbruster
The functions to receive messages are called qtest_qmp_receive() and qmp_receive(), qmp_fd_receive(). The ones to send messages are called qtest_async_qmp(), qtest_async_qmpv(), qmp_async(), qmp_fd_send(), qmp_fd_sendv(). Inconsistent. Rename the *_async* ones to qmp_send(), qtest_qmp_send(),

[Qemu-devel] [PATCH v3 17/23] migration-test: Make wait_command() cope with '%'

2018-08-06 Thread Markus Armbruster
wait_command() passes its argument @command to qtest_qmp_send(). Falls apart if @command contain '%'. Two ways to disarm this trap: suppress interpretation of '%' by passing @command as argument to format string "%s", or fix it by having wait_command() take the variable arguments to go with

[Qemu-devel] [PATCH v3 09/23] test-qobject-input-visitor: Avoid format string ambiguity

2018-08-06 Thread Markus Armbruster
When visitor_input_test_init_internal()'s argument @ap is null, then @json_string is interpreted literally, else it's gets %-escapes interpolated. This is awkward. One caller always passes null @ap, and the others never do. Lift the building of the QObject into the callers, where it can be done

[Qemu-devel] [PATCH v3 07/23] qobject: New qobject_from_vjsonf_nofail(), qdict_from_vjsonf_nofail()

2018-08-06 Thread Markus Armbruster
Every printf()-like function sooner or later needs its vprintf()-like buddy. The next commit will need qobject_from_jsonf_nofail()'s buddy, and qdict_from_jsonf_nofail()'s buddy will be used later in this series. Add both. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé

[Qemu-devel] [PATCH v3 08/23] libqtest: Simplify qmp_fd_vsend() a bit

2018-08-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Eric Blake --- tests/libqtest.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 2fe0f4dc29..9e3870bb7d 100644 ---

[Qemu-devel] [PATCH v3 13/23] cpu-plug-test: Don't pass integers as strings to device_add

2018-08-06 Thread Markus Armbruster
test_plug_with_device_add_x86() plugs Haswell-i386-cpu and Haswell-x86_64-cpu with device_add. It passes socket-id, core-id, thread-id as JSON strings. The properties are actually integers. test_plug_with_device_add_coreid() plugs power8_v2.0-spapr-cpu-core and qemu-s390x-cpu with device_add.

[Qemu-devel] [PATCH v3 15/23] migration-test: Make wait_command() return the "return" member

2018-08-06 Thread Markus Armbruster
All callers of wait_command() are only interested in the success response's "return" member. Lift its extraction into wait_command(). Cc: Juan Quintela Cc: Dr. David Alan Gilbert Signed-off-by: Markus Armbruster Reviewed-by: Juan Quintela Reviewed-by: Eric Blake --- tests/migration-test.c

[Qemu-devel] [PATCH v3 00/23] tests: Compile-time format string checking for libqtest.h

2018-08-06 Thread Markus Armbruster
This is a reboot of "[PATCH 0/9] tests: Clean up around qmp() and hmp()" I sent about a year ago. Back then, Eric folded it into his "Clean up around qmp() and hmp()" series, which stalled after v4. My reboot tries to avoid that fate by reducing mission creep. There are plenty of good ideas in

[Qemu-devel] [PATCH v3 18/23] migration-test: Clean up string interpolation into QMP, part 1

2018-08-06 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migrate_recover() builds QMP input manually because wait_command() can't interpolate. Well, it can

[Qemu-devel] [PATCH v3 12/23] tests: Clean up string interpolation into QMP input (simple cases)

2018-08-06 Thread Markus Armbruster
When you build QMP input manually like this cmd = g_strdup_printf("{ 'execute': 'migrate'," "'arguments': { 'uri': '%s' } }", uri); rsp = qmp(cmd); g_free(cmd); you're responsible for escaping the interpolated values for JSON. Not

[Qemu-devel] [PATCH v3 14/23] tests: Clean up string interpolation around qtest_qmp_device_add()

2018-08-06 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the commit before previous. qtest_qmp_device_add() and its wrappers interpolate into JSON as follows: * qtest_qmp_device_add() interpolates members into a JSON object. * So do its wrappers

[Qemu-devel] [PATCH v3 10/23] qobject: qobject_from_jsonv() is dangerous, hide it away

2018-08-06 Thread Markus Armbruster
qobject_from_jsonv() takes ownership of %p arguments. On failure, we can't generally know whether we failed before or after %p, so ownership becomes indeterminate. To avoid leaks, callers passing %p must terminate on error, e.g. by passing _abort. Trap for the unwary; document and give the

[Qemu-devel] [PATCH v3 05/23] libqtest: Document calling conventions

2018-08-06 Thread Markus Armbruster
From: Eric Blake We have two flavors of vararg usage in qtest: qtest_hmp() etc. work like sprintf(), and qtest_qmp() etc. work like qobject_from_jsonf(). Spell that out in the comments. Also add GCC_FMT_ATTR() to qtest_hmp() etc. so that the compiler can flag incorrect use. We have some

[Qemu-devel] [PATCH v3 03/23] libqtest: Clean up how we read the QMP greeting

2018-08-06 Thread Markus Armbruster
qtest_init() still uses the qtest_qmp_discard_response(s, "") hack to receive the greeting, even though we have qtest_qmp_receive() since commit 66e0c7b187e. Put it to use. Bonus: gets rid of an empty format string. A step towards compile-time format string checking without triggering

[Qemu-devel] [PATCH v3 16/23] tests: New helper qtest_qmp_receive_success()

2018-08-06 Thread Markus Armbruster
Commit b21373d0713 copied wait_command() from tests/migration-test.c to tests/tpm-util.c. Replace both copies by new libqtest helper qtest_qmp_receive_success(). Also use it to simplify qtest_qmp_device_del(). Bonus: gets rid of a non-literal format string. A step towards compile-time format

Re: [Qemu-devel] [PULL 0/5] pc, virtio: fixes

2018-08-06 Thread Peter Maydell
On 3 August 2018 at 19:14, Michael S. Tsirkin wrote: > On Fri, Aug 03, 2018 at 11:45:36AM +0100, Peter Maydell wrote: >> On 3 August 2018 at 10:27, Michael S. Tsirkin wrote: >> > Please consider for 3.0 if there is another rc. >> > >> > The following changes since commit >> >

[Qemu-devel] [PATCH v3 04/23] libqtest: Remove qtest_qmp_discard_response() & friends

2018-08-06 Thread Markus Armbruster
qtest_qmp_discard_response(...) is shorthand for qobject_unref(qtest_qmp(...), except it's not actually shorter. Moreover, the presence of these functions encourage sloppy testing. Remove them from libqtest. Add them as macros to the tests that use them, with a TODO comment asking for cleanup.

[Qemu-devel] [PATCH v3 06/23] qobject: Replace qobject_from_jsonf() by qobject_from_jsonf_nofail()

2018-08-06 Thread Markus Armbruster
Commit ab45015a968 "qobject: Let qobject_from_jsonf() fail instead of abort" fails to accomplish its stated aim: the function can still abort due to its use of _abort. Its rationale for letting it fail is that all remaining users cope fine with failure. Well, they're just fine with aborting,

[Qemu-devel] [PATCH v3 11/23] tests: Pass literal format strings directly to qmp_FOO()

2018-08-06 Thread Markus Armbruster
The qmp_FOO() take a printf-like format string. In a few places, we assign a string literal to a variable and pass that instead of simply passing the literal. Clean that up. Bonus: gets rid of non-literal format strings. A step towards compile-time format string checking without triggering

[Qemu-devel] [PATCH v3 02/23] libqtest: Clean up how we read device_del messages

2018-08-06 Thread Markus Armbruster
qtest_qmp_device_del() still uses the qmp("") hack to receive a message, even though we have qmp_receive() since commit 66e0c7b187e. Put it to use. Bonus: gets rid of empty format strings. A step towards compile-time format string checking without triggering -Wformat-zero-length. Signed-off-by:

Re: [Qemu-devel] [PATCH 0/6] qcow2: Make the L2 cache cover the whole image by default

2018-08-06 Thread Alberto Garcia
On Fri 03 Aug 2018 04:55:42 PM CEST, Kevin Wolf wrote: > By the way, weren't you working on subclusters a while ago? How did > that go? Because I think those would enable us to use larger cluster > sizes and therefore reduce the metadata sizes as well. I had a working prototype, but the changes

[Qemu-devel] [PATCH v3 20/23] migration-test: Clean up string interpolation into QMP, part 3

2018-08-06 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migration-test.c interpolates strings into JSON in a few places: * migrate_set_parameter()

[Qemu-devel] [PATCH v3 19/23] migration-test: Clean up string interpolation into QMP, part 2

2018-08-06 Thread Markus Armbruster
Leaving interpolation into JSON to qmp() is more robust than building QMP input manually, as explained in the recent commit "tests: Clean up string interpolation into QMP input (simple cases)". migrate() interpolates members into a JSON object. Change it to take its extra QMP arguments as

Re: [Qemu-devel] [PATCH 0/3] x86/cpu: Enable a few new cpu features

2018-08-06 Thread Liu, Jingqi
Hi Paolo & Eduardo, Do you have any comments for the series ? Thanks On 7/16/2018 10:59 PM, Paolo Bonzini wrote: On 10/07/2018 10:57, Jingqi Liu wrote: Enable a few new cpu features including UMONITOR, UMWAIT, TPAUSE, MOVDIRI and MOVDIR64B. UMONITOR, UMWAIT, and TPAUSE are a set of user wait

Re: [Qemu-devel] [PATCH v6 00/12] Enable postcopy RDMA live migration

2018-08-06 Thread 858585 jemmy
There is one compile error, please ignore those patch, I will send a new version patch. On Fri, Aug 3, 2018 at 5:13 PM, Lidong Chen wrote: > The RDMA QIOChannel does not support bi-directional communication, so when > RDMA > live migration with postcopy enabled, the source qemu return path get

[Qemu-devel] [PATCH v3 21/23] libqtest: Enable compile-time format string checking

2018-08-06 Thread Markus Armbruster
qtest_qmp() & friends pass their format string and variable arguments to qobject_from_vjsonf_nofail(). Unlike qobject_from_jsonv(), they aren't decorated with GCC_FMT_ATTR(). Fix that to get compile-time format string checking. Signed-off-by: Markus Armbruster Reviewed-by: Philippe

Re: [Qemu-devel] [PATCH v7 56/80] mips_malta: Add basic nanoMIPS boot code for MIPS' Malta

2018-08-06 Thread Aleksandar Markovic
> From: Aleksandar Markovic > Sent: Monday, August 6, 2018 7:00 PM > Subject: [PATCH v7 56/80] mips_malta: Add basic nanoMIPS boot code for MIPS' > Malta > > From: Matthew Fortune > > Added very very basic nanoMIPS boot code but this is hacked in > unconditionally currently. > >

[Qemu-devel] [Bug 1785698] [NEW] Solaris build error: unknown type name ‘gcry_error_t’

2018-08-06 Thread Michele Denber
Public bug reported: Building qemu 2.12.0 on a Sun Oracle Enterprise M3000 SPARC64 VII, opencsw toolchain and gcc 7.3.0, gmake fails with a bunch of related errors all in cypher-gcrypt.c: /export/home/denber/qemu-2.12.0/crypto/cipher-gcrypt.c:262:32: error: ‘gcry_cipher_hd_t’ undeclared (first

[Qemu-devel] [RFC v7 09/16] virtio-iommu: Implement probe request

2018-08-06 Thread Eric Auger
This patch implements the PROBE request. At the moment, no reserved regions are returned as none are registered per device. Only a NONE property is returned. Signed-off-by: Eric Auger --- v6 -> v7: - adapt to the change in virtio_iommu_probe_resv_mem fields - use get_endpoint() instead of

Re: [Qemu-devel] [PATCH v2] target-i386: coalesced PIO support for RTC

2018-08-06 Thread Eduardo Habkost
Hi, On Thu, Jul 12, 2018 at 10:00:57AM +0800, Wanpeng Li wrote: > From: Peng Hao > > Windows I/O, such as the real-time clock. The address register (port > 0x70 in the RTC case) can use coalesced I/O, cutting the number of > userspace exits by half when reading or writing the RTC. > > Guest

[Qemu-devel] [RFC v7 02/16] virtio-iommu: Add skeleton

2018-08-06 Thread Eric Auger
This patchs adds the skeleton for the virtio-iommu device. Signed-off-by: Eric Auger --- v6 -> v7: - removed qapi-event.h include - add primary_bus and associated property v4 -> v5: - use the new v0.5 terminology (domain, endpoint) - add the event virtqueue v3 -> v4: - use page_size_mask

[Qemu-devel] [RFC v7 07/16] virtio-iommu: Implement map/unmap

2018-08-06 Thread Eric Auger
This patch implements virtio_iommu_map/unmap. Signed-off-by: Eric Auger --- v5 -> v6: - use new v0.6 fields - replace error_report by qemu_log_mask v3 -> v4: - implement unmap semantics as specified in v0.4 --- hw/virtio/trace-events | 3 ++ hw/virtio/virtio-iommu.c | 94

[Qemu-devel] [RFC v7 05/16] virtio-iommu: Endpoint and domains structs and helpers

2018-08-06 Thread Eric Auger
This patch introduce domain and endpoint internal datatypes. Both are stored in RB trees. The domain owns a list of endpoints attached to it. Helpers to get/put end points and domains are introduced. get() helpers will become static in subsequent patches. Signed-off-by: Eric Auger --- v6 ->

[Qemu-devel] [RFC v7 11/16] virtio-iommu: Implement fault reporting

2018-08-06 Thread Eric Auger
The event queue allows to report asynchronous errors. The translate function now injects faults when relevant. Signed-off-by: Eric Auger --- hw/virtio/trace-events | 1 + hw/virtio/virtio-iommu.c | 67 +--- 2 files changed, 65 insertions(+), 3

Re: [Qemu-devel] [PULL 21/35] block: fix QEMU crash with scsi-hd and drive_del

2018-08-06 Thread Eric Blake
On 06/18/2018 11:44 AM, Kevin Wolf wrote: From: Greg Kurz Removing a drive with drive_del while it is being used to run an I/O intensive workload can cause QEMU to crash. ... The problem is that we should avoid making block driver graph changes while we have in-flight requests. Let's drain

Re: [Qemu-devel] [PATCH 1/3] x86/cpu: Enable UMONITOR/UMWAIT/TPAUSE cpu features

2018-08-06 Thread Eduardo Habkost
On Tue, Jul 10, 2018 at 04:57:32PM +0800, Jingqi Liu wrote: > UMONITOR, UMWAIT, and TPAUSE are a set of user wait instructions. > > UMONITOR arms address monitoring hardware using an address. A store > to an address within the specified address range triggers the > monitoring hardware to wake up

Re: [Qemu-devel] [PATCH] virtio-gpu: fix crashes upon warm reboot with vga mode

2018-08-06 Thread Marc-André Lureau
Hi On Mon, Aug 6, 2018 at 11:16 PM, Michael S. Tsirkin wrote: > On Fri, Aug 03, 2018 at 05:32:35PM +0200, Marc-André Lureau wrote: >> With vga=775 on the Linux command line a first boot of the VM running >> Linux works fine. After a warm reboot it crashes during Linux boot. >> >> Before that,

[Qemu-devel] [Bug 1785698] Re: Solaris build error: unknown type name ‘gcry_error_t’

2018-08-06 Thread Michele Denber
** Description changed: Building qemu 2.12.0 on a Sun Oracle Enterprise M3000 SPARC64 VII, - opencsw toolchain and gcc 7.3.0, gmake fails with a bunch of related - errors all in cypher-gcrypt.c: + Solaris 10 Update 11, opencsw toolchain and gcc 7.3.0, gmake fails with + a bunch of related

[Qemu-devel] [PATCH] linux-user: fix recvmsg()/recvfrom() with netlink and MSG_TRUNC

2018-08-06 Thread Laurent Vivier
If recvmsg()/recvfrom() are used with the MSG_TRUNC flag, they return the real length even if it was longer than the passed buffer. So when we translate the buffer we must check we don't go beyond the end of the buffer. Bug: https://github.com/vivier/qemu-m68k/issues/33 Reported-by: John Paul

[Qemu-devel] [RFC v7 04/16] virtio-iommu: Add the iommu regions

2018-08-06 Thread Eric Auger
This patch initializes the iommu memory regions so that PCIe end point transactions get translated. The translation function is not yet implemented though. Signed-off-by: Eric Auger --- v6 -> v7: - use primary_bus - rebase on new translate proto featuring iommu_idx v5 -> v6: - include

[Qemu-devel] [RFC v7 10/16] virtio-iommu: Add an msi_bypass property

2018-08-06 Thread Eric Auger
In case the msi_bypass property is set, it means we need to register the IOAPIC MSI window as a reserved region: 0xFEE0 - 0xFEEF. Signed-off-by: Eric Auger --- --- hw/virtio/virtio-iommu.c | 52 include/hw/virtio/virtio-iommu.h | 1 + 2

[Qemu-devel] [RFC v7 08/16] virtio-iommu: Implement translate

2018-08-06 Thread Eric Auger
This patch implements the translate callback Signed-off-by: Eric Auger --- v5 -> v6: - replace error_report by qemu_log_mask v4 -> v5: - check the device domain is not NULL - s/printf/error_report - set flags to IOMMU_NONE in case of all translation faults --- hw/virtio/trace-events | 1 +

[Qemu-devel] [RFC v7 16/16] hw/arm/virt: Allow virtio-iommu instantiation

2018-08-06 Thread Eric Auger
The virtio-iommu now can be instantiated by adding the virt machine option "-M virt,iommu=virtio" Signed-off-by: Eric Auger --- hw/arm/virt.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index dd3cc71..25f7c21 100644 ---

[Qemu-devel] [RFC v7 13/16] qdev: export qbus_find_recursive

2018-08-06 Thread Eric Auger
We intend to create the virtio-iommu from the virt machine realize() code and not by passing the -device virtio-iommu-device option. That way the instantiation of the virtio-iommu can depend on a virt machine option, as it is currently done for the smmuv3 iommu. Its parent bus, the virtio-bus

[Qemu-devel] [RFC v7 03/16] virtio-iommu: Decode the command payload

2018-08-06 Thread Eric Auger
This patch adds the command payload decoding and introduces the functions that will do the actual command handling. Those functions are not yet implemented. Signed-off-by: Eric Auger --- v5 -> v6: - change map/unmap semantics (remove size) v4 -> v5: - adopt new v0.5 terminology v3 -> v4: - no

[Qemu-devel] [RFC v7 00/16] VIRTIO-IOMMU device

2018-08-06 Thread Eric Auger
This series rebases the virtio-iommu device on qemu 3.0.0-rc3 and implements the v0.7 virtio-iommu spec [1]. This is a basic upgrade as the fate of the virtio mmio based solution is unclear. It also fixes a bug when the end-points are not attached to the root bus. Important notice: the way the

[Qemu-devel] [RFC v7 01/16] linux-headers: Partial update for virtio-iommu v0.7

2018-08-06 Thread Eric Auger
Partial sync against Jean-Philippe's branch: git://linux-arm.org/linux-jpb.git virtio-iommu/v0.7 Signed-off-by: Eric Auger --- include/standard-headers/linux/virtio_ids.h | 1 + include/standard-headers/linux/virtio_iommu.h | 172 ++

[Qemu-devel] [RFC v7 06/16] virtio-iommu: Implement attach/detach command

2018-08-06 Thread Eric Auger
This patch implements the endpoint attach/detach to/from a domain. Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 43 +++ 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index

Re: [Qemu-devel] [PATCH 1/2] sysbus: always allow explicit_ofw_unit_address() to override address generation

2018-08-06 Thread Eduardo Habkost
On Sun, Aug 05, 2018 at 12:28:49PM +0100, Mark Cave-Ayland wrote: > Some SysBusDevices either use sysbus_init_mmio() without > sysbus_mmio_map() or the first MMIO memory region doesn't represent the > bus address, causing a firmware device path with an invalid address to > be generated. > >

[Qemu-devel] [RFC v7 15/16] hw/arm/virt-acpi-build: Add virtio-iommu node in IORT table

2018-08-06 Thread Eric Auger
This patch builds the virtio-iommu node in the ACPI IORT table. The RID space of the root complex, which spans 0x0-0x1 maps to streamid space 0x0-0x1 in smmuv3, which in turn maps to deviceid space 0x0-0x1 in the ITS group. Signed-off-by: Eric Auger --- hw/arm/virt-acpi-build.c

[Qemu-devel] [RFC v7 14/16] hw/arm/virt: Add virtio-iommu to the virt board

2018-08-06 Thread Eric Auger
Both the virtio-iommu device and its dedicated mmio transport get instantiated when requested. Signed-off-by: Eric Auger --- v6 -> v7: - align to the smmu instantiation code v4 -> v5: - VirtMachineClass no_iommu added in this patch - Use object_resolve_path_type --- hw/arm/virt.c |

Re: [Qemu-devel] [PATCH v7 47/80] target/mips: Add updating BadInstr, BadInstrP, BadInstrX for nanoMIPS

2018-08-06 Thread Aleksandar Markovic
> From: Aleksandar Markovic > Sent: Monday, August 6, 2018 7:00 PM > > Subject: [PATCH v7 47/80] target/mips: Add updating BadInstr, BadInstrP, > BadInstrX for nanoMIPS > > From: Stefan Markovic > > Update BadInstr, BadInstrP,and BadInstrX registers for nanoMIPS. > The same support for

Re: [Qemu-devel] [PATCH v7 48/80] target/mips: Implement CP0 Config1.WR bit functionality

2018-08-06 Thread Aleksandar Markovic
> From: Aleksandar Markovic > Sent: Monday, August 6, 2018 7:00 PM > > Subject: [PATCH v7 48/80] target/mips: Implement CP0 Config1.WR bit > functionality > > From: Stefan Markovic > > Add testing Config1.WR bit into watch exception handling logic. > > Signed-off-by: Aleksandar Markovic >

[Qemu-devel] [RFC v7 12/16] virtio_iommu: Handle reserved regions in translation process

2018-08-06 Thread Eric Auger
When translating an address we need to check if it belongs to a reserved virtual address range. If it does, there are 2 cases: - it belongs to a RESERVED region: the guest should neither use this address in a MAP not instruct the end-point to DMA on them. We report an error - It belongs to

Re: [Qemu-devel] [PATCH] virtio-gpu: fix crashes upon warm reboot with vga mode

2018-08-06 Thread Michael S. Tsirkin
On Fri, Aug 03, 2018 at 05:32:35PM +0200, Marc-André Lureau wrote: > With vga=775 on the Linux command line a first boot of the VM running > Linux works fine. After a warm reboot it crashes during Linux boot. > > Before that, valgrind points out bad memory write to console > surface. The VGA code

Re: [Qemu-devel] [PATCH 2/2] fw_cfg: set the get_boot_devices_list() ignore_suffixes parameter from machine property

2018-08-06 Thread Eduardo Habkost
On Sun, Aug 05, 2018 at 12:28:50PM +0100, Mark Cave-Ayland wrote: > For the older machines (such as Mac and SPARC) the DT nodes representing > bootdevices for disk nodes are irregular for mainly historical reasons, and > should be handled on an individual basis via a custom FWPathProvider. > >

Re: [Qemu-devel] [PATCH 0/2] target/ppc: Fixes for my fpu cleanups

2018-08-06 Thread Mark Cave-Ayland
On 06/08/18 02:27, Richard Henderson wrote: David, please squash these with the patches you already have on your ppc-for-3.1 branch. The first fixes fp division within the vector insns. The second fixes some typos within the load/store converters as reported by Mark Cave-Ayland. I've just

[Qemu-devel] [PATCH 05/21] block/mirror: utilize job_exit shim

2018-08-06 Thread John Snow
Change the manual deferment to mirror_exit into the implicit callback to job_exit and the mirror_exit callback. Signed-off-by: John Snow --- block/mirror.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index

[Qemu-devel] [PATCH 04/21] block/commit: utilize job_exit shim

2018-08-06 Thread John Snow
Change the manual deferment to commit_complete into the implicit callback to job_exit. Signed-off-by: John Snow --- block/commit.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/block/commit.c b/block/commit.c index 620666161b..5bed098d5f 100644 ---

[Qemu-devel] [Bug 1785670] Re: Guest(ubuntu 18.04) crashes when trying uploading file

2018-08-06 Thread Zihan Yang
It's indeed e1000e specific, when I change e1000e to e1000, I can upload file freely. Looks like there is an overflow somewhere in e1000e that corrupted the heap chunk header. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

[Qemu-devel] [PATCH 08/21] tests/test-blockjob-txn: utilize job_exit shim

2018-08-06 Thread John Snow
This is safe to do because job_complete which will get called implicitly already handles resetting the job error code if the job gets cancelled, so this stanza was wasted effort. Signed-off-by: John Snow --- tests/test-blockjob-txn.c | 12 +++- 1 file changed, 3 insertions(+), 9

[Qemu-devel] [PATCH 01/21] jobs: canonize Error object

2018-08-06 Thread John Snow
Jobs presently use both an Error object in the case of the create job, and char strings in the case of generic errors elsewhere. Unify the two paths as just j->err, and remove the extra argument from job_completed. Signed-off-by: John Snow --- block/backup.c| 2 +- block/commit.c

Re: [Qemu-devel] [RFC PATCH] async: Fix aio_notify_accept

2018-08-06 Thread Fam Zheng
On Fri, 08/03 19:08, Paolo Bonzini wrote: > On 03/08/2018 17:49, Fam Zheng wrote: > > void aio_notify_accept(AioContext *ctx) > > { > > -if (atomic_xchg(>notified, false)) { > > +/* If ctx->notify_me >= 2, another aio_poll() is waiting which may > > need the > > + * ctx->notifier

[Qemu-devel] [PATCH 11/21] jobs: remove job_defer_to_main_loop

2018-08-06 Thread John Snow
The job infrastructure handles this now, so remove this call. Signed-off-by: John Snow --- include/qemu/job.h | 17 - job.c | 40 ++-- 2 files changed, 2 insertions(+), 55 deletions(-) diff --git a/include/qemu/job.h

[Qemu-devel] [PATCH 21/21] qapi/block-stream: expose new job properties

2018-08-06 Thread John Snow
Signed-off-by: John Snow --- blockdev.c | 9 + hmp.c| 5 +++-- qapi/block-core.json | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index bbb3279020..806531dc20 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3226,6

[Qemu-devel] [PATCH 13/21] block/commit: add block job creation flags

2018-08-06 Thread John Snow
Add support for taking and passing forward job creation flags. Signed-off-by: John Snow --- block/commit.c| 5 +++-- blockdev.c| 7 --- include/block/block_int.h | 5 - 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/block/commit.c

[Qemu-devel] [PATCH 06/21] block/stream: utilize job_exit shim

2018-08-06 Thread John Snow
Change the manual deferment to stream_complete into the implicit callback to job_exit. Signed-off-by: John Snow --- block/stream.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/block/stream.c b/block/stream.c index a5d6e0cf8a..163cd6431c 100644 ---

[Qemu-devel] [PATCH 16/21] block/commit: refactor commit to use job callbacks

2018-08-06 Thread John Snow
Use the component callbacks; prepare, commit, abort, and clean. NB: prepare is only called when the job has not yet failed; and abort can be called after prepare. complete -> prepare -> abort -> clean complete -> abort -> clean Signed-off-by: John Snow --- block/commit.c | 94

[Qemu-devel] [PATCH 09/21] tests/test-blockjob: utilize job_exit shim

2018-08-06 Thread John Snow
Change the manual deferment to test_block_job_complete into the implicit callback to job_exit. Signed-off-by: John Snow --- tests/test-blockjob.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c index

[Qemu-devel] [Bug 1785698] Re: Solaris build error: unknown type name ‘gcry_error_t’

2018-08-06 Thread Michele Denber
It turns out I needed #include in crypto/cipher-grypt.c However, now I'm stuck on # gmake mkdir -p dtc/libfdt mkdir -p dtc/tests Bad string LINKqemu-nbd ld: fatal: library -lutil: not found ld: fatal: file processing errors. No output written to qemu-nbd collect2: error: ld returned 1

[Qemu-devel] [Bug 1785734] [NEW] movdqu partial write at page boundary

2018-08-06 Thread Fabian Hemmer
Public bug reported: In TCG mode, when a 16-byte write instruction (such as movdqu) is executed at a page boundary and causes a page fault, a partial write is executed in the first page. See the attached code for an example. Tested on the qemu-3.0.0-rc1 release. % gcc -m32 qemu-bug2.c &&

Re: [Qemu-devel] [PATCH] qapi/block: Document restrictions for node names

2018-08-06 Thread Cong Li
- Original Message - > From: "Kevin Wolf" > To: qemu-bl...@nongnu.org > Cc: kw...@redhat.com, c...@redhat.com, qemu-devel@nongnu.org > Sent: Monday, August 6, 2018 8:37:28 PM > Subject: [PATCH] qapi/block: Document restrictions for node names > > blockdev-add fails if an invalid node

[Qemu-devel] [PATCH 07/21] block/create: utilize job_exit shim

2018-08-06 Thread John Snow
Utilize the job_exit shim by simply not calling job_defer_to_main_loop. While we're here, we don't need to duplicate the core job object's `ret`. Signed-off-by: John Snow --- block/create.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/block/create.c

[Qemu-devel] [PATCH 02/21] jobs: add exit shim

2018-08-06 Thread John Snow
Most jobs do the same thing when they leave their running loop: - Store the return code in a structure - wait to receive this structure in the main thread - signal job completion via job_completed More seriously, when we utilize job_defer_to_main_loop_bh to call a function that calls

[Qemu-devel] [PATCH 19/21] qapi/block-commit: expose new job properties

2018-08-06 Thread John Snow
Signed-off-by: John Snow --- blockdev.c | 8 qapi/block-core.json | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index c2e6402a66..8efc47e178 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3314,6 +3314,8 @@ void

[Qemu-devel] [PATCH 10/21] tests/test-bdrv-drain: utilize job_exit shim

2018-08-06 Thread John Snow
Utilize the job_exit shim by simply not calling job_defer_to_main_loop. Signed-off-by: John Snow --- tests/test-bdrv-drain.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/tests/test-bdrv-drain.c b/tests/test-bdrv-drain.c index 7b05082cae..f30310596c 100644 ---

[Qemu-devel] [PATCH 18/21] block/commit: refactor stream to use job callbacks

2018-08-06 Thread John Snow
Signed-off-by: John Snow --- block/stream.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/block/stream.c b/block/stream.c index af0a1d5d0c..20192fac77 100644 --- a/block/stream.c +++ b/block/stream.c @@ -54,16 +54,16 @@ static int coroutine_fn

[Qemu-devel] [PATCH 15/21] block/stream: add block job creation flags

2018-08-06 Thread John Snow
Add support for taking and passing forward job creaton flags. Signed-off-by: John Snow --- block/stream.c| 5 +++-- blockdev.c| 3 ++- include/block/block_int.h | 5 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/block/stream.c b/block/stream.c

Re: [Qemu-devel] [RFC v3 1/6] pci_expander_bridge: add type TYPE_PXB_PCIE_HOST

2018-08-06 Thread Zihan Yang
Marcel Apfelbaum 于2018年8月6日周一 下午7:46写道: > > > > On 08/02/2018 05:45 AM, Zihan Yang wrote: > > The inner host bridge created by pxb-pcie is TYPE_PXB_PCI_HOST by default, > > change it to a new type TYPE_PXB_PCIE_HOST to better utilize ECAM of PCIe > > After an offline conversation we decided to

[Qemu-devel] [PATCH 12/21] jobs: allow entrypoints to return status code

2018-08-06 Thread John Snow
Instead of awkwardly setting the return code in the job object, we can just return this on the stack and catch it in the caller. This also has the side-effect of changing the "opaque" type in the entrypoint to the more specific "Job" type, so change function signatures accordingly. Signed-off-by:

[Qemu-devel] [PATCH 20/21] qapi/block-mirror: expose new job properties

2018-08-06 Thread John Snow
Signed-off-by: John Snow --- blockdev.c | 14 ++ qapi/block-core.json | 6 -- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 8efc47e178..bbb3279020 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3707,6 +3707,8 @@ static void

[Qemu-devel] [PATCH 14/21] block/mirror: add block job creation flags

2018-08-06 Thread John Snow
Add support for taking and passing forward job creaton flags. Signed-off-by: John Snow --- block/mirror.c| 5 +++-- blockdev.c| 3 ++- include/block/block_int.h | 5 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/block/mirror.c b/block/mirror.c

[Qemu-devel] [PATCH 17/21] block/mirror: conservative mirror_exit refactor

2018-08-06 Thread John Snow
For purposes of minimum code movement, refactor the mirror_exit callback to use the post-finalization callbacks in a trivial way. Signed-off-by: John Snow --- block/mirror.c | 26 ++ 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/block/mirror.c

Re: [Qemu-devel] [PATCH 6/6] target/s390x: implement CVB, CVBY and CVBG

2018-08-06 Thread David Hildenbrand
On 05.08.2018 20:28, Pavel Zbitskiy wrote: > Convert to Binary - counterparts of the already implemented Convert > to Decimal (CVD*) instructions. > Example from the Principles of Operation: 25594C becomes 63FA. > > Signed-off-by: Pavel Zbitskiy > --- > target/s390x/helper.h | 2 ++ >

[Qemu-devel] [PATCH v6 00/11] Enable postcopy RDMA live migration

2018-08-06 Thread Lidong Chen
The RDMA QIOChannel does not support bi-directional communication, so when RDMA live migration with postcopy enabled, the source qemu return path get qemu file error. These patches implement bi-directional communication for RDMA QIOChannel and disable the RDMA WRITE during the postcopy phase.

[Qemu-devel] [PATCH v6 05/11] migration: implement io_set_aio_fd_handler function for RDMA QIOChannel

2018-08-06 Thread Lidong Chen
From: Lidong Chen if qio_channel_rdma_readv return QIO_CHANNEL_ERR_BLOCK, the destination qemu crash. The backtrace is: (gdb) bt #0 0x in ?? () #1 0x008db50e in qio_channel_set_aio_fd_handler (ioc=0x38111e0, ctx=0x3726080, io_read=0x8db841 ,

[Qemu-devel] [PATCH v6 03/11] migration: implement bi-directional RDMA QIOChannel

2018-08-06 Thread Lidong Chen
From: Lidong Chen This patch implements bi-directional RDMA QIOChannel. Because different threads may access RDMAQIOChannel currently, this patch use RCU to protect it. Signed-off-by: Lidong Chen Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 2 + migration/migration.c

[Qemu-devel] [PATCH v6 07/11] migration: poll the cm event while wait RDMA work request completion

2018-08-06 Thread Lidong Chen
From: Lidong Chen If the peer qemu is crashed, the qemu_rdma_wait_comp_channel function maybe loop forever. so we should also poll the cm event fd, and when receive RDMA_CM_EVENT_DISCONNECTED and RDMA_CM_EVENT_DEVICE_REMOVAL, we consider some error happened. Signed-off-by: Lidong Chen

[Qemu-devel] [PATCH v6 11/11] migration: create a dedicated thread to release rdma resource

2018-08-06 Thread Lidong Chen
ibv_dereg_mr wait for a long time for big memory size virtual server. The test result is: 10GB 326ms 20GB 699ms 30GB 1021ms 40GB 1387ms 50GB 1712ms 60GB 2034ms 70GB 2457ms 80GB 2807ms 90GB 3107ms 100GB 3474ms 110GB 3735ms 120GB 4064ms 130GB 4567ms 140GB 4886ms

Re: [Qemu-devel] [PATCH 1/7] hw/misc/nrf51_rng: Add NRF51 random number generator peripheral

2018-08-06 Thread Stefan Hajnoczi
On Mon, Aug 6, 2018 at 11:01 AM, Steffen Görtz wrote: > +#define NRF51_TRIGGER_TASK 0x01 > +#define NRF51_EVENT_CLEAR 0x00 Please consider putting these generic constants into hw/arm/nrf51.h or a similar file that all nRF51 devices can include. That way code duplication is eliminated.

Re: [Qemu-devel] [PATCH for-3.0 v2 0/5] Arm migration fixes for 3.0

2018-08-06 Thread Richard Henderson
On 08/06/2018 05:34 AM, Peter Maydell wrote: > Peter Maydell (5): > hw/intc/arm_gicv3_common: Give no-migration-shift-bug subsection a > needed function > hw/intc/arm_gicv3_common: Combine duplicate .subsections in > vmstate_gicv3_cpu > target/arm: Add dummy needed functions to M

[Qemu-devel] [PATCH v3 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-08-06 Thread Markus Armbruster
13 of 13 C99 library function pairs taking ... or a va_list parameter are called FOO() and vFOO(). In QEMU, we sometimes call the one taking a va_list FOOv() instead. Bad taste. libqtest.h uses both spellings. Normalize it to the standard spelling. Signed-off-by: Markus Armbruster

[Qemu-devel] [PATCH v3 22/23] libqtest: Replace qtest_startf() by qtest_initf()

2018-08-06 Thread Markus Armbruster
qtest_init() creates a new QTestState, and leaves @global_qtest alone. qtest_start() additionally assigns it to @global_qtest, but qtest_startf() additionally assigns NULL to @global_qtest. This makes no sense. Replace it by qtest_initf() that works like qtest_init(), i.e. leaves @global_qtest

Re: [Qemu-devel] [Qemu-ppc] [PULL 0/2] ppc-for-3.0 queue 20180801

2018-08-06 Thread Peter Maydell
On 5 August 2018 at 16:38, BALATON Zoltan wrote: > Now that it looks like we'll have an rc4 due to other fixes can these be > included as well despite not being regressions? These may not have been > serious enough to fix when we wouldn't have rc4 otherwise but holding on to > broken

[Qemu-devel] [PATCH 5/7] tests/microbit-test: Add Tests for nRF51 GPIO

2018-08-06 Thread Steffen Görtz
The test suite for the nRF51 GPIO peripheral for now only tests initial state. Additionally a set of tests testing an implementation detail of the model are included. Signed-off-by: Steffen Görtz --- tests/microbit-test.c | 96 +++ 1 file changed, 96

[Qemu-devel] [PATCH 6/7] hw/timer/nrf51_timer: Add nRF51 Timer peripheral

2018-08-06 Thread Steffen Görtz
This patch adds the model for the nRF51 timer peripheral. Currently, only the TIMER mode is implemented. Signed-off-by: Steffen Görtz --- hw/timer/Makefile.objs | 1 + hw/timer/nrf51_timer.c | 382 + hw/timer/trace-events | 5 +

Re: [Qemu-devel] [PATCH 0/7] arm: nRF51 Devices and Microbit Support

2018-08-06 Thread Peter Maydell
On 6 August 2018 at 11:01, Steffen Görtz wrote: > This series contains additional peripheral devices for the nRF51822 > microcontroller. Furthermore it includes a device to demultiplex > the row and column strobes used in embedded devices to drive > 2D LED dot-matrices. > > Included devices: > -

[Qemu-devel] [PATCH for-3.0 v2 4/5] hw/intc/arm_gicv3_common: Move post_load hooks to top-level VMSD

2018-08-06 Thread Peter Maydell
Contrary to the the impression given in docs/devel/migration.rst, the migration code does not run the pre_load hook for a subsection unless the subsection appears on the wire, and so this is not a place where you can set the default value for state for the "subsection not present" case. Instead

[Qemu-devel] [PATCH for-3.0 v2 1/5] hw/intc/arm_gicv3_common: Give no-migration-shift-bug subsection a needed function

2018-08-06 Thread Peter Maydell
Currently the migration code incorrectly treats a subsection with no .needed function pointer as if it was the subsection list terminator -- it is ignored and so is everything after it. Work around this by giving vmstate_gicv3_gicd_no_migration_shift_bug a 'needed' function that always returns

  1   2   3   4   >