Re: [Qemu-devel] [Qemu-arm] [PATCH 09/15] target/arm: Don't store M profile PRIMASK and FAULTMASK in daif

2017-08-04 Thread Edgar E. Iglesias
On Thu, Aug 03, 2017 at 03:05:17PM -0700, Richard Henderson wrote: > On 08/03/2017 08:38 AM, Edgar E. Iglesias wrote: > >> +uint32_t primask; > >> +uint32_t faultmask; > > It seems like these could be booleans? > > I was thinking the same thing until I read the v8m description as

Re: [Qemu-devel] [Qemu-arm] [PATCH 8/8] target/arm: Implement new do_transaction_failed hook

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:49PM +0100, Peter Maydell wrote: > Implement the new do_transaction_failed hook for ARM, which should > cause the CPU to take a prefetch abort or data abort. > > Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias

Re: [Qemu-devel] [Qemu-arm] [PATCH 7/8] target/arm: Allow deliver_fault() caller to specify EA bit

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:48PM +0100, Peter Maydell wrote: > For external aborts, we will want to be able to specify the EA > (external abort type) bit in the syndrome field. Allow callers of > deliver_fault() to do that by adding a field to ARMMMUFaultInfo which > we use when constructing

Re: [Qemu-devel] [Qemu-arm] [PATCH 6/8] target/arm: Factor out fault delivery code

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:47PM +0100, Peter Maydell wrote: > We currently have some similar code in tlb_fill() and in > arm_cpu_do_unaligned_access() for delivering a data abort or prefetch > abort. We're also going to want to do the same thing to handle > external aborts. Factor out the

Re: [Qemu-devel] [Qemu-arm] [PATCH 5/8] hw/arm: Set ignore_memory_transaction_failures for most ARM boards

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:46PM +0100, Peter Maydell wrote: > Set the MachineClass flag ignore_memory_transaction_failures > for almost all ARM boards. This means they retain the legacy > behaviour that accesses to unimplemented addresses will RAZ/WI > rather than aborting, when a subsequent

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:45PM +0100, Peter Maydell wrote: > Define a new MachineClass field ignore_memory_transaction_failures. > If this is flag is true then the CPU will ignore memory transaction > failures which should cause the CPU to take an exception due to an > access to an unassigned

