Re: [Qemu-devel] [PATCH] hw/core/qdev: Do not allow hot-plugging without hotplug controller

2017-09-21 Thread Eduardo Habkost
On Thu, Sep 07, 2017 at 11:22:42AM +0200, Thomas Huth wrote: > qdev_unplug() bails out with an assertion if the user tries to device_del > a hot-plugged device that does not have a hotplug controller. Unfortunately, > our devices are all marked with hotpluggable = true by default (see the >

Re: [Qemu-devel] [RFC v2 08/33] migration: new postcopy-pause state

2017-09-21 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > Introducing a new state "postcopy-paused", which can be used when the > postcopy migration is paused. It is targeted for postcopy network > failure recovery. > > Signed-off-by: Peter Xu > --- > migration/migration.c | 2 ++ >

Re: [Qemu-devel] [PATCH 1/2] s390x/3270: IDA support for 3270 via CcwDataStream

2017-09-21 Thread Cornelia Huck
On Wed, 20 Sep 2017 19:23:13 +0200 Halil Pasic wrote: > Let us convert the 3270 code so it uses the recently introduced > CcwDataStream abstraction instead of blindly assuming direct data access. > > This patch does not change behavior beyond introducing IDA support:

Re: [Qemu-devel] [PATCH qemu v4 2/3] vfio/spapr: Add a notifier for PPC64 HV/PR KVM about new group attached to LIOBN

2017-09-21 Thread Alexey Kardashevskiy
On 28/08/17 14:20, Alexey Kardashevskiy wrote: > On 25/08/17 16:21, David Gibson wrote: >> On Thu, Jul 20, 2017 at 05:22:30PM +1000, Alexey Kardashevskiy wrote: >>> This implements a notification for a new IOMMU group attached to >>> sPAPR's logical IO bus (LIOBN) to enable in-kernel TCE

[Qemu-devel] [PATCH v3] NUMA: Enable adding NUMA node implicitly

2017-09-21 Thread Dou Liyang
Linux and Windows need ACPI SRAT table to make memory hotplug work properly, however currently QEMU doesn't create SRAT table if numa options aren't present on CLI. Which breaks both linux and windows guests in certain conditions: * Windows: won't enable memory hotplug without SRAT table at all

Re: [Qemu-devel] [PATCH 2/2] s390x/3270: handle writes of arbitrary length

2017-09-21 Thread Cornelia Huck
On Wed, 20 Sep 2017 19:23:14 +0200 Halil Pasic wrote: > The problem is, that the current implementation places unrealistic and > arbitrary constraints on the length of writes to the device (that is the > outbound requests), by asserting ccw.count being such that that

Re: [Qemu-devel] [Bug 1706296] Re: Booting NT 4 disk causes /home/rjones/d/qemu/cpus.c:1580:qemu_mutex_lock_iothread: assertion failed: (!qemu_mutex_iothread_locked())

2017-09-21 Thread Peter Maydell
On 18 August 2017 at 11:33, Peter Maydell wrote: > On 18 August 2017 at 11:23, Alex Bennée wrote: >> Peter Maydell writes: >>> On 18 August 2017 at 09:40, Alex Bennée wrote: It might be

Re: [Qemu-devel] [PATCH 0/2] 3270 improvements

2017-09-21 Thread Cornelia Huck
On Wed, 20 Sep 2017 19:23:12 +0200 Halil Pasic wrote: > Jason found some problems with 3270 which he traced down to insufficient > output buffer size. I've looked into the underlying issue (and the > relevant code) and I saw strange things. Among others an unreasonable

Re: [Qemu-devel] [PATCH 2/5] s390x/css: use ccw data stream

2017-09-21 Thread Pierre Morel
On 05/09/2017 13:16, Halil Pasic wrote: Replace direct access which implicitly assumes no IDA or MIDA with the new ccw data stream interface which should cope with these transparently in the future. Signed-off-by: Halil Pasic --- hw/s390x/css.c | 5 +++-- 1 file

Re: [Qemu-devel] [PATCH 2/5] s390x/css: use ccw data stream

2017-09-21 Thread Pierre Morel
On 21/09/2017 11:33, Pierre Morel wrote: On 05/09/2017 13:16, Halil Pasic wrote: Replace direct access which implicitly assumes no IDA or MIDA with the new ccw data stream interface which should cope with these transparently in the future. Signed-off-by: Halil Pasic

Re: [Qemu-devel] [PATCH v3 2/5] s390x/css: use ccw data stream

2017-09-21 Thread Pierre Morel
On 19/09/2017 20:27, Halil Pasic wrote: Replace direct access which implicitly assumes no IDA or MIDA with the new ccw data stream interface which should cope with these transparently in the future. Signed-off-by: Halil Pasic Reviewed-by: Dong Jia Shi

Re: [Qemu-devel] [PATCH v3 3/5] virtio-ccw: use ccw data stream

2017-09-21 Thread Pierre Morel
On 19/09/2017 20:27, Halil Pasic wrote: Replace direct access which implicitly assumes no IDA or MIDA with the new ccw data stream interface which should cope with these transparently in the future. Signed-off-by: Halil Pasic Reviewed-by: Pierre

Re: [Qemu-devel] [PATCH 2/5] s390x/css: use ccw data stream

2017-09-21 Thread Cornelia Huck
On Thu, 21 Sep 2017 11:33:03 +0200 Pierre Morel wrote: > On 05/09/2017 13:16, Halil Pasic wrote: > > Replace direct access which implicitly assumes no IDA > > or MIDA with the new ccw data stream interface which should > > cope with these transparently in the future. >

Re: [Qemu-devel] [Qemu-block] [PATCH 2/2] qcow2: truncate the tail of the image file after shrinking the image

2017-09-21 Thread Pavel Butsykin
On 21.09.2017 00:38, John Snow wrote: On 09/20/2017 09:58 AM, Pavel Butsykin wrote: Now after shrinking the image, at the end of the image file, there might be a tail that probably will never be used. So we can find the last used cluster and cut the tail. Signed-off-by: Pavel Butsykin

[Qemu-devel] [PATCH qemu v5 12/18] memory: Share FlatView's and dispatch trees between address spaces

2017-09-21 Thread Alexey Kardashevskiy
This allows sharing flat views between address spaces (AS) when the same root memory region is used when creating a new address space. This is done by walking through all ASes and caching one FlatView per a physical root MR (i.e. not aliased). This removes search for duplicates from

[Qemu-devel] [PATCH qemu v5 18/18] memory: Avoid temporary FlatView allocation in a single child case

2017-09-21 Thread Alexey Kardashevskiy
The root MR may be enabled but the only child may be not (this is the case for the PCI bus master address space) so check this and avoid allocating temporary FV if that nested MR is not enabled. This does not make any difference though. Signed-off-by: Alexey Kardashevskiy ---

[Qemu-devel] [PATCH qemu v5 09/18] memory: Store physical root MR in FlatView

2017-09-21 Thread Alexey Kardashevskiy
Address spaces get to keep a root MR (alias or not) but FlatView stores the actual MR as this is going to be used later on to decide whether to share a particular FlatView or not. Signed-off-by: Alexey Kardashevskiy --- Changes: v4: *

[Qemu-devel] [PATCH qemu v5 14/18] memory: Rework "info mtree" to print flat views and dispatch trees

2017-09-21 Thread Alexey Kardashevskiy
This adds a new "-d" switch to "info mtree" to print dispatch tree internals. This changes the way "-f" is handled - it prints now flat views and associated address spaces. Signed-off-by: Alexey Kardashevskiy --- Changes: v3: * reimplemented as there is no more global FlatView

[Qemu-devel] [PATCH qemu v5 01/18] exec: Explicitly export target AS from address_space_translate_internal

2017-09-21 Thread Alexey Kardashevskiy
This adds an AS** parameter to address_space_do_translate() to make it easier for the next patch to share FlatViews. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- exec.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PATCH qemu v5 16/18] memory: Get rid of address_space_init_shareable

