[Qemu-devel] [RFC v3 1/3] util/qemu-error: Rename error_print_loc() to be more generic

2017-07-05 Thread Alistair Francis
Rename the error_print_loc() function in preparation for using it to print warnings as well. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- util/qemu-error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[Qemu-devel] [RFC PATCH 25/26] spapr: print the XIVE interrupt source for IPIs in the monitor

2017-07-05 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- hw/intc/xive_spapr.c | 5 + hw/ppc/spapr.c| 4 include/hw/ppc/xive.h | 1 + 3 files changed, 10 insertions(+) diff --git a/hw/intc/xive_spapr.c b/hw/intc/xive_spapr.c index eb8a5c081e51..4f689f8b97c0 100644 ---

[Qemu-devel] [RFC v3 0/3] Implement a warning_report function

2017-07-05 Thread Alistair Francis
QEMU currently has a standard method to report errors with error_repot(). This ensure a sane and standard format when printing errors. This series is attempting to extend this functionality for warnings and information as well. At the moment only one error is being converted, I wanted to get the

Re: [Qemu-devel] [PATCH v2 2/6] nbd/server: use errp instead of LOG

2017-07-05 Thread Markus Armbruster
Eric Blake writes: > On 06/21/2017 10:34 AM, Vladimir Sementsov-Ogievskiy wrote: >> Move to modern errp scheme from just LOGging errors. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy >> --- >> nbd/server.c | 268 >>

[Qemu-devel] [RFC PATCH 24/26] spapr: include the XIVE interrupt source for IPIs

2017-07-05 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- hw/intc/xive_spapr.c | 10 ++ hw/ppc/spapr.c| 11 ++- include/hw/ppc/xive.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hw/intc/xive_spapr.c b/hw/intc/xive_spapr.c index

[Qemu-devel] [RFC PATCH 23/26] spapr: add a XIVE object to the sPAPR machine

2017-07-05 Thread Cédric Le Goater
Let's create the XIVE object whether it used or not by the machine. CAS will decide which model will be used for the interrupt controller. Signed-off-by: Cédric Le Goater --- hw/ppc/spapr.c | 41 + 1 file changed, 41 insertions(+) diff

[Qemu-devel] [RFC PATCH 21/26] ppc/xive: introduce routines to allocate IRQ numbers

2017-07-05 Thread Cédric Le Goater
The IRQ number allocator is inspired by OPAL which allocates IPI IRQ numbers from the bottom of the IRQ number space and allocates the HW IRQ numbers from the top. So, this might be slightly overkill for our need. Needs to be discussed. Signed-off-by: Cédric Le Goater ---

[Qemu-devel] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XIVE interrupt source objects

2017-07-05 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- hw/intc/xive.c| 21 + include/hw/ppc/xive.h | 4 2 files changed, 25 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 895dd2b2f61b..bec123649ebd 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-05 Thread Alex Williamson
On Wed, 5 Jul 2017 13:42:03 +0100 Jean-Philippe Brucker wrote: > On 05/07/17 07:45, Tian, Kevin wrote: > >> From: Liu, Yi L > >> Sent: Monday, July 3, 2017 6:31 PM > >> > >> Hi Jean, > >> > >> > >>> > 2. Define a structure in

[Qemu-devel] [RFC PATCH 19/26] ppc/xive: introduce a helper to map the XIVE memory regions