Re: [Qemu-devel] [Qemu-arm] [PATCH 3/8] cputlb: Support generating CPU exceptions on memory transaction failures

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:44PM +0100, Peter Maydell wrote: > Call the new cpu_transaction_failed() hook at the places where > CPU generated code interacts with the memory system: > io_readx() > io_writex() > get_page_addr_code() > > Any access from C code (eg via cpu_physical_memory_rw(),

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:43PM +0100, Peter Maydell wrote: > Currently we have a rather half-baked setup for allowing CPUs to > generate exceptions on accesses to invalid memory: the CPU has a > cpu_unassigned_access() hook which the memory system calls in > unassigned_mem_write() and

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:43PM +0100, Peter Maydell wrote: > Currently we have a rather half-baked setup for allowing CPUs to > generate exceptions on accesses to invalid memory: the CPU has a > cpu_unassigned_access() hook which the memory system calls in > unassigned_mem_write() and

Re: [Qemu-devel] [Qemu-arm] [PATCH 1/8] memory.h: Move MemTxResult type to memattrs.h

2017-08-04 Thread Edgar E. Iglesias
On Fri, Aug 04, 2017 at 06:20:42PM +0100, Peter Maydell wrote: > Move the MemTxResult type to memattrs.h. We're going to want to > use it in cpu/qom.h, which doesn't want to include all of > memory.h. In practice MemTxResult and MemTxAttrs are pretty > closely linked since both are used for the

[Qemu-devel] [PATCH for-2.11 2/5] qmp-shell: Pass split cmdargs to __build_cmd()

2017-08-04 Thread Eduardo Habkost
This will allow us to implement a method to run a command that is already split in a list. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell

[Qemu-devel] [PATCH for-2.11 1/5] qmp-shell: Use argparse module

2017-08-04 Thread Eduardo Habkost
It makes command-line parsing and generation of help text much simpler. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 61 +-- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/scripts/qmp/qmp-shell

[Qemu-devel] [PATCH for-2.11 0/5] qmp-shell non-interactive mode, delete scripts/qmp/qmp

2017-08-04 Thread Eduardo Habkost
This series adds the ability to run QMP commands non-interactively to qmp-shell, and deletes scripts/qmp/qmp. Eduardo Habkost (5): qmp-shell: Use argparse module qmp-shell: Pass split cmdargs to __build_cmd() qmp-shell: execute_cmdargs() method qmp-shell: Accept QMP command as argument

[Qemu-devel] [PATCH for-2.11 5/5] Remove scripts/qmp/qmp

2017-08-04 Thread Eduardo Habkost
The only purpose of scripts/qmp/qmp was the ability to run QMP commands non-interactively. Now it is possible to run qmp-shell non-interactively by providing a QMP command a command-line argument, making scripts/qmp/qmp obsolete. Signed-off-by: Eduardo Habkost ---

[Qemu-devel] [PATCH for-2.11 4/5] qmp-shell: Accept QMP command as argument

2017-08-04 Thread Eduardo Habkost
This is useful for testing QMP commands in scripts. Example usage, combined with 'jq' for filtering the results: $ ./scripts/qmp/qmp-shell /tmp/qmp qom-list path=/ | jq -r .return[].name machine type chardevs backend $ Signed-off-by: Eduardo Habkost ---

[Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method

2017-08-04 Thread Eduardo Habkost
This will allow us to execute a command that was already split in a list. Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp-shell | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell index 5fe6162..6113aaf

Re: [Qemu-devel] [PATCH v3 2/3] pci: add QEMU-specific PCI capability structure

2017-08-04 Thread Alexander Bezzubikov
2017-08-04 23:28 GMT+03:00 Laszlo Ersek : > On 08/04/17 20:59, Alexander Bezzubikov wrote: >> 2017-08-01 20:28 GMT+03:00 Alexander Bezzubikov : >>> 2017-08-01 16:38 GMT+03:00 Marcel Apfelbaum : On 31/07/2017 22:01, Alexander Bezzubikov

Re: [Qemu-devel] [PATCH v3 2/3] pci: add QEMU-specific PCI capability structure

2017-08-04 Thread Laszlo Ersek
On 08/04/17 20:59, Alexander Bezzubikov wrote: > 2017-08-01 20:28 GMT+03:00 Alexander Bezzubikov : >> 2017-08-01 16:38 GMT+03:00 Marcel Apfelbaum : >>> On 31/07/2017 22:01, Alexander Bezzubikov wrote: 2017-07-31 21:57 GMT+03:00 Michael S. Tsirkin

Re: [Qemu-devel] [PATCH 8/8] target/arm: Implement new do_transaction_failed hook

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > Implement the new do_transaction_failed hook for ARM, which should > cause the CPU to take a prefetch abort or data abort. > > Signed-off-by: Peter Maydell > --- > target/arm/internals.h | 10 ++ > target/arm/cpu.c

Re: [Qemu-devel] [PATCH 7/8] target/arm: Allow deliver_fault() caller to specify EA bit

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > For external aborts, we will want to be able to specify the EA > (external abort type) bit in the syndrome field. Allow callers of > deliver_fault() to do that by adding a field to ARMMMUFaultInfo which > we use when constructing the syndrome values.

Re: [Qemu-devel] [PATCH 6/8] target/arm: Factor out fault delivery code

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > +if (fsc == 0x3f) { > +/* Caller doesn't have a long-format fault status code. This > + * should only happen if this fault will never actually be reported > + * to an EL that uses a syndrome register. Check that here. > +

Re: [Qemu-devel] [PATCH v4 08/15] qcow2: set inactive flag

2017-08-04 Thread Eric Blake
On 08/01/2017 09:19 AM, Anton Nefedov wrote: > Qcow2State and BlockDriverState flags have to be in sync > > Signed-off-by: Anton Nefedov > --- > block/qcow2.c | 1 + > 1 file changed, 1 insertion(+) Is this a bug fix needed for 2.10? > > diff --git

Re: [Qemu-devel] [PATCH v4 03/15] block: introduce BDRV_REQ_ALLOCATE flag

2017-08-04 Thread Eric Blake
On 08/01/2017 09:19 AM, Anton Nefedov wrote: > The flag is supposed to indicate that the region of the disk image has > to be sufficiently allocated so it reads as zeroes. The call with the flag > set has to return -ENOTSUP if allocation cannot be done efficiently > (i.e. without falling back to

Re: [Qemu-devel] [PATCH 3/3] parallels: drop check that bdrv_truncate() is working

2017-08-04 Thread Denis V. Lunev
On 08/04/2017 10:32 PM, Eric Blake wrote: > On 08/04/2017 10:10 AM, Denis V. Lunev wrote: >> This would be actually strange and error prone. If truncate() nowadays >> will fail, there is something fatally wrong. Let's check for that during >> the actual work. >> >> The only fallback case is when

Re: [Qemu-devel] [PATCH 3/3] parallels: drop check that bdrv_truncate() is working

2017-08-04 Thread Eric Blake
On 08/04/2017 10:10 AM, Denis V. Lunev wrote: > This would be actually strange and error prone. If truncate() nowadays > will fail, there is something fatally wrong. Let's check for that during > the actual work. > > The only fallback case is when the file is not zero initialized. In this > case

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Richard Henderson
On 08/04/2017 11:09 AM, Philippe Mathieu-Daudé wrote: > Since create_unimplemented_device() register overlapped with low priority, why > not register it as default device directly, over the whole address space? That's a good suggestion. It makes more sense to me than adding a flag on the

Re: [Qemu-devel] [PATCH 2/3] parallels: respect error code of bdrv_getlength() in allocate_clusters()

2017-08-04 Thread Eric Blake
On 08/04/2017 10:10 AM, Denis V. Lunev wrote: > If we can not get the file length, the state of BDS is broken completely. > Return error to the caller. > > Signed-off-by: Denis V. Lunev > CC: Markus Armbruster > CC: Kevin Wolf > CC: Max

Re: [Qemu-devel] [PATCH 1/3] block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes

2017-08-04 Thread Eric Blake
On 08/04/2017 10:10 AM, Denis V. Lunev wrote: > Original idea beyond the code in question was the following: we have failed > to write zeroes with fallocate(FALLOC_FL_ZERO_RANGE) as the simplest > approach and via fallocate(FALLOC_FL_PUNCH_HOLE)/fallocate(0). We have the > only chance now: if the

Re: [Qemu-devel] [PATCH] block: drop bdrv_set_key from BlockDriver

2017-08-04 Thread Eric Blake
On 08/04/2017 10:26 AM, Paolo Bonzini wrote: > This is not used anymore since c01c214b69 ("block: remove all encryption > handling APIs", 2017-07-11). > > Signed-off-by: Paolo Bonzini > --- > include/block/block_int.h | 1 - > 1 file changed, 1 deletion(-) Reviewed-by:

Re: [Qemu-devel] [PATCH v3 2/3] pci: add QEMU-specific PCI capability structure

2017-08-04 Thread Alexander Bezzubikov
2017-08-01 20:28 GMT+03:00 Alexander Bezzubikov : > 2017-08-01 16:38 GMT+03:00 Marcel Apfelbaum : >> On 31/07/2017 22:01, Alexander Bezzubikov wrote: >>> >>> 2017-07-31 21:57 GMT+03:00 Michael S. Tsirkin : On Mon, Jul 31, 2017 at

Re: [Qemu-devel] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > Currently we have a rather half-baked setup for allowing CPUs to > generate exceptions on accesses to invalid memory: the CPU has a > cpu_unassigned_access() hook which the memory system calls in > unassigned_mem_write() and unassigned_mem_read() if

Re: [Qemu-devel] [PATCH v8 0/5] hypertrace: Lightweight guest-to-QEMU trace channel

2017-08-04 Thread Lluís Vilanova
Stefan Hajnoczi writes: > On Sun, Jul 30, 2017 at 05:08:18PM +0300, Lluís Vilanova wrote: >> The hypertrace channel allows guest code to emit events in QEMU (the host) >> using >> its tracing infrastructure (see "docs/trace.txt"). This works in both >> 'system' >> and 'user' modes, is

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Philippe Mathieu-Daudé
On 08/04/2017 02:20 PM, Peter Maydell wrote: Define a new MachineClass field ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the

[Qemu-devel] [PATCH f0r 2.11] runstate/migrate: Two more transitions

2017-08-04 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" There's a race if someone does a 'stop' near the end of migrate; the migration process goes through two runstates: 'finish migrate' 'postmigrate' If the user issues a 'stop' between the two we end up with invalid state transitions. Add

Re: [Qemu-devel] Do we need a "virt-2.10" machine type before the 2.10 release?

2017-08-04 Thread Peter Maydell
On 4 August 2017 at 18:48, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: >> Hi; I noticed today that the virt board doesn't have a virt-2.10 >> machine type defined. Do we need to add it before release? >> >> (I don't know if there have in

Re: [Qemu-devel] [PATCH v8 1/5] hypertrace: Add documentation

2017-08-04 Thread Eric Blake
On 07/30/2017 09:12 AM, Lluís Vilanova wrote: > Signed-off-by: Lluís Vilanova > --- > docs/devel/tracing.txt |3 + > docs/hypertrace.txt| 225 > Do we want the new document directly in docs/, or does it live in one

Re: [Qemu-devel] Do we need a "virt-2.10" machine type before the 2.10 release?

2017-08-04 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > Hi; I noticed today that the virt board doesn't have a virt-2.10 > machine type defined. Do we need to add it before release? > > (I don't know if there have in fact been any changes between > 2.9 and 2.10 that would be compatibility issues.) I

Re: [Qemu-devel] [PATCH 1/8] memory.h: Move MemTxResult type to memattrs.h

2017-08-04 Thread Richard Henderson
On 08/04/2017 10:20 AM, Peter Maydell wrote: > Move the MemTxResult type to memattrs.h. We're going to want to > use it in cpu/qom.h, which doesn't want to include all of > memory.h. In practice MemTxResult and MemTxAttrs are pretty > closely linked since both are used for the new-style >

[Qemu-devel] Do we need a "virt-2.10" machine type before the 2.10 release?

2017-08-04 Thread Peter Maydell
Hi; I noticed today that the virt board doesn't have a virt-2.10 machine type defined. Do we need to add it before release? (I don't know if there have in fact been any changes between 2.9 and 2.10 that would be compatibility issues.) thanks -- PMM

[Qemu-devel] [PATCH 3/8] cputlb: Support generating CPU exceptions on memory transaction failures

2017-08-04 Thread Peter Maydell
Call the new cpu_transaction_failed() hook at the places where CPU generated code interacts with the memory system: io_readx() io_writex() get_page_addr_code() Any access from C code (eg via cpu_physical_memory_rw(), address_space_rw(), ld/st_*_phys()) will *not* trigger CPU exceptions via

[Qemu-devel] [PATCH 4/8] boards.h: Define new flag ignore_memory_transaction_failures

2017-08-04 Thread Peter Maydell
Define a new MachineClass field ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the transaction will instead return zero (for a read)

[Qemu-devel] [PATCH 5/8] hw/arm: Set ignore_memory_transaction_failures for most ARM boards

2017-08-04 Thread Peter Maydell
Set the MachineClass flag ignore_memory_transaction_failures for almost all ARM boards. This means they retain the legacy behaviour that accesses to unimplemented addresses will RAZ/WI rather than aborting, when a subsequent commit adds support for external aborts. The exceptions are: * virt --

[Qemu-devel] [PATCH 2/8] cpu: Define new cpu_transaction_failed() hook

2017-08-04 Thread Peter Maydell
Currently we have a rather half-baked setup for allowing CPUs to generate exceptions on accesses to invalid memory: the CPU has a cpu_unassigned_access() hook which the memory system calls in unassigned_mem_write() and unassigned_mem_read() if the current_cpu pointer is non-NULL. This was

[Qemu-devel] [PATCH 1/8] memory.h: Move MemTxResult type to memattrs.h

2017-08-04 Thread Peter Maydell
Move the MemTxResult type to memattrs.h. We're going to want to use it in cpu/qom.h, which doesn't want to include all of memory.h. In practice MemTxResult and MemTxAttrs are pretty closely linked since both are used for the new-style read_with_attrs and write_with_attrs callbacks, so memattrs.h

[Qemu-devel] [PATCH 6/8] target/arm: Factor out fault delivery code

2017-08-04 Thread Peter Maydell
We currently have some similar code in tlb_fill() and in arm_cpu_do_unaligned_access() for delivering a data abort or prefetch abort. We're also going to want to do the same thing to handle external aborts. Factor out the common code into a new function deliver_fault(). Signed-off-by: Peter

[Qemu-devel] [PATCH 8/8] target/arm: Implement new do_transaction_failed hook

2017-08-04 Thread Peter Maydell
Implement the new do_transaction_failed hook for ARM, which should cause the CPU to take a prefetch abort or data abort. Signed-off-by: Peter Maydell --- target/arm/internals.h | 10 ++ target/arm/cpu.c | 1 + target/arm/op_helper.c | 43

[Qemu-devel] [PATCH 7/8] target/arm: Allow deliver_fault() caller to specify EA bit

2017-08-04 Thread Peter Maydell
For external aborts, we will want to be able to specify the EA (external abort type) bit in the syndrome field. Allow callers of deliver_fault() to do that by adding a field to ARMMMUFaultInfo which we use when constructing the syndrome values. Signed-off-by: Peter Maydell

[Qemu-devel] [PATCH 0/8] Implement ARM external abort handling

2017-08-04 Thread Peter Maydell
Following recent list discussion https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg00063.html here's a patchseries which defines a new API for handling CPU memory transaction failures at the right level in the memory subsystem code, and implements it for ARM so that we can generate

Re: [Qemu-devel] [PATCH 1/2] rcu: completely disable pthread_atfork callbacks as soon as possible

2017-08-04 Thread Dr. David Alan Gilbert
* Paolo Bonzini (pbonz...@redhat.com) wrote: > Because of -daemonize, system mode QEMU sometimes needs to fork() and > keep RCU enabled in the child. However, there is a possible deadlock > with synchronize_rcu: > > - the CPU thread is inside a RCU critical section and wants to take > the BQL

Re: [Qemu-devel] [PATCH for-2.11 22/23] tcg/ppc: Look for shifted constants

2017-08-04 Thread Richard Henderson
On 08/04/2017 09:39 AM, Philippe Mathieu-Daudé wrote: >> @@ -638,6 +639,14 @@ static void tcg_out_movi_int(TCGContext *s, TCGType >> type, TCGReg ret, >> return; >> } >> +lsb = ctz64(arg); >> +high = arg >> lsb; >> +if (arg == (int16_t)arg) { > > Can you move these

Re: [Qemu-devel] [PATCH] kvm: workaround build break on gcc-7.1.1 / fedora26

2017-08-04 Thread Paolo Bonzini
On 03/08/2017 16:24, Cornelia Huck wrote: > On Thu, 3 Aug 2017 09:10:29 -0500 > Eric Blake wrote: > >> On 08/03/2017 08:46 AM, Philippe Mathieu-Daudé wrote: >>> Hi Greg, >>> >>> On 08/02/2017 11:47 AM, Greg Kurz wrote: Building QEMU on fedora26 with the latest gcc

Re: [Qemu-devel] [PATCH v2 6/6] dev-storage: Fix the unusual function name

2017-08-04 Thread Philippe Mathieu-Daudé
On 08/04/2017 07:26 AM, Mao Zhongyi wrote: The function name of usb_msd_{realize,unrealize}_*, usb_msd_class_initfn_* are unusual. Rename it to usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn. Cc: Gerd Hoffmann Signed-off-by: Mao Zhongyi

Re: [Qemu-devel] [Bug 1708551] Re: macOS Guest Reading USB 3.0 Bus as USB 2.0

2017-08-04 Thread Divine E
Removing the `bus=usb-bus.0` param from everything, [as shown here](https://pastebin.com/x0Cp70XD), boots fine; but completely breaks mouse functionality. To mitigate, i tried passing through a Logitech mousepad I own--in similar fashion to the iPhone; but Host complained about permissions &

[Qemu-devel] [Bug 1352179] Re: could not open disk image

2017-08-04 Thread Thomas Huth
Triaging old bug tickets ... can you still reproduce this problem with the latest release of QEMU? how did you create the disk image? ** Changed in: qemu Status: New => Incomplete -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to

[Qemu-devel] [PATCH 1/2] rcu: completely disable pthread_atfork callbacks as soon as possible

2017-08-04 Thread Paolo Bonzini
Because of -daemonize, system mode QEMU sometimes needs to fork() and keep RCU enabled in the child. However, there is a possible deadlock with synchronize_rcu: - the CPU thread is inside a RCU critical section and wants to take the BQL in order to do MMIO - the monitor thread, which is

Re: [Qemu-devel] [PATCH for-2.11 22/23] tcg/ppc: Look for shifted constants

2017-08-04 Thread Philippe Mathieu-Daudé
Hi Richard, On 08/04/2017 02:44 AM, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.inc.c | 9 + 1 file changed, 9 insertions(+) diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index bc14d2c9c6..4b32809217 100644

Re: [Qemu-devel] [PATCH 05/17] block/nbd-client: get rid of ssize_t

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 06:14:28PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Use int variable for nbd_co_send_request return value (as > nbd_co_send_request returns int). Hmm, nbd_co_send_request() propagates return value of nbd_send_request, which returns ssize_t. IOW, I think we need to fix

[Qemu-devel] [PATCH 2/2] Revert "rcu: do not create thread in pthread_atfork callback"

2017-08-04 Thread Paolo Bonzini
This reverts commit a59629fcc6f603e19b516dc08f75334e5c480bd0. This is not needed anymore because the IOThread mutex is not "magic" anymore (need not kick the CPU thread) and also because fork callbacks are only enabled at the very beginning of QEMU's execution. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH for-2.10 0/2] RCU: forking fix and cleanups

2017-08-04 Thread Paolo Bonzini
The first patch fixes a migration deadlock. The second reverts a now-unnecessary hack (introduced to support the pre-MTTCG "kick the CPU thread" special behavior of qemu_mutex_lock_iothread). Paolo Paolo Bonzini (2): rcu: completely disable pthread_atfork callbacks as soon as possible

Re: [Qemu-devel] [Qemu-block] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 10:41:54AM -0500, Eric Blake wrote: > On 08/04/2017 09:06 AM, Daniel P. Berrange wrote: > > On Fri, Aug 04, 2017 at 04:02:10PM +0200, Kevin Wolf wrote: > >> Am 04.08.2017 um 12:50 hat Daniel P. Berrange geschrieben: > >>> Signed-off-by: Daniel P. Berrange

Re: [Qemu-devel] [Qemu-block] [PATCH] block/null: Remove 'filename' option

2017-08-04 Thread Jeff Cody
On Fri, Aug 04, 2017 at 04:43:54PM +0200, Kevin Wolf wrote: > This option was only added to allow 'null-co://' and 'null-aio://' as > filenames, its value never served any actual purpose and was ignored. > Nevertheless it was accepted as '-drive driver=null,filename=foo'. > > The correct way to

Re: [Qemu-devel] [PATCH for-2.10] vmdk: Fix error handling/reporting of vmdk_check

2017-08-04 Thread Eric Blake
On 08/04/2017 09:09 AM, Fam Zheng wrote: > Errors from the callees must be captured and propagated to our caller, > ensure this for both find_extent() and bdrv_getlength(). > > Reported-by: Markus Armbruster > Signed-off-by: Fam Zheng > --- > block/vmdk.c |

Re: [Qemu-devel] [PATCH for-2.10] quorum: Handle bdrv_getlength() failures in quorum_co_flush()

2017-08-04 Thread Eric Blake
On 08/04/2017 09:08 AM, Alberto Garcia wrote: > A bdrv_getlength() call can fail and return a negative value. This > is not being handled in quorum_co_flush(), which can result in a > QUORUM_REPORT_BAD event with an arbitrary value on the 'sectors-count' > field. > > Reported-by: Markus

Re: [Qemu-devel] Is blk_getlength() in find_image_format() and img_map() kosher?

2017-08-04 Thread Eric Blake
On 08/04/2017 08:55 AM, Markus Armbruster wrote: > Have a look at find_image_format(): > > if (blk_is_sg(file) || !blk_is_inserted(file) || blk_getlength(file) == > 0) { > *pdrv = _raw; > return ret; > } > > blk_getlength() can fail. Shouldn't we error out then? > > We

Re: [Qemu-devel] [PATCH v4 14/15] iotest 190: test BDRV_REQ_ALLOCATE

2017-08-04 Thread Eric Blake
On 08/01/2017 09:19 AM, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > --- > tests/qemu-iotests/190 | 146 > + > tests/qemu-iotests/190.out | 50 > tests/qemu-iotests/group | 1 + > 3 files

Re: [Qemu-devel] [PATCH v4 02/15] blkverify: set supported write/zero flags

2017-08-04 Thread Eric Blake
On 08/01/2017 09:18 AM, Anton Nefedov wrote: > Signed-off-by: Anton Nefedov > --- > block/blkverify.c | 9 + > 1 file changed, 9 insertions(+) Basically, blkverify supports a flag if BOTH of its underlying files also support the flag; if either side can't

Re: [Qemu-devel] [PATCH v8 0/5] hypertrace: Lightweight guest-to-QEMU trace channel

2017-08-04 Thread Stefan Hajnoczi
On Sun, Jul 30, 2017 at 05:08:18PM +0300, Lluís Vilanova wrote: > The hypertrace channel allows guest code to emit events in QEMU (the host) > using > its tracing infrastructure (see "docs/trace.txt"). This works in both 'system' > and 'user' modes, is architecture-agnostic and introduces minimal

Re: [Qemu-devel] [PATCH v3] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 09:28:54AM -0500, Eric Blake wrote: > On 08/04/2017 09:08 AM, Daniel P. Berrange wrote: > > Signed-off-by: Daniel P. Berrange > > --- > > > > - Clarify that @bytes matches @qiov total size (Kevin) > > > > include/block/block_int.h | 31

[Qemu-devel] [PATCH 02/17] nbd/client: refactor nbd_read_eof

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Refactor nbd_read_eof to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/nbd-internal.h | 34

[Qemu-devel] [PATCH 00/17] nbd client refactoring and fixing

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
A bit more refactoring and fixing before BLOCK_STATUS series. I've tried to make individual patches simple enough, so there are a lot of them. Vladimir Sementsov-Ogievskiy (17): nbd/client: fix nbd_opt_go nbd/client: refactor nbd_read_eof nbd/client: refactor nbd_receive_reply nbd/client:

Re: [Qemu-devel] [Qemu-block] [PATCH v2] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Jeff Cody
On Fri, Aug 04, 2017 at 10:36:58PM +0800, Fam Zheng wrote: > It's not too surprising when a user specifies the backing file relative > to the current working directory instead of the top layer image. This > causes error when they differ. Though the error message has enough > information to infer

[Qemu-devel] [PATCH 07/17] block/nbd-client: refactor request send/receive

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move nbd_co_receive_reply and nbd_coroutine_end calls into nbd_co_send_request and rename the latter to just nbd_co_request. This removes code duplications in nbd_client_co_{pwrite,pread,...} functions. Also this is needed for further refactoring. Signed-off-by: Vladimir Sementsov-Ogievskiy

[Qemu-devel] [PATCH 15/17] block/nbd-client: refactor reading reply

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Read the whole reply in one place - in nbd_read_reply_entry. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.h | 1 + block/nbd-client.c | 27 +-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git

[Qemu-devel] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Set reply.handle to 0 on error path to prevent normal path of nbd_co_receive_reply. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/nbd-client.c b/block/nbd-client.c index

[Qemu-devel] [PATCH 13/17] block/nbd-client: refactor NBDClientSession.recv_coroutine

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move from recv_coroutine[i] to requests[i].co. This is needed for further refactoring, new fields will be added to created structure. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.h | 4 +++- block/nbd-client.c | 20 ++-- 2 files

[Qemu-devel] [PATCH 01/17] nbd/client: fix nbd_opt_go

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Do not send NBD_OPT_ABORT to the broken server. After sending NBD_REP_ACK on NBD_OPT_GO server is most probably in transmission phase, when option sending is finished. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/client.c | 2 -- 1 file changed, 2 deletions(-)

[Qemu-devel] [PATCH 09/17] block/nbd-client: move nbd_co_receive_reply content into nbd_co_request

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Move code from nbd_co_receive_reply into nbd_co_request. This simplify things, makes further refactoring possible. Also, a function starting with qemu_coroutine_yield is weird. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 33

[Qemu-devel] [PATCH 08/17] block/nbd-client: rename nbd_recv_coroutines_enter_all

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Rename nbd_recv_coroutines_enter_all to nbd_recv_coroutines_wake_all, as it most probably just add all recv coroutines into co_queue_wakeup, not directly enter them. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 4 ++-- 1 file changed, 2

[Qemu-devel] [PATCH 12/17] block/nbd-client: refactor nbd_co_request

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Reduce nesting, get rid of extra variable. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index

[Qemu-devel] [PATCH 14/17] block/nbd-client: exit reply-reading coroutine on incorrect handle

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Check reply-handle == request-handle in the same place, where recv coroutine number is calculated from reply->handle and it's correctness checked - in nbd_read_reply_entry. Also finish nbd_read_reply_entry in case of reply-handle != request-handle in the same way as in case of incorrect

[Qemu-devel] [PATCH 03/17] nbd/client: refactor nbd_receive_reply

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Refactor nbd_receive_reply to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 2 +- nbd/client.c| 12

Re: [Qemu-devel] [Qemu-block] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-04 Thread Eric Blake
On 08/04/2017 09:06 AM, Daniel P. Berrange wrote: > On Fri, Aug 04, 2017 at 04:02:10PM +0200, Kevin Wolf wrote: >> Am 04.08.2017 um 12:50 hat Daniel P. Berrange geschrieben: >>> Signed-off-by: Daniel P. Berrange >>> --- >> Really? We are asserting that they match in

Re: [Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with Clover EFI bootloader

2017-08-04 Thread Igor Mammedov
On Fri, 4 Aug 2017 16:17:07 +0530 Dhiru Kholia wrote: > On Fri, Aug 4, 2017 at 2:35 PM, Igor Mammedov wrote: > > On Fri, 4 Aug 2017 12:15:40 +0530 > > Dhiru Kholia wrote: > > > >> This was tested with macOS 10.12.5 and

[Qemu-devel] [PATCH 11/17] block/nbd-client: fix nbd_co_request: set s->reply.handle to 0 on error

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
We set s->reply.handle to 0 on one error path and don't set on another. For consistancy and to avoid assert in nbd_read_reply_entry let's set s->reply.handle to 0 in case of wrong handle too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 6 +++---

[Qemu-devel] [PATCH 05/17] block/nbd-client: get rid of ssize_t

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Use int variable for nbd_co_send_request return value (as nbd_co_send_request returns int). Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/nbd-client.c

[Qemu-devel] [Bug 1708551] Re: macOS Guest Reading USB 3.0 Bus as USB 2.0

2017-08-04 Thread Thomas Huth
Then simply omit the "bus=usb-bus.0" here - the devices then should be put onto the XHCI bus automatically. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1708551 Title: macOS Guest Reading USB 3.0

[Qemu-devel] [PATCH 3/3] parallels: drop check that bdrv_truncate() is working

2017-08-04 Thread Denis V. Lunev
This would be actually strange and error prone. If truncate() nowadays will fail, there is something fatally wrong. Let's check for that during the actual work. The only fallback case is when the file is not zero initialized. In this case we should switch to preallocation via fallocate().

[Qemu-devel] [PATCH 2/3] parallels: respect error code of bdrv_getlength() in allocate_clusters()

2017-08-04 Thread Denis V. Lunev
If we can not get the file length, the state of BDS is broken completely. Return error to the caller. Signed-off-by: Denis V. Lunev CC: Markus Armbruster CC: Kevin Wolf CC: Max Reitz CC: Stefan Hajnoczi

[Qemu-devel] [PATCH] block: drop bdrv_set_key from BlockDriver

2017-08-04 Thread Paolo Bonzini
This is not used anymore since c01c214b69 ("block: remove all encryption handling APIs", 2017-07-11). Signed-off-by: Paolo Bonzini --- include/block/block_int.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index

[Qemu-devel] QAPI design mistake: RockerPort member @speed shoud bi

2017-08-04 Thread Markus Armbruster
RockerPort member @speed is documented to be "in Mbps" (presumably Megabits/second). It uses QAPI type 'uint32'. This is inappropriate for QAPI/QMP. It should have been made plain bits/second (no multiple), and maybe 'uint64'. As far as I can tell, the QAPI part didn't get review from QAPI

[Qemu-devel] [PATCH 1/3] block: respect error code from bdrv_getlength in handle_aiocb_write_zeroes

2017-08-04 Thread Denis V. Lunev
Original idea beyond the code in question was the following: we have failed to write zeroes with fallocate(FALLOC_FL_ZERO_RANGE) as the simplest approach and via fallocate(FALLOC_FL_PUNCH_HOLE)/fallocate(0). We have the only chance now: if the request comes beyond end of the file. Thus we should

Re: [Qemu-devel] [PATCH v4 0/9] s390x: zPCI detangling

2017-08-04 Thread Cornelia Huck
On Fri, 4 Aug 2017 13:29:37 +0200 Cornelia Huck wrote: > Next version, not so many changes from v3. > > As you might have guessed, the goals are still the same: > - Being able to disable PCI support in a build completely. > - Properly fencing off PCI if the relevant facility

[Qemu-devel] [PATCH 16/17] block/nbd-client: drop reply field from NBDClientSession

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Drop 'reply' from NBDClientSession. It's usage is not very transparent: 1. it is used to deliver error to receiving coroutine, and receiving coroutine must save or handle it somehow and then zero out it in NBDClientSession. 2. it is used to inform receiving coroutines that

[Qemu-devel] [PATCH 0/3] respect bdrv_getlength() error code

2017-08-04 Thread Denis V. Lunev
These cases were reported by Markus Armbruster Patches add error checking of the bdrv_getlength() call or remove the call of that function. Signed-off-by: Denis V. Lunev CC: Markus Armbruster CC: Kevin Wolf CC: Max Reitz

[Qemu-devel] [PATCH 04/17] nbd/client: fix nbd_send_request to return int

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Fix nbd_send_request to return int, as it returns a return value of nbd_write (which is int), and the only user of nbd_send_request's return value (nbd_co_send_request) consider it as int too. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 2 +-

Re: [Qemu-devel] [Qemu-block] [PATCH] block/null: Remove 'filename' option

2017-08-04 Thread Eric Blake
On 08/04/2017 09:43 AM, Kevin Wolf wrote: > This option was only added to allow 'null-co://' and 'null-aio://' as > filenames, its value never served any actual purpose and was ignored. > Nevertheless it was accepted as '-drive driver=null,filename=foo'. > > The correct way to enable the protocol

[Qemu-devel] [PATCH 17/17] block/nbd-client: always return EIO on and after the first io channel error

2017-08-04 Thread Vladimir Sementsov-Ogievskiy
Do not communicate after the first error to avoid communicating throught broken channel. The only exclusion is try to send NBD_CMD_DISC anyway on in nbd_client_close. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nbd-client.c | 26 -- 1

[Qemu-devel] [PATCH] pc/acpi: Fix booting of macOS with Clover EFI bootloader

2017-08-04 Thread Programmingkid
> On Aug 4, 2017, at 5:21 AM, qemu-devel-requ...@nongnu.org wrote: > > Message: 3 > Date: Fri, 4 Aug 2017 12:15:40 +0530 > From: > To: qemu-devel@nongnu.org > Cc: Igor Mammedov , Pankaj Gupta > , Dhiru Kholia > Subject:

Re: [Qemu-devel] [PATCH v4 00/22] Clean up around qmp() and hmp()

2017-08-04 Thread Fam Zheng
On Fri, 08/04 06:50, Eric Blake wrote: > On 08/03/2017 08:54 PM, no-re...@patchew.org wrote: > > Hi, > > > > This series failed automatic build test. Please find the testing commands > > and > > their output below. If you have docker installed, you can probably > > reproduce it > > locally. >

Re: [Qemu-devel] Is the use of bdrv_getlength() in handle_aiocb_write_zeroes() kosher?

2017-08-04 Thread Markus Armbruster
"Denis V. Lunev" writes: > On 08/04/2017 03:16 PM, Markus Armbruster wrote: >> Denis, you added this in commit d50d822: >> >> #ifdef CONFIG_FALLOCATE >> if (s->has_fallocate && aiocb->aio_offset >= bdrv_getlength(aiocb->bs)) { >> int ret = do_fallocate(s->fd, 0,

  1   2   3   >