[Qemu-devel] [PATCH v18 02/10] radix tree test suite: remove ARRAY_SIZE to avoid redefinition

2017-11-29 Thread Wei Wang
ARRAY_SIZE() has been defined in include/linux/kernel.h, and "make" complains a warning of redefinition of ARRAY_SIZE() in testing/radix/linux/kernel.h. So, remove ARRAY_SIZE() from there. Signed-off-by: Wei Wang Cc: Matthew Wilcox Cc: Andrew Morton --- tools/testing/radix-tree/linux/kernel.h

[Qemu-devel] [PATCH v18 08/10] mm: support reporting free page blocks

2017-11-29 Thread Wei Wang
This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after zone->lock is released, so it is the caller's responsibility to either detect or prevent the use of such pages. One use example of this

[Qemu-devel] [PATCH v18 01/10] idr: add #include

2017-11-29 Thread Wei Wang
The was removed from radix-tree.h by the following commit: f5bba9d11a256ad2a1c2f8e7fc6aabe6416b7890. Since that commit, tools/testing/radix-tree/ couldn't pass compilation due to: tools/testing/radix-tree/idr.c:17: undefined reference to WARN_ON_ONCE. This patch adds the bug.h header to idr.h to

[Qemu-devel] [PATCH v18 06/10] virtio_ring: add a new API, virtqueue_add_one_desc

2017-11-29 Thread Wei Wang
Current virtqueue_add API implementation is based on the scatterlist struct, which uses kaddr. This is inadequate to all the use case of vring. For example: - Some usages don't use IOMMU, in this case the user can directly pass in a physical address in hand, instead of going through the sg impl

[Qemu-devel] [PATCH v18 03/10] xbitmap: Introduce xbitmap

2017-11-29 Thread Wei Wang
From: Matthew Wilcox The eXtensible Bitmap is a sparse bitmap representation which is efficient for set bits which tend to cluster. It supports up to 'unsigned long' worth of bits, and this commit adds the bare bones -- xb_set_bit(), xb_clear_bit() and xb_test_bit(). Signed-off-by: Wei Wang --

[Qemu-devel] [PATCH v18 07/10] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-11-29 Thread Wei Wang
Add a new feature, VIRTIO_BALLOON_F_SG, which enables the transfer of balloon (i.e. inflated/deflated) pages using scatter-gather lists to the host. A scatter-gather list is described by a vring desc. The implementation of the previous virtio-balloon is not very efficient, because the balloon page

[Qemu-devel] [PATCH v18 04/10] xbitmap: potential improvement

2017-11-29 Thread Wei Wang
This patch made some changes to the original xbitmap implementation from the linux-dax tree: - remove xb_fill() and xb_zero() from xbitmap.h since they are not implemented; - xb_test_bit: changed "ebit > BITS_PER_LONG" to "ebit >= BITS_PER_LONG", because bit 64 beyonds the "unsigned long" exc

[Qemu-devel] [PATCH v18 09/10] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-11-29 Thread Wei Wang
Negotiation of the VIRTIO_BALLOON_F_FREE_PAGE_VQ feature indicates the support of reporting hints of guest free pages to host via virtio-balloon. Host requests the guest to report free pages by sending a new cmd id to the guest via the free_page_report_cmd_id configuration register. When the gues

[Qemu-devel] [PATCH v18 10/10] virtio-balloon: don't report free pages when page poisoning is enabled

2017-11-29 Thread Wei Wang
The guest free pages should not be discarded by the live migration thread when page poisoning is enabled with PAGE_POISONING_NO_SANITY=n, because skipping the transfer of such poisoned free pages will trigger false positive when new pages are allocated and checked on the destination. This patch ski

Re: [Qemu-devel] [PATCH v17 2/6] radix tree test suite: add tests for xbitmap

2017-11-29 Thread Wei Wang
On 11/07/2017 01:00 AM, Matthew Wilcox wrote: On Fri, Nov 03, 2017 at 04:13:02PM +0800, Wei Wang wrote: From: Matthew Wilcox Add the following tests for xbitmap: 1) single bit test: single bit set/clear/find; 2) bit range test: set/clear a range of bits and find a 0 or 1 bit in the range. Sig

Re: [Qemu-devel] [PATCH v2 0/5] target/m68k: implement 680x0 FPU (part 3)

2017-11-29 Thread Laurent Vivier
Le 29/11/2017 à 15:08, Thomas Huth a écrit : > On 29.11.2017 14:59, Peter Maydell wrote: >> On 29 November 2017 at 13:42, Laurent Vivier wrote: >>> these functions come from: >>> >>> http://previous.alternative-system.com/ >>> >>> http://svn.code.sf.net/p/previous/code/trunk/src/softfloat/softfloa

Re: [Qemu-devel] [PATCH 4/4] blockjob: reimplement block_job_sleep_ns to allow cancellation

2017-11-29 Thread Kevin Wolf
Am 29.11.2017 um 14:56 hat Jeff Cody geschrieben: > On Wed, Nov 29, 2017 at 11:25:13AM +0100, Paolo Bonzini wrote: > > This reverts the effects of commit 4afeffc857 ("blockjob: do not allow > > coroutine double entry or entry-after-completion", 2017-11-21) > > > > This fixed the symptom of a bug r

Re: [Qemu-devel] [PATCH 4/4] blockjob: reimplement block_job_sleep_ns to allow cancellation