2017-07-05 Thread Cédric Le Goater
It will be used when the guest chooses the XIVE exploitation mode in CAS. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c| 11 +++ include/hw/ppc/xive.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Eric Blake
On 07/05/2017 12:04 PM, Max Reitz wrote: > Or, well, yes, it is in this case, but I meant literally UINT64_MAX + 1, > not the uint64_t value. I meant the natural number 2^64. > > Because the issue is that (double)UINT64_MAX will (or may, depending on > the environment and such) give us 2.0^64 ==

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Eric Blake
On 07/05/2017 12:00 PM, Max Reitz wrote: >> (uint64_t)(UINT64_MAX + 1) is well-defined - it is 0. >> >> (Adding in unsigned integers is always well-defined - it wraps around on >> mathematical overflow modulo the integer size. You're thinking of >> overflow addition on signed integers, which is

[Qemu-devel] [RFC PATCH 26/26] spapr: force XIVE exploitation mode for POWER9 (HACK)

2017-07-05 Thread Cédric Le Goater
The CAS negotiation process determines the interrupt controller model to use in the guest but currently, the sPAPR machine make uses of the controller very early in the initialization sequence. The interrupt source is used to allocate IRQ numbers and populate the device tree and the interrupt

[Qemu-devel] [RFC PATCH 17/26] ppc/xive: add hcalls support

2017-07-05 Thread Cédric Le Goater
A set of Hypervisor's call are used to configure the interrupt sources and the event/notification queues of the guest: H_INT_GET_SOURCE_INFO H_INT_SET_SOURCE_CONFIG H_INT_GET_SOURCE_CONFIG H_INT_GET_QUEUE_INFO H_INT_SET_QUEUE_CONFIG H_INT_GET_QUEUE_CONFIG H_INT_RESET

[Qemu-devel] [RFC PATCH 22/26] ppc/xive: create an XIVE interrupt source to handle IPIs

2017-07-05 Thread Cédric Le Goater
Isolate the IPIs in their own interrupt source. This is not strictly needed for sPAPR, but it might useful for PowerNV. Signed-off-by: Cédric Le Goater --- hw/intc/xive-internal.h | 2 ++ hw/intc/xive.c | 24 +++- 2 files changed, 25 insertions(+),

[Qemu-devel] [RFC PATCH 15/26] ppc/xive: push EQ data in OS event queues

2017-07-05 Thread Cédric Le Goater
If a triggered event is let through, the event queue data defined in the associated IVE is pushed in the in-memory event queue of the OS. The latter is a memory ring buffer defined by the OS with H_INT_SET_QUEUE_CONFIG hcall. Then, an interrupt presenter is located and notified. See next patch.

Re: [Qemu-devel] [PATCH 1/1] s390x: fixup for "fix error propagation in kvm-flic..."

2017-07-05 Thread Halil Pasic
On 07/05/2017 06:27 PM, Christian Borntraeger wrote: > On 07/05/2017 05:29 PM, Cornelia Huck wrote: >> On Wed, 5 Jul 2017 15:54:07 +0200 >> Halil Pasic wrote: >> >>> My patch "s390x: fix error propagation in kvm-flic's realize" accidentally >>> replaced with. That's

[Qemu-devel] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model

2017-07-05 Thread Cédric Le Goater
The Thread Interrupt Management Area for the OS is mostly used to acknowledge interrupts and set the CPPR of the CPU. The TIMA is mapped at the same address for each CPU. 'current_cpu' is used to retrieve the targeted interrupt presenter object. Signed-off-by: Cédric Le Goater

[Qemu-devel] [RFC PATCH 18/26] ppc/xive: add device tree support

2017-07-05 Thread Cédric Le Goater
As for XICS, the XIVE interface for the guest is described in the device tree under the interrupt controller node. A couple of new properties are specific to XIVE : - "reg" contains the base address and size of the thread interrupt managnement areas (TIMA) for the user level for the OS

[Qemu-devel] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priority is more privileged

2017-07-05 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- hw/intc/xive.c | 21 + 1 file changed, 21 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index c3c1e9c9db2d..cda1fa18e44d 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -53,6 +53,21 @@ static uint64_t

[Qemu-devel] [RFC PATCH 11/26] ppc/xics: introduce a print_info() handler to the ICS and ICP objects

2017-07-05 Thread Cédric Le Goater
This handler will be used to customize the ouput of the XIVE interrupt source and presenter objects. Signed-off-by: Cédric Le Goater --- hw/intc/xics.c| 36 include/hw/ppc/xics.h | 2 ++ 2 files changed, 26 insertions(+), 12

[Qemu-devel] [RFC PATCH 13/26] ppc/xive: introduce a XIVE interrupt presenter model

2017-07-05 Thread Cédric Le Goater
Just like the interrupt source model, we try to reuse the ICP model because the sPAPR machine is tied to the XICSFabric interface and should be using a common framework to switch from one controller model to another: XICS <-> XIVE. The XIVE interrupt presenter exposes a set of Thread Interrupt

[Qemu-devel] [RFC PATCH 10/26] ppc/xive: record interrupt source MMIO address for hcalls

2017-07-05 Thread Cédric Le Goater
The address of the MMIO page through which the Event State Buffer is controlled is returned to the guest by the H_INT_GET_SOURCE_INFO hcall. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c| 3 +++ include/hw/ppc/xive.h | 1 + 2 files changed, 4 insertions(+) diff

[Qemu-devel] [RFC PATCH 08/26] ppc/xive: add flags to the XIVE interrupt source

2017-07-05 Thread Cédric Le Goater
These flags define some characteristics of the source : - XIVE_SRC_H_INT_ESB the Event State Buffer are controlled with a specific hcall H_INT_ESB - XIVE_SRC_LSILSI or MSI source - XIVE_SRC_TRIGGERthe full function page supports trigger - XIVE_SRC_STORE_EOI

[Qemu-devel] [RFC PATCH 12/26] ppc/xive: add a print_info() handler for the interrupt source

2017-07-05 Thread Cédric Le Goater
This is much like the default one but we expose the PQ bits also. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c | 20 1 file changed, 20 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 0db97fd33981..db808e0cbe3d 100644 ---

[Qemu-devel] [RFC PATCH 09/26] ppc/xive: add an overall memory region for the ESBs

2017-07-05 Thread Cédric Le Goater
Each source adds its own ESB mempry region to the overall ESB memory region of the controller. It will be mapped in the CPU address space when XIVE is activated. The default mapping address for the ESB memory region is the same one used on baremetal. Signed-off-by: Cédric Le Goater

[Qemu-devel] [RFC PATCH 03/26] target/ppc/POWER9: add POWERPC_EXCP_POWER9

2017-07-05 Thread Cédric Le Goater
Prepare ground for the new exception model XIVE of POWER9. Signed-off-by: Cédric Le Goater --- target/ppc/cpu-qom.h| 2 ++ target/ppc/excp_helper.c| 9 ++--- target/ppc/translate.c | 3 ++- target/ppc/translate_init.c | 2 +- 4 files changed, 11

[Qemu-devel] [RFC PATCH 07/26] ppc/xive: add MMIO handlers to the XIVE interrupt source

2017-07-05 Thread Cédric Le Goater
Each interrupt source is associated with a 2-bit state machine called an Event State Buffer (ESB). It is controlled by MMIO to trigger events. See code for more details on the states. Signed-off-by: Cédric Le Goater --- hw/intc/xive.c| 230

[Qemu-devel] [RFC PATCH 06/26] ppc/xive: introduce a XIVE interrupt source model

2017-07-05 Thread Cédric Le Goater
This is very similar to the current ICS_SIMPLE model in XICS. We try to reuse the ICS model because the sPAPR machine is tied to the XICSFabric interface and should be using a common framework to switch from one controller model to another: XICS <-> XIVE. The next patch will introduce the MMIO

[Qemu-devel] [RFC PATCH 04/26] ppc/xive: introduce a skeleton for the XIVE interrupt controller model

2017-07-05 Thread Cédric Le Goater
Let's provide an empty shell for the XIVE controller model with a couple of attributes for the IRQ number allocator. The latter is largely inspired by OPAL which allocates IPI IRQ numbers from the bottom of the IRQ number space and allocates the HW IRQ numbers from the top. The number of IPIs is

[Qemu-devel] [RFC PATCH 05/26] ppc/xive: define XIVE internal tables

2017-07-05 Thread Cédric Le Goater
The XIVE interrupt controller of the POWER9 uses a set of tables to redirect exception from event sources to CPU threads. Among which we choose to model : - the State Bit Entries (SBE), also known as Event State Buffer (ESB). This is a two bit state machine for each event source which is

[Qemu-devel] [RFC PATCH 02/26] spapr: populate device tree depending on XIVE_EXPLOIT option

2017-07-05 Thread Cédric Le Goater
When XIVE is supported, the device tree should be populated accordingly and the XIVE memory regions mapped to activate MMIOs. Depending on the design we choose, we could also allocate different ICS and ICP objects, or switch between objects. This needs to be discussed. Signed-off-by: Cédric Le

[Qemu-devel] [RFC PATCH 01/26] spapr: introduce the XIVE_EXPLOIT option in CAS

2017-07-05 Thread Cédric Le Goater
On POWER9, the Client Architecture Support (CAS) negotiation process determines whether the guest operates in XIVE Legacy compatibility (the former POWER8 interrupt model) or in XIVE exploitation mode (the newer POWER9 interrupt model). Bit 7 of Byte 23 of vector 5 is used for this purpose.

[Qemu-devel] [RFC PATCH 00/26] guest exploitation of the XIVE interrupt controller (POWER9)

2017-07-05 Thread Cédric Le Goater
On a POWER9 sPAPR machine, the Client Architecture Support (CAS) negotiation process determines whether the guest operates with an interrupt controller using the XICS legacy model, as found on POWER8, or in XIVE exploitation mode, the newer POWER9 interrupt model. This patchset is a first proposal

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Max Reitz
On 2017-07-05 19:00, Max Reitz wrote: > On 2017-07-05 18:29, Eric Blake wrote: >> On 07/05/2017 11:22 AM, Max Reitz wrote: >> >> return (double)x == x && x == y; > > Yes, that would do, too; and spares me of having to think about how well > comparing an arbitrary double to

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Max Reitz
On 2017-07-05 18:29, Eric Blake wrote: > On 07/05/2017 11:22 AM, Max Reitz wrote: > > return (double)x == x && x == y; Yes, that would do, too; and spares me of having to think about how well comparing an arbitrary double to UINT64_MAX actually works. :-) >>> >>> On second