2017-09-21 Thread Alexey Kardashevskiy
Since FlatViews are shared now and ASes not, this gets rid of address_space_init_shareable(). This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- Changes: v3: * now removes @malloced and @ref_count, used to be in the previos patch ---

[Qemu-devel] [PATCH qemu v5 17/18] memory: Create FlatView directly

2017-09-21 Thread Alexey Kardashevskiy
This avoids usual memory_region_transaction_commit() which rebuilds all FVs. On POWER8 with 255 CPUs, 255 virtio-net, 40 PCI bridges guest this brings down the boot time from 25s to 20s and reduces the amount of temporary FVs allocated during machine constructon (~80 -> ~64) and amount of

[Qemu-devel] [PATCH qemu v5 15/18] memory: Share special empty FlatView

2017-09-21 Thread Alexey Kardashevskiy
This shares an cached empty FlatView among address spaces. The empty FV is used every time when a root MR renders into a FV without memory sections which happens when MR or its children are not enabled or zero-sized. The empty_view is not NULL to keep the rest of memory API intact; it also has a

Re: [Qemu-devel] [PATCH 5/5] s390x/ccs: add ccw-tester emulated device

2017-09-21 Thread Cornelia Huck
On Thu, 21 Sep 2017 16:45:47 +0800 Dong Jia Shi wrote: > * Cornelia Huck [2017-09-07 10:08:17 +0200]: > > [...] > > > > I'm thinking of a method these days: > > > Could passing through an fully emulated ccw device (e.g. 3270), or a > > > virtio