2017-11-29 Thread Jeff Cody
On Wed, Nov 29, 2017 at 03:21:37PM +0100, Kevin Wolf wrote: > Am 29.11.2017 um 14:56 hat Jeff Cody geschrieben: > > On Wed, Nov 29, 2017 at 11:25:13AM +0100, Paolo Bonzini wrote: > > > This reverts the effects of commit 4afeffc857 ("blockjob: do not allow > > > coroutine double entry or entry-after

Re: [Qemu-devel] [PATCH v6 0/4] vITS Reset

2017-11-29 Thread Peter Maydell
On 28 November 2017 at 15:41, Eric Auger wrote: > At the moment the ITS is not properly reset. On System reset or > reboot, previous ITS register values and caches are left > unchanged. Some of the registers might point to some guest RAM > tables which are not valid anymore. This leads to state >

Re: [Qemu-devel] [for-2.12 4/7] pci: Simplify pci_bus_is_root()

2017-11-29 Thread Marcel Apfelbaum
On 29/11/2017 15:12, David Gibson wrote: On Wed, Nov 29, 2017 at 12:45:28PM +0200, Marcel Apfelbaum wrote: On 29/11/2017 10:46, David Gibson wrote: pci_bus_is_root() currently relies on a method in the PCIBusClass. But it's always known if a PCI bus is a root bus when we create it, so using a d

Re: [Qemu-devel] [for-2.12 6/7] pci: Eliminate redundant PCIDevice::bus pointer

2017-11-29 Thread Marcel Apfelbaum
On 29/11/2017 13:41, Eduardo Habkost wrote: On Wed, Nov 29, 2017 at 12:54:04PM +0200, Marcel Apfelbaum wrote: On 29/11/2017 10:46, David Gibson wrote: The bus pointer in PCIDevice is basically redundant with QOM information. It's always initialized to the qdev_get_parent_bus(), the only differe

Re: [Qemu-devel] [qemu-s390x] [PATCH v1 for-2.12 00/15] s390x/tcg: cleanup and fix program interrupts

2017-11-29 Thread Cornelia Huck
On Wed, 29 Nov 2017 15:06:33 +0100 David Hildenbrand wrote: > On 29.11.2017 14:51, Thomas Huth wrote: > > On 28.11.2017 21:33, David Hildenbrand wrote: > >> I have quite some patches on my queue for 2.12. (booting Fedora 26/27 > >> guests, floating interrupts, machine checks, missing instructio

[Qemu-devel] [PATCH RFC 0/9] block: Rewrite block drain begin/end

2017-11-29 Thread Fam Zheng
While we look at the fixes for 2.11, I briefly prototyped this series to see if it makes sense as a simplification of the drain API for 2.12. The idea is to let AioContext manage quiesce callbacks, then the block layer only needs to do the in-flight request waiting. This lets us get rid of the cal

[Qemu-devel] [PATCH RFC 2/9] aio: Add drain begin/end API to AioContext

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- include/block/aio.h | 27 +--- util/async.c| 73 + 2 files changed, 97 insertions(+), 3 deletions(-) diff --git a/include/block/aio.h b/include/block/aio.h index e9aeeaec94..40c2f64544 100644

[Qemu-devel] [PATCH RFC 1/9] block: Remove unused bdrv_requests_pending

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/io.c| 18 -- include/block/block_int.h | 1 - 2 files changed, 19 deletions(-) diff --git a/block/io.c b/block/io.c index 4fdf93a014..7f07972489 100644 --- a/block/io.c +++ b/block/io.c @@ -134,24 +134,6 @@ void bdrv_disable_cop

[Qemu-devel] [PATCH RFC 4/9] throttle: Implement AioContext drain ops

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/throttle.c | 34 +++--- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/block/throttle.c b/block/throttle.c index 833175ac77..35b740e3de 100644 --- a/block/throttle.c +++ b/block/throttle.c @@ -70,6 +70,25 @@ fin:

[Qemu-devel] [PATCH RFC 3/9] blockjob: Implement AioContext drain ops

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- blockjob.c | 47 ++- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/blockjob.c b/blockjob.c index ff9a614531..86d060c89c 100644 --- a/blockjob.c +++ b/blockjob.c @@ -148,6 +148,23 @@ static void block_job_at

[Qemu-devel] [PATCH RFC 9/9] blockjob: Drop unused functions

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- blockjob.c | 24 include/block/blockjob_int.h | 14 -- 2 files changed, 38 deletions(-) diff --git a/blockjob.c b/blockjob.c index 809111bf24..bfeb7c4ace 100644 --- a/blockjob.c +++ b/blockjob.c @@ -699,18 +699,6

[Qemu-devel] [PATCH RFC 6/9] block: Use aio_context_drained_begin in bdrv_set_aio_context

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 9a1a0d1e73..949f0dec11 100644 --- a/block.c +++ b/block.c @@ -4745,8 +4745,7 @@ void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context) {

[Qemu-devel] [PATCH RFC 7/9] block: Switch to use AIO drained begin/end API

2017-11-29 Thread Fam Zheng
Instead of the recursion of the "disable/enable external requests" operations on the graph, we switch to AioContext's API to disable/enable on the whole AioContext altogether. Strictly it is be a bit more than necessary, but as all drained sections are short, it is not a big problem. Drained end c

[Qemu-devel] [PATCH RFC 5/9] qed: Implement AioContext drain ops

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/qed.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/block/qed.c b/block/qed.c index 821dcaa055..8ddaa31e7c 100644 --- a/block/qed.c +++ b/block/qed.c @@ -337,12 +337,33 @@ static void qed_cancel_need_chec

Re: [Qemu-devel] [PATCH v1 for-2.12 01/15] s390x/tcg: introduce and use program_interrupt_ra()

2017-11-29 Thread Cornelia Huck
On Tue, 28 Nov 2017 21:33:11 +0100 David Hildenbrand wrote: > Allows to easily convert more callers of program_interrupt() and to > easily introduce new exceptions without forgetting about the cpu state > reset. > > Use program_interrupt_ra() in places where we already had the same > pattern. >

[Qemu-devel] [PATCH RFC 8/9] block: Drop old drained_{begin, end} callbacks

2017-11-29 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block.c| 24 block/block-backend.c | 22 -- blockjob.c | 6 -- include/block/block.h | 16 include/block/block_int.h | 11 ---

[Qemu-devel] RFC: Let NBD client request read-only mode

2017-11-29 Thread Eric Blake
Right now, only the server can choose whether an export is read-only. A client can always treat an export as read-only by not sending any writes, but a server has no guarantee that a client will behave that way, and must assume that an export where the server did not advertise NBD_FLAG_READ_ON

Re: [Qemu-devel] [PATCH] firmware: Use PTR_ERR_OR_ZERO()

2017-11-29 Thread Gabriel L. Somlo
Acked-by: Gabriel Somlo On Tue, Nov 28, 2017 at 10:40:27PM +0100, Vasyl Gomonovych wrote: > Fix ptr_ret.cocci warnings: > drivers/firmware/efi/efi.c:610:8-14: WARNING: PTR_ERR_OR_ZERO can be used > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > Generated by: scripts/coccinelle/

Re: [Qemu-devel] [PATCH v1 for-2.12 01/15] s390x/tcg: introduce and use program_interrupt_ra()

2017-11-29 Thread David Hildenbrand
On 29.11.2017 15:55, Cornelia Huck wrote: > On Tue, 28 Nov 2017 21:33:11 +0100 > David Hildenbrand wrote: > >> Allows to easily convert more callers of program_interrupt() and to >> easily introduce new exceptions without forgetting about the cpu state >> reset. >> >> Use program_interrupt_ra() i

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread Cornelia Huck
On Tue, 28 Nov 2017 21:33:14 +0100 David Hildenbrand wrote: > TCG needs the retaddr when injecting an interrupt. Let's just pass it > along and use 0 for KVM. The value will be completely ignored for KVM. Can we get a #define for that? Just to make it clear at a glance that we're passing an igno

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread David Hildenbrand
On 29.11.2017 16:13, Cornelia Huck wrote: > On Tue, 28 Nov 2017 21:33:14 +0100 > David Hildenbrand wrote: > >> TCG needs the retaddr when injecting an interrupt. Let's just pass it >> along and use 0 for KVM. The value will be completely ignored for KVM. > > Can we get a #define for that? Just t

Re: [Qemu-devel] [PATCH qemu-web v2] Suggest qemu-web prefix in the introductory post

2017-11-29 Thread Eric Blake
On 11/29/2017 03:16 AM, Paolo Bonzini wrote: On 29/11/2017 05:00, Fam Zheng wrote: Chances are qemu-devel@nongnu.org patches only adding new files can be picked up by patchew and treated like a qemu.git patch. Patchew already ignores [qemu-web] patches, so suggest it in this article as well. (Ar

Re: [Qemu-devel] [PATCH v2 0/5] target/m68k: implement 680x0 FPU (part 3)

2017-11-29 Thread Thomas Huth
On 29.11.2017 15:17, Laurent Vivier wrote: > Le 29/11/2017 à 15:08, Thomas Huth a écrit : >> On 29.11.2017 14:59, Peter Maydell wrote: >>> On 29 November 2017 at 13:42, Laurent Vivier wrote: these functions come from: http://previous.alternative-system.com/ http://svn.code

Re: [Qemu-devel] [Bug 645662] x87 fpu emulation not accurate enough

2017-11-29 Thread KONRAD Frederic
On 11/29/2017 01:51 PM, Peter Maydell wrote: On 29 November 2017 at 12:47, KONRAD Frederic wrote: Maybe a little hack might work for x86 on x86 though. Something like hardcoding the helper with an inline assembly code? The set of people who want to emulate x86 on x86 is surely even smaller

Re: [Qemu-devel] [PATCH RESEND 1/2] x86_iommu: Move machine check to x86_iommu_realize()

2017-11-29 Thread Thomas Huth
On 29.11.2017 13:33, Mohammed Gamal wrote: > Instead of having the same error checks in vtd_realize() > and amdvi_realize(), move that over to the generic > x86_iommu_realize(). > > Reviewed-by: Peter Xu > Reviewed-by: Eduardo Habkost > Signed-off-by: Mohammed Gamal > --- > hw/i386/amd_iommu.c

[Qemu-devel] [PATCH] maint: Mention web site maintenance in README

2017-11-29 Thread Eric Blake
Now that we have a website that accepts patches on the list, the main project should make it easier to find information about that process. Signed-off-by: Eric Blake --- Doc only, so it could go in -rc3 if we have a reason to slip it in this late; but I'm also fine if it waits for 2.12. README

[Qemu-devel] [PULL 01/10] iotests: fix 075 and 078

2017-11-29 Thread Kevin Wolf
From: John Snow Both of these tests are for formats which now stipulate that they are read-only. Adjust the tests to match. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Lukáš Doktor Signed-off-by: Kevin Wolf --- tests/qemu-iotests/075 | 18 +- tests/qemu-iot

Re: [Qemu-devel] [PATCH qemu] vfio/spapr: Allow fallback to SPAPR TCE IOMMU v1

2017-11-29 Thread Alex Williamson
On Wed, 22 Nov 2017 16:15:52 +1100 Alexey Kardashevskiy wrote: > The vfio_iommu_spapr_tce driver always advertises v1 and v2 IOMMU support, > however PR KVM (a special version of KVM designed to work in > a paravirtualized system; these days used for nested virtualizaion) only > supports the "pse

[Qemu-devel] [PULL 03/10] qemu-options: Mention locking option of file driver

2017-11-29 Thread Kevin Wolf
From: Fam Zheng Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- qemu-options.hx | 4 1 file changed, 4 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 3728e9b4dd..f11c4ac960 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -693,6 +693,10 @@ This is the prot

[Qemu-devel] [PULL 02/10] docs: Add image locking subsection

2017-11-29 Thread Kevin Wolf
From: Fam Zheng This documents the image locking feature and explains when and how related options can be used. Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- docs/qemu-block-drivers.texi | 36 qemu-doc.texi| 1 + 2 files changed,

[Qemu-devel] [PULL 00/10] Block layer fixes for 2.11.0-rc3

2017-11-29 Thread Kevin Wolf
The following changes since commit e7b47c22e2df14d55e3e4426688c929bf8e3f7fb: osdep.h: Make TIME_MAX handle different time_t types (2017-11-24 13:23:36 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to 5591c001a10

[Qemu-devel] [PULL 04/10] QAPI & interop: Clarify events emitted by 'block-job-cancel'

2017-11-29 Thread Kevin Wolf
From: Kashyap Chamarthy When you cancel an in-progress 'mirror' job (or "active `block-commit`") with QMP `block-job-cancel`, it emits the event: BLOCK_JOB_CANCELLED. However, when `block-job-cancel` is issued *after* `drive-mirror` has indicated (via the event BLOCK_JOB_READY) that the source an

[Qemu-devel] [PULL 10/10] block/nfs: fix nfs_client_open for filesize greater than 1TB

2017-11-29 Thread Kevin Wolf
From: Peter Lieven DIV_ROUND_UP(st.st_size, BDRV_SECTOR_SIZE) was overflowing ret (int) if st.st_size is greater than 1TB. Cc: qemu-sta...@nongnu.org Signed-off-by: Peter Lieven Message-id: 1511798407-31129-1-git-send-email...@kamp.de Signed-off-by: Max Reitz --- block/nfs.c | 7 +++ 1 fi

[Qemu-devel] [qemu-web PATCH] Mention website maintainence under Contribute

2017-11-29 Thread Eric Blake
Web (and other doc) updates are also valid contributions. Suggested-by: Paolo Bonzini Signed-off-by: Eric Blake --- contribute.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contribute.md b/contribute.md index bf4a55d..88baee6 100644 --- a/contribute.md +++ b/contribu

[Qemu-devel] [PULL 08/10] blockjob: introduce block_job_do_yield

2017-11-29 Thread Kevin Wolf
From: Paolo Bonzini Hide the clearing of job->busy in a single function, and set it in block_job_enter. This lets block_job_do_yield verify that qemu_coroutine_enter is not used while job->busy = false. Signed-off-by: Paolo Bonzini Tested-By: Jeff Cody Reviewed-by: Fam Zheng Reviewed-by: Jef

Re: [Qemu-devel] [PATCH RESEND 2/2] x86_iommu: check if machine has PCI bus

2017-11-29 Thread Thomas Huth
On 29.11.2017 13:33, Mohammed Gamal wrote: > Starting qemu with > qemu-system-x86_64 -S -M isapc -device {amd|intel}-iommu > leads to a segfault. The code assume PCI bus is present and > tries to access the bus structure without checking. > > Since Intel VT-d and AMDVI should only work with PCI, a

[Qemu-devel] [PULL 05/10] blockjob: Remove the job from the list earlier in block_job_unref()

2017-11-29 Thread Kevin Wolf
From: Alberto Garcia When destroying a block job in block_job_unref() we should remove it from the job list before calling block_job_remove_all_bdrv(). This is because removing the BDSs can trigger an aio_poll() and wake up other jobs that might attempt to use the block job list. If that happens

Re: [Qemu-devel] [PATCH qemu] vfio: Allow configuration without INTx

2017-11-29 Thread Alex Williamson
On Wed, 22 Nov 2017 16:16:49 +1100 Alexey Kardashevskiy wrote: > On some platforms INTx may not be enabled on a KVM host (one such > example is IBM pHyp hypervisor and this is intentional). However > the PCI_INTERRUPT_PIN is not 0 so QEMU tries initializing INTx, fails as > (!vdev->pdev->irq) in

[Qemu-devel] [PULL 09/10] blockjob: reimplement block_job_sleep_ns to allow cancellation

2017-11-29 Thread Kevin Wolf
From: Paolo Bonzini This reverts the effects of commit 4afeffc857 ("blockjob: do not allow coroutine double entry or entry-after-completion", 2017-11-21) This fixed the symptom of a bug rather than the root cause. Canceling the wait on a sleeping blockjob coroutine is generally fine, we just nee

[Qemu-devel] [PULL 06/10] block: Expect graph changes in bdrv_parent_drained_begin/end

2017-11-29 Thread Kevin Wolf
The .drained_begin/end callbacks can (directly or indirectly via aio_poll()) cause block nodes to be removed or the current BdrvChild to point to a different child node. Use QLIST_FOREACH_SAFE() to make sure we don't access invalid BlockDriverStates or accidentally continue iterating the parents o

Re: [Qemu-devel] [Bug 645662] x87 fpu emulation not accurate enough

2017-11-29 Thread Thomas Huth
On 29.11.2017 16:20, KONRAD Frederic wrote: > > > On 11/29/2017 01:51 PM, Peter Maydell wrote: >> On 29 November 2017 at 12:47, KONRAD Frederic >> wrote: >>> Maybe a little hack might work for x86 on x86 though. >>> Something like hardcoding the helper with an inline assembly >>> code? >> >> The

[Qemu-devel] [PULL 07/10] blockjob: remove clock argument from block_job_sleep_ns

2017-11-29 Thread Kevin Wolf
From: Paolo Bonzini All callers are using QEMU_CLOCK_REALTIME, and it will not be possible to support more than one clock when block_job_sleep_ns switches to a single timer stored in the BlockJob struct. Signed-off-by: Paolo Bonzini Reviewed-by: Alberto Garcia Tested-By: Jeff Cody Reviewed-by

Re: [Qemu-devel] [PATCH RESEND 0/2] x86_iommu: Fix segfault when starting on non-PCI machines

2017-11-29 Thread Michael S. Tsirkin
On Wed, Nov 29, 2017 at 08:42:17PM +0800, Peter Xu wrote: > On Wed, Nov 29, 2017 at 01:33:11PM +0100, Mohammed Gamal wrote: > > [Resending for the second time] > > > > Starting qemu with > > qemu-system-x86_64 -S -M isapc -device {amd|intel}-iommu > > leads to a segfault. The code assume PCI bus i

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread Cornelia Huck
On Wed, 29 Nov 2017 16:38:03 +0100 David Hildenbrand wrote: > On 29.11.2017 16:35, Cornelia Huck wrote: > > On Wed, 29 Nov 2017 16:14:40 +0100 > > David Hildenbrand wrote: > > > >> On 29.11.2017 16:13, Cornelia Huck wrote: > >>> On Tue, 28 Nov 2017 21:33:14 +0100 > >>> David Hildenbrand wr

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread Cornelia Huck
On Wed, 29 Nov 2017 16:14:40 +0100 David Hildenbrand wrote: > On 29.11.2017 16:13, Cornelia Huck wrote: > > On Tue, 28 Nov 2017 21:33:14 +0100 > > David Hildenbrand wrote: > > > >> TCG needs the retaddr when injecting an interrupt. Let's just pass it > >> along and use 0 for KVM. The value wi

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread David Hildenbrand
On 29.11.2017 16:35, Cornelia Huck wrote: > On Wed, 29 Nov 2017 16:14:40 +0100 > David Hildenbrand wrote: > >> On 29.11.2017 16:13, Cornelia Huck wrote: >>> On Tue, 28 Nov 2017 21:33:14 +0100 >>> David Hildenbrand wrote: >>> TCG needs the retaddr when injecting an interrupt. Let's just p

Re: [Qemu-devel] [PATCH qemu] vfio-pci: Remove unused fields from VFIOMSIXInfo

2017-11-29 Thread Alex Williamson
On Wed, 22 Nov 2017 18:39:47 +1100 Alexey Kardashevskiy wrote: Missing reference to commit that made these fields unused. A Fixes tag to that commit also seems appropriate. An empty commit log is pretty much never justified. This also looks like 2.12 material. Thanks, Alex > Signed-off-by:

Re: [Qemu-devel] [PATCH] vfio/common: init giommu_list and hostwin_list of vfio container

2017-11-29 Thread Alex Williamson
On Wed, 22 Nov 2017 15:58:02 +0800 "Liu, Yi L" wrote: > The init of giommu_list and hostwin_list is missed during container > initialization. > > Signed-off-by: Liu, Yi L > --- > hw/vfio/common.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/vfio/common.c b/hw/vfio/common.c >

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread David Hildenbrand
On 29.11.2017 16:39, Cornelia Huck wrote: > On Wed, 29 Nov 2017 16:38:03 +0100 > David Hildenbrand wrote: > >> On 29.11.2017 16:35, Cornelia Huck wrote: >>> On Wed, 29 Nov 2017 16:14:40 +0100 >>> David Hildenbrand wrote: >>> On 29.11.2017 16:13, Cornelia Huck wrote: > On Tue, 28 No

Re: [Qemu-devel] [PATCH v1 for-2.12 07/15] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG)

2017-11-29 Thread Cornelia Huck
On Tue, 28 Nov 2017 21:33:17 +0100 David Hildenbrand wrote: > s390_cpu_virt_mem_rw() must always return, so callers can react on > an exception (e.g. see ioinst_handle_stcrw()). For TCG, there was one > case where a cpu loop exit was triggered. Fix that up. > > However, for TCG we always have to

Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/25] spapr: introduce a skeleton for the XIVE interrupt controller

2017-11-29 Thread Greg Kurz
On Wed, 29 Nov 2017 14:46:56 +0100 Cédric Le Goater wrote: > On 11/29/2017 12:49 PM, Greg Kurz wrote: > > > Cédric Le Goater wrote: > > > >> The XIVE interrupt controller uses a set of tables to redirect exception > >> from event sources to CPU threads. The Interrupt Virtualization Entry (IV

Re: [Qemu-devel] [PATCH v1 for-2.12 13/15] s390x/tcg: use program_interrupt_ra() in STSI

2017-11-29 Thread Cornelia Huck
On Tue, 28 Nov 2017 21:33:23 +0100 David Hildenbrand wrote: > STSI needs some more love, but let's do one step at a time. Out of curiousity: What else do you want to do? > We can now drop potential_page_fault(). > > Signed-off-by: David Hildenbrand > --- > target/s390x/misc_helper.c | 2 +- >

Re: [Qemu-devel] [PATCH v1 for-2.12 14/15] s390x/tcg: drop program_interrupt()

2017-11-29 Thread Cornelia Huck
On Tue, 28 Nov 2017 21:33:24 +0100 David Hildenbrand wrote: > All users are gone, we can finally drop it and make sure that all new > new program interrupt injections are reminded of the retaddr - as they s/new new/new/ > have to use program_interrupt_ra() now. > > Signed-off-by: David Hildenb

Re: [Qemu-devel] [PATCH v1 for-2.12 07/15] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG)

2017-11-29 Thread David Hildenbrand
> This looks a bit odd if you don't realize that kvm already handled the > exception. But I don't really have a better idea. > >> } >> return; >> } > >> @@ -645,9 +657,12 @@ void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb, >> uintptr_t ra) >> if (!s390_cpu_virt_mem

Re: [Qemu-devel] [PATCH v1 for-2.12 13/15] s390x/tcg: use program_interrupt_ra() in STSI

2017-11-29 Thread David Hildenbrand
On 29.11.2017 16:53, Cornelia Huck wrote: > On Tue, 28 Nov 2017 21:33:23 +0100 > David Hildenbrand wrote: > >> STSI needs some more love, but let's do one step at a time. > > Out of curiousity: What else do you want to do? > Will post the patch as soon as this series has been picked up. Here

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread Cornelia Huck
On Wed, 29 Nov 2017 16:45:21 +0100 David Hildenbrand wrote: > On 29.11.2017 16:39, Cornelia Huck wrote: > > On Wed, 29 Nov 2017 16:38:03 +0100 > > David Hildenbrand wrote: > > > >> On 29.11.2017 16:35, Cornelia Huck wrote: > >>> On Wed, 29 Nov 2017 16:14:40 +0100 > >>> David Hildenbrand wr

Re: [Qemu-devel] [PATCH v1 for-2.12 07/15] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG)

