Re: [Qemu-devel] [PATCH] qemu-img.c: add help for each command

2018-09-07 Thread Programmingkid
> On Sep 7, 2018, at 11:13 PM, Peter Maydell wrote: > > On 8 September 2018 at 04:01, John Arbuckle wrote: > >> +/* print the help for this command */ >> +if (strcmp("--help", argv[optind + 1]) == 0) { >> +if (strcmp("amend", cmdname) == 0) { >> +help_amend(); >>

Re: [Qemu-devel] [PATCH] qemu-img.c: add help for each command

2018-09-07 Thread Peter Maydell
On 8 September 2018 at 04:01, John Arbuckle wrote: > +/* print the help for this command */ > +if (strcmp("--help", argv[optind + 1]) == 0) { > +if (strcmp("amend", cmdname) == 0) { > +help_amend(); > +} else if (strcmp("bench", cmdname) == 0) { > +

[Qemu-devel] [PATCH] qemu-img.c: add help for each command

2018-09-07 Thread John Arbuckle
Add the ability for the user to display help for a certain command. Example: qemu-img create --help What is printed is all the options available to this command and an example. Signed-off-by: John Arbuckle --- qemu-img.c | 767 + 1

Re: [Qemu-devel] [RFC PATCH v2 0/7] QEMU binary instrumentation prototype

2018-09-07 Thread Peter Maydell
On 7 September 2018 at 15:39, Alex Bennée wrote: > > Pavel Dovgalyuk writes: > >> The following series implements dynamic binary instrumentation upon >> QEMU. > > OK I've done a pass through the patches, final comments bellow. > > >> >> For the current patches the plugins should provide the

Re: [Qemu-devel] [RFC] target/mips: Initial support for MIPS R5900

2018-09-07 Thread Philippe Mathieu-Daudé
Hi, On 7/7/18 4:41 PM, Fredrik Noring wrote: [...] > --- a/target/mips/mips-defs.h > +++ b/target/mips/mips-defs.h > @@ -52,6 +52,7 @@ > #define ASE_MSA 0x0100 > > /* Chip specific instructions. */ > +#define INSN_R5900 0x1000 We have 4 bits to store the

Re: [Qemu-devel] [Qemu-arm] [PATCH 02/15] gdbstub: add multiprocess support to '?' packets

2018-09-07 Thread Philippe Mathieu-Daudé
Hi Luc, On 9/1/18 9:46 AM, Luc Michel wrote: [...] > +static char *get_thread_id(const GDBState *s, CPUState *cpu, > + char *buf, size_t buf_size) To avoid confusion with 'int qemu_get_thread_id()' from "qemu/osdep.h", can we use another name such gdb_fmt_thread_id() or

Re: [Qemu-devel] [Qemu-arm] [PATCH 09/15] gdbstub: add multiprocess support to 'D' packets

2018-09-07 Thread Philippe Mathieu-Daudé
Hi Luc, On 9/1/18 9:46 AM, Luc Michel wrote: > 'D' packets are used by GDB to detach from a process. In multiprocess > mode, the PID to detach from is sent in the request. > > Signed-off-by: Luc Michel > --- > gdbstub.c | 55 --- > 1 file

Re: [Qemu-devel] [PATCH v5 00/16] jobs: Job Exit Refactoring Pt 2

2018-09-07 Thread Max Reitz
On 2018-09-06 15:02, John Snow wrote: > This is part two of a two part series that refactors the exit logic > of jobs. > > This series forces all jobs to use the "finalize" semantics that were > introduced previously, but only exposed via the backup jobs. > > Patches 1-3 add plumbing for the

Re: [Qemu-devel] [Qemu-arm] [PATCH 05/15] gdbstub: add multiprocess support to 'sC' packets

2018-09-07 Thread Philippe Mathieu-Daudé
On 9/1/18 9:46 AM, Luc Michel wrote: > Change the sC packet handling to support the multiprocess extension. > Instead of returning the first thread, we return the first thread of the > current process. > > Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé > --- > gdbstub.c | 11

Re: [Qemu-devel] [PATCH v5 16/16] blockdev: document transactional shortcomings

2018-09-07 Thread Max Reitz
On 2018-09-06 15:02, John Snow wrote: > Presently only the backup job really guarantees what one would consider > transactional semantics. To guard against someone helpfully adding them > in the future, document that there are shortcomings in the model that > would need to be audited at that time.

Re: [Qemu-devel] [PATCH v5 06/16] block/mirror: conservative mirror_exit refactor

2018-09-07 Thread Max Reitz
On 2018-09-06 22:31, John Snow wrote: > > > On 09/06/2018 12:57 PM, Jeff Cody wrote: >> On Thu, Sep 06, 2018 at 09:02:15AM -0400, John Snow wrote: >>> For purposes of minimum code movement, refactor the mirror_exit >>> callback to use the post-finalization callbacks in a trivial way. >>> >>>

Re: [Qemu-devel] [PATCH v5 05/16] block/mirror: don't install backing chain on abort

2018-09-07 Thread Max Reitz
On 2018-09-06 15:02, John Snow wrote: > In cases where we abort the block/mirror job, there's no point in > installing the new backing chain before we finish aborting. > > Signed-off-by: John Snow > --- > block/mirror.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Max

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

2018-09-07 Thread Max Reitz
On 2018-09-06 15:02, John Snow wrote: > Use the component callbacks; prepare, 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 > > During refactor, a

Re: [Qemu-devel] [Qemu-arm] [PATCH 03/11] hw/arm/aspeed: Add an Aspeed machine class

2018-09-07 Thread Philippe Mathieu-Daudé
On 8/31/18 7:38 AM, Cédric Le Goater wrote: > The code looks better, it removes duplicated lines and it will ease > the introduction of common properties for the Aspeed machines. > > Signed-off-by: Cédric Le Goater Nice cleanup :) Reviewed-by: Philippe Mathieu-Daudé > --- >

Re: [Qemu-devel] [PATCH 06/11] aspeed/smc: fix default read value

2018-09-07 Thread Philippe Mathieu-Daudé
Hi Cédric, On 8/31/18 7:38 AM, Cédric Le Goater wrote: > 0x should be returned for non implemented registers. > > Signed-off-by: Cédric Le Goater > --- > hw/ssi/aspeed_smc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/ssi/aspeed_smc.c

Re: [Qemu-devel] [Qemu-arm] [PATCH 11/11] aspeed/smc: Add dummy data register

2018-09-07 Thread Philippe Mathieu-Daudé
On 8/31/18 8:15 AM, Cédric Le Goater wrote: > The SMC controllers have a register containing the byte that will be > used as dummy output. It can be modified by software. > > Signed-off-by: Cédric Le Goater > --- > hw/ssi/aspeed_smc.c | 9 ++--- > 1 file changed, 6 insertions(+), 3

[Qemu-devel] [PATCH v2 1/3] usb-mtp: fix error conditions for write operation

2018-09-07 Thread Bandan Das
From: Bandan Return STORE_FULL if we can't write all the bytes but return incomplete transfer if data received is less then what was specified in the metadata. Also, use d->offset as the file size which is valid for all file sizes. Signed-off-by: Bandan --- hw/usb/dev-mtp.c | 7 --- 1

[Qemu-devel] [PATCH v2 3/3] usb-mtp: reset ObjectInfo dataset size on cleanup

2018-09-07 Thread Bandan Das
Stale values in this field may result in qemu expecting more data on the next operation Signed-off-by: Bandan Das --- hw/usb/dev-mtp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 15edf3bb82..00a3691bae 100644 --- a/hw/usb/dev-mtp.c +++

[Qemu-devel] [PATCH v2 2/3] doc: replace x-root with rootdir for usb-mtp

2018-09-07 Thread Bandan Das
From: Bandan Signed-off-by: Bandan --- qemu-doc.texi | 2 +- scripts/device-crash-test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index f74542a0e9..cc7d81181c 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -943,7 +943,7

[Qemu-devel] [PATCH 0/2] softfloat tests based on berkeley's testfloat

2018-09-07 Thread Emilio G. Cota
Alex was not too pleased with my previous fp-test incarnation; it only tested some 32 and 64 primitives, and it relied on test files by IBM that had no particular license (so we could not redistribute them, and IBM might pull them off the web any time). This attempt leverages berkeley's softfloat

[Qemu-devel] [PATCH v2 0/3] Misc usb-mtp fixes

2018-09-07 Thread Bandan Das
v2: Same as v1 but with another minor cleanup patch. The write buffer breakup is still WIP. A documentation fix and changes to return the right error code on write failures. Bandan (2): usb-mtp: fix error conditions for write operation doc: replace x-root with rootdir for usb-mtp Bandan Das

[Qemu-devel] [PATCH 2/2] tests: add floating point tests

2018-09-07 Thread Emilio G. Cota
By leveraging berkeley's softfloat and testfloat. fp-test.c is derived from testfloat's testsoftfloat.c. To ease the tracking of upstream changes to the latter file, fp-test.c keeps the original camel-case variable naming, and includes most new code via wrap.inc.c. Most changes to the original

[Qemu-devel] [PATCH 1/2] gitmodules: add berkeley's softfloat + testfloat version 3

2018-09-07 Thread Emilio G. Cota
These are BSD-licensed so we can add them as submodules. Signed-off-by: Emilio G. Cota --- .gitmodules | 6 ++ tests/fp/berkeley-softfloat-3 | 1 + tests/fp/berkeley-testfloat-3 | 1 + 3 files changed, 8 insertions(+) create mode 16 tests/fp/berkeley-softfloat-3

Re: [Qemu-devel] [PATCH v3 2/8] tests: add tests for hbitmap_next_zero with specified end parameter

2018-09-07 Thread John Snow
On 08/14/2018 08:14 AM, Vladimir Sementsov-Ogievskiy wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/test-hbitmap.c | 32 > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c >

[Qemu-devel] [PULL 3/7] hw/pci: factor PCI reserve resources to a separate structure

2018-09-07 Thread Michael S. Tsirkin
From: Jing Liu Factor "bus_reserve", "io_reserve", "mem_reserve", "pref32_reserve" and "pref64_reserve" fields of the "GenPCIERootPort" structure out to "PCIResReserve" structure, so that other PCI bridges can reuse it to add resource reserve capability. Signed-off-by: Jing Liu Reviewed-by:

[Qemu-devel] [PULL 2/7] virtio: update MemoryRegionCaches when guest negotiates features

2018-09-07 Thread Michael S. Tsirkin
From: Paolo Bonzini Because the cache is sized to include the rings and the event indices, negotiating the VIRTIO_RING_F_EVENT_IDX feature will result in the size of the cache changing. And because MemoryRegionCache accesses are range-checked, if we skip this we end up with an assertion

[Qemu-devel] [PULL 7/7] tests: update acpi expected files

2018-09-07 Thread Michael S. Tsirkin
Fixes: dbb6da8ba7e ("pc: acpi: revert back to 1 SRAT entry for hotpluggable area") Signed-off-by: Michael S. Tsirkin --- tests/acpi-test-data/pc/DSDT | Bin 5144 -> 5131 bytes tests/acpi-test-data/pc/DSDT.bridge | Bin 7003 -> 6990 bytes tests/acpi-test-data/pc/DSDT.cphp | Bin

[Qemu-devel] [PULL 6/7] vhost: fix invalid downcast

2018-09-07 Thread Michael S. Tsirkin
From: Yury Kotov virtio_queue_get_desc_addr returns 64-bit hwaddr while int is usually 32-bit. If returned hwaddr is not equal to 0 but least-significant 32 bits are equal to 0 then this code will not actually stop running queue. Signed-off-by: Yury Kotov Acked-by: Jia He Cc:

[Qemu-devel] [PULL 5/7] pc: make sure that guest isn't able to unplug the first cpu

2018-09-07 Thread Michael S. Tsirkin
From: Igor Mammedov The first cpu unplug wasn't ever supported and corresponding monitor/qmp commands refuse to unplug it. However guest is able to issue eject request either using following command: # echo 1 >/sys/devices/system/cpu/cpu0/firmware_node/eject or directly writing to cpu hotplug

[Qemu-devel] [PULL 0/7] pci, pc, virtio: fixes, features

2018-09-07 Thread Michael S. Tsirkin
The following changes since commit 19b599f7664b2ebfd0f405fb79c14dd241557452: Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-08-27-v2' into staging (2018-08-27 16:44:20 +0100) are available in the Git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git

[Qemu-devel] [PULL 4/7] hw/pci: add PCI resource reserve capability to legacy PCI bridge

2018-09-07 Thread Michael S. Tsirkin
From: Jing Liu Add hint to firmware (e.g. SeaBIOS) to reserve addtional BUS/IO/MEM/PREF resource for legacy pci-pci bridge. Add the resource reserve capability deleting in pci_bridge_dev_exitfn. Signed-off-by: Jing Liu Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin

[Qemu-devel] [PULL 1/7] pc: acpi: revert back to 1 SRAT entry for hotpluggable area

2018-09-07 Thread Michael S. Tsirkin
From: Igor Mammedov Commit 10efd7e108 "pc: acpi: fix memory hotplug regression by reducing stub SRAT entry size" attemped to fix hotplug regression introduced by 848a1cc1e "hw/acpi-build: build SRAT memory affinity structures for DIMM devices" fixed issue for Windows/3.0+ linux kernels,

Re: [Qemu-devel] [PATCH v3 1/8] dirty-bitmap: improve bdrv_dirty_bitmap_next_zero

2018-09-07 Thread John Snow
On 08/14/2018 08:14 AM, Vladimir Sementsov-Ogievskiy wrote: > Add bytes parameter to the function, to limit searched range. > I'm going to assume that Eric Blake has been through here and commented on the interface itself. > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- >

Re: [Qemu-devel] [virtio-dev] [PATCH v25 0/2] virtio-crypto: virtio crypto device specification

2018-09-07 Thread Michael S. Tsirkin
OK it is time to apply this. If I do I get latex errors (undefined and multiple-defined labels). Please post patches on top to fix this up, I will squash. On Fri, Aug 24, 2018 at 08:43:34AM +0800, Longpeng(Mike) wrote: > --- > v25 -> v24 > - fix some typos and letex grammar. > > v24 -> v23 >

Re: [Qemu-devel] [PATCH V5 1/4] target-i386: introduce coalesced_pio kvm header update

2018-09-07 Thread Michael S. Tsirkin
On Fri, Aug 31, 2018 at 05:05:02PM +0800, Peng Hao wrote: > add coalesced_pio's struct and KVM_CAP_COALESCED_PIO header. > > Signed-off-by: Peng Hao I can merge ths together with q35 patch, but pls get acks from kvm folks, to this end fix up commit logs and subjects to match reality and repost.

Re: [Qemu-devel] [PATCH V5 1/4] target-i386: introduce coalesced_pio kvm header update

2018-09-07 Thread Michael S. Tsirkin
On Fri, Aug 31, 2018 at 05:05:02PM +0800, Peng Hao wrote: > add coalesced_pio's struct and KVM_CAP_COALESCED_PIO header. > > Signed-off-by: Peng Hao Despite what the subject says, this is a kvm patch not a target-i386 one. In fact none of these are. And it does not add a header. Please change

Re: [Qemu-devel] [PATCH] pc: make sure that guest isn't able to unplug the first cpu

2018-09-07 Thread Michael S. Tsirkin
On Wed, Aug 29, 2018 at 03:51:38PM +0200, Igor Mammedov wrote: > On Wed, 29 Aug 2018 09:15:53 -0400 > "Michael S. Tsirkin" wrote: > > > On Wed, Aug 29, 2018 at 10:43:11AM +0200, Igor Mammedov wrote: > > > On Wed, 29 Aug 2018 12:54:40 +1000 > > > David Gibson wrote: > > > > > > > On Tue, Aug

Re: [Qemu-devel] [PATCH 1/2] linux-headers: update to mainline 5c60a7389d79

2018-09-07 Thread Michael S. Tsirkin
On Fri, Aug 17, 2018 at 04:37:06PM +0800, Jason Wang wrote: > Sync linux headers to 5c60a7389d79 ("Merge tag 'for-linus-4.19-ofs1' of > git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux"). > > Signed-off-by: Jason Wang so there will be a new version of this as ioctl has changed,

[Qemu-devel] [PULL v1 0/1] Merge tpm 2018/09/07 v1

2018-09-07 Thread Stefan Berger
This patch fixes a TPM test failure in QEMU's test suite. Stefan The following changes since commit 19b599f7664b2ebfd0f405fb79c14dd241557452: Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-08-27-v2' into staging (2018-08-27 16:44:20 +0100) are available in the Git

[Qemu-devel] [PULL v1 1/1] tests: Fix signalling race condition in TPM tests

2018-09-07 Thread Stefan Berger
This patch fixes a race condition and test failure where the main process waits for the signal of a thread but the thread already sent that signal via a condition. Since these signals are non-sticky, we need to introduce a separate variable to make this signal sticky. Signed-off-by: Stefan Berger

Re: [Qemu-devel] [PATCH] pc: acpi: revert back to 1 SRAT entry for hotpluggable area

2018-09-07 Thread Michael S. Tsirkin
On Wed, Aug 22, 2018 at 11:46:44AM +0200, Igor Mammedov wrote: > Commit > 10efd7e108 "pc: acpi: fix memory hotplug regression by reducing stub SRAT > entry size" > attemped to fix hotplug regression introduced by > 848a1cc1e "hw/acpi-build: build SRAT memory affinity structures for DIMM >

Re: [Qemu-devel] [PATCH] kvm: x86: Fix kvm_arch_fixup_msi_route for remap-less case

2018-09-07 Thread Michael S. Tsirkin
On Mon, Aug 27, 2018 at 10:47:51AM +0200, Jan Kiszka wrote: > The AMD IOMMU does not (yet) support interrupt remapping. But > kvm_arch_fixup_msi_route assumes that all implementations do and crashes > when the AMD IOMMU is used in KVM mode. > > Fixes: 8b5ed7dffa1f ("intel_iommu: add support for

Re: [Qemu-devel] [PATCH v4 00/29] postcopy+vhost-user/shared ram

2018-09-07 Thread Michael S. Tsirkin
On Thu, Mar 08, 2018 at 07:57:42PM +, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > This set enables postcopy migration with shared memory to a vhost user > process. > It's based off current head. > > Testing is mostly performed with dpdk, with corresponding

Re: [Qemu-devel] [Bug 1776920] Re: qemu-img convert on Mac OSX creates corrupt images

2018-09-07 Thread Eric Blake
On 09/07/2018 01:04 PM, Yan-Jie Wang wrote: I have done some experiments and find out that the behavior of lseek with whence set to SEEK_DATA is different from the behavior of Linux's lseek. If the supplied offset is in the middle of a data region, it returns the start of the next data region.

Re: [Qemu-devel] [PATCH v2] target/mips: Initial support for MIPS R5900

2018-09-07 Thread Fredrik Noring
Thank you, Richard, > > Can QEMU be instructed to emulate > > the FPU only for Linux user space programs as opposed to hardware emulation? > > Yes, that can be done. I would suggest something like > > /* > * Hardware traps to the operating system for emulation. > * For user-only, qemu is

Re: [Qemu-devel] [PATCH v2 01/12] qdev-monitor: print help to stdout

2018-09-07 Thread Marc-André Lureau
Hi On Fri, Sep 7, 2018 at 5:49 PM Eric Blake wrote: > > On 09/07/2018 02:59 AM, Marc-André Lureau wrote: > > qdev_device_help() is used from command line "-device help", or from > > HMP "device_add". If used from command line, print help to stdout > > (it is only printed on explicit demand). > >

Re: [Qemu-devel] [PATCH] tests: Fix signalling race condition in TPM tests

2018-09-07 Thread Marc-André Lureau
On Fri, Sep 7, 2018 at 10:47 PM Stefan Berger wrote: > > This patch fixes a race condition and test failure where the main process > waits for the signal of a thread but the thread already sent that signal > via a condition. Since these signals are non-sticky, we need to introduce a > separate

[Qemu-devel] [PATCH] tests: Fix signalling race condition in TPM tests

2018-09-07 Thread Stefan Berger
This patch fixes a race condition and test failure where the main process waits for the signal of a thread but the thread already sent that signal via a condition. Since these signals are non-sticky, we need to introduce a separate variable to make this signal sticky. Signed-off-by: Stefan Berger

Re: [Qemu-devel] [Qemu-arm] [PATCH 05/11] aspeed/smc: fix some alignment issues

2018-09-07 Thread Philippe Mathieu-Daudé
On 8/31/18 7:38 AM, Cédric Le Goater wrote: > Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé > --- > hw/ssi/aspeed_smc.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c > index

Re: [Qemu-devel] [PATCH] hw/arm/exynos4210: fix Exynos4210 UART support

2018-09-07 Thread Philippe Mathieu-Daudé
On 8/31/18 7:23 AM, Bartlomiej Zolnierkiewicz wrote: > commit 97274d0c05d4 ("hw/char/exynos4210_uart.c: Remove unneeded > handling of NULL chardev") broke Exynos4210 support as it removed > NULL 'Chardev *chr' handling from exynos4210_uart_create() and > currently exynos4210_init() always passes

[Qemu-devel] [Bug 1776920] Re: qemu-img convert on Mac OSX creates corrupt images

2018-09-07 Thread Yan-Jie Wang
I have done some experiments and find out that the behavior of lseek with whence set to SEEK_DATA is different from the behavior of Linux's lseek. If the supplied offset is in the middle of a data region, it returns the start of the next data region. There may be many data regions in a big

[Qemu-devel] [Bug 1790975] Re: Default arm virt machine broken

2018-09-07 Thread Jonathan Marler
LPAE is actually disabled in my kernel config. Knowing the cause now, I can see that qemu would not be able to detect this problem. This error should have been detected in the linux kernel with an indication that the ECAM window was using a 40-bit address but LPAE was not enabled. ** Changed

[Qemu-devel] [PATCH 14/14] test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level()

2018-09-07 Thread Kevin Wolf
This is a regression test for a deadlock that could occur in callbacks called from the aio_poll() in bdrv_drain_poll_top_level(). The AioContext lock wasn't released and therefore would be taken a second time in the callback. This would cause a possible AIO_WAIT_WHILE() in the callback to hang.

[Qemu-devel] [PATCH 08/14] block-backend: Add .drained_poll callback

2018-09-07 Thread Kevin Wolf
A bdrv_drain operation must ensure that all parents are quiesced, this includes BlockBackends. Otherwise, callbacks called by requests that are completed on the BDS layer, but not quite yet on the BlockBackend layer could still create new requests. Signed-off-by: Kevin Wolf ---

[Qemu-devel] [PATCH 10/14] block-backend: Decrease in_flight only after callback

2018-09-07 Thread Kevin Wolf
Request callbacks can do pretty much anything, including operations that will yield from the coroutine (such as draining the backend). In that case, a decreased in_flight would be visible to other code and could lead to a drain completing while the callback hasn't actually completed yet.

[Qemu-devel] [PATCH 12/14] blockjob: Lie better in child_job_drained_poll()

2018-09-07 Thread Kevin Wolf
Block jobs claim in .drained_poll() that they are in a quiescent state as soon as job->deferred_to_main_loop is true. This is obviously wrong, they still have a completion BH to run. We only get away with this because commit 91af091f923 added an unconditional aio_poll(false) to the drain

[Qemu-devel] [PATCH 13/14] block: Remove aio_poll() in bdrv_drain_poll variants

2018-09-07 Thread Kevin Wolf
bdrv_drain_poll_top_level() was buggy because it didn't release the AioContext lock of the node to be drained before calling aio_poll(). This way, callbacks called by aio_poll() would possibly take the lock a second time and run into a deadlock with a nested AIO_WAIT_WHILE() call. However, it

[Qemu-devel] [PATCH 05/14] test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback

2018-09-07 Thread Kevin Wolf
This is a regression test for a deadlock that occurred in block job completion callbacks (via job_defer_to_main_loop) because the AioContext lock was taken twice: once in job_finish_sync() and then again in job_defer_to_main_loop_bh(). This would cause AIO_WAIT_WHILE() to hang. Signed-off-by:

[Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb()

2018-09-07 Thread Kevin Wolf
bdrv_do_drained_begin/end() assume that they are called with the AioContext lock of bs held. If we call drain functions from a coroutine with the AioContext lock held, we yield and schedule a BH to move out of coroutine context. This means that the lock for the home context of the coroutine is

[Qemu-devel] [PATCH 01/14] blockjob: Wake up BDS when job becomes idle

2018-09-07 Thread Kevin Wolf
In the context of draining a BDS, the .drained_poll callback of block jobs is called. If this returns true (i.e. there is still some activity pending), the drain operation may call aio_poll() with blocking=true to wait for completion. As soon as the pending activity is completed and the job

[Qemu-devel] [PATCH 11/14] mirror: Fix potential use-after-free in active commit

2018-09-07 Thread Kevin Wolf
When starting an active commit job, other callbacks can run before mirror_start_job() calls bdrv_ref() where needed and cause the nodes to go away. Add another pair of bdrv_ref/unref() around it to protect against this case. Signed-off-by: Kevin Wolf --- block/mirror.c | 9 + 1 file

[Qemu-devel] [PATCH 07/14] aio-wait: Increase num_waiters even in home thread

2018-09-07 Thread Kevin Wolf
Even if AIO_WAIT_WHILE() is called in the home context of the AioContext, we still want to allow the condition to change depending on other threads as long as they kick the AioWait. Specfically block jobs can be running in an I/O thread and should then be able to kick a drain in the main loop

[Qemu-devel] [PATCH 00/14] Fix some jobs/drain/aio_poll related hangs

2018-09-07 Thread Kevin Wolf
Especially the combination of iothreads, block jobs and drain tends to lead to hangs currently. This series fixes a few of these bugs, although there are more of them, to be addressed in separate patches. The primary goal of this series is to fix the scenario from:

[Qemu-devel] [PATCH 09/14] block-backend: Fix potential double blk_delete()

2018-09-07 Thread Kevin Wolf
blk_unref() first decreases the refcount of the BlockBackend and calls blk_delete() if the refcount reaches zero. Requests can still be in flight at this point, they are only drained during blk_delete(): At this point, arbitrary callbacks can run. If any callback takes a temporary BlockBackend

[Qemu-devel] [PATCH 04/14] job: Use AIO_WAIT_WHILE() in job_finish_sync()

2018-09-07 Thread Kevin Wolf
job_finish_sync() needs to release the AioContext lock of the job before calling aio_poll(). Otherwise, callbacks called by aio_poll() would possibly take the lock a second time and run into a deadlock with a nested AIO_WAIT_WHILE() call. Also, job_drain() without aio_poll() isn't necessarily

[Qemu-devel] [PATCH 03/14] test-blockjob: Acquire AioContext around job_finish_sync()

2018-09-07 Thread Kevin Wolf
All callers in QEMU proper hold the AioContext lock when calling job_finish_sync(). test-blockjob should do the same. Signed-off-by: Kevin Wolf --- include/qemu/job.h| 6 ++ tests/test-blockjob.c | 6 ++ 2 files changed, 12 insertions(+) diff --git a/include/qemu/job.h

[Qemu-devel] [PATCH 02/14] test-bdrv-drain: Drain with block jobs in an I/O thread

2018-09-07 Thread Kevin Wolf
This extends the existing drain test with a block job to include variants where the block job runs in a different AioContext. Signed-off-by: Kevin Wolf --- tests/test-bdrv-drain.c | 92 + 1 file changed, 86 insertions(+), 6 deletions(-) diff

Re: [Qemu-devel] [PATCH 2/3] Improve xen_disk response latency

2018-09-07 Thread Paul Durrant
> -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+paul.durrant=citrix@nongnu.org] On Behalf Of Tim Smith > Sent: 07 September 2018 11:21 > To: qemu-devel@nongnu.org > Subject: [Qemu-devel] [PATCH 2/3] Improve xen_disk response latency > > If the I/O ring is full,

Re: [Qemu-devel] [PATCH 3/3] Avoid repeated memory allocation in xen_disk

2018-09-07 Thread Paul Durrant
> -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+paul.durrant=citrix@nongnu.org] On Behalf Of Tim Smith > Sent: 07 September 2018 11:22 > To: qemu-devel@nongnu.org > Subject: [Qemu-devel] [PATCH 3/3] Avoid repeated memory allocation in > xen_disk > > xen_disk

Re: [Qemu-devel] [Qemu-block] [PATCH v3 2/2] aio: Do aio_notify_accept only during blocking aio_poll

2018-09-07 Thread Kevin Wolf
Am 09.08.2018 um 15:22 hat Fam Zheng geschrieben: > Furthermore, blocking aio_poll is only allowed on home thread > (in_aio_context_home_thread), because otherwise two blocking > aio_poll()'s can steal each other's ctx->notifier event and cause > hanging just like described above. It's good to

Re: [Qemu-devel] [PATCH 2/6] qht: add qht_iter_remove

2018-09-07 Thread Emilio G. Cota
On Fri, Sep 07, 2018 at 15:51:12 +0100, Alex Bennée wrote: > > Emilio G. Cota writes: > > > This currently has no users, but the use case is so common that I > > think we must support it. > > > > Note that without the appended we cannot safely remove a set of > > elements; a 2-step approach

Re: [Qemu-devel] [PATCH 6/6] test-qht: speed up + test qht_resize

2018-09-07 Thread Alex Bennée
Emilio G. Cota writes: > Perform first the tests that exercise code paths that are > easier to hit at small table sizes, and then resize the table > to speed up subsequent tests. If this resize is not too large, > we can make the test faster with no code coverage loss. > > - With gcov enabled:

Re: [Qemu-devel] [PATCH 5/6] test-qht: test deletion of the last entry in a bucket

2018-09-07 Thread Alex Bennée
Emilio G. Cota writes: > This improves coverage by one (!) LoC in qht.c, bringing the > coverage rate up from 90.00% to 90.28%. > > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > tests/test-qht.c | 13 - > 1 file changed, 12 insertions(+), 1 deletion(-) > >

Re: [Qemu-devel] [PATCH 4/6] test-qht: test removal of non-existent entries

2018-09-07 Thread Alex Bennée
Emilio G. Cota writes: > This improves qht.c code coverage from 89.44% to 90.00%. > > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > tests/test-qht.c | 26 -- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/tests/test-qht.c

Re: [Qemu-devel] [PATCH 3/6] test-qht: test qht_iter_remove

2018-09-07 Thread Alex Bennée
Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > tests/test-qht.c | 50 ++-- > 1 file changed, 48 insertions(+), 2 deletions(-) > > diff --git a/tests/test-qht.c b/tests/test-qht.c > index

Re: [Qemu-devel] [PATCH 2/6] qht: add qht_iter_remove

2018-09-07 Thread Alex Bennée
Emilio G. Cota writes: > This currently has no users, but the use case is so common that I > think we must support it. > > Note that without the appended we cannot safely remove a set of > elements; a 2-step approach (i.e. qht_iter first, keep track of > the to-be-deleted elements, and then a

Re: [Qemu-devel] [PATCH 1/6] qht: remove unused map param from qht_remove__locked

2018-09-07 Thread Alex Bennée
Emilio G. Cota writes: > Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée > --- > util/qht.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/util/qht.c b/util/qht.c > index c138777a9c..7b57b50a24 100644 > --- a/util/qht.c > +++ b/util/qht.c > @@ -665,8

Re: [Qemu-devel] [RFC PATCH v2 0/7] QEMU binary instrumentation prototype

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > The following series implements dynamic binary instrumentation upon > QEMU. OK I've done a pass through the patches, final comments bellow. > > For the current patches the plugins should provide the following > callbacks: > - "needs" callback to check whether the

Re: [Qemu-devel] [RFC PATCH v2 2/7] Add plugin support

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > This patch adds support for dynamically loaded plugins. > Every plugin is a dynamic library with a set of optional exported > functions that will be called from QEMU. > > + > +static QLIST_HEAD(, QemuPluginInfo) qemu_plugins > +=

Re: [Qemu-devel] [PATCH 1/3] Improve xen_disk batching behaviour

2018-09-07 Thread Paul Durrant
> -Original Message- > From: Qemu-devel [mailto:qemu-devel- > bounces+paul.durrant=citrix@nongnu.org] On Behalf Of Tim Smith > Sent: 07 September 2018 11:21 > To: qemu-devel@nongnu.org > Subject: [Qemu-devel] [PATCH 1/3] Improve xen_disk batching behaviour > > When I/O consists of

Re: [Qemu-devel] [RFC PATCH v2 0/7] QEMU binary instrumentation prototype

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > Peter, what about this one? > > Pavel Dovgalyuk > >> -Original Message- >> From: Pavel Dovgalyuk [mailto:dovga...@ispras.ru] >> Sent: Tuesday, June 05, 2018 2:56 PM >> To: 'Peter Maydell'; 'Pavel Dovgalyuk' >> Cc: 'QEMU Developers';

Re: [Qemu-devel] [RFC PATCH v2 7/7] plugins: add syscall logging plugin sample

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > This is an example of plugin which instruments only specific instructions: > sysenter and sysexit. When executing them, it prints system call id > and return code to the QEMU log. Again I'm not sure this is a very useful example either. It doesn't achieve anything we

Re: [Qemu-devel] [PATCH v2 1/3] util: add qemu_write_pidfile()

2018-09-07 Thread Eric Blake
On 09/07/2018 07:13 AM, Marc-André Lureau wrote: There are variants of qemu_create_pidfile() in qemu-pr-helper and qemu-ga. Let's have a common implementation in libqemuutil. Unrelated to this patch, but a question that this raises: should 'qemu-nbd' also have a mode for creating a pid file,

Re: [Qemu-devel] [Bug 1716292] Re: User mode emulation returns wrong value for write(fd, NULL, 0)

2018-09-07 Thread Eric Blake
On 09/07/2018 06:51 AM, Tony Garnock-Jones wrote: ** Patch added: "0001-Bring-linux-user-write-2-handling-into-line-with-lin.patch" https://bugs.launchpad.net/qemu/+bug/1716292/+attachment/5186008/+files/0001-Bring-linux-user-write-2-handling-into-line-with-lin.patch While a developer

Re: [Qemu-devel] [RFC PATCH v2 6/7] plugin: add instruction execution logger

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > From: Pavel Dovgalyuk > > This patch adds a plugin for logging addresses of all executed instructions, > making a complete instruction-level trace. This isn't a good example. You can do this now with a much simpler: ${QEMU} -singlestep -d nochain,trace:exec_tb -D

Re: [Qemu-devel] [PATCH v2 12/12] vl: list user creatable properties when 'help' is argument

2018-09-07 Thread Eric Blake
On 09/07/2018 02:59 AM, Marc-André Lureau wrote: Iterate over the writable class properties, sort and print them out with the description if available. Ex: qemu -object memory-backend-file,help memory-backend-file.align=int memory-backend-file.discard-data=bool memory-backend-file.dump=bool -

Re: [Qemu-devel] [RFC PATCH v2 5/7] plugins: add plugin template

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > From: Pavel Dovgalyuk > > This is a template of the QEMU plugin. It includes empty functions that > plugins may implement. > I'm not sure it's worth having a null-template plugin if we can have one or two well documented example plugins. It just runs the risk of

Re: [Qemu-devel] [PATCH v2 01/12] qdev-monitor: print help to stdout

2018-09-07 Thread Eric Blake
On 09/07/2018 02:59 AM, Marc-André Lureau wrote: qdev_device_help() is used from command line "-device help", or from HMP "device_add". If used from command line, print help to stdout (it is only printed on explicit demand). Signed-off-by: Marc-André Lureau --- include/monitor/monitor.h | 2

Re: [Qemu-devel] [PULL 01/14] ppc: Remove deprecated ppcemb target

2018-09-07 Thread Eric Blake
On 09/07/2018 02:31 AM, David Gibson wrote: From: Thomas Huth There is no known available OS for ppc around anymore that uses page sizes below 4k, so it does not make much sense that we keep wasting our time on building and testing the ppcemb-softmmu target. It has been deprecated since two

[Qemu-devel] [PATCH v2 4/4] qemu_thread_create: propagate the error to callers to handle

2018-09-07 Thread Fei Li
Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hold the error message and let the callers handle it. Besides, directly return if thread->data is NULL to avoid the segmentation fault in qemu_thread_join in

Re: [Qemu-devel] [PATCH V9 2/4] tests/migration: Support cross compilation in generating boot header file

2018-09-07 Thread Wei Huang
On 09/07/2018 02:04 AM, Andrew Jones wrote: > On Thu, Sep 06, 2018 at 12:23:45PM -0400, Wei Huang wrote: >> >> >> - Original Message - >>> From: "Andrew Jones" >>> To: "Wei Huang" >>> Cc: lviv...@redhat.com, "peter maydell" , >>> quint...@redhat.com, qemu-devel@nongnu.org, >>>

Re: [Qemu-devel] [PATCH v2 03/12] qemu-option: add help fallback to print the list of options

2018-09-07 Thread Eric Blake
On 09/07/2018 02:59 AM, Marc-André Lureau wrote: QDev options accept 'help' (or '?', but that's problematic with shell globing) in the list of parameters, which is handy to list the s/globing/globbing/ available options. Unfortunately, this isn't built in QemuOpts. qemu_opts_parse_noisily()

[Qemu-devel] [PATCH v2 2/4] ui/vnc.c: polish vnc_init_func

2018-09-07 Thread Fei Li
Add a new Error parameter for vnc_display_init() to handle errors in its caller: vnc_init_func(), just like vnc_display_open() does. And let the call trace propagate the Error. Besides, make vnc_start_worker_thread() return a bool to indicate whether it succeeds instead of returning nothing.

[Qemu-devel] [PATCH v2 3/4] qemu_init_vcpu: add a new Error parameter to propagate

2018-09-07 Thread Fei Li
The caller of qemu_init_vcpu() already passed the **errp to handle errors. In view of this, add a new Error parameter to the following call trace to propagate the error and let the further caller check it. Besides, make qemu_init_vcpu() return a Boolean value to let its callers know whether it

[Qemu-devel] [PATCH v2 0/4] qemu_thread_create: propagate errors to callers to check

2018-09-07 Thread Fei Li
Hi, This idea comes from BiteSizedTasks, and this patch series implement the error checking of qemu_thread_create: make qemu_thread_create return a flag to indicate if it succeeded rather than failing with an error; make all callers check it. The first three patches apply to those call traces

[Qemu-devel] [PATCH v2 1/4] Fix segmentation fault when qemu_signal_init fails

2018-09-07 Thread Fei Li
Currently, when qemu_signal_init() fails it only returns a non-zero value but without propagating any Error. But its callers need a non-null err when runs error_report_err(err), or else 0->msg occurs. To avoid such segmentation fault, add a new Error parameter to make the call trace to propagate

Re: [Qemu-devel] [RFC PATCH v2 4/7] tcg: add instrumenting module

2018-09-07 Thread Alex Bennée
Pavel Dovgalyuk writes: > From: Pavel Dovgalyuk > > This is a samples of the instrumenting interface and implementation > of some instruction tracing tasks. > > Signed-off-by: Pavel Dovgalyuk > --- > accel/tcg/translator.c|5 + > include/qemu/instrument.h |7 +++ >

[Qemu-devel] [PATCH] target/ppc/cpu-models: Re-group the 970 CPUs together again

2018-09-07 Thread Thomas Huth
The addition of the POWER9 CPUs divided the entries for the 970 CPUs, which is a little bit confusing when you look at the code. So let's re-group the 970 CPUs together again, and since these chips have been based on the POWER4 processor, move them also in front of the POWER5 chips now.

Re: [Qemu-devel] [PATCH v4 00/29] vhost-user for input & GPU

2018-09-07 Thread Marc-André Lureau
Hi On Wed, Aug 29, 2018 at 4:00 PM Marc-André Lureau wrote: > > Hi > > On Wed, Aug 29, 2018 at 11:50 AM, Daniel P. Berrangé > wrote: > > On Fri, Jul 13, 2018 at 03:08:47PM +0200, Marc-André Lureau wrote: > >> Hi, > >> > >> vhost-user allows to drive a virtio device in a seperate > >> process.

Re: [Qemu-devel] [PATCH v2 3/3] scsi: remove unused lsi53c895a_create() and lsi53c810_create() functions

2018-09-07 Thread Thomas Huth
On 2018-09-07 14:56, Mark Cave-Ayland wrote: > Now that these functions are no longer required they can be removed. > > Signed-off-by: Mark Cave-Ayland > --- > hw/scsi/lsi53c895a.c | 14 -- > include/hw/pci/pci.h | 2 -- > 2 files changed, 16 deletions(-) Reviewed-by: Thomas Huth

  1   2   >