[Qemu-devel] [PATCH v2] vmxnet3: Fix reading/writing guest memory specially when behind an IOMMU

2016-06-20 Thread KarimAllah Ahmed
When a PCI device lives behind an IOMMU, it should use 'pci_dma_*' family of functions when any transfer from/to guest memory is required while 'cpu_physical_memory_*' family of functions completely bypass any MMU/IOMMU in the system. vmxnet3 in some places was using 'cpu_physical_memory_*' family

Re: [Qemu-devel] [RFC 0/7] Safe watch and breakpoint manipulation

2016-06-20 Thread Sergey Fedorov
On 17/06/16 20:01, Paolo Bonzini wrote: > > On 17/06/2016 18:33, Alex Bennée wrote: >> First we move the break/watchpoints into an array which is more >> amenable to RCU control that the QLIST. We then control the life time >> of references to break/watchpoint data by removing long held >> referenc

Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/10] ppc: Fix rfi/rfid/hrfi/... emulation

2016-06-20 Thread Alexander Graf
On 06/20/2016 11:32 AM, Benjamin Herrenschmidt wrote: On Mon, 2016-06-20 at 18:02 +1000, Benjamin Herrenschmidt wrote: On Mon, 2016-06-20 at 17:08 +1000, Benjamin Herrenschmidt wrote: That fixed, it dies elsewhere in something related to page faults, still digging. Next problem: Darwin k

[Qemu-devel] [PATCH] Improve the alignment check infrastructure

2016-06-20 Thread Sergey Sorokin
Some architectures (e.g. ARMv8) need the address which is aligned to a size more than the size of the memory access. It's enougth the current costless alignment check implementation in QEMU, but we need to support the alignment size specifying. Signed-off-by: Sergey Sorokin --- include/exec/cpu-

Re: [Qemu-devel] [PATCH 1/2] hw/misc: Add a model for the ASPEED System Control Unit