Re: [Qemu-devel] qemu_system_reset_request() broken w.r.t BQL locking regime

2017-07-05 Thread G 3
On Jul 5, 2017, at 12:42 PM, qemu-devel-requ...@nongnu.org wrote: Hi, An interesting bug was reported on #qemu today. It was bisected to 8d04fb55 (drop global lock for TCG) and only occurred when QEMU was run with taskset -c 0. Originally the fingers where pointed at mttcg but it occurs

Re: [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 18:40, Marc-André Lureau wrote: > Hi > > - Original Message - >> >> >> On 05/07/2017 18:06, Marc-André Lureau wrote: > coroutine_fn too) It's not controversial, I would not have expected the functions to call coroutine_fn. :) How do they do that? >>>

Re: [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn

2017-07-05 Thread Marc-André Lureau
Hi - Original Message - > > > On 05/07/2017 18:06, Marc-André Lureau wrote: > >>> coroutine_fn too) > >> It's not controversial, I would not have expected the functions to call > >> coroutine_fn. :) How do they do that? > >> > > For example, null_co_readv() calls null_co_common()

Re: [Qemu-devel] [PATCH v3 09/20] mirror: Update signature of mirror_clip_sectors()

2017-07-05 Thread Kevin Wolf
Am 27.06.2017 um 21:24 hat Eric Blake geschrieben: > Rather than having a void function that modifies its input > in-place as the output, change the signature to reduce a layer > of indirection and return the result. > > Suggested-by: John Snow > Signed-off-by: Eric Blake

