[Qemu-devel] [PATCH 2/3] xen-pt: bind/unbind interrupt remapping format MSI

2017-06-29 Thread Lan Tianyu
From: Chao Gao If a vIOMMU is exposed to guest, guest will configure the msi to remapping format. The original code isn't suitable to the new format. A new pair bind/unbind interfaces are added for this usage. This patch recognizes this case and uses new interfaces to bind/unbind msi. Signed-off

[Qemu-devel] [PATCH 3/3] msi: Handle remappable format interrupt request

2017-06-29 Thread Lan Tianyu
From: Chao Gao According to VT-d spec Interrupt Remapping and Interrupt Posting -> Interrupt Remapping -> Interrupt Request Formats On Intel 64 Platforms, fields of MSI data register have changed. This patch avoids wrongly regarding a remappable format interrupt request as an interrupt binded wit

[Qemu-devel] [PATCH 1/3] i386/msi: Correct mask of destination ID in MSI address

2017-06-29 Thread Lan Tianyu
From: Chao Gao According to SDM 10.11.1, only [19:12] bits of MSI address are Destination ID, change the mask to avoid ambiguity for VT-d spec has used the bit 4 to indicate a remappable interrupt request. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- include/hw/i386/apic-msidef.h | 2

Re: [Qemu-devel] [PATCH v2 4/7] qdev: Introduce DEFINE_PROP_LINK

2017-06-29 Thread Fam Zheng
On Thu, 06/29 13:51, Paolo Bonzini wrote: > > > On 29/06/2017 10:04, Fam Zheng wrote: > > +#define DEFINE_PROP_LINK(_name, _state, _field, _type, _check, _flags) {\ > > +.name = (_name),\ > > +.info = &(qdev_prop_link),