2016-06-20 Thread Peter Maydell
On 20 June 2016 at 04:44, Andrew Jeffery wrote: > On Fri, 2016-06-17 at 15:22 +0100, Peter Maydell wrote: >> +static Property aspeed_scu_properties[] = { >> +DEFINE_PROP_ARRAY("reset", AspeedSCUState, num_resets, reset, >> + qdev_prop_uint32, uint32_t), >> +DEFINE_PROP

Re: [Qemu-devel] PPC e500spin pir improperly initialized

2016-06-20 Thread Thomas Huth
On 18.06.2016 02:50, alar...@ddci.com wrote: > Note change of subject from "Determining interest in PPC e500spin, > yield". > > Thomas Huth wrote on 06/16/2016 01:47:05 AM: > Aaron Larson wrote on 15.06.2016 22:12 > > in ppce500_spin.c > > AL> @@ -104,6 +108,16 @@ > AL> > AL> cpu_synchro

[Qemu-devel] [PULL 00/20] Block patches

2016-06-20 Thread Stefan Hajnoczi
The following changes since commit 482b61844ae7c6df39df0b48ac90ffbc87bed7d2: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160617' into staging (2016-06-17 16:16:37 +0100) are available in the git repository at: git://github.com/stefanha/qemu.git tags/block-pull-requ

[Qemu-devel] [PULL 01/20] libqos: use virtio_ids.h for device ID definitions

2016-06-20 Thread Stefan Hajnoczi
Avoid redefining device IDs. Use the standard Linux headers that are already in the source tree. Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-2-git-send-email-stefa...@redhat.com --- tests/libqos/virtio.h| 9 - tests/virtio-blk-test.c | 7 --- tests/virtio-net-te

[Qemu-devel] [PULL 03/20] libqos: drop duplicated virtio_config.h definitions

2016-06-20 Thread Stefan Hajnoczi
Note that VIRTIO_F_ANY_LAYOUT and VIRTIO_F_NOTIFY_ON_EMPTY are bit numbers in virtio_config.h but bit masks in qtest virtio.h. Therefore it's necessary to change users from X to (1u << X). Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-4-git-send-email-stefa...@redhat.com --- tests

[Qemu-devel] [PULL 09/20] libqos: add qvirtqueue_cleanup()

2016-06-20 Thread Stefan Hajnoczi
qvirtqueue_setup() allocates the vring and virtqueue state. So far there has been no function to free it. Callers have been using guest_free() for the vring but forgot to free the QVirtQueue state. This patch solves the memory leak by introducing qvirtqueue_cleanup(). Signed-off-by: Stefan Hajn

[Qemu-devel] [PULL 11/20] block: fix race in bdrv_co_discard with drive-mirror

2016-06-20 Thread Stefan Hajnoczi
From: "Denis V. Lunev" Actually we must set dirty bitmap dirty after we have written all our zeroes for correct processing in drive mirror code. In the other case we can face not zeroes in this area in mirror_iteration. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy Rev

[Qemu-devel] [PULL 02/20] libqos: drop duplicated PCI vendor ID definition

2016-06-20 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-3-git-send-email-stefa...@redhat.com --- tests/libqos/virtio-pci.c | 3 ++- tests/libqos/virtio.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c index 9d45

[Qemu-devel] [PULL 10/20] block: fixed BdrvTrackedRequest filling in bdrv_co_discard

2016-06-20 Thread Stefan Hajnoczi
From: "Denis V. Lunev" The request area is specified in bytes, not in sectors. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fam Zheng Reviewed-by: Eric Blake Message-id: 1466093381-6120-2-git-send-email-...@openvz.org CC: Stefan Hajnoczi CC: Kevin Wolf

[Qemu-devel] [Bug 1594394] [NEW] Using setreuid / setegid crashes x86_64 user-mode target

2016-06-20 Thread Timothy Pearson
Public bug reported: When setreuid() or setegid() are called from x86_64 target code in user mode, qemu crashes inside the NPTL signal handlers. x86 targets do not directly use a syscall to handle setreuid() / setegid(); instead the x86 NPTL implementation sets up a temporary data region in memor

[Qemu-devel] [PULL 13/20] blockjob: move iostatus reset out of block_job_enter()

2016-06-20 Thread Stefan Hajnoczi
The QMP block-job-resume command and cancellation may want to reset the job's iostatus. The next patches add a user who does not want to reset iostatus so move it up to block_job_enter() callers. Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Reviewed-by: Paolo Bonzini Message-id: 14660

Re: [Qemu-devel] [PATCH 1/5] BIT_RANGE convenience macro

2016-06-20 Thread Peter Maydell
On 20 June 2016 at 15:11, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: >> I prefer a "start, length" macro to "position, position", >> because this matches what we already have for the deposit >> and extract functions in this header. > > I think it depends on t

[Qemu-devel] [PULL 20/20] backup: follow AioContext change gracefully

2016-06-20 Thread Stefan Hajnoczi
Move s->target to the new AioContext when there is an AioContext change. The backup_run() coroutine does not use asynchronous I/O so there is no need to wait for in-flight requests in a BlockJobDriver->pause() callback. Guest writes are intercepted by the backup job. Treat them as guest activity

[Qemu-devel] [PULL 05/20] libqos: drop duplicated virtio_vring.h structs

2016-06-20 Thread Stefan Hajnoczi
The descriptor element, used, and avail vring structs are defined in virtio_ring.h. There is no need to duplicate them in libqos virtio. Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-6-git-send-email-stefa...@redhat.com --- tests/libqos/virtio.c | 10 +- tests/libqos/virti

[Qemu-devel] [PULL 15/20] blockjob: add pause points

2016-06-20 Thread Stefan Hajnoczi
Block jobs are coroutines that usually perform I/O but sometimes also sleep or yield. Currently only sleeping or yielded block jobs can be paused. This means jobs that do not sleep or yield (using block_job_yield()) are unaffected by block_job_pause(). Add block_job_pause_point() so that block j

[Qemu-devel] [PULL 12/20] block: process before_write_notifiers in bdrv_co_discard

2016-06-20 Thread Stefan Hajnoczi
From: "Denis V. Lunev" This is mandatory for correct backup creation. In the other case the content under this area would be lost. Dirty bits are set exactly like in bdrv_aligned_pwritev, i.e. they are set even if notifier has returned a error. Signed-off-by: Denis V. Lunev Reviewed-by: Vladim

Re: [Qemu-devel] Any topics for today's MTTCG sync-up call?

2016-06-20 Thread alvise rigo
On Mon, Jun 20, 2016 at 4:12 PM, Alex Bennée wrote: > > alvise rigo writes: > > > Hi Alex, > > > > I'm looking into the worries that Sergey issued in his review of the > > last LL/SC series. The target is to reduce the TLB flushes by using an > > exclusive history of dynamic length. I don't have

[Qemu-devel] [PULL 06/20] libqos: drop duplicated virtio_blk.h definitions

2016-06-20 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-7-git-send-email-stefa...@redhat.com --- tests/virtio-blk-test.c | 50 - 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c in

Re: [Qemu-devel] [PATCH 1/5] BIT_RANGE convenience macro

2016-06-20 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > On 16 June 2016 at 18:12, Dr. David Alan Gilbert (git) > wrote: > > From: "Dr. David Alan Gilbert" > > > > e.g. BIT_RANGE(15, 0) gives 0xff00 > > > > Suggested by: Paolo Bonzini > > Signed-off-by: Dr. David Alan Gilbert > > --- > > include/qe

[Qemu-devel] [PULL 17/20] block: use safe iteration over AioContext notifiers

2016-06-20 Thread Stefan Hajnoczi
It's possible that an AioContext notifier user was close to finishing when .detach_aio_context() or .attached_aio_context() is called. In that case they may call bdrv_remove_aio_context_notifier() during the callback. Use safe iteration to avoid crashing when the notifier list is modified during

[Qemu-devel] [PATCH 0/2] qcow2: Fix qcow2_get_cluster_offset()

2016-06-20 Thread Max Reitz
Patch 2 fixes a wrong assertion in qcow2_get_cluster_offet(). Patch 1 fixes wrong range limitations I encountered in qemu-io while trying to break that wrong assertion. Not CC-ing qemu-stable because these issues were introduced after 2.6.0. Max Reitz (2): qemu-io: Use correct range limitation

Re: [Qemu-devel] Any topics for today's MTTCG sync-up call?

2016-06-20 Thread Alex Bennée
alvise rigo writes: > Hi Alex, > > I'm looking into the worries that Sergey issued in his review of the > last LL/SC series. The target is to reduce the TLB flushes by using an > exclusive history of dynamic length. I don't have anything ready yet > though. Are you also tackling the race condit

[Qemu-devel] [PULL 08/20] libqos: drop duplicated virtio_pci.h definitions

2016-06-20 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-9-git-send-email-stefa...@redhat.com --- tests/libqos/virtio-pci.c | 42 ++ tests/libqos/virtio-pci.h | 17 - tests/virtio-blk-test.c | 11 ++- tests/virtio-scsi-test.c |

[Qemu-devel] [PULL 18/20] blockjob: add AioContext attached callback

2016-06-20 Thread Stefan Hajnoczi
Block jobs that use additional BDSes or event loop resources need a callback to get their affairs in order when the AioContext is switched. Simple block jobs don't need an attach callback, they automatically work thanks to the generic attach/detach notifiers that this patch adds. Signed-off-by: S

[Qemu-devel] [Bug 1594394] Re: Using setreuid / setegid crashes x86_64 user-mode target

2016-06-20 Thread Peter Maydell
Whoops, I meant http://patchwork.ozlabs.org/patch/590640/. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1594394 Title: Using setreuid / setegid crashes x86_64 user-mode target Status in QEMU: N

Re: [Qemu-devel] [RFC 0/7] Safe watch and breakpoint manipulation

2016-06-20 Thread Paolo Bonzini
On 20/06/2016 15:55, Sergey Fedorov wrote: >> > I'm not sure why you say that arrays are more amenable than QTAILQ >> > (though indeed include/qemu/rcu_queue.h only includes QLIST for now), >> > but I feel bad asking you to redo all the work... > Is there any realistic way to manage *doubly* link

[Qemu-devel] [PULL 14/20] blockjob: rename block_job_is_paused()

2016-06-20 Thread Stefan Hajnoczi
The block_job_is_paused() function name is not great because callers only use it to determine whether pausing has been requested. Rename it to highlight those semantics and remove it from the public header file as there are no external callers. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo B

Re: [Qemu-devel] [PATCH RFC 7/7] hw/ich9: enable pci acpi hotplug

2016-06-20 Thread Igor Mammedov
On Tue, 31 May 2016 20:48:38 +0300 Marcel Apfelbaum wrote: > Re-use the pci acpi hotplug code and enable it only for > the new machines using the 'acpi-pci-hotplug-with-bridge-support' > compat property. > > Signed-off-by: Marcel Apfelbaum > --- > hw/acpi/ich9.c | 31 ++

[Qemu-devel] [PATCH 1/2] qemu-io: Use correct range limitations

2016-06-20 Thread Max Reitz
create_iovec() has a comment lamenting the lack of SIZE_T_MAX. Since there actually is a SIZE_MAX, use it. Two places use INT_MAX for checking the upper bound of a sector count that is used as an argument for a blk_*() function (blk_discard() and blk_write_compressed(), respectively). BDRV_REQUEST

[Qemu-devel] [PULL 07/20] libqos: drop duplicated virtio_scsi.h definitions

2016-06-20 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi Message-id: 1462798061-30382-8-git-send-email-stefa...@redhat.com --- tests/virtio-scsi-test.c | 45 +++-- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c ind

[Qemu-devel] [PULL 16/20] blockjob: add block_job_get_aio_context()

2016-06-20 Thread Stefan Hajnoczi
Add a helper function to document why block jobs sometimes run in the QEMU main loop and to avoid code duplication in a following patch. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Reviewed-by: Fam Zheng Message-id: 1466096189-6477-5-git-send-email-stefa...@redhat.com --- blockjo

[Qemu-devel] [PATCH 1/3] ich9: call ich9_lpc_update_pic for disabled pirqs

2016-06-20 Thread Paolo Bonzini
An asserted pirq can be disabled and the corresponding GSIs should then go down to 0. However, because of the conditional in ich9_lpc_update_by_pirq, the legacy 8259 pin could remain stuck to 1. Signed-off-by: Paolo Bonzini --- hw/isa/lpc_ich9.c | 3 --- 1 file changed, 3 deletions(-) diff --g

[Qemu-devel] [PULL 04/20] libqos: drop duplicated virtio_ring.h bit definitions

2016-06-20 Thread Stefan Hajnoczi
Note that virtio_ring.h defines feature bits using their bit number: #define VIRTIO_RING_F_INDIRECT_DESC 28 On the other hand libqos virtio.h uses the bit mask: #define QVIRTIO_F_RING_INDIRECT_DESC0x1000 The patch makes the necessary adjustments. I have used "1u << BITMASK" ins

[Qemu-devel] [PULL 19/20] mirror: follow AioContext change gracefully

2016-06-20 Thread Stefan Hajnoczi
Add block_job_pause_point() calls to mark quiescent points and make sure to complete in-flight requests when switching AioContexts. This patch solves undefined behavior in the mirror block job when the BDS AioContext is changed by dataplane. Signed-off-by: Stefan Hajnoczi Signed-off-by: Fam Zhen

[Qemu-devel] [PATCH 5/6] char: change qemu_chr_fe_add_watch to return unsigned

2016-06-20 Thread Paolo Bonzini
g_source_attach can return any value between 1 and UINT_MAX if you let QEMU run long enough. However, qemu_chr_fe_add_watch can also return a negative errno value when the device is disconnected or does not support chr_add_watch. Change it to return zero to avoid overloading these values. Fix th

[Qemu-devel] [PATCH 2/2] qcow2: Fix qcow2_get_cluster_offset()

2016-06-20 Thread Max Reitz
Recently, qcow2_get_cluster_offset() has been changed to work with bytes instead of sectors. This invalidated some assertions and introduced a possible integer multiplication overflow. This could be reproduced using e.g. $ qemu-img create -f qcow2 -o cluster_size=1M blub.qcow2 8G Formatting 'foo.

[Qemu-devel] [PATCH 3/6] serial: separate serial_xmit and serial_watch_cb

2016-06-20 Thread Paolo Bonzini
serial_xmit starts transmission of whatever is in the FIFO or THR; serial_watch_cb is a wrapper around it. Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index 6f0a49

[Qemu-devel] [Bug 1594069] Re: SIMD instructions translated to scalar host instructions

2016-06-20 Thread Timothy Pearson
I mostly filed the bug report since I was seeing multiple different attempts to implement this, and even a proper patch series on the mailing list, but no movement at all toward integrating this feature into mainline qemu. What would be needed to e.g. make the patch series on the mailing list acce

[Qemu-devel] [PATCH 3/3] ich9: unify pic and ioapic IRQ vectors

2016-06-20 Thread Paolo Bonzini
ich9->pic and ich9->ioapic differ for the first 16 GSIs (because ich9->pic is wired to 8259+IOAPIC but ich9->ioapic is wired to IOAPIC only). However, ich9->ioapic is never used for the first 16 GSIs, so the two vectors can be merged. Signed-off-by: Paolo Bonzini --- hw/i386/pc_q35.c | 3

Re: [Qemu-devel] [PATCH RFC 6/7] hw/acpi: extend acpi pci hotplug support for pci express

2016-06-20 Thread Igor Mammedov
On Tue, 31 May 2016 20:48:37 +0300 Marcel Apfelbaum wrote: subj doesn't match patch, it does opposite i.e. makes sure that pcie isn't counted in when building acpi hotplug aml > Emit acpi code for pci hotplug on all PC machines: > - if legacy pci hotpug is enabled (pcihp_bridge_en) > - if ther

Re: [Qemu-devel] [PATCH v2] Change net/socket.c to use socket_*() functions

2016-06-20 Thread Paolo Bonzini
On 18/06/2016 09:54, Ashijeet Acharya wrote: > Use socket_*() functions from include/qemu/sockets.h instead of > listen()/bind()/ connect()/parse_host_port(). socket_*() fucntions are > QAPI based and this patch performs this api conversion since everything > will be using QAPI based sockets in t

[Qemu-devel] [Bug 1594394] Re: Using setreuid / setegid crashes x86_64 user-mode target

2016-06-20 Thread Peter Maydell
https://patches.linaro.org/patch/63313/ may be relevant here. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1594394 Title: Using setreuid / setegid crashes x86_64 user-mode target Status in QEMU:

[Qemu-devel] [PATCH 3/2] MAINTAINERS: Remove Blue Swirl leftovers

2016-06-20 Thread Markus Armbruster
Blue hasn't been active in the QEMU project for a long time. Drop his last MAINTAINERS entries. As per Paolo's recommendation, downgrade status of "BSD user" from Maintained to Orphan since the FreeBSD guys effectively forked it, and "SPARC target" from Maintained to Odd Fixes, since we still hav

[Qemu-devel] [PATCH 0/3] ich9: clean up handling of output interrupt pins

2016-06-20 Thread Paolo Bonzini
Currently the southbridge in the q35 machine types gets 40 different qemu_irqs. The 16 lower GSIs (connected to both 8259 and IOAPIC) and the 24 input pins of the IOAPIC (the higher 8 of which correspond to the 8 higher GSIs). However, there's no reason to use the 16 first input pins of the IOAPI

[Qemu-devel] [PATCH 0/3] linux-user: three minor fixes

2016-06-20 Thread Peter Maydell
This patchset fixes a couple of minor bugs in linux-user which were manifesting as LTP test failures: * syscalls which take a sigsetsize argument should check it matches the target's sigset_t size, or fail EINVAL * a typo meant we weren't locking enough data for the argument to rt_sigqueuin

[Qemu-devel] [PULL 5/7] log: Plug memory leak on multiple -dfilter

2016-06-20 Thread Markus Armbruster
-dfilter overwrites any previous filter. The overwritten filter is leaked. Leaks since the beginning (commit 3514552, v2.6.0). Free it properly. Signed-off-by: Markus Armbruster Message-Id: <1466011636-6112-2-git-send-email-arm...@redhat.com> Reviewed-by: Eric Blake --- util/log.c | 7 ++

[Qemu-devel] [PATCH 1/3] linux-user: Check sigsetsize argument to syscalls

2016-06-20 Thread Peter Maydell
Many syscalls which take a sigset_t argument also take an argument giving the size of the sigset_t. The kernel insists that this matches its idea of the type size and fails EINVAL if it is not. Implement this logic in QEMU. (This mostly just means some LTP test cases which check error cases now p

[Qemu-devel] [PATCH 3/3] linux-user: Support F_GETPIPE_SZ and F_SETPIPE_SZ fcntls

2016-06-20 Thread Peter Maydell
Support the F_GETPIPE_SZ and F_SETPIPE_SZ fcntl operations. Signed-off-by: Peter Maydell --- linux-user/strace.c | 7 +++ linux-user/syscall.c | 6 ++ linux-user/syscall_defs.h | 2 ++ 3 files changed, 15 insertions(+) diff --git a/linux-user/strace.c b/linux-user/strace.c in

[Qemu-devel] [Bug 1585008] Re: Windows 7 guests hang on bootup when qxl video is used

2016-06-20 Thread Serge Hallyn
*** This bug is a duplicate of bug 1591724 *** https://bugs.launchpad.net/bugs/1591724 Thanks - so it's fixed upstream and in ubuntu yakkety. I'll mark it as a dup of bug 1591724. ** Changed in: qemu (Ubuntu) Status: Confirmed => Fix Released ** This bug has been marked a duplicate o

Re: [Qemu-devel] [RFC v3 PATCH 14/14] target-i386: Generate fences for x86

2016-06-20 Thread Pranith Kumar
On Sat, Jun 18, 2016 at 1:48 AM, Richard Henderson wrote: > On 06/17/2016 09:03 PM, Pranith Kumar wrote: >> >> case 0xe8 ... 0xef: /* lfence */ >> +tcg_gen_mb(TCG_MO_LD_LD | TCG_BAR_SC); >> +break; >> case 0xf0 ... 0xf7: /* mfence */ >> if (!(

Re: [Qemu-devel] [PATCH] i386: pci-assign: Fix MSI-X table size

2016-06-20 Thread Paolo Bonzini
On 18/06/2016 22:42, Ido Yariv wrote: > The current code creates a whole page mmio region for the MSI-X table > size. > > However, the page containing the MSI-X table may contain other registers > not related to MSI-X. Creating an mmio region for the whole page masks > such registers and may bre

[Qemu-devel] analysis of LTP test failures under QEMU linux-user

2016-06-20 Thread Peter Maydell
I went through and quickly analysed all our LTP failures when running under linux-user, which I figured might be of interest to the list... This is with current master plus the following patches (all on list): linux-user: Avoid possible misalignment in host_to_target_siginfo() linux-user: Use __g

[Qemu-devel] [PATCH 0/6] serial: flow control fixes

2016-06-20 Thread Paolo Bonzini
The main fixes here are in patch 2 and patch 6: watches are lost after migration, and not removed on reset. The rest are cleanups; patch 5 fixes the qemu_chr_fe_add_watch API, which botches its return value pretty badly. Paolo Paolo Bonzini (6): serial: make tsr_retry unsigned serial: reinst

[Qemu-devel] [PULL 2/7] error: Remove NULL checks on error_propagate() calls

2016-06-20 Thread Markus Armbruster
From: Eduardo Habkost error_propagate() already ignores local_err==NULL, so there's no need to check it before calling. Coccinelle patch used to perform the changes added to scripts/coccinelle/error_propagate_null.cocci. Reviewed-by: Eric Blake Acked-by: Cornelia Huck Reviewed-by: Markus Armb

[Qemu-devel] [PULL 0/7] Error reporting patches for 2016-06-20

2016-06-20 Thread Markus Armbruster
The following changes since commit 5edbd4e30426d3a0d712510b2509a521e35192b1: Merge remote-tracking branch 'remotes/otubo/tags/pull-seccomp-20160620' into staging (2016-06-20 12:53:35 +0100) are available in the git repository at: git://repo.or.cz/qemu/armbru.git tags/pull-error-

[Qemu-devel] [PATCH 4/6] serial: simplify tsr_retry reset

2016-06-20 Thread Paolo Bonzini
Move common code outside the if, and reset tsr_retry even in loopback mode. Right now it cannot become non-zero, but it will be possible as soon as we start respecting the baud rate. Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[Qemu-devel] [Bug 984476] Re: "segmentaion" error when DMAing

2016-06-20 Thread T. Huth
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=362f5fb5643a9cfcf4b5127f ** Changed in: qemu Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/984476 Title:

[Qemu-devel] [PULL 7/7] log: Fix qemu_set_log_filename() error handling

2016-06-20 Thread Markus Armbruster
When qemu_set_log_filename() detects an invalid file name, it reports an error, closes the log file (if any), and starts logging to stderr (unless daemonized or nothing is being logged). This is wrong. Asking for an invalid log file on the command line should be fatal. Asking for one in the moni

[Qemu-devel] [PATCH 2/6] serial: reinstate watch after migration

2016-06-20 Thread Paolo Bonzini
Otherwise, a serial port can get stuck if it is migrated while flow control is in effect. Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 16 ++-- include/hw/char/serial.h | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/char/serial.c b/hw/char/s

Re: [Qemu-devel] [PATCH v2] Change net/socket.c to use socket_*() functions

2016-06-20 Thread Peter Maydell
On 20 June 2016 at 15:55, Paolo Bonzini wrote: > > > On 18/06/2016 09:54, Ashijeet Acharya wrote: >> Use socket_*() functions from include/qemu/sockets.h instead of >> listen()/bind()/ connect()/parse_host_port(). socket_*() fucntions are >> QAPI based and this patch performs this api conversion s

[Qemu-devel] [PULL 4/7] coccinelle: Remove unnecessary variables for function return value

2016-06-20 Thread Markus Armbruster
From: Eduardo Habkost Use Coccinelle script to replace 'ret = E; return ret' with 'return E'. The script will do the substitution only when the function return type and variable type are the same. Manual fixups: * audio/audio.c: coding style of "read (...)" and "write (...)" * block/qcow2-clust

[Qemu-devel] [PATCH 6/6] serial: remove watch on reset

2016-06-20 Thread Paolo Bonzini
Otherwise, this can cause serial_xmit to be entered with LSR.TEMT=0, which is invalid and causes an assertion failure. Reported-by: Bret Ketchum Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/char/serial

[Qemu-devel] [Bug 1036987] Re: compilation error due to bug in savevm.c

2016-06-20 Thread T. Huth
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=a5b71725c7067f6805eb30 ** Changed in: qemu Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1036987 Title:

[Qemu-devel] [PATCH 1/6] serial: make tsr_retry unsigned

2016-06-20 Thread Paolo Bonzini
It can never become negative; reflect this in the type of the field and simplify the conditions. Signed-off-by: Paolo Bonzini --- hw/char/serial.c | 12 include/hw/char/serial.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/char/serial.c b/hw/cha

Re: [Qemu-devel] [Bug 1594069] Re: SIMD instructions translated to scalar host instructions

2016-06-20 Thread Peter Maydell
On 20 June 2016 at 15:05, Timothy Pearson wrote: > I mostly filed the bug report since I was seeing multiple different > attempts to implement this, and even a proper patch series on the > mailing list, but no movement at all toward integrating this feature > into mainline qemu. > > What would be

[Qemu-devel] [PATCH] scsi: esp: fix migration

2016-06-20 Thread Paolo Bonzini
Commit 926cde5 ("scsi: esp: make cmdbuf big enough for maximum CDB size", 2016-06-16) changed the size of a migrated field. Split it in two parts, and only migrate the second part in a new vmstate version. Signed-off-by: Paolo Bonzini --- hw/scsi/esp.c | 5 +++-- include/migration

[Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-20 Thread Denis V. Lunev
From: Evgeny Yakovlev Some guests (win2008 server for example) do a lot of unnecessary flushing when underlying media has not changed. This adds additional overhead on host when calling fsync/fdatasync. This change introduces a dirty flag in BlockDriverState which is set in bdrv_set_dirty and is

[Qemu-devel] [PATCH 2/3] ich9: clean up ich9_lpc_update_pic/ich9_lpc_update_apic and callers

2016-06-20 Thread Paolo Bonzini
Make ich9_lpc_update_pic take care only of GSIs 0-15, and ich9_lpc_update_apic take care only of GSIs 16-23. Assert that they are called with the correct GSI indices. Signed-off-by: Paolo Bonzini --- hw/isa/lpc_ich9.c | 39 --- 1 file changed, 16 insertions(+

Re: [Qemu-devel] [PATCH 1/2] qemu-io: Use correct range limitations

2016-06-20 Thread Eric Blake
On 06/20/2016 08:26 AM, Max Reitz wrote: > create_iovec() has a comment lamenting the lack of SIZE_T_MAX. Since > there actually is a SIZE_MAX, use it. > > Two places use INT_MAX for checking the upper bound of a sector count > that is used as an argument for a blk_*() function (blk_discard() and

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] qcow2: Fix qcow2_get_cluster_offset()

2016-06-20 Thread Eric Blake
On 06/20/2016 08:26 AM, Max Reitz wrote: > Recently, qcow2_get_cluster_offset() has been changed to work with bytes > instead of sectors. This invalidated some assertions and introduced a > possible integer multiplication overflow. > > This could be reproduced using e.g. > > $ qemu-img create -f

[Qemu-devel] [PATCH v2 1/1] cpu: report hyperv feature words through qom

2016-06-20 Thread Denis V. Lunev
From: Evgeny Yakovlev This change adds hyperv feature words report through qom rpc. When VM is configured with hyperv features enabled libvirt will check that required feature words are set in cpuid leaf 4003 through qom request. Currently qemu does not report hyperv feature words which pre

Re: [Qemu-devel] [PATCH 11/13] ICH9 LPC: move call of isa_bus_irqs to 'realize' method

2016-06-20 Thread Paolo Bonzini
On 17/06/2016 16:03, Paolo Bonzini wrote: > The modeling here was weird. ICH9 does not need both ->pic and > ->ioapic, it can make do with just a 24-entry GSI array. > > If you change that in the previous patch, this one makes much more > sense. As it is now, it seems like the ISA bus will not

Re: [Qemu-devel] [PATCH v6 8/9] target-mips: Add nan2008 flavor of ..

2016-06-20 Thread Maciej W. Rozycki
On Mon, 20 Jun 2016, Aleksandar Markovic wrote: > This patch is about NaN-2008 flavor of Mips instructions CEIL, CVT, > FLOOR, ROUND, TRUNC only (its title is "Add nan2008 flavor..."). > > Legacy-NaN flavors of the same Mips instructions already operate > correctly, and there is nothing to be f

Re: [Qemu-devel] [PATCH 4/4] tests: add a m25p80 test

2016-06-20 Thread Peter Maydell
On 17 June 2016 at 09:35, Cédric Le Goater wrote: > This test uses the palmetto platform and the AST2400 SPI controller to > test the m25p80 flash module device model. The flash model is defined > by the platform (n25q256a) and it would be nice to find way to control > it, using a property probabl

[Qemu-devel] [PATCH 2/3] linux-user: Fix wrong type used for argument to rt_sigqueueinfo

2016-06-20 Thread Peter Maydell
The third argument to the rt_sigqueueinfo syscall is a pointer to a siginfo_t, not a pointer to a sigset_t. Fix the error in the arguments to lock_user(), which meant that we would not have detected some faults that we should. Signed-off-by: Peter Maydell --- linux-user/syscall.c | 5 - 1 fi

Re: [Qemu-devel] [PATCH] Improve the alignment check infrastructure

2016-06-20 Thread Richard Henderson
On 06/20/2016 06:56 AM, Sergey Sorokin wrote: /* Flags stored in the low bits of the TLB virtual address. These are - defined so that fast path ram access is all zeros. */ + * defined so that fast path ram access is all zeros. + * They start after address alignment bits. + */ +#define TLB_FL

Re: [Qemu-devel] [PATCH] build: Use $(CC) for compiling .S files

2016-06-20 Thread Richard Henderson
On 06/20/2016 06:43 AM, Peter Maydell wrote: On 18 June 2016 at 07:47, Richard Henderson wrote: We fail to pass to AS all of the different flags that may be required for a given set of CFLAGS. Rather than figuring out the host-specific mapping, it's better to allow the compiler driver to do th

[Qemu-devel] [Bug 1594394] Re: Using setreuid / setegid crashes x86_64 user-mode target

2016-06-20 Thread Timothy Pearson
Sounds very relevant, yes. Thanks for the link! -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1594394 Title: Using setreuid / setegid crashes x86_64 user-mode target Status in QEMU: New Bug de

[Qemu-devel] [PATCH v2 00/10] globals: Clean up validation and error checking

2016-06-20 Thread Eduardo Habkost
This series includes multiple changes to the way errors are handled by the global property system. Git tree: https://github.com/ehabkost/qemu-hacks.git work/global-error-handling Changes v1 -> v2: * Fix test-qdev-global-props unit test * Remove subprocess code and "nouser" test case * Repor

[Qemu-devel] [PATCH v2 05/10] machine: Add machine_register_compat_props() function

2016-06-20 Thread Eduardo Habkost
Move the compat_props handling to core machine code. Reviewed-by: Marcel Apfelbaum Signed-off-by: Eduardo Habkost --- hw/core/machine.c | 16 include/hw/boards.h | 1 + vl.c| 9 ++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/hw/cor

[Qemu-devel] [PULL 1/7] vl: Error messages need to go to stderr, fix some

2016-06-20 Thread Markus Armbruster
We print a few fatal error messages to stdout instead of stderr. Reproducer: $ qemu-system-x86_64 -g 1024x768 Option g not supported for this target $ qemu-system-x86_64 -g 1024x768 >/dev/null Fix by printing them with error_report(). This also improves the messages. The above one be

[Qemu-devel] [PATCH v2 10/10] machine: Skip global registration for non-existing classes

2016-06-20 Thread Eduardo Habkost
MachineClass::compat_props may point to class names that are not compiled into the QEMU binary. Skip registering those as global properties. This will allow the qdev global property code to implement stricter checks on the global property values in the future. Signed-off-by: Eduardo Habkost --- C

[Qemu-devel] [PATCH v2 09/10] qdev: Remove qdev_prop_register_global_list()

2016-06-20 Thread Eduardo Habkost
The function is not used by any QEMU code, except for the test-qdev-global-props unit test. Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * (New patch in series) --- hw/core/qdev-properties.c | 9 - include/hw/qdev-properties.h | 1 - tests/test-qdev-global-props.c | 12 +

[Qemu-devel] [PATCH v2 01/10] qdev: Don't stop applying globals on first error

2016-06-20 Thread Eduardo Habkost
Since commit 25f8dd9, qdev_prop_set_globals_for_type() stops applying global properties on the first error. It is a leftover from when QEMU exited on any error when applying global property. Now we print a warning about the first error, bug ignore all other global properties after it. For example,

[Qemu-devel] [PATCH v2 03/10] vl: Reject invalid class names on -global

2016-06-20 Thread Eduardo Habkost
Instead of just printing a warning very late, reject obviously invalid -global arguments by validating the class name. Update test-qdev-global-props to not expect class name validation to be performed in qdev_prop_check_globals(). Reviewed-by: Markus Armbruster Signed-off-by: Eduardo Habkost --

[Qemu-devel] [PULL 3/7] error: Remove unnecessary local_err variables

2016-06-20 Thread Markus Armbruster
From: Eduardo Habkost This patch simplifies code that uses a local_err variable just to immediately use it for an error_propagate() call. Coccinelle patch used to perform the changes added to scripts/coccinelle/remove_local_err.cocci. Reviewed-by: Eric Blake Acked-by: Cornelia Huck Signed-off

[Qemu-devel] [PATCH v2 07/10] qdev: Eliminate "global not used" warning

2016-06-20 Thread Eduardo Habkost
qdev_prop_check_globals() tries to warn the user if a given -global option was not used. But it does that only if the device is not hotpluggable. The warning also makes it harder for management code or people that write their own scripts or config files: there's no way to know if a given -global o

[Qemu-devel] [Bug 1356916] Re: Too small argv limit

2016-06-20 Thread Peter Maydell
This was fixed in QEMU 2.5. ** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1356916 Title: Too small argv limit Status in QEMU: Fix Release

[Qemu-devel] [PULL 6/7] log: Fix qemu_set_dfilter_ranges() error reporting

2016-06-20 Thread Markus Armbruster
g_error() is not an acceptable way to report errors to the user: $ qemu-system-x86_64 -dfilter 1000+0 ** (process:17187): ERROR **: Failed to parse range in: 1000+0 Trace/breakpoint trap (core dumped) g_assert() isn't, either: $ qemu-system-x86_64 -dfilter 1000x+64 ** ER

[Qemu-devel] [PATCH v2 06/10] vl: Set errp to &error_abort on machine compat_props

2016-06-20 Thread Eduardo Habkost
Use the new GlobalProperty.errp field to handle compat_props errors. Example output before this change: (with an intentionally broken entry added to PC_COMPAT_1_3 just for testing) $ qemu-system-x86_64 -machine pc-1.3 qemu-system-x86_64: hw/core/qdev-properties.c:1091: qdev_prop_set_globals_

[Qemu-devel] [PATCH v2 02/10] qdev: Eliminate qemu_add_globals() function

2016-06-20 Thread Eduardo Habkost
The function is just a helper to handle the -global options, it can stay in vl.c like most qemu_opts_foreach() calls. Reviewed-by: Igor Mammedov Signed-off-by: Eduardo Habkost --- hw/core/qdev-properties-system.c | 21 + include/qemu/config-file.h | 1 - vl.c

Re: [Qemu-devel] [PATCH] vl: Error messages need to go to stderr, fix some

2016-06-20 Thread Markus Armbruster
Paolo Bonzini writes: > On 13/06/2016 11:03, Markus Armbruster wrote: >> Paolo, will you pick this up, or do you want me to take it through my >> (currently empty) error-next branch? > > I can pick it up. Since other error-related patches have since accumulated, I posted a pull request for all o

[Qemu-devel] [Bug 1572329] Re: ARM bootloader does not set r0 to 0

2016-06-20 Thread Peter Maydell
Fix committed: b4850e5ae9607f9f31932 ** Changed in: qemu Status: New => Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1572329 Title: ARM bootloader does not set r0 to 0 Stat

Re: [Qemu-devel] [PATCH v2 4/5] ast2400: create SPI flash slaves

2016-06-20 Thread Cédric Le Goater
On 06/20/2016 05:38 PM, Peter Maydell wrote: > On 17 June 2016 at 13:15, Cédric Le Goater wrote: >> A set of SPI flash slaves is attached under the flash controllers of >> the palmetto platform. "n25q256a" flash modules are used for the BMC >> and "mx25l25635e" for the host. These types are common

[Qemu-devel] [Bug 1590336] Re: qemu-arm does not reject vrintz on non-v8 cpu

2016-06-20 Thread Peter Maydell
** Changed in: qemu Status: New => Fix Committed -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1590336 Title: qemu-arm does not reject vrintz on non-v8 cpu Status in QEMU: Fix Committed

Re: [Qemu-devel] [PATCH] block/qcow2: Don't use cpu_to_*w()

2016-06-20 Thread Max Reitz
On 16.06.2016 18:06, Peter Maydell wrote: > Don't use the cpu_to_*w() functions, which we are trying to deprecate. > Instead either just use cpu_to_*() to do the byteswap, or use > st*_be_p() if we need to do the store somewhere other than to a > variable that's already the correct type. > > Signe

<    1   2   3   4   >