Re: [Qemu-devel] [PATCH v3 08/20] mirror: Switch mirror_do_zero_or_discard() to byte-based

2017-07-05 Thread Kevin Wolf
Am 27.06.2017 um 21:24 hat Eric Blake geschrieben: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Convert another internal > function (no semantic change). > > Signed-off-by: Eric Blake > Reviewed-by: John Snow

Re: [Qemu-devel] Managing architectural restrictions with -device and libvirt

2017-07-05 Thread Mark Cave-Ayland
On 05/07/17 16:46, Markus Armbruster wrote: I've been working on a patchset that brings the sun4u machine on qemu-system-sparc64 much closer to a real Ultra 5, however due to various design restrictions I need to be able to restrict how devices are added to the machine with

Re: [Qemu-devel] [PATCH] hmp: Update info vnc

2017-07-05 Thread Dr. David Alan Gilbert
* Daniel P. Berrange (berra...@redhat.com) wrote: > On Wed, Jul 05, 2017 at 03:43:02PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > The QMP query-vnc interfaces have gained a lot more information that > > the HMP interfaces hasn't got

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Max Reitz
On 2017-07-05 18:22, Max Reitz wrote: > On 2017-07-05 18:05, Max Reitz wrote: >> On 2017-07-05 15:48, Max Reitz wrote: >>> On 2017-07-05 09:07, Markus Armbruster wrote: Max Reitz writes: > This generic function (along with its implementations for different >

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Eric Blake
On 07/05/2017 11:22 AM, Max Reitz wrote: return (double)x == x && x == y; >>> >>> Yes, that would do, too; and spares me of having to think about how well >>> comparing an arbitrary double to UINT64_MAX actually works. :-) >> >> On second thought, this won't do, because (double)x == x is

Re: [Qemu-devel] [PATCH] hmp: Update info vnc

2017-07-05 Thread Daniel P. Berrange
On Wed, Jul 05, 2017 at 03:43:02PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The QMP query-vnc interfaces have gained a lot more information that > the HMP interfaces hasn't got yet. Update it. > > Note the output format has changed,

Re: [Qemu-devel] [PATCH 1/1] s390x: fixup for "fix error propagation in kvm-flic..."

2017-07-05 Thread Christian Borntraeger
On 07/05/2017 05:29 PM, Cornelia Huck wrote: > On Wed, 5 Jul 2017 15:54:07 +0200 > Halil Pasic wrote: > >> My patch "s390x: fix error propagation in kvm-flic's realize" accidentally >> replaced with. That's wrong! So please apply this fixup before including > > This

Re: [Qemu-devel] [PATCH] hmp: Update info vnc

2017-07-05 Thread Marc-André Lureau
- Original Message - > From: "Dr. David Alan Gilbert" > > The QMP query-vnc interfaces have gained a lot more information that > the HMP interfaces hasn't got yet. Update it. > > Note the output format has changed, but this is HMP so that's OK. > > In particular,

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Max Reitz
On 2017-07-05 18:05, Max Reitz wrote: > On 2017-07-05 15:48, Max Reitz wrote: >> On 2017-07-05 09:07, Markus Armbruster wrote: >>> Max Reitz writes: >>> This generic function (along with its implementations for different types) determines whether two QObjects are

Re: [Qemu-devel] qemu_system_reset_request() broken w.r.t BQL locking regime

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 18:14, Peter Maydell wrote: >> - Guest resets board, writing to some hw address (e.g. >> arm_sysctl_write) >> - This triggers qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET) >> - We exit iowrite and drop the BQL >> - vl.c schedules

Re: [Qemu-devel] qemu_system_reset_request() broken w.r.t BQL locking regime