Re: [Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Manos Pitsidianakis
On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which unrefs

Re: [Qemu-devel] [PATCH V2] monitor: Add -a (all) option to info registers

2017-06-29 Thread Dr. David Alan Gilbert
* Suraj Jitindar Singh (sjitindarsi...@gmail.com) wrote: > The info registers command in the qemu monitor is used to dump register > values. > > Currently this command uses the monitor cpu (which can be set by the > user) as the cpu for whose registers will be dumped. Sometimes it is > useful to s

Re: [Qemu-devel] [PATCHv6 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init()

2017-06-29 Thread Mark Cave-Ayland
On 28/06/17 15:12, Igor Mammedov wrote: >>> I don't understand this part. When and why would the check become >>> useless? >> >> Well because when using the standard QEMU pattern of >> qdev_create()...qdev_init_nofail() it is possible to realize the device >> and wire up its MemoryRegions manua

Re: [Qemu-devel] [PATCH 0/3] please pull xen-20170627-tag

2017-06-29 Thread Peter Maydell
On 27 June 2017 at 23:04, Stefano Stabellini wrote: > The following changes since commit 577caa2672ccde7352fda3ef17e44993de862f0e: > > Merge remote-tracking branch > 'remotes/edgar/tags/edgar/mmio-exec-v2.for-upstream' into staging (2017-06-27 > 16:56:55 +0100) > > are available in the git rep

[Qemu-devel] [PATCH v10 0/7] trace: [tcg] Optimize per-vCPU tracing states with separate TB caches

2017-06-29 Thread Lluís Vilanova
Optimizes tracing of events with the 'tcg' and 'vcpu' properties (e.g., memory accesses), making it feasible to statically enable them by default on all QEMU builds. Last patch shows that overheads are completely eliminated in various types of benchmarks for linux-user and softmmu (overheads where

[Qemu-devel] [PATCH v10 1/7] exec: [tcg] Refactor flush of per-CPU virtual TB cache

2017-06-29 Thread Lluís Vilanova
The function is reused in later patches. Signed-off-by: Lluís Vilanova Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c|2 +- accel/tcg/translate-all.c | 15 ++- include/exec/exec-all.h |6 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git

[Qemu-devel] [PATCH v10 2/7] trace: Allocate cpu->trace_dstate in place

2017-06-29 Thread Lluís Vilanova
There's little point in dynamically allocating the bitmap if we know at compile-time the max number of events we want to support. Thus, make room in the struct for the bitmap, which will make things easier later: this paves the way for upcoming changes, in which we'll use a u32 to fully capture cpu

Re: [Qemu-devel] [RFC v1 1/4] util/aio-win32: Only select on what we are actually waiting for

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/aio-win32.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/util/aio-win32.c b/util/aio-win32.c > index bca496a47a..949979c2f5 1

Re: [Qemu-devel] [RFC v1 3/4] util/oslib-win32: Fix up if conditional

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/oslib-win32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/util/oslib-win32.c b/util/oslib-win32.c > index 7ec0f8e083..a015e1ac96 100644 > -

[Qemu-devel] [PATCH v10 3/7] trace: [tcg] Delay changes to dynamic state when translating

2017-06-29 Thread Lluís Vilanova
This keeps consistency across all decisions taken during translation when the dynamic state of a vCPU is changed in the middle of translating some guest code. Signed-off-by: Lluís Vilanova Reviewed-by: Richard Henderson --- include/qom/cpu.h |3 +++ trace/control-target.c | 20 ++

Re: [Qemu-devel] [Qemu-block] [PATCH v4 1/2] live-block-ops.txt: Rename, rewrite, and improve it

2017-06-29 Thread Alberto Garcia
On Wed 28 Jun 2017 04:58:00 PM CEST, Kashyap Chamarthy wrote: > +Once a 'mirror' job has started, there are two possible actions when a > +``drive-mirror`` job is active: > + > +1. Issuing the command ``block-job-cancel``: will, after completing > + synchronization of the content from the disk im

[Qemu-devel] [PATCH v10 4/7] exec: [tcg] Use different TBs according to the vCPU's dynamic tracing state

2017-06-29 Thread Lluís Vilanova
Every vCPU now uses a separate set of TBs for each set of dynamic tracing event state values. Each set of TBs can be used by any number of vCPUs to maximize TB reuse when vCPUs have the same tracing state. This feature is later used by tracetool to optimize tracing of guest code events. The maxim

Re: [Qemu-devel] [PATCH] aspeed: Register all watchdogs

2017-06-29 Thread Peter Maydell
On 28 June 2017 at 12:57, Cédric Le Goater wrote: > On 06/28/2017 01:47 PM, Joel Stanley wrote: >> The ast2400 contains two and the ast2500 contains three watchdogs. >> Add this information to the AspeedSoCInfo and realise the correct number >> of watchdogs for that each SoC type. >> >> Signed-off

[Qemu-devel] [PATCH v10 5/7] trace: [tcg] Do not generate TCG code to trace dynamically-disabled events

2017-06-29 Thread Lluís Vilanova
If an event is dynamically disabled, the TCG code that calls the execution-time tracer is not generated. Removes the overheads of execution-time tracers for dynamically disabled events. As a bonus, also avoids checking the event state when the execution-time tracer is called from TCG-generated cod

Re: [Qemu-devel] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > +/* We only found one and we are waiting on more then one. Let's try > + * again. > */ > -if (timeout == 0 && nhandles > 1) { > +if (nhandles > 1) { > /* Remove the handle that fired */ >

Re: [Qemu-devel] [PATCH v1 3/3] armv7m_systick: abort instead of locking on a bad rate

2017-06-29 Thread Philippe Mathieu-Daudé
Hi Frederic, On 06/29/2017 06:28 AM, KONRAD Frederic wrote: This helps the board developer by asserting that system_clock_rate is not null. Using systick with a zero rate will lead to a deadlock so better showing the error. Signed-off-by: KONRAD Frederic --- hw/timer/armv7m_systick.c | 3 +++

[Qemu-devel] [PATCH v10 6/7] trace: [tcg, trivial] Re-align generated code

2017-06-29 Thread Lluís Vilanova
Last patch removed a nesting level in generated code. Re-align all code generated by backends to be 4-column aligned. Signed-off-by: Lluís Vilanova --- scripts/tracetool/backend/dtrace.py |4 ++-- scripts/tracetool/backend/ftrace.py | 20 ++-- scripts/tracetool/backend/log.

[Qemu-devel] [PATCH v10 7/7] trace: [trivial] Statically enable all guest events

2017-06-29 Thread Lluís Vilanova
The existing optimizations makes it feasible to have them available on all builds. Some quick'n'dirty numbers with 400.perlbench (SPECcpu2006) on the train input (medium size - suns.pl) and the guest_mem_before event: * vanilla, statically disabled real0m2,259s user0m2,252s sys 0m0,00

Re: [Qemu-devel] [PATCH v1 3/3] armv7m_systick: abort instead of locking on a bad rate

2017-06-29 Thread Peter Maydell
On 29 June 2017 at 13:35, Philippe Mathieu-Daudé wrote: > This is true it is better to abort here than risking a deadlock. > > However it seems to me they are 3 issues here: > - the deadlock pattern is caused by using a global variable, > - stellaris:ssys_calculate_system_clock() no checking RCC.S

Re: [Qemu-devel] [PATCH v2 2/4] dump: add vmcoreinfo ELF note

2017-06-29 Thread Marc-André Lureau
Hi Laszlo, On Tue, Jun 6, 2017 at 4:21 PM Laszlo Ersek wrote: > Adding Drew > > > On 06/02/17 13:13, Marc-André Lureau wrote: > > HI > > > > On Thu, Jun 1, 2017 at 10:38 PM Laszlo Ersek wrote: > > > >> On 06/01/17 15:03, Marc-André Lureau wrote: > >>> Read vmcoreinfo note from guest memory when

Re: [Qemu-devel] [PATCH v1 3/3] armv7m_systick: abort instead of locking on a bad rate

2017-06-29 Thread KONRAD Frederic
On 06/29/2017 02:43 PM, Peter Maydell wrote: On 29 June 2017 at 13:35, Philippe Mathieu-Daudé wrote: This is true it is better to abort here than risking a deadlock. However it seems to me they are 3 issues here: - the deadlock pattern is caused by using a global variable, - stellaris:ssys_c

Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

2017-06-29 Thread Eduardo Habkost
On Thu, Jun 29, 2017 at 08:54:29AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Wed, Jun 28, 2017 at 11:05:26AM +0200, Markus Armbruster wrote: > >> Eduardo Habkost writes: [...] > >> > I understand the reason we need to support errp==NULL, as it > >> > makes life simpler f

Re: [Qemu-devel] [PATCH v1 3/3] armv7m_systick: abort instead of locking on a bad rate

2017-06-29 Thread Philippe Mathieu-Daudé
On 06/29/2017 09:43 AM, Peter Maydell wrote: On 29 June 2017 at 13:35, Philippe Mathieu-Daudé wrote: This is true it is better to abort here than risking a deadlock. However it seems to me they are 3 issues here: - the deadlock pattern is caused by using a global variable, - stellaris:ssys_cal

Re: [Qemu-devel] [RISU PATCH v6 02/10] build-all-archs: support cross building via docker

2017-06-29 Thread Philippe Mathieu-Daudé
Hi Alex, On 06/21/2017 12:42 PM, Alex Bennée wrote:> By default we use the QEMU projects qemu:debian-FOO-cross images as RISU hackers are likely to be QEMU developers too. However any docker tag can be passed on the command line. Any thought about starting to push images?

Re: [Qemu-devel] [PATCH v2 07/23] hyperv: ensure VP index equal to QEMU cpu_index

2017-06-29 Thread Roman Kagan
On Thu, Jun 29, 2017 at 01:53:29PM +0200, Igor Mammedov wrote: > On Thu, 29 Jun 2017 12:53:27 +0300 > Roman Kagan wrote: > > > On Wed, Jun 28, 2017 at 04:47:43PM +0200, Igor Mammedov wrote: > > > On Wed, 21 Jun 2017 19:24:08 +0300 > > > Roman Kagan wrote: > > > > > > > Hyper-V identifies vCPU

Re: [Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type

2017-06-29 Thread Khem Raj
On Thu, Jun 29, 2017 at 1:02 AM, Laurent Vivier wrote: > Le 28/06/2017 à 22:44, Khem Raj a écrit : >> The ucontext_t type had a tag struct ucontext until now >> but newer glibc will drop it so we need to adjust and use >> the exposed type instead > > I didn't find in glib git tree the commit dropp

Re: [Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type

2017-06-29 Thread Markus Armbruster
Peter Maydell writes: > On 28 June 2017 at 21:44, Khem Raj wrote: >> The ucontext_t type had a tag struct ucontext until now >> but newer glibc will drop it so we need to adjust and use >> the exposed type instead > > If true this seems like a bug in glibc to break > existing working programs, a

Re: [Qemu-devel] [PATCH v1 3/3] armv7m_systick: abort instead of locking on a bad rate

2017-06-29 Thread KONRAD Frederic
On 06/29/2017 03:02 PM, Philippe Mathieu-Daudé wrote: On 06/29/2017 09:43 AM, Peter Maydell wrote: On 29 June 2017 at 13:35, Philippe Mathieu-Daudé wrote: This is true it is better to abort here than risking a deadlock. However it seems to me they are 3 issues here: - the deadlock pattern i

Re: [Qemu-devel] [PATCH v5 01/25] block/mirror: Small absolute-paths simplification

2017-06-29 Thread Alberto Garcia
On Wed 21 Jun 2017 02:50:23 PM CEST, Max Reitz wrote: > When invoking drive-mirror in absolute-paths mode, the target's backing > BDS is assigned to it in mirror_exit(). The current logic only does so > if the target does not have that backing BDS already; but it actually > cannot have a backing BD

Re: [Qemu-devel] [PATCH v5 02/25] block: Use children list in bdrv_refresh_filename

2017-06-29 Thread Alberto Garcia
On Wed 21 Jun 2017 02:50:24 PM CEST, Max Reitz wrote: > bdrv_refresh_filename() should invoke itself recursively on all > children, not just on file. > > With that change, we can remove the manual invocations in blkverify, > quorum, commit, and mirror. > > Signed-off-by: Max Reitz Reviewed-by: Al

Re: [Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type

2017-06-29 Thread Daniel P. Berrange
On Thu, Jun 29, 2017 at 10:05:13AM +0100, Peter Maydell wrote: > On 28 June 2017 at 21:44, Khem Raj wrote: > > The ucontext_t type had a tag struct ucontext until now > > but newer glibc will drop it so we need to adjust and use > > the exposed type instead > > If true this seems like a bug in gl

Re: [Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type

2017-06-29 Thread Kamil Rytarowski
On 29.06.2017 15:12, Markus Armbruster wrote: > Peter Maydell writes: > >> On 28 June 2017 at 21:44, Khem Raj wrote: >>> The ucontext_t type had a tag struct ucontext until now >>> but newer glibc will drop it so we need to adjust and use >>> the exposed type instead >> >> If true this seems lik

[Qemu-devel] [PATCH 1/7] vmgenid: replace x-write-pointer-available hack

2017-06-29 Thread Marc-André Lureau
This compat property sole function is to prevent the device from being instantiated. Instead of requiring an extra compat property, check if fw_cfg has DMA enabled. This has the additional benefit of handling other cases properly, like: $ qemu-system-x86_64 -device vmgenid -machine none qemu-

[Qemu-devel] [PATCH 0/7] KASLR kernel dump support

2017-06-29 Thread Marc-André Lureau
Recent linux kernels enable KASLR to randomize phys/virt memory addresses. This series aims to provide enough information in qemu dumps so that crash utility can work with randomized kernel too (it hasn't been tested on other archs than x86 though, help welcome). The vmcoreinfo device is an emulat

[Qemu-devel] [PATCH 2/7] acpi: add vmcoreinfo device

2017-06-29 Thread Marc-André Lureau
The VM coreinfo (vmcoreinfo) device is an emulated device which exposes a 4k memory range to the guest to store various informations useful to debug the guest OS. (it is greatly inspired by the VMGENID device implementation) This is an early-boot alternative to the qemu-ga VMDUMP_INFO event propos

[Qemu-devel] [PATCH 6/7] scripts/dump-guest-memory.py: add vmcoreinfo

2017-06-29 Thread Marc-André Lureau
Add vmcoreinfo ELF note if vmcoreinfo device is ready. To help the python script, add a little global vmcoreinfo_gdb structure, that is populated with vmcoreinfo_gdb_update(). Signed-off-by: Marc-André Lureau --- scripts/dump-guest-memory.py | 32 include/hw/acp

[Qemu-devel] [PATCH 4/7] dump: add vmcoreinfo ELF note

2017-06-29 Thread Marc-André Lureau
Read the vmcoreinfo ELF PT_NOTE from guest memory when vmcoreinfo device provides the location, and write it as an ELF note in the dump. There are now 2 possible sources of phys_base information. (1) arch guessed value from arch_dump_info_get() (2) vmcoreinfo ELF note NUMBER(phys_base)= field

[Qemu-devel] [PATCH 3/7] tests: add simple vmcoreinfo test

2017-06-29 Thread Marc-André Lureau
This test is based off vmgenid test from Ben Warren . It simply checks the vmcoreinfo ACPI device is present and that the memory region associated can be read. Signed-off-by: Marc-André Lureau --- tests/vmcoreinfo-test.c | 130 tests/Makefile.incl

Re: [Qemu-devel] [RISU PATCH v6 02/10] build-all-archs: support cross building via docker

2017-06-29 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Hi Alex, > > On 06/21/2017 12:42 PM, Alex Bennée wrote:> By default we use the QEMU > projects qemu:debian-FOO-cross images as >> RISU hackers are likely to be QEMU developers too. However any docker >> tag can be passed on the command line. > > Any thought about

[Qemu-devel] [PATCH 01/11] qcow2: call CoQueue APIs under CoMutex

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 2f94f0326e..70d3f4a18e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1741,8 +1741,

[Qemu-devel] [PATCH 5/7] kdump: add vmcoreinfo ELF note

2017-06-29 Thread Marc-André Lureau
kdump header provides offset and size of the vmcoreinfo ELF note, append it if available. Signed-off-by: Marc-André Lureau --- dump.c | 48 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/dump.c b/dump.c index 8fda5cc1ed..b78bc1fda7

[Qemu-devel] [PATCH 10/11] sheepdog: add queue_lock

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/sheepdog.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 08d7b11e9d..a6013f0f17 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -390,

[Qemu-devel] [PATCH 07/11] block: invoke .bdrv_drain callback in coroutine context and from AioContext

2017-06-29 Thread Paolo Bonzini
This will let the callback take a CoMutex in the next patch. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/io.c| 42 +- block/qed.c | 6 +++--- include/block/block_int.h | 2 +- 3 files changed, 37 ins

[Qemu-devel] [PATCH 02/11] coroutine-lock: add qemu_co_rwlock_downgrade and qemu_co_rwlock_upgrade

2017-06-29 Thread Paolo Bonzini
These functions are more efficient in the presence of contention. qemu_co_rwlock_downgrade also guarantees not to block, which may be useful in some algorithms too. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 18 +++

[Qemu-devel] [PATCH 7/7] MAINTAINERS: add Dump maintainers

2017-06-29 Thread Marc-André Lureau
Proposing myself, since I have some familiarity with the code now. Signed-off-by: Marc-André Lureau --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 839f7ca063..45a0eb4cb0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1272,6 +1272,13 @@

[Qemu-devel] [PATCH 04/11] vpc: make it thread-safe

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/vpc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 4240ba9d1c..0ff686540a 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -496,

[Qemu-devel] [PATCH v2 00/11] Block layer thread-safety, part 2

2017-06-29 Thread Paolo Bonzini
This part takes care of drivers and devices, making sure that they can accept concurrent I/O from multiple AioContext. The following drivers are thread-safe without using any QemuMutex/CoMutex: crypto, gluster, null, rbd, win32-aio. NBD has already been fixed, because the patch fixed an unrelated

Re: [Qemu-devel] [PATCH v4 2/3] Add memfd based hostmem

2017-06-29 Thread Marc-André Lureau
Hi On Wed, Jun 28, 2017 at 8:29 PM Eduardo Habkost wrote: > On Tue, Jun 27, 2017 at 08:23:03AM +, Marc-André Lureau wrote: > > Hi Eduardo > > > > On Fri, Jun 23, 2017 at 11:09 PM Eduardo Habkost > > wrote: > > > > > On Wed, Jun 21, 2017 at 04:02:18PM +0200, Marc-André Lureau wrote: > > > >

[Qemu-devel] [PATCH 08/11] qed: introduce bdrv_qed_init_state

2017-06-29 Thread Paolo Bonzini
This will be used in the next patch, which will call bdrv_qed_do_open with a CoMutex taken. bdrv_qed_init_state provides a nice place to initialize it. Signed-off-by: Paolo Bonzini --- RFC->v2: new block/qed.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PATCH 03/11] vdi: make it thread-safe

2017-06-29 Thread Paolo Bonzini
The VirtualBox driver is using a mutex to order all allocating writes, but it is not protecting accesses to the bitmap because they implicitly happen under the AioContext mutex. Change this to use a CoRwlock explicitly. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo B

Re: [Qemu-devel] [PATCH] intel_iommu: fix migration breakage on mr switch

2017-06-29 Thread Michael S. Tsirkin
On Thu, Jun 29, 2017 at 12:26:57PM +0800, Peter Xu wrote: > Migration is broken after the vfio integration work: > > qemu-kvm: AHCI: Failed to start FIS receive engine: bad FIS receive buffer > address > qemu-kvm: Failed to load ich9_ahci:ahci > qemu-kvm: error while loading state for instance 0x

[Qemu-devel] [PATCH 09/11] qed: protect table cache with CoMutex

2017-06-29 Thread Paolo Bonzini
This makes the driver thread-safe. The CoMutex is dropped temporarily while accessing the data clusters or the backing file. Signed-off-by: Paolo Bonzini --- RFC->v2: add bdrv_qed_invalidate_cache change; invalidate_cache can run in a coroutine when called by block migra

[Qemu-devel] [PATCH 05/11] vvfat: make it thread-safe

2017-06-29 Thread Paolo Bonzini
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/vvfat.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/vvfat.c b/block/vvfat.c index 8ab647c0c6..d2679c2ff5 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2982,8 +29

Re: [Qemu-devel] [PATCH v5 3/5] qmp: refactor duplicate code

2017-06-29 Thread Pradeep Jagadeesh
On 6/21/2017 12:00 PM, Greg Kurz wrote: On Wed, 21 Jun 2017 10:34:42 +0200 Pradeep Jagadeesh wrote: On 6/20/2017 6:05 PM, Greg Kurz wrote: On Mon, 19 Jun 2017 09:11:34 -0400 Pradeep Jagadeesh wrote: This patch factor out the duplicate qmp throttle interface code that was present in both bl

[Qemu-devel] [PATCH 06/11] qed: move tail of qed_aio_write_main to qed_aio_write_{cow, alloc}

2017-06-29 Thread Paolo Bonzini
This part is never called for in-place writes, move it away to avoid the "backwards" coding style typical of callback-based code. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/qed.c | 70 - 1 file changed, 32 inse

Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 11:05, Markus Armbruster wrote: > If foo() additionally returned an indication of success, you could write > > if (!foo(arg, errp)) {// assuming foo() returns a bool > handle the error... > } > > Nicely concise. > > For what it's worth, this is how GLib wa

[Qemu-devel] [PATCH 11/11] ssh: support I/O from any AioContext

2017-06-29 Thread Paolo Bonzini
The coroutine may run in a different AioContext, causing the fd handler to busy wait. Fix this by resetting the handler in restart_coroutine, before the coroutine is restarted. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/ssh.c | 24 +--- 1 file chang

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

2017-06-29 Thread Paolo Bonzini
On 28/06/2017 01:57, Alistair Francis wrote: > There is no way nhandles can be zero in this section so that part of the > if statement will always be false. Let's just remove it to make the code > easier to read. > > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/

[Qemu-devel] [PULL 0/8] 9pfs patches for 2.10 20170629

2017-06-29 Thread Greg Kurz
The following changes since commit 464588675455afda2899e20a0b120e4075de50c7: Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20170627-tag' into staging (2017-06-29 11:45:01 +0100) are available in the git repository at: https://github.com/gkurz/qemu.git tags/for-upstream for you

[Qemu-devel] [PULL 1/8] 9pfs: local: remove: use correct path component

2017-06-29 Thread Greg Kurz
From: Bruce Rogers Commit a0e640a8 introduced a path processing error. Pass fstatat the dirpath based path component instead of the entire path. Signed-off-by: Bruce Rogers Signed-off-by: Greg Kurz --- hw/9pfs/9p-local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9

Re: [Qemu-devel] [PATCH] cryptodev: fix two typos in error message

2017-06-29 Thread Gonglei (Arei)
> -Original Message- > From: Pu Hou [mailto:bjho...@linux.vnet.ibm.com] > Sent: Thursday, June 29, 2017 7:58 PM > To: qemu-devel@nongnu.org; Gonglei (Arei) > Cc: pa...@linux.vnet.ibm.com; bagra...@de.ibm.com; Pu Hou > Subject: [PATCH] cryptodev: fix two typos in error message > > Currentl

Re: [Qemu-devel] [PATCH] qom: enforce readonly nature of link's check callback

2017-06-29 Thread Paolo Bonzini
On 29/06/2017 13:14, Igor Mammedov wrote: > link's check callback is supposed to verify/permit setting it, > however currently nothing restricts it from misusing it > and modifying target object from within. > Make sure that readonly semantics are checked by compiler > to prevent callback's misuse.

[Qemu-devel] [PULL 5/8] virtio-9p: message header is 7-byte long

2017-06-29 Thread Greg Kurz
The 9p spec at http://man.cat-v.org/plan_9/5/intro reads: "Each 9P message begins with a four-byte size field specify- ing the length in bytes of the complete message including the four bytes of the size field itself. The next byte is the message type, one of the constants in the enumerati

[Qemu-devel] [PULL 4/8] virtio-9p: record element after sanity checks

2017-06-29 Thread Greg Kurz
If the guest sends a malformed request, we end up with a dangling pointer in V9fsVirtioState. This doesn't seem to cause any bug, but let's remove this side effect anyway. Signed-off-by: Greg Kurz Reviewed-by: Michael S. Tsirkin --- hw/9pfs/virtio-9p-device.c | 3 ++- 1 file changed, 2 insertio

Re: [Qemu-devel] [RISU PATCH v6 02/10] build-all-archs: support cross building via docker

2017-06-29 Thread Philippe Mathieu-Daudé
On Thu, Jun 29, 2017 at 10:27 AM, Alex Bennée wrote: > Philippe Mathieu-Daudé writes: >> On 06/21/2017 12:42 PM, Alex Bennée wrote:> By default we use the QEMU >> projects qemu:debian-FOO-cross images as >>> RISU hackers are likely to be QEMU developers too. However any docker >>> tag can be pass

Re: [Qemu-devel] [PATCH v5 6/6] target-m68k, linux-user: manage FP registers in ucontext

2017-06-29 Thread Riku Voipio
On Wed, Jun 28, 2017 at 10:44:57PM +0200, Laurent Vivier wrote: > Riku, > > could you ACK this patch, so I will add it in my next pull request for m68k? Whatabout Richard's comment about using cpu_m68k_set_fpcr ? Riku > Thanks, > Laurent > > Le 20/06/2017 à 22:51, Laurent Vivier a écrit : > >

[Qemu-devel] [PULL 6/8] virtio-9p: break device if buffers are misconfigured

2017-06-29 Thread Greg Kurz
The 9P protocol is transport agnostic: if the guest misconfigured the buffers, the best we can do is to set the broken flag on the device. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 2 +- hw/9pfs/9p.h | 2 +- hw/9pfs/virtio-9p-device.c | 40

[Qemu-devel] [PULL 7/8] xen-9pfs: disconnect if buffers are misconfigured

2017-06-29 Thread Greg Kurz
From: Stefano Stabellini Implement xen_9pfs_disconnect by unbinding the event channels. On xen_9pfs_free, call disconnect if any event channels haven't been disconnected. If the frontend misconfigured the buffers set the backend to "Closing" and disconnect it. Misconfigurations include requestin

[Qemu-devel] [PULL 2/8] 9pfs: local: Add support for custom fmode/dmode in 9ps mapped security modes

2017-06-29 Thread Greg Kurz
From: Tobias Schramm In mapped security modes, files are created with very restrictive permissions (600 for files and 700 for directories). This makes file sharing between virtual machines and users on the host rather complicated. Imagine eg. a group of users that need to access data produced by

[Qemu-devel] [PULL 8/8] 9pfs: handle transport errors in pdu_complete()

2017-06-29 Thread Greg Kurz
Contrary to what is written in the comment, a buggy guest can misconfigure the transport buffers and pdu_marshal() may return an error. If this ever happens, it is up to the transport layer to handle the situation (9P is transport agnostic). This fixes Coverity issue CID1348518. Signed-off-by: G

[Qemu-devel] [PULL 3/8] 9pfs: replace g_malloc()+memcpy() with g_memdup()

2017-06-29 Thread Greg Kurz
From: Marc-André Lureau I found these pattern via grepping the source tree. I don't have a coccinelle script for it! Signed-off-by: Marc-André Lureau --- hw/9pfs/9p-synth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index 4b6d4

[Qemu-devel] Debugging source code with Eclipse

2017-06-29 Thread Ormaetxea Xabier
Hello! Im trying to debug the source code of Qemu with Eclipse to try to understand how it works. Im not totally sure how should I do this process, but I've create a Eclipse C project using all the Qemu source code. Unfortunately I get a lot of errors for each code piece, and I can't run it. T

[Qemu-devel] [PATCH] cryptodev: fix two typos in error message

2017-06-29 Thread Pu Hou
Currently we have the name of the backend 'cryptodev-builtin' misspelled as 'cryptdov-builtin' in two potentially user facing error messages. Let's fix this. Furthermore The second mention of 'cryptodev-builtin' omits 'backend'. Let's make things consistent by adding it. Reported-by: Timur Bagram

[Qemu-devel] [PATCH] cryptodev: fix two typos in error message

2017-06-29 Thread Pu Hou
Currently we have the name of the backend 'cryptodev-builtin' misspelled as 'cryptdov-builtin' in two potentially user facing error messages. Let's fix this. Furthermore The second mention of 'cryptodev-builtin' omits 'backend'. Let's make things consistent by adding it. Reported-by: Timur Bagram

Re: [Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-06-29 Thread Kevin Wolf
Am 29.06.2017 um 14:07 hat Manos Pitsidianakis geschrieben: > On Thu, Jun 29, 2017 at 01:18:24PM +0200, Kevin Wolf wrote: > >Am 29.06.2017 um 08:03 hat Manos Pitsidianakis geschrieben: > >>bdrv_open_driver() is called in two places, bdrv_new_open_driver() and > >>bdrv_open_common(). In the latter,

Re: [Qemu-devel] TPM status

2017-06-29 Thread Javier Martinez Canillas
Hello Stefan, Thanks a lot for the summary, it's very informative. I've a question below. On 06/27/2017 06:12 PM, Stefan Berger wrote: > > QEMU TPM Device > === > > = Guest-side Hardware Interface = > > The QEMU TPM emulation implements a TPM TIS hardware interface following > the

Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

2017-06-29 Thread Daniel P. Berrange
On Wed, Jun 28, 2017 at 02:41:58PM -0300, Eduardo Habkost wrote: > On Wed, Jun 28, 2017 at 11:05:26AM +0200, Markus Armbruster wrote: > > > Ensuring errp is never NULL > > > --- > > > > > > The last patch on this series changes the (Error **errp) > > > parameters in functio

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] block: add default implementations for bdrv_co_get_block_status()

2017-06-29 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 01:46:16AM +0300, Manos Pitsidianakis wrote: > bdrv_co_get_block_status_from_file() and > bdrv_co_get_block_status_from_backing() set *file to bs->file and > bs->backing respectively, so that bdrv_co_get_block_status() can recurse > to them. Future block drivers won't have t

Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 01:46:15AM +0300, Manos Pitsidianakis wrote: > The following functions fail if bs->drv does not implement them: > > bdrv_probe_blocksizes > bdrv_probe_geometry > bdrv_truncate > bdrv_has_zero_init > bdrv_get_info > bdrv_media_changed > bdrv_eject > bdrv_lock_medium > bdrv_c

Re: [Qemu-devel] [PULL 00/14] Migration pull request for 20170628

2017-06-29 Thread Peter Maydell
On 28 June 2017 at 12:30, Juan Quintela wrote: > Hi > > This is the migration pull request, it includes: > - return path capability (peter) > - objectify migration (peter) > Thanks to all the people who helped debug the QOM/QAPI. > - fix access to ramblocks (Haozhong) > - add error hint to VMSTA

[Qemu-devel] [PATCHv7 0/6] fw_cfg: qdev-related tidy-ups

2017-06-29 Thread Mark Cave-Ayland
As part of some ongoing sun4u work, I need to be able to wire the fw_cfg IO interface to a separate IO space by instantiating the qdev device instead of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with FW_CFG_MEM and tidies up the realize methods accordingly. Signed-off-by: Ma

[Qemu-devel] [PATCHv7 2/6] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1()

2017-06-29 Thread Mark Cave-Ayland
The setting of the FW_CFG_VERSION_DMA bit is the same across both the TYPE_FW_CFG_MEM and TYPE_FW_CFG_IO devices, so unify the logic in fw_cfg_init1(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Laszlo Ersek Reviewed-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé --- hw/nvram/fw_cf

[Qemu-devel] [PATCHv7 4/6] fw_cfg: add assert() to ensure the fw_cfg device has been added as a child property

2017-06-29 Thread Mark Cave-Ayland
This will currently always succeed until the check is moved from init to realize. Signed-off-by: Mark Cave-Ayland --- hw/nvram/fw_cfg.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 0fe7404..2291121 100644 --- a/hw/nvram/fw_cfg.

Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block: pass bdrv_* methods to bs->file by default

2017-06-29 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 01:46:15AM +0300, Manos Pitsidianakis wrote: > @@ -3406,13 +3410,18 @@ int bdrv_truncate(BdrvChild *child, int64_t offset, > Error **errp) > > assert(child->perm & BLK_PERM_RESIZE); > > -if (!drv) { > -error_setg(errp, "No medium inserted"); > -

Re: [Qemu-devel] [PATCH] replace struct ucontext with ucontext_t type

2017-06-29 Thread Laurent Vivier
Le 28/06/2017 à 22:44, Khem Raj a écrit : > The ucontext_t type had a tag struct ucontext until now > but newer glibc will drop it so we need to adjust and use > the exposed type instead > > Signed-off-by: Khem Raj > Cc: Kamil Rytarowski > Cc: Riku Voipio > Cc: Laurent Vivier > Cc: Paolo Bonzi

[Qemu-devel] [PATCHv7 1/6] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize()

2017-06-29 Thread Mark Cave-Ayland
As indicated by Laszlo it is a QOM bug for the realize() method to actually map the device. Set up the IO regions within fw_cfg_io_realize() and defer the mapping with sysbus_add_io() to the caller, as already done in fw_cfg_init_mem_wide(). This makes the iobase and dma_iobase properties now obso

[Qemu-devel] [PATCHv7 5/6] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers

2017-06-29 Thread Mark Cave-Ayland
When looking to instantiate a TYPE_FW_CFG_MEM or TYPE_FW_CFG_IO device to be able to wire it up differently, it is much more convenient for the caller to instantiate the device and have the fw_cfg default files already preloaded during realize. Move fw_cfg_init1() to the end of both the fw_cfg_mem

Re: [Qemu-devel] TPM status

2017-06-29 Thread Javier Martinez Canillas
Hello Stefan, On 06/28/2017 10:57 PM, Stefan Berger wrote: > On 06/28/2017 12:44 PM, Laszlo Ersek wrote: >> On 06/28/17 17:22, Peter Jones wrote: >>> On Tue, Jun 27, 2017 at 12:12:50PM -0400, Stefan Berger wrote: [snip] To support measurements logs to be written by the firmware, e.g. >

Re: [Qemu-devel] [PATCH 1/7] vmgenid: replace x-write-pointer-available hack

2017-06-29 Thread Michael S. Tsirkin
On Thu, Jun 29, 2017 at 03:23:04PM +0200, Marc-André Lureau wrote: > This compat property sole function is to prevent the device from being > instantiated. Instead of requiring an extra compat property, check if > fw_cfg has DMA enabled. > > This has the additional benefit of handling other cases

[Qemu-devel] [PATCHv7 6/6] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h

2017-06-29 Thread Mark Cave-Ayland
By exposing FWCfgIoState and FWCfgMemState internals we allow the possibility for the internal MemoryRegion fields to be mapped by name for boards that wish to wire up the fw_cfg device themselves. Signed-off-by: Mark Cave-Ayland Reviewed-by: Laszlo Ersek --- hw/nvram/fw_cfg.c | 49 +-

Re: [Qemu-devel] Debugging source code with Eclipse

2017-06-29 Thread Peter Maydell
On 29 June 2017 at 10:37, Ormaetxea Xabier wrote: > Im trying to debug the source code of Qemu with Eclipse to try to understand > how it works. Im not totally sure how should I do this process, but I've > create a Eclipse C project using all the Qemu source code. Unfortunately I > get a lot of

[Qemu-devel] [PATCHv7 3/6] fw_cfg: switch fw_cfg_find() to locate the fw_cfg device by type rather than path

2017-06-29 Thread Mark Cave-Ayland
This will enable the fw_cfg device to be placed anywhere within the QOM tree regardless of its machine location. Signed-off-by: Mark Cave-Ayland --- hw/nvram/fw_cfg.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 99bdbc2..0fe74

Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

2017-06-29 Thread Daniel P. Berrange
On Wed, Jun 28, 2017 at 11:05:26AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > Rationale > > - > > > > I'm often bothered by the fact that we can't write the following: > > > > foo(arg, errp); > > if (*errp) { > > handle the error... > > error_p

Re: [Qemu-devel] [PATCH v5 6/6] target-m68k, linux-user: manage FP registers in ucontext

2017-06-29 Thread Laurent Vivier
Le 29/06/2017 à 15:46, Riku Voipio a écrit : > On Wed, Jun 28, 2017 at 10:44:57PM +0200, Laurent Vivier wrote: >> Riku, >> >> could you ACK this patch, so I will add it in my next pull request for m68k? > > Whatabout Richard's comment about using cpu_m68k_set_fpcr ? You're right. I've fixed it my

Re: [Qemu-devel] [PATCH v5 6/6] target-m68k, linux-user: manage FP registers in ucontext

2017-06-29 Thread Laurent Vivier
Le 29/06/2017 à 16:11, Laurent Vivier a écrit : > Le 29/06/2017 à 15:46, Riku Voipio a écrit : >> On Wed, Jun 28, 2017 at 10:44:57PM +0200, Laurent Vivier wrote: >>> Riku, >>> >>> could you ACK this patch, so I will add it in my next pull request for m68k? >> >> Whatabout Richard's comment about us

Re: [Qemu-devel] [RFC 00/15] Error API: Flag errors in *errp even if errors are being ignored

2017-06-29 Thread Daniel P. Berrange
On Thu, Jun 29, 2017 at 03:39:58PM +0200, Paolo Bonzini wrote: > On 28/06/2017 11:05, Markus Armbruster wrote: > > If foo() additionally returned an indication of success, you could write > > > > if (!foo(arg, errp)) {// assuming foo() returns a bool > > handle the error... > >

<    1   2   3   4   5   >