Re: [Qemu-devel] [PATCH v3 0/3] nbd client refactoring and fixing

2017-09-21 Thread Vladimir Sementsov-Ogievskiy
20.09.2017 20:22, Eric Blake wrote: On 09/20/2017 07:45 AM, Vladimir Sementsov-Ogievskiy wrote: v3: dropped all controversial things. I'll try to implement minimal structured reply and block status over this small residue. Vladimir Sementsov-Ogievskiy (3): block/nbd-client: refactor

[Qemu-devel] [PULL] qemu-sparc updates

2017-09-21 Thread Mark Cave-Ayland
Hi Peter, This contains the code for the new Sun HME (Happy Meal Ethernet) card and switches the sun4u machine over to use it as the default. Please pull. ATB, Mark. The following changes since commit b62b7ed0fc9c58e373b8946c9bd2e193be98dae6: Merge remote-tracking branch

Re: [Qemu-devel] [RFC PATCH] NUMA: Enable adding NUMA node implicitly

2017-09-21 Thread Igor Mammedov
On Thu, 21 Sep 2017 12:19:17 +0800 Dou Liyang wrote: > Hi Igor, > > I am sorry I missed some comments you gave to me. > > my reply is below. > At 09/18/2017 05:24 PM, Dou Liyang wrote: > [...] > >>> ranges where > >>> *the guest will attempt to probe for a

Re: [Qemu-devel] [RFC PATCH] NUMA: Enable adding NUMA node implicitly

2017-09-21 Thread Dou Liyang
Hi Igor, At 09/21/2017 03:54 PM, Igor Mammedov wrote: On Thu, 21 Sep 2017 12:19:17 +0800 [...] I've meant something like that: parse_numa_opts() { if (mc->auto_enable_numa_with_memhp == true) { qemu_opts_parse_noisily(qemu_find_opts("numa"), "node", true); } } Oops,

Re: [Qemu-devel] [PATCH 5/5] s390x/ccs: add ccw-tester emulated device

2017-09-21 Thread Dong Jia Shi
* Cornelia Huck [2017-09-07 10:08:17 +0200]: [...] > > I'm thinking of a method these days: > > Could passing through an fully emulated ccw device (e.g. 3270), or a > > virtio ccw device, in the level 1 kvm guest to a level 2 guest be a test > > method for this? > > > > All

[Qemu-devel] [PATCH qemu v5 11/18] memory: Move address_space_update_ioeventfds

2017-09-21 Thread Alexey Kardashevskiy
So it is called (twice) from the same function. This is to make the next patches a bit simpler. Signed-off-by: Alexey Kardashevskiy --- memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/memory.c b/memory.c index eb730cd619..9868d0f57c 100644 ---

[Qemu-devel] [PATCH qemu v5 06/18] memory: Switch memory from using AddressSpace to FlatView

2017-09-21 Thread Alexey Kardashevskiy
FlatView's will be shared between AddressSpace's and subpage_t and MemoryRegionSection cannot store AS anymore, hence this change. In particular, for: typedef struct subpage_t { MemoryRegion iomem; -AddressSpace *as; +FlatView *fv; hwaddr base; uint16_t sub_section[]; }

[Qemu-devel] [PATCH qemu v5 03/18] memory: Move FlatView allocation to a helper

2017-09-21 Thread Alexey Kardashevskiy
This moves a FlatView allocation and initialization to a helper. While we are nere, replace g_new with g_new0 to not to bother if we add new fields in the future. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- Changes: v3: *

[Qemu-devel] [PATCH qemu v5 05/18] memory: Remove AddressSpace pointer from AddressSpaceDispatch

2017-09-21 Thread Alexey Kardashevskiy
AS in ASD is only used to pass AS from mem_begin() to register_subpage() to store it in MemoryRegionSection, we can do this directly now. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- exec.c | 15 +++ 1 file changed, 7

