Re: [Qemu-devel] [PATCH qemu v5 1/2] memory/iommu/vfio: Define add_vfio_group() callback

2017-12-01 Thread Alex Williamson
On Fri, 1 Dec 2017 08:56:42 +1100 Alexey Kardashevskiy wrote: > On 05/10/17 16:50, Alexey Kardashevskiy wrote: > > The new callback will be called when a new VFIO IOMMU group is added. > > > > This should cause no behavioral change, the next patch will. > > > > Signed-off-by: Alexey Kardashevsk

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

2017-12-01 Thread Michael S. Tsirkin
On Wed, Nov 29, 2017 at 09:55:22PM +0800, Wei Wang wrote: > 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 > i

Re: [Qemu-devel] [PATCH v4 05/32] migration: implement "postcopy-pause" src logic

2017-12-01 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > On Thu, Nov 30, 2017 at 10:49:45AM +, Dr. David Alan Gilbert wrote: > > * Peter Xu (pet...@redhat.com) wrote: > > > Now when network down for postcopy, the source side will not fail the > > > migration. Instead we convert the status into this new paused s

Re: [Qemu-devel] [PATCH v3 for-2.12 00/16] s390x/tcg: cleanup and fix program interrupts

2017-12-01 Thread Cornelia Huck
On Thu, 30 Nov 2017 17:27:28 +0100 David Hildenbrand wrote: > I have quite some patches on my queue for 2.12. (booting Fedora 26/27 > guests, floating interrupts, machine checks, missing instructions ...) > > So let's start slowly This series gets rid of program_interrupt() and > potential_page