2017-11-29 Thread Cornelia Huck
On Wed, 29 Nov 2017 16:54:30 +0100 David Hildenbrand wrote: > >> diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c > >> index 31e3f3f415..39da9aeef4 100644 > >> --- a/target/s390x/mmu_helper.c > >> +++ b/target/s390x/mmu_helper.c > >> @@ -22,6 +22,7 @@ > >> #include "internal.h

[Qemu-devel] [PATCH for-2.12] iotests: Make 200 run on tmpfs

2017-11-29 Thread Max Reitz
200 currently fails on tmpfs because it sets cache=none. However, without that (and aio=native), the test still works now and it fails before Jeff's series (on fc7dbc119e0852a70dc9fa68bb41a318e49e4cd6). So we can probably remove it safely. Signed-off-by: Max Reitz --- tests/qemu-iotests/200 |

Re: [Qemu-devel] [PATCH for-2.12] iotests: Make 200 run on tmpfs

2017-11-29 Thread Jeff Cody
On Wed, Nov 29, 2017 at 04:59:42PM +0100, Max Reitz wrote: > 200 currently fails on tmpfs because it sets cache=none. However, > without that (and aio=native), the test still works now and it fails > before Jeff's series (on fc7dbc119e0852a70dc9fa68bb41a318e49e4cd6). So > we can probably remove i

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread David Hildenbrand
On 29.11.2017 16:57, Cornelia Huck wrote: > On Wed, 29 Nov 2017 16:45:21 +0100 > David Hildenbrand wrote: > >> On 29.11.2017 16:39, Cornelia Huck wrote: >>> On Wed, 29 Nov 2017 16:38:03 +0100 >>> David Hildenbrand wrote: >>> On 29.11.2017 16:35, Cornelia Huck wrote: > On Wed, 29 No