2017-07-05 Thread Peter Maydell
On 5 July 2017 at 17:01, Alex Bennée wrote: > An interesting bug was reported on #qemu today. It was bisected to > 8d04fb55 (drop global lock for TCG) and only occurred when QEMU was run > with taskset -c 0. Originally the fingers where pointed at mttcg but it > occurs in

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Markus Armbruster
Eric Blake writes: > On 07/05/2017 08:48 AM, Max Reitz wrote: /** + * qnum_is_equal(): Test whether the two QNums are equal + */ +bool qnum_is_equal(const QObject *x, const QObject *y) +{ +QNum *num_x = qobject_to_qnum(x); +QNum

Re: [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 18:06, Marc-André Lureau wrote: >>> coroutine_fn too) >> It's not controversial, I would not have expected the functions to call >> coroutine_fn. :) How do they do that? >> > For example, null_co_readv() calls null_co_common() which calls > co_aio_sleep_ns() But these are

Re: [Qemu-devel] [PATCH] docs: add qemu-block-drivers(7) man page

2017-07-05 Thread Paolo Bonzini
On 22/06/2017 14:17, Stefan Hajnoczi wrote: > +@c man begin SYNOPSIS > +QEMU block driver reference manual > +@c man end > + I think this should be wrapped with @ignore / @end ignore. Otherwise looks like a great idea. Paolo

Re: [Qemu-devel] DIRTY_MEMORY_BLOCK_SIZE;

2017-07-05 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > On Fri, Jun 30, 2017 at 12:26:10PM +0100, Dr. David Alan Gilbert wrote: > > * ali saeedi (ali.saeed...@gmail.com) wrote: > > > Hello > > > what does 'DIRTY_MEMORY_BLOCK_SIZE' mean? > > > is it the number of words in a block? or number of pages in a

Re: [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn

2017-07-05 Thread Marc-André Lureau
Hi - Original Message - > > > On 05/07/2017 16:21, Marc-André Lureau wrote: > >> > >> They are, but it's an implementation detail. Why is this patch necessary? > > I didn't think this would be controversial :) well, the checks I added to > > clang verify function pointer share the

Re: [Qemu-devel] [PATCH RFC v19 00/13] QEMU AVR 8 bit cores

2017-07-05 Thread Michael Rolnik
No, I can't. I did not build any peripherals. I expect other people to join for this task. On Wed, Jul 5, 2017, 6:59 PM Richard Henderson wrote: > On 07/04/2017 08:34 PM, Michael Rolnik wrote: > > Hi Richard. > > > > Thank you for finding a bug. > > As for the testing > > 1. I

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Max Reitz
On 2017-07-05 15:48, Max Reitz wrote: > On 2017-07-05 09:07, Markus Armbruster wrote: >> Max Reitz writes: >> >>> This generic function (along with its implementations for different >>> types) determines whether two QObjects are equal. >>> >>> Signed-off-by: Max Reitz

[Qemu-devel] qemu_system_reset_request() broken w.r.t BQL locking regime

2017-07-05 Thread Alex Bennée
Hi, An interesting bug was reported on #qemu today. It was bisected to 8d04fb55 (drop global lock for TCG) and only occurred when QEMU was run with taskset -c 0. Originally the fingers where pointed at mttcg but it occurs in both single and multi-threaded modes. I think the problem is

Re: [Qemu-devel] [PATCH RFC v19 00/13] QEMU AVR 8 bit cores

2017-07-05 Thread Richard Henderson
On 07/04/2017 08:34 PM, Michael Rolnik wrote: Hi Richard. Thank you for finding a bug. As for the testing 1. I have a small program that calculates fibonacci numbers. I use it to test mainly stack operations for different CPU flavors (1, 2 or 3 bytes PC). 2. I manually verified that I can

Re: [Qemu-devel] [RFC v2 2/3] qemu-error: Implement a more generic error reporting

2017-07-05 Thread Alistair Francis
On Mon, Jul 3, 2017 at 11:53 PM, Markus Armbruster wrote: > "Daniel P. Berrange" writes: > >> On Mon, Jul 03, 2017 at 04:07:21PM +0200, Markus Armbruster wrote: >>> "Daniel P. Berrange" writes: >>> >>> > On Thu, Jun 29, 2017 at

Re: [Qemu-devel] [PATCH] sockets: avoid formatting buffer that may not be NULL terminated

2017-07-05 Thread Markus Armbruster
Stefan Hajnoczi writes: > On Mon, Jun 26, 2017 at 12:19:40PM +0200, Thomas Huth wrote: >> On 26.06.2017 12:11, Daniel P. Berrange wrote: >> > The 'sun_path' field in the sockaddr_un struct is not required >> > to be NULL termianted, so when reporting an error, we must use >>

Re: [Qemu-devel] Managing architectural restrictions with -device and libvirt

2017-07-05 Thread Markus Armbruster
Mark Cave-Ayland writes: > On 05/07/17 06:38, Markus Armbruster wrote: > >> Copying Marcel for PCI expertise. >> >> Mark Cave-Ayland writes: >> >>> Hi all, >>> >>> I've been working on a patchset that brings the sun4u machine on

Re: [Qemu-devel] [RFC v1 2/4] util/oslib-win32: Remove invalid check

2017-07-05 Thread Alistair Francis
On Fri, Jun 30, 2017 at 3:37 AM, Paolo Bonzini wrote: > > > On 29/06/2017 18:37, Alistair Francis wrote: >>> Hmm, I think it's possible, poll_msgs is true here. >> poll_msgs? >> >> If nhandles is 0 then we have already entered an earlier if statement >> and set ready to

Re: [Qemu-devel] [PATCH] hw/s390x/ipl: Fix endianness problem with netboot_start_addr

2017-07-05 Thread Cornelia Huck
On Wed, 5 Jul 2017 17:25:45 +0200 Thomas Huth wrote: > The start address has to be stored in big endian byte order > in the iplb.ccw block for the guest. > > Signed-off-by: Thomas Huth > --- > hw/s390x/ipl.c | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [Qemu-devel] [PATCH 3/4] doc: add item for "-M enforce-config-section"

2017-07-05 Thread Markus Armbruster
Eduardo Habkost writes: > (CCing Greg, the original author of the code that added the > enforce-config-section option) > > On Tue, Jul 04, 2017 at 10:06:54AM +0200, Markus Armbruster wrote: >> Peter Xu writes: >> >> > It's never documented, and now we

Re: [Qemu-devel] [PATCH 1/1] s390x: fixup for "fix error propagation in kvm-flic..."

2017-07-05 Thread Cornelia Huck
On Wed, 5 Jul 2017 15:54:07 +0200 Halil Pasic wrote: > My patch "s390x: fix error propagation in kvm-flic's realize" accidentally > replaced with. That's wrong! So please apply this fixup before including This sentence is missing something ;) > that patch into

Re: [Qemu-devel] [PATCH v2 6/6] nbd: use generic trace subsystem instead of TRACE macro

2017-07-05 Thread Paolo Bonzini
On 21/06/2017 17:34, Vladimir Sementsov-Ogievskiy wrote: > Starting from this patch to enable traces use -trace option of qemu or > -T, --trace option of qemu-img, qemu-io and qemu-nbd. For qemu traces > also can be managed by qmp commands trace-event-{get,set}-state. > > Recompilation with

[Qemu-devel] [PATCH] hw/s390x/ipl: Fix endianness problem with netboot_start_addr

2017-07-05 Thread Thomas Huth
The start address has to be stored in big endian byte order in the iplb.ccw block for the guest. Signed-off-by: Thomas Huth --- hw/s390x/ipl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 4e6469d..cc36003 100644 ---

Re: [Qemu-devel] [PATCH v2 5/6] nbd/client: refactor TRACE of NBD_MAGIC

2017-07-05 Thread Paolo Bonzini
On 29/06/2017 21:36, Eric Blake wrote: >> +memcpy(_magic, buf, 8); >> +nbd_magic = be64_to_cpu(nbd_magic); > Do we really need to copy the memory around twice? Can't we just use: > magic = ldq_be_p(buf); > and call it good? Yes. Paolo signature.asc Description: OpenPGP digital

Re: [Qemu-devel] [PATCH v2 2/6] nbd/server: use errp instead of LOG

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 14:33, Vladimir Sementsov-Ogievskiy wrote: > > >>> -static int GCC_FMT_ATTR(4, 5) >>> +static int GCC_FMT_ATTR(5, 6) >>> nbd_negotiate_send_rep_err(QIOChannel *ioc, uint32_t type, >>> - uint32_t opt, const char *fmt, ...) >>> +

Re: [Qemu-devel] [PATCH v4 0/1] virtio-scsi-ccw: fix iotest 068 for s390x

2017-07-05 Thread Stefan Hajnoczi
On Tue, Jul 04, 2017 at 03:23:49PM +0200, QingFeng Hao wrote: > This commit fixes iotest 068 for s390x as s390x uses virtio-scsi-ccw. > It's based on commit c324fd0a39c by Stefan Hajnoczi. > Thanks! > > Change history: > v4: > Got Cornelia Huck's Reviewed-by and take the comment to change

Re: [Qemu-devel] [PATCH v5 13/13] serial: chardev hotswap support

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 16:02, Anton Nefedov wrote: > { > -if (!qemu_chr_fe_get_driver(>chr)) { > +if (!qemu_chr_fe_backend_connected(>chr)) { > error_setg(errp, "Can't create serial device, empty char device"); Same here. Paolo

Re: [Qemu-devel] [PATCH v5 00/13] chardevice hotswap

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 16:01, Anton Nefedov wrote: > Changed in v5: > - rebased > - patch 6 fixed (wouldn't compile until patch 7 (broken by previous rebase)) > - patch 11 commit message added I commented on a few patches, but v6 should be the final one. Thanks, Paolo

Re: [Qemu-devel] [PATCH v5 11/13] virtio-console: chardev hotswap support

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 16:02, Anton Nefedov wrote: > Also, avoid unsafe qemu_chr_fe_get_driver() usage even though the pointer > is not really stored. Please move that part to patch 5, together with other switches to qemu_chr_fe_backend_connected. Paolo

Re: [Qemu-devel] DIRTY_MEMORY_BLOCK_SIZE;

2017-07-05 Thread Stefan Hajnoczi
On Fri, Jun 30, 2017 at 12:26:10PM +0100, Dr. David Alan Gilbert wrote: > * ali saeedi (ali.saeed...@gmail.com) wrote: > > Hello > > what does 'DIRTY_MEMORY_BLOCK_SIZE' mean? > > is it the number of words in a block? or number of pages in a block? or > > number of bytes in a block? > > thanks a

Re: [Qemu-devel] [PATCH v5 03/13] char: chardevice hotswap

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 16:01, Anton Nefedov wrote: > This patch adds a possibility to change a char device without a frontend > removal. > > 1. Ideally, it would have to happen transparently to a frontend, i.e. > frontend would continue its regular operation. > However, backends are not stateless and

Re: [Qemu-devel] [PATCH v4] tests: Avoid non-portable 'echo -ARG'

2017-07-05 Thread Max Reitz
On 2017-07-03 20:09, Eric Blake wrote: > POSIX says that backslashes in the arguments to 'echo', as well as > any use of 'echo -n' and 'echo -e', are non-portable; it recommends > people should favor 'printf' instead. This is definitely true where > we do not control which shell is running (such

Re: [Qemu-devel] [Qemu-block] [RFC] QMP design: Fixing query-block and friends

2017-07-05 Thread Stefan Hajnoczi
On Tue, Jun 27, 2017 at 02:24:12PM -0400, John Snow wrote: > On 06/27/2017 12:31 PM, Kevin Wolf wrote: > > If that's what we're going to do, I think I can figure out something > > nice for block nodes. That shouldn't be too hard. The only question > > would be whether we want a command to query

Re: [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn

2017-07-05 Thread Paolo Bonzini
On 05/07/2017 16:21, Marc-André Lureau wrote: >> >> They are, but it's an implementation detail. Why is this patch necessary? > I didn't think this would be controversial :) well, the checks I added to > clang verify function pointer share the coroutine attribute. > > The function themself

[Qemu-devel] [PATCH] hmp: Update info vnc

2017-07-05 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" The QMP query-vnc interfaces have gained a lot more information that the HMP interfaces hasn't got yet. Update it. Note the output format has changed, but this is HMP so that's OK. In particular, this now includes client information for

Re: [Qemu-devel] [PATCH 08/35] block: all bdrv_aio callbacks are coroutine_fn

2017-07-05 Thread Marc-André Lureau
- Original Message - > On 05/07/2017 00:03, Marc-André Lureau wrote: > > Signed-off-by: Marc-André Lureau > > --- > > include/block/block_int.h | 10 +- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git

Re: [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated()

2017-07-05 Thread Fam Zheng
On Wed, 07/05 09:01, Eric Blake wrote: > On 07/05/2017 07:07 AM, Fam Zheng wrote: > >>> > >>> Sorry for bikeshedding. > >> > >> Not a problem, I also had some double-takes in writing my own code > >> trying to remember which way I wanted the 'allocation' boolean to be > >> set, so coming up with a

Re: [Qemu-devel] [PATCH v5 13/13] serial: chardev hotswap support

2017-07-05 Thread Michael S. Tsirkin
On Wed, Jul 05, 2017 at 05:02:04PM +0300, Anton Nefedov wrote: > for a backend change, a number of ioctls has to be replayed to sync > the current setup of a frontend to a backend tty. This is hopefully > enough so we don't have to track, store and replay the whole original > control byte

[Qemu-devel] [PATCH] xen/pt: Fixup addr validation in xen_pt_pci_config_access_check

2017-07-05 Thread Anoob Soman
xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid address and should not be ignored. Signed-off-by: Anoob Soman --- hw/xen/xen_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index

[Qemu-devel] [PATCH v5 10/13] hmp: add hmp analogue for qmp-chardev-change

2017-07-05 Thread Anton Nefedov
Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Dr. David Alan Gilbert --- include/chardev/char.h | 10 ++ hmp.h | 1 + chardev/char.c | 2 +-

[Qemu-devel] [PATCH v5 02/13] char: add backend hotswap handler

2017-07-05 Thread Anton Nefedov
Frontends should have an interface to setup the handler of a backend change. The interface will be used in the next commits Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Marc-André Lureau

Re: [Qemu-devel] [PATCH v3 2/5] qapi: Add qobject_is_equal()

2017-07-05 Thread Eric Blake
On 07/05/2017 08:48 AM, Max Reitz wrote: >>> /** >>> + * qnum_is_equal(): Test whether the two QNums are equal >>> + */ >>> +bool qnum_is_equal(const QObject *x, const QObject *y) >>> +{ >>> +QNum *num_x = qobject_to_qnum(x); >>> +QNum *num_y = qobject_to_qnum(y); >>> + >>> +switch

[Qemu-devel] [PATCH v5 06/13] test-char: destroy chardev-udp after test

2017-07-05 Thread Anton Nefedov
this is only not a problem if the test is last in a suite, otherwise it makes the following main_loop() calls to fail Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 1 + 1 file changed, 1

[Qemu-devel] [PATCH v5 07/13] test-char: split char_udp_test

2017-07-05 Thread Anton Nefedov
makes it possible to test the existing chardev-udp Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 56 +++ 1 file changed, 40 insertions(+), 16

Re: [Qemu-devel] [PATCH 01/35] WIP: coroutine: annotate coroutine with clang thread safety attributes

2017-07-05 Thread Marc-André Lureau
Hi - Original Message - > On 05/07/2017 00:03, Marc-André Lureau wrote: > > +typedef int TAA_ROLE coroutine_role; > > +extern coroutine_role _coroutine_fn; > > + > > +static inline void co_role_acquire(coroutine_role R) TAA_ACQUIRE(R) > > TAA_NO_ANALYSYS {} > > +static inline void

Re: [Qemu-devel] [PATCH 3/4] doc: add item for "-M enforce-config-section"

2017-07-05 Thread Eduardo Habkost
(CCing Greg, the original author of the code that added the enforce-config-section option) On Tue, Jul 04, 2017 at 10:06:54AM +0200, Markus Armbruster wrote: > Peter Xu writes: > > > It's never documented, and now we have one more parameter for it (which > > means this one

Re: [Qemu-devel] [PATCH 31/35] parallels: mark coroutine_fn

2017-07-05 Thread Denis V. Lunev
On 07/05/2017 01:03 AM, Marc-André Lureau wrote: > Signed-off-by: Marc-André Lureau > --- > block/parallels.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/block/parallels.c b/block/parallels.c > index 8be46a7d48..213e42b9d2 100644 > ---

Re: [Qemu-devel] [PATCH 2/4] vl: move global property, migrate init earlier

2017-07-05 Thread Eduardo Habkost
On Tue, Jul 04, 2017 at 10:12:45AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Mon, Jul 03, 2017 at 10:44:06AM +0800, Peter Xu wrote: > >> Currently drive_init_func() may call migrate_get_current() while the > >> migrate object is still not ready yet

[Qemu-devel] [PATCH v5 04/13] char: forbid direct chardevice access for hotswap devices

2017-07-05 Thread Anton Nefedov
qemu_chr_fe_get_driver() is unsafe, frontends with hotswap support should not access CharDriver ptr directly as CharDriver might change. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Marc-André Lureau

Re: [Qemu-devel] [PATCH 0/5] qemu-iotests: test savevm/loadvm iothread (and make it work!)

2017-07-05 Thread Pavel Butsykin
On 05.07.2017 15:55, Stefan Hajnoczi wrote: On Mon, Jun 19, 2017 at 03:26:56PM +0300, Pavel Butsykin wrote: On 15.06.2017 19:38, Stefan Hajnoczi wrote: This series extends qemu-iotests 068 to also run with iothread enabled. Doing so was harder than expected because: 1. ioeventfd is disabled

[Qemu-devel] [PATCH v5 08/13] test-char: split char_file_test

2017-07-05 Thread Anton Nefedov
makes it possible to test the existing chardev-file Signed-off-by: Anton Nefedov Reviewed-by: Marc-André Lureau --- tests/test-char.c | 137 +- 1 file changed, 84 insertions(+), 53

[Qemu-devel] [PATCH v5 13/13] serial: chardev hotswap support

2017-07-05 Thread Anton Nefedov
for a backend change, a number of ioctls has to be replayed to sync the current setup of a frontend to a backend tty. This is hopefully enough so we don't have to track, store and replay the whole original control byte sequence. Signed-off-by: Anton Nefedov

[Qemu-devel] [PATCH v5 01/13] char: move QemuOpts->ChardevBackend translation to a separate func

2017-07-05 Thread Anton Nefedov
parse function will be used by the following patch Signed-off-by: Anton Nefedov --- chardev/char.c | 81 -- 1 file changed, 51 insertions(+), 30 deletions(-) diff --git a/chardev/char.c b/chardev/char.c index

[Qemu-devel] [PATCH v5 11/13] virtio-console: chardev hotswap support

2017-07-05 Thread Anton Nefedov
In case of a backend change, the handler functions and the watch have to be reset. Also, avoid unsafe qemu_chr_fe_get_driver() usage even though the pointer is not really stored. Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy

<    1   2   3   4   >