Re: [Qemu-devel] [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Wang, Wei W
On Friday, December 1, 2017 9:02 PM, Tetsuo Handa wrote: > Wei Wang wrote: > > On 11/30/2017 06:34 PM, Tetsuo Handa wrote: > > > Wei Wang wrote: > > >> + * @start: the start of the bit range, inclusive > > >> + * @end: the end of the bit range, inclusive > > >> + * > > >> + * This function is used

Re: [Qemu-devel] Block layer complexity: what to do to keep it under control?

2017-12-01 Thread Fam Zheng
On Fri, 12/01 14:08, Stefan Hajnoczi wrote: > What I'm getting at is that the essential complexity of a parallel I/O > engine with a runtime reconfigurable graph, background operations, and > non-trivial disk image file formats sets a certain floor (minimum) > complexity. The consequence is that o

Re: [Qemu-devel] [PATCH v4 0/7] s390x/pci: Improve zPCI to cover more cases

2017-12-01 Thread Pierre Morel
On 01/12/2017 11:29, Cornelia Huck wrote: On Thu, 30 Nov 2017 13:55:23 +0100 Pierre Morel wrote: This patch fixes the following BUG: Even a guest is able to detect virtio_pci device, the init function the Linux virtio_pci driver will hang because zPCI does not support the subregions used by vi

Re: [Qemu-devel] [PATCH v4 0/7] s390x/pci: Improve zPCI to cover more cases

2017-12-01 Thread Cornelia Huck
On Thu, 30 Nov 2017 13:55:23 +0100 Pierre Morel wrote: > This patch fixes the following BUG: > Even a guest is able to detect virtio_pci device, the init function > the Linux virtio_pci driver will hang because zPCI does not support > the subregions used by virtio_pci. > > It follows that right

Re: [Qemu-devel] [PATCH 4/3] checkpatch: Enforce proper do/while (0) style

2017-12-01 Thread Eric Blake
On 12/01/2017 01:31 AM, Markus Armbruster wrote: Eric Blake writes: On 11/30/2017 08:01 AM, Eric Blake wrote: while (0) is only idiomatic in a macro definition, where the caller will be supplying the trailing ';'. Warn if the macro has a duplicate. +# 'while (0);' is odd; only macros sh

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

2017-12-01 Thread Michael S. Tsirkin
On Wed, Nov 29, 2017 at 09:55:23PM +0800, Wei Wang wrote: > 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 pre

Re: [Qemu-devel] Apple hyphervisor.framework availability

2017-12-01 Thread Stefan Hajnoczi
On Tue, Nov 21, 2017 at 08:14:49PM +1100, Brendan Simon (eTRIX) wrote: > Hi QEMU devs, > > Just wondering when the accelerator for Apple's hypervisor.framework > (hvf) will hit the git repos to build and try out? > > I get the impression that patches have been submitted, but I can't see > anythin

[Qemu-devel] [RFC] vhost: check if ring mapping is still valid when building memmap

2017-12-01 Thread Igor Mammedov
vhost_verify_ring_mappings() were used to verify that rings are still accessible and related memory hasn't been moved after flatview is updated. It were doing checks by mapping ring's GPA+len and checking that HVA hasn't changed with new memory map. To avoid maybe expensive mapping call, we were i

Re: [Qemu-devel] [Qemu-block] [PATCH 1/4] block: Expect graph changes in bdrv_parent_drained_begin/end

2017-12-01 Thread Stefan Hajnoczi
On Wed, Nov 29, 2017 at 02:55:28PM +0100, Kevin Wolf wrote: > Am 29.11.2017 um 14:44 hat Stefan Hajnoczi geschrieben: > > On Wed, Nov 29, 2017 at 11:25:10AM +0100, Paolo Bonzini wrote: > > > From: Kevin Wolf > > > > > > The .drained_begin/end callbacks can (directly or indirectly via > > > aio_po

Re: [Qemu-devel] [PATCH v5 01/20] block: Add .bdrv_co_block_status() callback

2017-12-01 Thread Eric Blake
On 12/01/2017 08:40 AM, Kevin Wolf wrote: Note that most drivers give sector-aligned answers, except at end-of-file, even when request_alignment is smaller than a sector. However, bdrv_getlength() is sector-aligned (even though it gives a byte answer), often by exceeding the actual file size. If

Re: [Qemu-devel] [PATCH v4 12/20] qed: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
On 11/30/2017 04:27 AM, Vladimir Sementsov-Ogievskiy wrote: 12.10.2017 21:59, Eric Blake wrote: We are gradually moving away from sector-based interfaces, towards byte-based.  Update the qed driver accordingly, taking the opportunity to inline qed_is_allocated_cb() into its lone caller (the call

[Qemu-devel] [PATCH for-2.11] spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

2017-12-01 Thread David Gibson
At guest reset time, we allocate a hash page table (HPT) for the guest based on the guest's RAM size. If dynamic HPT resizing is not available we use the maximum RAM size, if it is we use the current RAM size. But the "current RAM size" calculation is incorrect - we just use the "base" ram_size f

[Qemu-devel] [PATCH v1] spapr.c: Update qemu's maxcpus for pseries machine.

2017-12-01 Thread Seeteena Thoufeek
Need to adjust the max cpus supported number from error message since it was conflicting with KVM's. Steps to Reproduce: 1.boot up with "-smp 64,maxcpus=102464,cores=8,threads=1,sockets=8" qemu-kvm: Number of SMP CPUs requested (102464) exceeds max CPUs supported by machine 'pseries-rhel7.4.0alt'

Re: [Qemu-devel] [PATCH 06/17] iotests: Drop format-specific in _filter_img_info

2017-12-01 Thread Fam Zheng
On Thu, 11/30 09:42, Eric Blake wrote: > On 11/29/2017 09:16 PM, Fam Zheng wrote: > > On Thu, 11/23 03:08, Max Reitz wrote: > > > _filter_img_info should remove format-specific information, too. We > > > already have such a filter in _img_info, and it is very useful for > > > query-block-named-blo

Re: [Qemu-devel] [PATCH v5 01/20] block: Add .bdrv_co_block_status() callback

2017-12-01 Thread Kevin Wolf
Am 01.12.2017 um 16:03 hat Eric Blake geschrieben: > On 12/01/2017 08:40 AM, Kevin Wolf wrote: > > > Note that most drivers give sector-aligned answers, except at > > > end-of-file, even when request_alignment is smaller than a sector. > > > However, bdrv_getlength() is sector-aligned (even though

Re: [Qemu-devel] [PATCH v4 01/32] migration: better error handling with QEMUFile

2017-12-01 Thread Peter Xu
On Thu, Nov 30, 2017 at 10:24:38AM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > If the postcopy down due to some reason, we can always see this on dst: > > > > qemu-system-x86_64: RP: Received invalid message 0x length 0x > > > > However in most cases

Re: [Qemu-devel] [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Matthew Wilcox
On Fri, Dec 01, 2017 at 10:02:01PM +0900, Tetsuo Handa wrote: > If start == end is legal, > >for (; start < end; start = (start | (IDA_BITMAP_BITS - 1)) + 1) { > > makes this loop do nothing because 10 < 10 is false. ... and this is why we add tests to the test-suite!

Re: [Qemu-devel] [PATCH v4 17/20] vmdk: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
On 11/30/2017 05:39 AM, Vladimir Sementsov-Ogievskiy wrote: 12.10.2017 21:59, Eric Blake wrote: We are gradually moving away from sector-based interfaces, towards byte-based.  Update the vmdk driver accordingly. Signed-off-by: Eric Blake --- v4: rebase to interface tweak v3: no change v2: reb

Re: [Qemu-devel] [RFC 0/7] Rework vhost memory region updates

2017-12-01 Thread Stefan Hajnoczi
On Wed, Nov 29, 2017 at 06:50:19PM +, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > Hi, > This is an experimental set that reworks the way the vhost > code handles changes in physical address space layout that > came from a discussion with Igor. > > Instead of up

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

2017-12-01 Thread Michael S. Tsirkin
On Wed, Nov 29, 2017 at 09:55:26PM +0800, Wei Wang wrote: > 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

Re: [Qemu-devel] [PATCH v4 20/32] migration: synchronize dirty bitmap for resume

2017-12-01 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > This patch implements the first part of core RAM resume logic for > postcopy. ram_resume_prepare() is provided for the work. > > When the migration is interrupted by network failure, the dirty bitmap > on the source side will be meaningless, because even the

[Qemu-devel] [PATCH v5 14/20] sheepdog: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the sheepdog driver accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- v5: no change v4: update to interface tweak v3: no change v2: rebase to mapping flag --- block/sheepdo

[Qemu-devel] [PATCH 0/3] unrestrict cssids related patches

2017-12-01 Thread Halil Pasic
Hi all! This serises is a follow up of: * [RFC PATCH v2 1/1] s390x/css: unrestrict cssids * [RFC PATCH 1/1] s390x: deprecate s390-squash-mcss See the commit messages and cover letters of the individual patches for more details. Halil Pasic (3): s390x/css: unrestrict cssids s390x/css: adverti

[Qemu-devel] [PATCH v5 00/20] add byte-based block_status driver callbacks

2017-12-01 Thread Eric Blake
There are patches floating around to add NBD_CMD_BLOCK_STATUS, but NBD wants to report status on byte granularity (even if the reporting will probably be naturally aligned to sectors or even much higher levels). I've therefore started the task of converting our block status code to report at a byt

[Qemu-devel] guest reboot after hotadd gpu device

2017-12-01 Thread Lying
Hello, i encounter a problem that my guest reboot after hot-add GPU device. Following is detail message: First:i start my guest without GPU device, after i can connect it, add GPU device with commands "device_add driver=vfio-pci,host=02:00.0,x-vga=on,multifunction=yes,id=gpu1" But my guest is r

[Qemu-devel] [PATCH v5 04/20] gluster: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the gluster driver accordingly. In want_zero mode, we continue to report fine-grained hole information (the caller wants as much mapping detail as possible); but when not in that mode, the caller prefers larger

Re: [Qemu-devel] [PATCH v8 3/5] fw_cfg: do DMA read operation

2017-12-01 Thread Michael S. Tsirkin
On Thu, Nov 23, 2017 at 03:02:04PM +0100, Marc-André Lureau wrote: > Modify fw_cfg_read_blob() to use DMA if the device supports it. > Return errors, because the operation may fail. > > The DMA operation is expected to run synchronously with today qemu, > but the specification states that it may b

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

2017-12-01 Thread Fam Zheng
On Thu, 11/30 17:04, Paolo Bonzini wrote: > On 30/11/2017 16:10, Kevin Wolf wrote: > >> Yes, I agree, but that (using CoMutex around graph change) requires > >> everything, especially the defer_to_main_loop_bh, runs in a coroutine > >> context, which is exactly what I mean by "introducing 'ubiquito

[Qemu-devel] [PATCH v5 16/20] vdi: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the vdi driver accordingly. Note that the TODO is already covered (the block layer guarantees bounds of its requests), and that we can remove the now-unused s->block_sectors. Signed-off-by: Eric Blake Reviewed

[Qemu-devel] [PATCH v5 15/20] vdi: Avoid bitrot of debugging code

2017-12-01 Thread Eric Blake
Rework the debug define so that we always get -Wformat checking, even when debugging is disabled. Signed-off-by: Eric Blake Reviewed-by: Stefan Weil Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Vladimir Sementsov-Ogievskiy --- v2-v5: no change --- block/vdi.c | 12 +--- 1 file ch

Re: [Qemu-devel] [PATCH 4/3] checkpatch: Enforce proper do/while (0) style

2017-12-01 Thread Markus Armbruster
Eric Blake writes: > On 11/30/2017 08:01 AM, Eric Blake wrote: >> while (0) is only idiomatic in a macro definition, where the caller >> will be supplying the trailing ';'. Warn if the macro has a duplicate. >> >> Signed-off-by: Eric Blake >> --- >> scripts/checkpatch.pl | 5 + >> 1 file

[Qemu-devel] [PATCH] virtio-input: add missing KEY_COMPOSE mapping

2017-12-01 Thread Ladi Prosek
This key tends to be located somewhere between right Alt and right Ctrl and is usually used for opening context menus. Signed-off-by: Ladi Prosek --- hw/input/virtio-input-hid.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index e7

[Qemu-devel] [PATCH v5 11/20] qcow2: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the qcow2 driver accordingly. For now, we are ignoring the 'want_zero' hint. However, it should be relatively straightforward to honor the hint as a way to return larger *pnum values when we have consecutive cl

[Qemu-devel] [PATCH v5 05/20] iscsi: Switch cluster_sectors to byte-based

2017-12-01 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert all uses of the cluster size in sectors, along with adding assertions that we are not dividing by zero. Improve some comment grammar while in the area. Signed-off-by: Eric Blake A

[Qemu-devel] [PATCH v2] target/ppc: Fix system lockups caused by interrupt_request state corruption

2017-12-01 Thread Richard Purdie
Occasionally in Linux guests on x86_64 we're seeing logs like: ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 0100req 0004 when they should read: ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 0100req 0002 The "0004" is CPU_INTERRUPT_EXITTB yet the code calls

Re: [Qemu-devel] [PATCH v4 09/20] parallels: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
On 11/30/2017 03:03 AM, Vladimir Sementsov-Ogievskiy wrote: 12.10.2017 21:59, Eric Blake wrote: We are gradually moving away from sector-based interfaces, towards byte-based.  Update the parallels driver accordingly.  Note that the internal function block_status() is still sector-based, because

[Qemu-devel] [PATCH v5 13/20] raw: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the raw driver accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- v5: no change v4: rebase to interface tweak v3: no change v2: rebase to mapping --- block/raw-format.c | 16

[Qemu-devel] [PATCH v5 17/20] vmdk: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the vmdk driver accordingly. Drop the now-unused vmdk_find_index_in_cluster(). Also, fix a pre-existing bug: if find_extent() fails (unlikely, since the block layer did a bounds check), then we must return a fa

[Qemu-devel] [PATCH v5 01/20] block: Add .bdrv_co_block_status() callback

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Now that the block layer exposes byte-based allocation, it's time to tackle the drivers. Add a new callback that operates on as small as byte boundaries. Subsequent patches will then update individual drivers, then fina

[Qemu-devel] [PATCH v5 06/20] iscsi: Switch iscsi_allocmap_update() to byte-based

2017-12-01 Thread Eric Blake
We are gradually converting to byte-based interfaces, as they are easier to reason about than sector-based. Convert all uses of the allocmap (no semantic change). Callers that already had bytes available are simpler, and callers that now scale to bytes will be easier to switch to byte-based in th

[Qemu-devel] [PATCH v5 18/20] vpc: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the vpc driver accordingly. Drop the now-unused get_sector_offset(). Signed-off-by: Eric Blake --- v5: fix incorrect rounding in 'map' and bad loop condition [Vladimir] v4: rebase to interface tweak v3: rebas

Re: [Qemu-devel] [PATCH v4 0/4] Convert to realize and improve error handling

2017-12-01 Thread Stefan Hajnoczi
On Wed, Nov 22, 2017 at 11:08:42AM +0800, Mao Zhongyi wrote: > This series mainly implements the conversions of ide, floppy and nvme > device to realize. Add some error handling messages and remove the local > variable local_err, use errp to propagate the error directly. Also > fix the unusual func

[Qemu-devel] [PATCH v5 12/20] qed: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the qed driver accordingly, taking the opportunity to inline qed_is_allocated_cb() into its lone caller (the callback used to be important, until we switched qed to coroutines). There is no intent to optimize ba

[Qemu-devel] [PATCH v5 08/20] null: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the null driver accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- v5: minor fix to type of 'ret' v4: rebase to interface tweak v3: no change v2: rebase to mapping parameter

[Qemu-devel] [PATCH for-2.12 0/2] qcow2: add overlap check for bitmap directory

2017-12-01 Thread Vladimir Sementsov-Ogievskiy
Add simple constant overlap check. Vladimir Sementsov-Ogievskiy (2): qcow2: add overlap check for bitmap directory qcow2: fix indentation after previous patch block/qcow2.h | 45 - block/qcow2-refcount.c | 12 block/qcow2.c

[Qemu-devel] [PATCH v5 02/20] block: Switch passthrough drivers to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the generic helpers, and all passthrough clients (blkdebug, commit, mirror, throttle) accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- v5: rebase to master v4: rebase to in

Re: [Qemu-devel] [PATCH v4 05/32] migration: implement "postcopy-pause" src logic

2017-12-01 Thread Peter Xu
On Thu, Nov 30, 2017 at 10:49:45AM +, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > Now when network down for postcopy, the source side will not fail the > > migration. Instead we convert the status into this new paused state, and > > we will try to wait for a rescue

[Qemu-devel] [PATCH v5 03/20] file-posix: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the file protocol driver accordingly. In want_zero mode, we continue to report fine-grained hole information (the caller wants as much mapping detail as possible); but when not in that mode, the caller prefers l

[Qemu-devel] [PATCH] rtc: fix windows guest hang problem when Reading RTC_REG_C is overwritten

2017-12-01 Thread Gonglei
We hit a bug in our test while run PCMark 10 in a windows 7 VM, The VM got stuck and the wallclock was hang after several minutes running PCMark 10 in it. It is quite easily to reproduce the bug with the upstream KVM and Qemu. We found that KVM can not inject any RTC irq to VM after it was hang, i

Re: [Qemu-devel] [PATCH 1/1] vhost-scsi: add missing virtqueue_size parameter

2017-12-01 Thread Paolo Bonzini
On 01/12/2017 16:15, Eric Farman wrote: > Commit 5c0919d02066 ("virtio-scsi: Add virtqueue_size parameter allowing > virtqueue size to be set.") introduced a new parameter to virtio-scsi. > Later, commit 920036106044 ("vhost-user-scsi: add missing virtqueue_size > param") added that parameter to th

[Qemu-devel] [PATCH v5 07/20] iscsi: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the iscsi driver accordingly. In this case, it is handy to teach iscsi_co_block_status() to handle a NULL map and file parameter, even though the block layer passes non-NULL values, because we also call the func

Re: [Qemu-devel] [PATCH v1 2/2] intel-iommu: Extend address width to 48 bits

2017-12-01 Thread Michael S. Tsirkin
On Thu, Nov 30, 2017 at 10:33:50AM -0800, Prasad Singamsetty wrote: > > > On 11/29/2017 7:25 PM, Peter Xu wrote: > > On Wed, Nov 29, 2017 at 01:05:22PM -0800, Prasad Singamsetty wrote: > > > Thanks Michael. Some comments below. > > > > > > On 11/28/2017 9:32 AM, Michael S. Tsirkin wrote: > > > >

[Qemu-devel] [PATCH v5 10/20] qcow: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the qcow driver accordingly. There is no intent to optimize based on the want_zero flag for this format. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- v5: no change v4: rebase to in

Re: [Qemu-devel] [PATCH v4 19/20] vvfat: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
On 11/30/2017 06:25 AM, Vladimir Sementsov-Ogievskiy wrote: 12.10.2017 21:59, Eric Blake wrote: We are gradually moving away from sector-based interfaces, towards byte-based.  Update the vvfat driver accordingly.  Note that we can rely on the block driver having already clamped limits to our blo

[Qemu-devel] [PATCH v5 09/20] parallels: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the parallels driver accordingly. Note that the internal function block_status() is still sector-based, because it is still in use by other sector-based functions; but that's okay because request_alignment is 51

Re: [Qemu-devel] [PATCH v4] vhost: Don't abort when vhost-user connection is lost during migration

2017-12-01 Thread Michael S. Tsirkin
On Fri, Dec 01, 2017 at 01:58:32PM +0800, fangying wrote: > QEMU will abort when vhost-user process is restarted during migration > when vhost_log_global_start/stop is called. The reason is clear that > vhost_dev_set_log returns -1 because network connection is lost. > > To handle this situation,

Re: [Qemu-devel] [PATCH v5 01/20] block: Add .bdrv_co_block_status() callback

2017-12-01 Thread Kevin Wolf
Am 01.12.2017 um 02:42 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. Now that the block layer exposes byte-based allocation, > it's time to tackle the drivers. Add a new callback that operates > on as small as byte boundaries. Subseq

[Qemu-devel] [PATCH 3/5] spapr: move the IRQ allocation routines under the machine

2017-12-01 Thread Cédric Le Goater
Also change the prototype to use a sPAPRMachineState and prefix them with spapr_irq_. It will let us synchronise the IRQ allocation with the XIVE interrupt mode when available. Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson Reviewed-by: Greg Kurz --- hw/intc/trace-events | 4 --

[Qemu-devel] [PATCH v5 19/20] vvfat: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Update the vvfat driver accordingly. Note that we can rely on the block driver having already clamped limits to our block size, and simplify accordingly. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogie

Re: [Qemu-devel] [PATCH v4 09/20] parallels: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
On 11/30/2017 04:12 PM, Eric Blake wrote:   BDRVParallelsState *s = bs->opaque; -    int64_t offset; +    int count; +    assert(QEMU_IS_ALIGNED(offset | bytes, BDRV_SECTOR_SIZE));   qemu_co_mutex_lock(&s->lock); -    offset = block_status(s, sector_num, nb_sectors, pnum); +    offset =

[Qemu-devel] [PATCH 5/5] spapr: introduce a spapr_qirq() helper

2017-12-01 Thread Cédric Le Goater
xics_get_qirq() is only used by the sPAPR machine. Let's move it there and change its name to reflect its scope. It will be useful for XIVE support which will use its own set of qirqs. Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson --- Changes since initial XIVE patchset : - s/sp

[Qemu-devel] [PATCH 2/2] qcow2: fix indentation after previous patch

2017-12-01 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 34 +- block/qcow2.c | 16 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index 8f226a3609..896ad08e5b 100644 --- a/block/qcow2.h +++ b/

Re: [Qemu-devel] [PATCH v4 18/20] vpc: Switch to .bdrv_co_block_status()

2017-12-01 Thread Eric Blake
On 11/30/2017 06:22 AM, Vladimir Sementsov-Ogievskiy wrote: 12.10.2017 21:59, Eric Blake wrote: We are gradually moving away from sector-based interfaces, towards byte-based.  Update the vpc driver accordingly.  Drop the now-unused get_sector_offset(). Signed-off-by: Eric Blake --- -    o

Re: [Qemu-devel] [PATCH v1 1/2] intel-iommu: Redefine macros to enable supporting 48 bit address width

2017-12-01 Thread Liu, Yi L
On Tue, Nov 14, 2017 at 06:13:49PM -0500, prasad.singamse...@oracle.com wrote: > From: Prasad Singamsetty > > The current implementation of Intel IOMMU code only supports 39 bits > host/iova address width so number of macros use hard coded values based > on that. This patch is to redefine them so

[Qemu-devel] [PATCH 1/3] s390x/css: unrestrict cssids

2017-12-01 Thread Halil Pasic
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 guests can exploit multiple channel subsystems. Since current guests don't do that, the pain of the partitioned (cssid) name

Re: [Qemu-devel] [PATCH for-2.12] hmp-commands: Remove the deprecated usb_add and usb_del

2017-12-01 Thread Thomas Huth
On 30.11.2017 20:32, Dr. David Alan Gilbert wrote: > * Thomas Huth (th...@redhat.com) wrote: >> It's easy to use device_add and device_del as replacement instead. >> The usb_add and usb_del commands are deprecated since QEMU 2.10, >> and nobody complained that they are still needed, so let's get ri

Re: [Qemu-devel] [PATCH v4 30/32] migration: delay the postcopy-active state switch

2017-12-01 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Switch the state until we try to start the VM on destination side. The > problem is that without doing this we may have a very small window that > we'll be in such a state: > > - dst VM is in postcopy-active state, > - main thread is handling MIG_CMD_PACKAG

Re: [Qemu-devel] /usr/bin/m4: internal error detected

2017-12-01 Thread John Paul Adrian Glaubitz
On 12/01/2017 01:18 PM, Andreas Schwab wrote: This isn't a bug in m4 or anything architecture-specific, it's a regression that was introduced by an upstream change in glibc [1] and mainly affects qemu-user which we are using for m68k and sh4 [2]. It's a bug in qemu-linux-user, which ignores CLO

[Qemu-devel] [PATCH 1/5] ppc/xics: introduce an icp_create() helper

2017-12-01 Thread Cédric Le Goater
The sPAPR and the PowerNV core objects create the interrupt presenter object of the CPUs in a very similar way. Let's provide a common routine in which we use the presenter 'type' as a child identifier. Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson Reviewed-by: Greg Kurz --- Chang

[Qemu-devel] [PATCH v5 20/20] block: Drop unused .bdrv_co_get_block_status()

2017-12-01 Thread Eric Blake
We are gradually moving away from sector-based interfaces, towards byte-based. Now that all drivers have been updated to provide the byte-based .bdrv_co_block_status(), we can delete the sector-based interface. Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- v5: rebase

Re: [Qemu-devel] [PATCH] block: Formats don't need CONSISTENT_READ with NO_IO

2017-12-01 Thread Eric Blake
On 12/01/2017 06:41 AM, Kevin Wolf wrote: I guess it is the block of writes/resizes that prevents metadata from getting inconsistent; CONSISTENT_READ does indeed make more sense if interpreted solely in light of will the guest read consistent data (and not will the format layer see consistent co

[Qemu-devel] [PATCH v4] vhost: Don't abort when vhost-user connection is lost during migration

2017-12-01 Thread fangying
QEMU will abort when vhost-user process is restarted during migration when vhost_log_global_start/stop is called. The reason is clear that vhost_dev_set_log returns -1 because network connection is lost. To handle this situation, let's cancel migration by setting migrate state to failure and repor

Re: [Qemu-devel] [PATCH 17/25] spapr: add a sPAPRXive object to the machine

2017-12-01 Thread David Gibson
On Thu, Nov 30, 2017 at 03:38:46PM +, Cédric Le Goater wrote: > >> +} else { > >> +/* XIVE uses the full range of IRQ numbers. The CPU IPIs will > >> + * use the range below XICS_IRQ_BASE, which is unused by XICS. */ > >> +spapr->xive = spapr_xive_create(spapr, XICS_

Re: [Qemu-devel] [PATCH v4 00/32] Migration: postcopy failure recovery

2017-12-01 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Tree is pushed here for better reference and testing: > github.com/xzpeter postcopy-recovery-support Hi Peter, Do you have a git with this code + your OOB world in? I'd like to play with doing recovery and see what happens; I still worry a bit about whet

Re: [Qemu-devel] [PATCH 17/25] spapr: add a sPAPRXive object to the machine

2017-12-01 Thread David Gibson
On Thu, Nov 30, 2017 at 03:15:09PM +, Cédric Le Goater wrote: > On 11/30/2017 05:55 AM, David Gibson wrote: > > On Thu, Nov 23, 2017 at 02:29:47PM +0100, Cédric Le Goater wrote: > >> The XIVE object is designed to be always available, so it is created > >> unconditionally on newer machines. > >

[Qemu-devel] [PATCH 0/5] spapr: preliminary cleanups before introducing XIVE

2017-12-01 Thread Cédric Le Goater
Hello, These are initial patches of the XIVE patchset which prepare ground for the integration of the XIVE model. Thanks, C. Cédric Le Goater (5): ppc/xics: introduce an icp_create() helper ppc/xics: assign of the CPU 'intc' pointer under the core spapr: move the IRQ allocation routines u

Re: [Qemu-devel] [RFC 0/7] Rework vhost memory region updates

2017-12-01 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@gmail.com) wrote: > On Wed, Nov 29, 2017 at 06:50:19PM +, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Hi, > > This is an experimental set that reworks the way the vhost > > code handles changes in physical address space layout t

[Qemu-devel] [PATCH 1/2] qcow2: add overlap check for bitmap directory

2017-12-01 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/qcow2.h | 7 +-- block/qcow2-refcount.c | 12 block/qcow2.c | 6 ++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index 6f0ff15dd0..8f226a3609 100644 ---

[Qemu-devel] [PATCH 2/5] ppc/xics: assign of the CPU 'intc' pointer under the core

2017-12-01 Thread Cédric Le Goater
The 'intc' pointer of the CPU references the interrupt presenter in the XICS interrupt mode. When the XIVE interrupt mode is available and activated, the machine will need to reassign this pointer to reflect the change. Moving this assignment under the realize routine of the CPU will ease the proc

Re: [Qemu-devel] [PATCH 14/25] spapr: push the XIVE EQ data in OS event queue

2017-12-01 Thread David Gibson
On Thu, Nov 30, 2017 at 02:16:30PM +, Cédric Le Goater wrote: > On 11/30/2017 04:49 AM, David Gibson wrote: > > On Thu, Nov 23, 2017 at 02:29:44PM +0100, Cédric Le Goater wrote: > >> If a triggered event is let through, the Event Queue data defined in the > >> associated IVE is pushed in the in

Re: [Qemu-devel] [PATCH v5 03/20] file-posix: Switch to .bdrv_co_block_status()

2017-12-01 Thread Kevin Wolf
Am 01.12.2017 um 02:42 hat Eric Blake geschrieben: > We are gradually moving away from sector-based interfaces, towards > byte-based. Update the file protocol driver accordingly. > > In want_zero mode, we continue to report fine-grained hole > information (the caller wants as much mapping detail

[Qemu-devel] [PATCH for-2.12] hmp-commands: Remove the deprecated usb_add and usb_del

2017-12-01 Thread Thomas Huth
It's easy to use device_add and device_del as replacement instead. The usb_add and usb_del commands are deprecated since QEMU 2.10, and nobody complained that they are still needed, so let's get rid of them now to make the HMP interface a little bit less overloaded. Signed-off-by: Thomas Huth ---

Re: [Qemu-devel] [PATCH v18 05/10] xbitmap: add more operations

2017-12-01 Thread Tetsuo Handa
Wei Wang wrote: > On 11/30/2017 06:34 PM, Tetsuo Handa wrote: > > Wei Wang wrote: > >> + * @start: the start of the bit range, inclusive > >> + * @end: the end of the bit range, inclusive > >> + * > >> + * This function is used to clear a bit in the xbitmap. If all the bits > >> of the > >> + * bi

[Qemu-devel] [PATCH 4/5] spapr: introduce a spapr_irq_set_lsi() helper

2017-12-01 Thread Cédric Le Goater
It will make synchronisation easier with the XIVE interrupt mode when available. The 'irq' parameter refers to the global IRQ number space. Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson --- Changes since initial XIVE patchset: - s/spapr_irq_set/spapr_irq_set_lsi/ hw/ppc/spapr.

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

2017-12-01 Thread Kevin Wolf
Am 01.12.2017 um 10:51 hat Fam Zheng geschrieben: > On Thu, 11/30 17:04, Paolo Bonzini wrote: > > On 30/11/2017 16:10, Kevin Wolf wrote: > > >> Yes, I agree, but that (using CoMutex around graph change) requires > > >> everything, especially the defer_to_main_loop_bh, runs in a coroutine > > >> con

Re: [Qemu-devel] /usr/bin/m4: internal error detected

2017-12-01 Thread John Paul Adrian Glaubitz
Hi Daniel! On 12/01/2017 06:08 AM, Daniel Kahn Gillmor wrote: Copying file po/Makefile.in.in Copying file po/Makevars.template qemu: Unsupported syscall: -1 m4: ../sysdeps/unix/sysv/linux/spawni.c:366: __spawnix: Assertion `ec >= 0' failed. /usr/bin/m4: internal error detected; ple

Re: [Qemu-devel] /usr/bin/m4: internal error detected

2017-12-01 Thread John Paul Adrian Glaubitz
Hi Florian! On 12/01/2017 11:40 AM, Florian Weimer wrote: Is this ?  If yes, it should be fixed in master and on the 2.25 and 2.26 branches. 2.24 and earlier should not be affected. You're right, this is indeed fixed by your patch. I trie

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

2017-12-01 Thread David Gibson
On Thu, Nov 30, 2017 at 02:23:45PM +0800, Peter Xu wrote: > On Wed, Nov 29, 2017 at 07:46:25PM +1100, David Gibson wrote: > > [...] > > > struct PCIBus { > > BusState qbus; > > +enum PCIBusFlags flags; > > PCIIOMMUFunc iommu_fn; > > void *iommu_opaque; > > uint8_t devfn_m

Re: [Qemu-devel] [PATCH v4 0/7] s390x/pci: Improve zPCI to cover more cases

2017-12-01 Thread Cornelia Huck
On Thu, 30 Nov 2017 13:55:23 +0100 Pierre Morel wrote: > This patch fixes the following BUG: > Even a guest is able to detect virtio_pci device, the init function > the Linux virtio_pci driver will hang because zPCI does not support > the subregions used by virtio_pci. > > It follows that right

Re: [Qemu-devel] [PATCH for-2.11] spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

2017-12-01 Thread Greg Kurz
On Fri, 1 Dec 2017 16:41:25 +1100 David Gibson wrote: > At guest reset time, we allocate a hash page table (HPT) for the guest > based on the guest's RAM size. If dynamic HPT resizing is not available we > use the maximum RAM size, if it is we use the current RAM size. > > But the "current RAM

Re: [Qemu-devel] [PATCH 12/25] spapr: introduce a XIVE interrupt presenter model

2017-12-01 Thread David Gibson
On Thu, Nov 30, 2017 at 01:44:51PM +, Cédric Le Goater wrote: > On 11/30/2017 04:06 AM, David Gibson wrote: > > On Wed, Nov 29, 2017 at 10:55:34AM +0100, Cédric Le Goater wrote: > >> On 11/29/2017 06:11 AM, David Gibson wrote: > >>> On Thu, Nov 23, 2017 at 02:29:42PM +0100, Cédric Le Goater wro

Re: [Qemu-devel] [PATCH] dump-guest-memory.py: fix No symbol "vmcoreinfo_find"

2017-12-01 Thread Laszlo Ersek
On 12/01/17 12:37, Marc-André Lureau wrote: > When qemu is compiled without debug, the dump gdb python script can fail with: > > Error occurred in Python command: No symbol "vmcoreinfo_find" in current > context. > > Because vmcoreinfo_find() is inlined and not exported. > > Use the underlying

Re: [Qemu-devel] [for-2.12 3/7] pci: Fold pci_bus.h into pci.h

2017-12-01 Thread Michael S. Tsirkin
On Thu, Nov 30, 2017 at 03:02:48PM +1100, David Gibson wrote: > On Wed, Nov 29, 2017 at 12:38:00PM +0200, Marcel Apfelbaum wrote: > > On 29/11/2017 10:46, David Gibson wrote: > > > include/hw/pci/pci_bus.h is now very small and can only safely be included > > > after hw/pci/pci.h. So, just fold it

Re: [Qemu-devel] /usr/bin/m4: internal error detected

2017-12-01 Thread Florian Weimer
On 12/01/2017 12:58 PM, John Paul Adrian Glaubitz wrote: The fix is already in the packaging source of Debian's glibc [1] after I reported the bug. But the updated package has not been uploaded to the FTP servers yet. I'll ask Debian's glibc maintainers to push it. Okay. Based on the other res

Re: [Qemu-devel] [PATCH] block: Formats don't need CONSISTENT_READ with NO_IO

2017-12-01 Thread Eric Blake
On 11/30/2017 12:27 PM, Kevin Wolf wrote: @@ -1936,7 +1938,9 @@ void bdrv_format_default_perms(BlockDriverState *bs, BdrvChild *c, /* bs->file always needs to be consistent because of the metadata. We * can never allow other users to resize or write to it. */ -perm

Re: [Qemu-devel] [PATCH v1 2/2] intel-iommu: Extend address width to 48 bits

2017-12-01 Thread Liu, Yi L
On Tue, Nov 14, 2017 at 06:13:50PM -0500, prasad.singamse...@oracle.com wrote: > From: Prasad Singamsetty > > The current implementation of Intel IOMMU code only supports 39 bits > iova address width. This patch provides a new parameter (x-aw-bits) > for intel-iommu to extend its address width to

  1   2   3   >