Re: [Qemu-devel] [qemu-web PATCH] Mention website maintainence under Contribute

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 16:31, Eric Blake wrote: > Web (and other doc) updates are also valid contributions. > > Suggested-by: Paolo Bonzini > Signed-off-by: Eric Blake > --- > contribute.md | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/contribute.md b/contribute.md > index

Re: [Qemu-devel] [PATCH v4] thread: move detach_thread from creating thread to created thread

2017-11-29 Thread Eric Blake
On 11/27/2017 10:46 PM, linzhecheng wrote: If we create a thread with QEMU_THREAD_DETACHED mode, QEMU may get a segfault in a low probability. The root cause of this problem is a bug of glibc(version 2.17,the latest version has the same bug), let's see what happened in glibc's code. Have

Re: [Qemu-devel] [PATCH 01/17] block/vmdk: Fix , instead of ; at end of line

2017-11-29 Thread Eric Blake
On 11/22/2017 08:08 PM, Max Reitz wrote: Signed-off-by: Max Reitz --- block/vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) No semantic difference as far as I can tell, but avoiding needless use of the comma operator is always a win in my book. Reviewed-by: Eric Blake di

Re: [Qemu-devel] [qemu-web PATCH] Mention website maintainence under Contribute

2017-11-29 Thread Peter Maydell
On 29 November 2017 at 15:31, Eric Blake wrote: > Web (and other doc) updates are also valid contributions. > > Suggested-by: Paolo Bonzini > Signed-off-by: Eric Blake > --- > contribute.md | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/contribute.md b/contribute.md