Re: [Qemu-devel] [PATCH] trivial: Add missing "-m" parameter in docs/memory-hotplug.txt

2017-09-21 Thread Igor Mammedov
On Tue, 19 Sep 2017 11:02:26 +0200 Thomas Huth wrote: > The example obviously lacks the "-m" parameter. > > Signed-off-by: Thomas Huth Reviewed-by: Igor Mammedov > --- > docs/memory-hotplug.txt | 2 +- > 1 file changed, 1

Re: [Qemu-devel] [RFC PATCH] qdev: Mark devices as non-hotpluggable by default

2017-09-21 Thread Igor Mammedov
On Wed, 20 Sep 2017 18:10:48 +0200 Thomas Huth wrote: > On 20.09.2017 13:17, Thomas Huth wrote: > > On 20.09.2017 12:57, Marcel Apfelbaum wrote: > >> On 20/09/2017 13:07, Peter Maydell wrote: > [...] > >>> Is it possible to hack together some kind of test code that > >>>

Re: [Qemu-devel] [PATCH v3 0/3] Implement basic MSA functions

2017-09-21 Thread Cornelia Huck
On Wed, 20 Sep 2017 17:30:13 +0200 David Hildenbrand wrote: > Some leftover from "target/s390x: tcg improvments + MSA functions". > > Implement all basic MSA (cpacf/crypto) instructions <= z13. Only provide > the query subfunction (to query available subfunctions), no actual >

[Qemu-devel] [PATCH qemu v5 04/18] memory: Move AddressSpaceDispatch from AddressSpace to FlatView

2017-09-21 Thread Alexey Kardashevskiy
As we are going to share FlatView's between AddressSpace's, and AddressSpaceDispatch is a structure to perform quick lookup in FlatView, this moves ASD to FlatView. After previosly open coded ASD rendering, we can also remove as->next_dispatch as the new FlatView pointer is stored on a stack and

[Qemu-devel] [PATCH qemu v5 13/18] memory: Do not allocate FlatView in address_space_init

2017-09-21 Thread Alexey Kardashevskiy
This creates a new AS object without any FlatView as memory_region_transaction_commit() may want to reuse the empty FV. Signed-off-by: Alexey Kardashevskiy --- I do not really want to add view!=NULL into flatview_ref()/flatview_unref() as this is quite special case when

[Qemu-devel] [PATCH qemu v5 08/18] memory: Rename mem_begin/mem_commit/mem_add helpers

2017-09-21 Thread Alexey Kardashevskiy
This renames some helpers to reflect better what they do. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- Changes: v3: * s/flatview_mem_add/flatview_add_to_dispatch/ * s/phys_page_compact_all/address_space_dispatch_compact/ *

[Qemu-devel] [PATCH qemu v5 02/18] memory: Open code FlatView rendering

2017-09-21 Thread Alexey Kardashevskiy
We are going to share FlatView's between AddressSpace's and per-AS memory listeners won't suit the purpose anymore so open code the dispatch tree rendering. Since there is a good chance that dispatch_listener was the only listener, this avoids address_space_update_topology_pass() if there is no

[Qemu-devel] [PATCH qemu v5 00/18] memory: Store physical root MR in FlatView

2017-09-21 Thread Alexey Kardashevskiy
This was inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1481593 Previous versions: v1: https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01559.html v2: https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04069.html v3:

[Qemu-devel] [PATCH qemu v5 10/18] memory: Alloc dispatch tree where topology is generared

2017-09-21 Thread Alexey Kardashevskiy
This is to make next patches simpler. Signed-off-by: Alexey Kardashevskiy --- memory.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/memory.c b/memory.c index 98b0b95e6e..eb730cd619 100644 --- a/memory.c +++ b/memory.c @@ -742,6 +742,7 @@

[Qemu-devel] [PATCH qemu v5 07/18] memory: Cleanup after switching to FlatView

2017-09-21 Thread Alexey Kardashevskiy
We store AddressSpaceDispatch* in FlatView anyway so there is no need to carry it from mem_add() to register_subpage/register_multipage. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- exec.c | 16 1 file changed, 8

Re: [Qemu-devel] [PULL 0/2] xen-20170920-tag

2017-09-21 Thread Peter Maydell
On 21 September 2017 at 03:21, Stefano Stabellini wrote: > The following changes since commit b62b7ed0fc9c58e373b8946c9bd2e193be98dae6: > > Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging > (2017-09-20 20:33:48 +0100) > > are available in the

Re: [Qemu-devel] [PATCH v3 0/7] Update websocket code to more fully support the RFC

2017-09-21 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 09:56:07AM -0700, Brandon Carpenter wrote: > How are things looking, Daniel. I believe every comment from the previous > version of the series was addressed. > > I also wanted to mention that I put together a Python script, which acts as > a proxy between noVNC and qemu,

Re: [Qemu-devel] [PATCH] tcg/tci: do not use ldst label (never implemented)

2017-09-21 Thread Thomas Huth
On 12.09.2017 17:13, Paolo Bonzini wrote: > On 12/09/2017 16:56, Thomas Huth wrote: >> The problem is that the SLOF firmware just performs very badly with TCG >> (it's fine on real hardware). It executes a lot of Forth code, and the >> Forth interpreter uses things like computed gotos or other

Re: [Qemu-devel] [PATCH qemu v5 00/18] memory: Store physical root MR in FlatView

2017-09-21 Thread Paolo Bonzini
On 21/09/2017 10:50, Alexey Kardashevskiy wrote: > This was inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1481593 > Previous versions: > v1: https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01559.html > v2: https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg04069.html > v3:

Re: [Qemu-devel] [PATCH] virtio/vhost: reset dev->log after syncing

2017-09-21 Thread Marc-André Lureau
- Original Message - > vhost_log_put() is called to decomission the dirty log between qemu and > a vhost device when stopping the device. Such a call can happen from > migration_completion(). > > Present code sets dev->log_size to zero too early in vhost_log_put(), > causing the sync

[Qemu-devel] [PATCH] memory: avoid a name clash with access macro

2017-09-21 Thread KONRAD Frederic
This avoids a name clash with the access macro on windows 64: make CHK version_gen.h CC aarch64-softmmu/memory.o /home/konrad/qemu/memory.c: In function 'access_with_adjusted_size': /home/konrad/qemu/memory.c:591:73: error: macro "access" passed 7 arguments, \

[Qemu-devel] [PATCH] io: add trace events for websockets frame handling

2017-09-21 Thread Daniel P. Berrange
It is useful to trace websockets frame encoding/decoding when debugging problems. Signed-off-by: Daniel P. Berrange --- io/channel-websock.c | 23 ++- io/trace-events | 5 + 2 files changed, 23 insertions(+), 5 deletions(-) diff --git

Re: [Qemu-devel] [PATCH qemu v5 00/18] memory: Store physical root MR in FlatView

2017-09-21 Thread Alexey Kardashevskiy
On 21/09/17 20:03, Paolo Bonzini wrote: > On 21/09/2017 10:50, Alexey Kardashevskiy wrote: >> This was inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1481593 >> Previous versions: >> v1: https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg01559.html >> v2:

Re: [Qemu-devel] [PATCH v10 06/10] migration: add postcopy blocktime ctx into MigrationIncomingState

2017-09-21 Thread Dr. David Alan Gilbert
* Alexey Perevalov (a.pereva...@samsung.com) wrote: > This patch adds request to kernel space for UFFD_FEATURE_THREAD_ID, > in case when this feature is provided by kernel. > > PostcopyBlocktimeContext is incapsulated inside postcopy-ram.c, > due to it's postcopy only feature. > Also it defines

Re: [Qemu-devel] [PATCH] hw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case

2017-09-21 Thread Marcel Apfelbaum
Hi Aleksandr, On 21/09/2017 0:21, Aleksandr Bezzubikov wrote: Signed-off-by: Aleksandr Bezzubikov --- hw/pci-bridge/pcie_pci_bridge.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) Please add Eduardo's Reported-by tag and the actual

Re: [Qemu-devel] [PATCH 0/2] 3270 improvements

2017-09-21 Thread Halil Pasic
On 09/21/2017 11:24 AM, Cornelia Huck wrote: > On Wed, 20 Sep 2017 19:23:12 +0200 > Halil Pasic wrote: > >> Jason found some problems with 3270 which he traced down to insufficient >> output buffer size. I've looked into the underlying issue (and the >> relevant code)

Re: [Qemu-devel] [PATCH 2/2] s390x/3270: handle writes of arbitrary length

2017-09-21 Thread Halil Pasic
On 09/21/2017 11:23 AM, Cornelia Huck wrote: > On Wed, 20 Sep 2017 19:23:14 +0200 > Halil Pasic wrote: > >> The problem is, that the current implementation places unrealistic and >> arbitrary constraints on the length of writes to the device (that is the >> outbound

<    1   2   3   4