Re: [Qemu-devel] [PATCH 10/25] spapr: add MMIO handlers for the XIVE interrupt sources

2017-11-29 Thread Cédric Le Goater
On 11/29/2017 02:56 PM, Cédric Le Goater wrote: > +switch (offset) { > +case 0: > +spapr_xive_source_eoi(xive, lisn); Hrm. I don't love that you're dealing with clearing that LSI bit here, but setting it at a different level. The state machines

Re: [Qemu-devel] [PATCH 02/17] qcow2: No persistent dirty bitmaps for compat=0.10

2017-11-29 Thread Eric Blake
On 11/22/2017 08:08 PM, Max Reitz wrote: Persistent dirty bitmaps require a properly functioning autoclear_features field, or we cannot track when an unsupporting program might overwrite them. Therefore, we cannot support them for compat=0.10 images. Signed-off-by: Max Reitz --- block/qcow2-

[Qemu-devel] [RFC PATCH 0/1] ppc: loadvm corrupts excp_prefix

2017-11-29 Thread Kurban Mallachiev
On processors which don't support MSR_EP bit, loadvm command set exception prefix to an incorrect value and so guest OS freezes. In cpu_post_load() there is: /* Invalidate all msr bits except MSR_TGPR/MSR_HVB before restoring */ msr = env->msr; env->msr ^= ~((1ULL << MSR_T

[Qemu-devel] [RFC PATCH 1/1] target-ppc: Don't invalidate non-supported msr bits

2017-11-29 Thread Kurban Mallachiev
The msr invalidation code (commits 993eb and 2360b) inverts all bits except MSR_TGPR and MSR_HVB. On non PowerPC 601 processors this leads to incorrect change of excp_prefix in hreg_store_msr() function. The problem is that new msr value get multiplied by msr_mask and inverted msr does not, thus va

Re: [Qemu-devel] [PATCH v1 for-2.12 07/15] s390x: handle exceptions during s390_cpu_virt_mem_rw() correctly (TCG)

2017-11-29 Thread David Hildenbrand
On 29.11.2017 16:59, Cornelia Huck wrote: > On Wed, 29 Nov 2017 16:54:30 +0100 > David Hildenbrand wrote: > > diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 31e3f3f415..39da9aeef4 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c

Re: [Qemu-devel] [RFC PATCH v2 1/1] s390x/css: unrestrict cssids

2017-11-29 Thread Halil Pasic
On 11/29/2017 01:37 PM, Cornelia Huck wrote: > On Tue, 28 Nov 2017 14:07:58 +0100 > Halil Pasic wrote: > >> The default css 0xfe is currently restricted to virtual subchannel >> devices. The hope when the decision was made was, that non-virtual >> subchannel devices will come around when guest

Re: [Qemu-devel] [PATCH v4] thread: move detach_thread from creating thread to created thread

2017-11-29 Thread Gonglei (Arei)
> -Original Message- > From: Eric Blake [mailto:ebl...@redhat.com] > Sent: Thursday, November 30, 2017 12:19 AM > To: linzhecheng; qemu-devel@nongnu.org > Cc: aligu...@us.ibm.com; f...@redhat.com; wangxin (U); Gonglei (Arei); > pbonz...@redhat.com > Subject: Re: [Qemu-devel] [PATCH v4] th

Re: [Qemu-devel] [RFC PATCH v2 1/1] s390x/css: unrestrict cssids

2017-11-29 Thread Halil Pasic
On 11/29/2017 12:47 PM, Cornelia Huck wrote: > On Wed, 29 Nov 2017 16:17:35 +0800 > Dong Jia Shi wrote: > >> * Halil Pasic [2017-11-28 14:07:58 +0100]: >> >> [...] >>> The auto-generated bus ids are affected by both changes. We hope to not >>> encounter any auto-generated bus ids in production

Re: [Qemu-devel] [qemu-web PATCH] Mention website maintainence under Contribute

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 17:22, Peter Maydell wrote: > On 29 November 2017 at 15:31, Eric Blake wrote: >> Web (and other doc) updates are also valid contributions. >> >> Suggested-by: Paolo Bonzini >> Signed-off-by: Eric Blake >> --- >> contribute.md | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletio

Re: [Qemu-devel] [PATCH v4] thread: move detach_thread from creating thread to created thread

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 17:28, Gonglei (Arei) wrote: >>> The root cause of this problem is a bug of glibc(version 2.17,the latest >>> version >> has the same bug), >>> let's see what happened in glibc's code. >> Have you reported this bug to the glibc folks, and if so, can we include >> a URL to the glibc b

Re: [Qemu-devel] [PATCH v4] thread: move detach_thread from creating thread to created thread

2017-11-29 Thread Gonglei (Arei)
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Thursday, November 30, 2017 12:39 AM > To: Gonglei (Arei); Eric Blake; linzhecheng; qemu-devel@nongnu.org > Cc: f...@redhat.com; wangxin (U) > Subject: Re: [Qemu-devel] [PATCH v4] thread: move detach_thread fro

Re: [Qemu-devel] [Qemu-ppc] [PATCH 08/25] spapr: introduce a skeleton for the XIVE interrupt controller

2017-11-29 Thread Cédric Le Goater
+static const VMStateDescription vmstate_spapr_xive = { +.name = TYPE_SPAPR_XIVE, +.version_id = 1, +.minimum_version_id = 1, +.needed = vmstate_spapr_xive_needed, +.fields = (VMStateField[]) { +VMSTATE_UINT32_EQUAL(nr_irqs, sPAPRXive,

Re: [Qemu-devel] [PATCH 5/6] migration: Now set the migration uri

2017-11-29 Thread Juan Quintela
"Daniel P. Berrange" wrote: > On Wed, Nov 22, 2017 at 12:54:58PM +, Daniel P. Berrange wrote: >> On Wed, Nov 22, 2017 at 01:29:57PM +0100, Juan Quintela wrote: >> > "Daniel P. Berrange" wrote: >> > > On Mon, Oct 30, 2017 at 12:21:11PM +0100, Juan Quintela wrote: > > > This is bad as it is th

[Qemu-devel] [Bug 645662] Re: QEMU x87 emulation of trig and other complex ops is only at 64-bit precision, not 80-bit

2017-11-29 Thread Arno Wagner
That explains it. For most operations that approach works well as basically nobody uses the 80 bit formats directly anyways. Unfortunately asinh() is very badly conditioned in the region tested and it is not enough. A possible approach to fix this would be to use long double (128 bit) were availab

Re: [Qemu-devel] [PATCH 5/6] migration: Now set the migration uri

2017-11-29 Thread Daniel P. Berrange
On Wed, Nov 29, 2017 at 05:43:35PM +0100, Juan Quintela wrote: > "Daniel P. Berrange" wrote: > > On Wed, Nov 22, 2017 at 12:54:58PM +, Daniel P. Berrange wrote: > >> On Wed, Nov 22, 2017 at 01:29:57PM +0100, Juan Quintela wrote: > >> > "Daniel P. Berrange" wrote: > >> > > On Mon, Oct 30, 2017

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-29 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 04:35:25PM +0300, Roman Kagan wrote: > > On 2017/11/29 18:41, Eduardo Habkost wrote: [...] > > > IMO, the long term solution is to make Linux guests not misbehave > > > when we stop lying about the L3 cache. Maybe we could provide a > > > "IPIs are expensive, please avoid t

Re: [Qemu-devel] [PATCH] i386: turn off l3-cache property by default

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 14:35, Roman Kagan wrote: >> >>> IMO, the long term solution is to make Linux guests not misbehave >>> when we stop lying about the L3 cache. Maybe we could provide a >>> "IPIs are expensive, please avoid them" hint in the KVM CPUID >>> leaf? > We already have it, it's the hypervisor

Re: [Qemu-devel] [PATCH v1 for-2.12 01/15] s390x/tcg: introduce and use program_interrupt_ra()

2017-11-29 Thread Richard Henderson
On 11/28/2017 08:33 PM, David Hildenbrand wrote: > +S390CPU *cpu = s390_env_get_cpu(env); > + > +#ifdef CONFIG_TCG > +if (tcg_enabled() && ra) { > +cpu_restore_state(CPU(cpu), ra); > +} > +#endif FWIW, I have a patch queued for 2.12 that removes the RA != 0 check protecting cal

Re: [Qemu-devel] [PATCH v1 for-2.12 02/15] s390x/tcg: get rid of runtime_exception()

2017-11-29 Thread Richard Henderson
On 11/28/2017 08:33 PM, David Hildenbrand wrote: > Let's use program_interrupt_ra() instead. > > Signed-off-by: David Hildenbrand > --- > target/s390x/fpu_helper.c | 2 +- > target/s390x/int_helper.c | 14 +++--- > target/s390x/internal.h| 2 -- > target/s390x/misc_helper.c | 16

Re: [Qemu-devel] [PATCH RFC 0/9] block: Rewrite block drain begin/end

2017-11-29 Thread Kevin Wolf
Am 29.11.2017 um 15:49 hat Fam Zheng geschrieben: > While we look at the fixes for 2.11, I briefly prototyped this series > to see if it makes sense as a simplification of the drain API for > 2.12. > > The idea is to let AioContext manage quiesce callbacks, then the block > layer only needs to do

Re: [Qemu-devel] [PATCH v1 for-2.12 03/15] s390x/tcg: rip out dead tpi code

2017-11-29 Thread Richard Henderson
On 11/28/2017 08:33 PM, David Hildenbrand wrote: > It is broken and not even wired up. We'll add a new handler soon, but > that will live somewhere else. > > Signed-off-by: David Hildenbrand > --- > hw/s390x/css.c | 6 -- > include/hw/s390x/css.h | 1 - > target/s390x/internal.h

Re: [Qemu-devel] [RFC PATCH v2 1/1] s390x/css: unrestrict cssids

2017-11-29 Thread Cornelia Huck
On Wed, 29 Nov 2017 17:25:59 +0100 Halil Pasic wrote: > On 11/29/2017 01:37 PM, Cornelia Huck wrote: > > On Tue, 28 Nov 2017 14:07:58 +0100 > > Halil Pasic wrote: > > > >> The default css 0xfe is currently restricted to virtual subchannel > >> devices. The hope when the decision was made was,

Re: [Qemu-devel] [PATCH v1 for-2.12 04/15] s390x/ioinst: pass the retaddr to all IO instructions

2017-11-29 Thread Richard Henderson
On 11/28/2017 08:33 PM, David Hildenbrand wrote: > TCG needs the retaddr when injecting an interrupt. Let's just pass it > along and use 0 for KVM. The value will be completely ignored for KVM. > > Convert program_interrupt() to program_interrupt_ra() directly, making > use of the passed address.

Re: [Qemu-devel] [PATCH v1 for-2.12 05/15] s390x/pci: pass the retaddr to all PCI instructions

2017-11-29 Thread Richard Henderson
On 11/28/2017 08:33 PM, David Hildenbrand wrote: > Once we wire up TCG, we will need the retaddr to correctly inject > program interrupts. As we want to get rid of the function > program_interrupt(), convert PCI code too. > > For KVM, we can simply pass a 0. > > Convert program_interrupt() to pro

  1   2   3   4   >