[Qemu-devel] [PATCH 2/2] hw/arm/smmuv3: fix eventq recording and IRQ triggerring

2018-09-21 Thread Eric Auger
The event queue management is broken today. Event records are not properly written as EVT_SET_* macro was not updating the actual event record. Also the event queue interrupt is not correctly triggered. Fixes: bb981004eaf4 ("hw/arm/smmuv3: Event queue recording helper") Signed-off-by: Eric Auger

[Qemu-devel] [PATCH 1/2] hw/arm/smmu-common: Fix the name of the iommu memory regions

2018-09-21 Thread Eric Auger
At the point smmu_find_add_as() gets called, the bus number might not be computed. Let's change the name of IOMMU memory region and just use the devfn and an incrementing index. The name only is used for debug. Signed-off-by: Eric Auger --- hw/arm/smmu-common.c | 6 +++--- 1 file changed, 3 ins

[Qemu-devel] [PATCH 0/2] ARM SMMUv3: Fix event queue handling and memory region names

2018-09-21 Thread Eric Auger
This series fixes the event queue handling: the events were incorrectly recorded and the interrupt was not sent as expected. Also we fix the IOMMU memory region names. This last issue is minor as names only are used for debug/tracing. However it can be confusing. Best Regards Eric Eric Auger (2

Re: [Qemu-devel] [PATCH v3 07/22] memory-device: add and use memory_device_get_region_size()

2018-09-21 Thread David Hildenbrand
>> >> -mr = ddc->get_memory_region(dimm, errp); >> -if (!mr) { >> +value = memory_device_get_region_size(MEMORY_DEVICE(obj), errp); > > Given the below, that should be &local_err above, no? Yes, very right! > >> +if (local_err) { >> +error_propagate(errp, local_err);

Re: [Qemu-devel] [PATCH v3 09/22] memory-device: drop get_region_size()

2018-09-21 Thread David Hildenbrand
On 21/09/2018 07:19, David Gibson wrote: > On Thu, Sep 20, 2018 at 12:32:30PM +0200, David Hildenbrand wrote: >> We now have get_memory_region(), which can be used generically to detect >> the region size. Use memory_device_get_region_size() where >> get_region_size() was used and use memory_device

Re: [Qemu-devel] [RFC v2 8/8] virtio: guest driver reload for vhost-net

2018-09-21 Thread Maxime Coquelin
On 09/21/2018 04:33 AM, Jason Wang wrote: On 2018年09月21日 04:39, Maxime Coquelin wrote: Hi Wei, Jason, On 06/19/2018 09:53 AM, Wei Xu wrote: On Wed, Jun 06, 2018 at 11:48:19AM +0800, Jason Wang wrote: On 2018å¹´06月06æ—¥ 03:08, w...@redhat.com wrote: From: Wei Xu last_avail, avail_w

Re: [Qemu-devel] [PATCH v3 17/22] virtio-pmem: prototype

2018-09-21 Thread Markus Armbruster
Quick review of just the QAPI part. David Hildenbrand writes: > From: Pankaj Gupta > > This is the current protoype of virtio-pmem. Support will require > machine changes for the architectures that will support it, so it will > not yet be compiled. > > Signed-off-by: Pankaj Gupta > [ MemoryDev

Re: [Qemu-devel] [QEMU PATCH] net: Deprecate the old way of using a legacy net via "name" instead of "id"

2018-09-21 Thread Markus Armbruster
Thomas Huth writes: > On 2018-09-20 08:07, Markus Armbruster wrote: >> Thomas Huth writes: >> >>> In early times, network backends were specified by a "vlan" and "name" >>> tuple. With the introduction of netdevs, the "name" was replaced by an >>> "id" (which is supposed to be unique), but the

Re: [Qemu-devel] [PATCH] qapi: birtmap-merge: document name change

2018-09-21 Thread Markus Armbruster
Eric Blake writes: > On 9/19/18 2:09 PM, John Snow wrote: > > In the subject-line: s/birtmap/bitmap/ > >> We named these using underscores instead of the preferred dash, >> document this nearby so we cannot possibly forget to rectify this >> when we remove the 'x-' prefixes when the feature becom

[Qemu-devel] [PATCH v2 2/8] hyperv_testdev: drop unnecessary includes

2018-09-21 Thread Roman Kagan
Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 4 1 file changed, 4 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index de07d7e8c3..e1e9ad7dda 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -13,13 +13,9 @@ #include "qemu

[Qemu-devel] [PATCH v2 0/8] hyperv: refactor HvSintRoute management

2018-09-21 Thread Roman Kagan
This series modifies the management of HvSintRoute, which is an important building block in Hyper-V emulation infrastructure, to make it easier to maintain and enhance, and paves the way to the more complete Synthetic Interrupt Controller (SynIC) emulation. v1 -> v2: - include two more cosmetic pa

[Qemu-devel] [RFC v2 00/28] vSMMUv3/pSMMUv3 2 stage VFIO integration

2018-09-21 Thread Eric Auger
Up to now vSMMUv3 has not been integrated with VFIO. VFIO integration requires to program the physical IOMMU consistently with the guest mappings. However, as opposed to VTD, SMMUv3 has no "Caching Mode" which allows easy trapping of guest mappings. This means the vSMMUV3 cannot use the same VFIO i

[Qemu-devel] [PATCH v2 3/8] hyperv: cosmetic: g_malloc -> g_new

2018-09-21 Thread Roman Kagan
Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 3065d765ed..47368b77c0 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -88,7 +88,7 @@ HvSintRoute *kvm_hv_sint_

[Qemu-devel] [PATCH v2 1/8] hyperv_testdev: refactor for better maintainability

2018-09-21 Thread Roman Kagan
Make hyperv_testdev slightly easier to follow and enhance in future. For that, put the hyperv sint routes (wrapped in a helper structure) on a linked list rather than a fixed-size array. Besides, this way HvSintRoute can be treated as an opaque structure, allowing for easier refactoring of the cor

[Qemu-devel] [PATCH v2 6/8] hyperv: address HvSintRoute by X86CPU pointer

2018-09-21 Thread Roman Kagan
Use X86CPU pointer to refer to the respective HvSintRoute instead of vp_index. This is more convenient and also paves the way for future enhancements. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/i386/h

[Qemu-devel] [PATCH v2 8/8] hyperv: rename kvm_hv_sint_route_set_sint

2018-09-21 Thread Roman Kagan
There's nothing kvm-specific in it so follow the suite and replace "kvm_hv" prefix with "hyperv". Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 +- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/targe

[Qemu-devel] [PATCH v2 5/8] hyperv: allow passing arbitrary data to sint ack callback

2018-09-21 Thread Roman Kagan
Make sint ack callback accept an opaque pointer, that is stored on sint_route at creation time. This allows for more convenient interaction with the callback. Besides, nothing outside hyperv.c should need to know the layout of HvSintRoute fields any more so its declaration can be removed from the

[Qemu-devel] [RFC v2 06/28] hw/arm/smmuv3: Implement get_attr API to report IOMMU_ATTR_VFIO_NESTED

2018-09-21 Thread Eric Auger
Virtual SMMUv3 requires physical nested stages for VFIO integration. Let's advertise this. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 8c4e99fecc..d6895071a5 100644 --- a/hw/arm/smmuv3.c +

[Qemu-devel] [PATCH v2 4/8] hyperv: synic: only setup ack notifier if there's a callback

2018-09-21 Thread Roman Kagan
There's no point setting up an sint ack notifier if no callback is specified. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 47368b77c0..

[Qemu-devel] [RFC v2 01/28] hw/arm/smmu-common: Fix the name of the iommu memory regions

2018-09-21 Thread Eric Auger
At the point smmu_find_add_as() gets called, the bus number might not be computed. Let's change the name of IOMMU memory region and just use the devfn and an incrementing index. The name only is used for debug. Signed-off-by: Eric Auger --- hw/arm/smmu-common.c | 6 +++--- 1 file changed, 3 ins

[Qemu-devel] [RFC v2 05/28] memory: add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute

2018-09-21 Thread Eric Auger
We introduce a new IOMMU Memory Region attribute, IOMMU_ATTR_VFIO_NESTED which tells whether the virtual IOMMU requires physical nested stages for VFIO integration. Intel virtual IOMMU supports Caching Mode and does not require 2 stages at physical level. However virtual ARM SMMU does not implement

[Qemu-devel] [RFC v2 09/28] memory: Introduce IOMMUIOLTBNotifier

2018-09-21 Thread Eric Auger
Current IOMMUNotifiers dedicate to IOTLB related notifications. We want to introduce notifiers for virtual IOMMU config changes. Let's create a new IOMMUIOLTBNotifier datatype. This paves the way to the introduction of an IOMMUConfigNotifier. IOMMUNotifier now has an iotlb_notifier field. We change

[Qemu-devel] [RFC v2 02/28] hw/arm/smmuv3: fix eventq recording and IRQ triggerring

2018-09-21 Thread Eric Auger
The event queue management is broken today. Event records are not properly written as EVT_SET_* macro was not updating the actual event record. Also the event queue interrupt is not correctly triggered. Fixes: bb981004eaf4 ("hw/arm/smmuv3: Event queue recording helper") Signed-off-by: Eric Auger

[Qemu-devel] [RFC v2 14/28] hw/arm/smmuv3: Implement dummy replay

2018-09-21 Thread Eric Auger
The default implementation of memory_region_iommu_replay() shall not be used as it forces the translation of the whole RAM range. The purpose of this function is to update the shadow page tables. However in case of nested stage, there is no shadow page table so we can simply return. Signed-off-by:

[Qemu-devel] [RFC v2 03/28] update-linux-headers: Import iommu.h

2018-09-21 Thread Eric Auger
Update the script to import the new iommu.h uapi header. Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 0a964fe240..3f11e49758 100755 --- a/s

[Qemu-devel] [RFC v2 12/28] memory: Add arch_id in IOTLBEntry

2018-09-21 Thread Eric Auger
TLB entries are usually tagged with some ids such as the asid or pasid. When propagating an invalidation command from the guest to the host, we need to pass this id. Signed-off-by: Eric Auger --- include/exec/memory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/memory.h b/in

[Qemu-devel] [PATCH v2 7/8] hyperv: make HvSintRoute reference-counted

2018-09-21 Thread Roman Kagan
Multiple entities (e.g. VMBus devices) can use the same SINT route. To make their lives easier in maintaining SINT route ownership, make it reference-counted. Adjust the respective API names accordingly. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 10 +- hw/misc/hyperv_te

[Qemu-devel] [RFC v2 04/28] linux-headers: Partial header update

2018-09-21 Thread Eric Auger
This imports both the iommu.h and vfio.h headers found on branch https://github.com/eauger/linux/tree/v4.19-rc4-2stage-rfc-v2 ([RFC v2 00/20] SMMUv3 Nested Stage Setup) Signed-off-by: Eric Auger --- v1 -> v2: - addition of the default reporting API - renamings - CD removal from iommu_pasid_smmu

[Qemu-devel] [RFC v2 18/28] hw/vfio/common: Introduce vfio_dma_(un)map_ram_section helpers

2018-09-21 Thread Eric Auger
This code is going to be duplicated soon, so let's introduce an helper which dma (unp)maps a ram memory section. No functional change. Signed-off-by: Eric Auger --- hw/vfio/common.c | 198 ++- hw/vfio/trace-events | 4 +- 2 files changed, 123 insert

[Qemu-devel] [RFC v2 15/28] hw/arm/smmuv3: Notify on config changes

2018-09-21 Thread Eric Auger
In case IOMMU config notifiers are attached to the IOMMU memory region, we execute them, passing as argument the iommu_pasid_table_config struct updated with the new viommu translation config. Config notifiers are called on STE changes. At physical level, they translate into CMD_CFGI_STE_* commands

[Qemu-devel] [RFC v2 07/28] hw/vfio/common: Refactor container initialization

2018-09-21 Thread Eric Auger
To prepare for testing yet another extension, let's refactor the code. We introduce vfio_iommu_get_type() helper which selects the richest API (v2 first). Then vfio_init_container() does the SET_CONTAINER and SET_IOMMU ioctl calls. So we end up with a switch/case on the iommu_type which should be a

[Qemu-devel] [RFC v2 10/28] memory: rename memory_region notify_iommu, notify_one

2018-09-21 Thread Eric Auger
Le's rename those notification functions to clearly discriminate iotlb notifications from looming config notifications. Signed-off-by: Eric Auger --- hw/arm/smmu-common.c | 2 +- hw/arm/smmuv3.c | 2 +- hw/i386/intel_iommu.c| 10 +- hw/misc/tz-mpc.c | 8 --

Re: [Qemu-devel] [PULL 6/7] monitor: move init global earlier

2018-09-21 Thread Wolfgang Bumiller
On Thu, Sep 20, 2018 at 06:14:11PM +0200, Markus Armbruster wrote: > Wolfgang Bumiller writes: > > > On Thu, Sep 20, 2018 at 04:10:00PM +0800, Peter Xu wrote: > >> On Thu, Sep 20, 2018 at 10:02:22AM +0200, Wolfgang Bumiller wrote: > >> > >> > Either way, spawning the iothread on demand can still

[Qemu-devel] [RFC v2 17/28] hw/vfio/common: Introduce vfio_alloc_guest_iommu helper

2018-09-21 Thread Eric Auger
Soon this code will be called several times. So let's introduce an helper. Signed-off-by: Eric Auger --- hw/vfio/common.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 5dcb502f42..ce13c102a5 100644 --- a/h

[Qemu-devel] [RFC v2 13/28] hw/arm/smmuv3: Store s1ctrptr in translation config data

2018-09-21 Thread Eric Auger
For VFIO integration we will need to pass the context descriptor table GPA to the host. So let's decode and store it. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 1 + include/hw/arm/smmu-common.h | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmu

[Qemu-devel] [RFC v2 08/28] hw/vfio/common: Force nested if iommu requires it

2018-09-21 Thread Eric Auger
In case we detect the address space is translated by a virtual IOMMU which requires nested stages, let's set up the container with the VFIO_TYPE1_NESTING_IOMMU iommu_type. Signed-off-by: Eric Auger --- hw/vfio/common.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-

[Qemu-devel] [PATCH 00/10] hyperv: add connection infrastructure

2018-09-21 Thread Roman Kagan
This series introduces the infrastructure to send and receive Hyper-V messages and events. More specifically, - SynIC is turned into a full-fledged device managing the memory regions used for QEMU->guest communication - machinery is introduced to post messages and signal events to the guest -

[Qemu-devel] [PATCH 0/5] hyperv: move to hw/ and allow opt-out

2018-09-21 Thread Roman Kagan
This series restructures Hyper-V emulation code such that - most of it lives in hw/ and bears no target-specific dependencies - it's only built when CONFIG_HYPERV=y (default on x86+KVM) Based-on: 20180921081836.29230-1-rka...@virtuozzo.com Roman Kagan (5): hyperv: split hyperv-proto.h into x86

[Qemu-devel] [RFC v2 11/28] memory: Add IOMMUConfigNotifier

2018-09-21 Thread Eric Auger
With this patch, an IOMMUNotifier can now be either an IOTLB notifier or a config notifier. A config notifier is supposed to be called on guest translation config change. This gives host a chance to update the physical IOMMU configuration so that is consistent with the guest view. The notifier is

Re: [Qemu-devel] [PATCH v3 13/22] memory-device: complete factoring out unplug handling

2018-09-21 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:34PM +0200, David Hildenbrand wrote: > With the new memory device functions in place, we can factor out > unplugging of memory devices completely. > > Signed-off-by: David Hildenbrand Reviewed-by: David Gibson > --- > hw/mem/memory-device.c | 8 ++-- >

[Qemu-devel] [PATCH 2/5] hyperv: make hyperv_vp_index inline

2018-09-21 Thread Roman Kagan
Also make the inverse function, hyperv_find_vcpu, static as it's not used outside hyperv.c This paves the way to making hyperv.c built optionally. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 6 -- target/i386/hyperv.c | 11 --- 2 files changed, 8 insertions(+), 9 deletion

[Qemu-devel] [PATCH 1/5] hyperv: split hyperv-proto.h into x86 and arch-independent parts

2018-09-21 Thread Roman Kagan
Some parts of the Hyper-V hypervisor-guest interface appear to be target-independent, so move them into a proper header. Not that Hyper-V ARM64 emulation is around the corner but it seems more conveninent to have most of Hyper-V and VMBus target-independent, and allows to avoid conflicts with incl

[Qemu-devel] [RFC v2 16/28] hw/arm/smmuv3: Fill the IOTLBEntry arch_id on NH_VA invalidation

2018-09-21 Thread Eric Auger
When the guest invalidates one S1 entry, it passes the asid. When propagating this invalidation downto the host, the asid information also must be passed. So let's fill the arch_id field introduced for that purpose. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 1 + 1 file changed, 1 insertion

[Qemu-devel] [PATCH 5/5] i386: add hyperv-stub for CONFIG_HYPERV=n

2018-09-21 Thread Roman Kagan
This will allow to build slightly leaner QEMU that supports some HyperV features of KVM (e.g. SynIC timers, PV spinlocks, APIC assists, etc.) but nothing else on the QEMU side. Signed-off-by: Roman Kagan --- target/i386/hyperv-stub.c | 33 + target/i386/Makefile.o

[Qemu-devel] [PATCH 4/5] default-configs: collect CONFIG_HYPERV* in hyperv.mak

2018-09-21 Thread Roman Kagan
Accumulate HYPERV config options in a dedicated file. There are only two so far; more will be added later. Signed-off-by: Roman Kagan --- default-configs/hyperv.mak | 2 ++ default-configs/i386-softmmu.mak | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 default

Re: [Qemu-devel] [PATCH v3 10/22] memory-device: add device class function set_addr()

2018-09-21 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:31PM +0200, David Hildenbrand wrote: 1;5202;0c> To be able to factor out address asignment of memory devices, we will > have to read (get_addr()) and write (set_addr()) the address. > > We can't use properties for this purpose, as properties are device > specific. E.g

[Qemu-devel] [RFC v2 21/28] target/arm/kvm: Notifies IOMMU on MSI stage 1 binding

2018-09-21 Thread Eric Auger
When the MSI route is setup, we know the MSI IOVA and the doorbell GPA . At that point we can communicate this guest stage 1 binding to the host. Then the host will be able to construct a stage 2 binding taking as input address the doorbell GPA. We also directly use the iommu memory region transla

[Qemu-devel] [RFC v2 19/28] hw/vfio/common: Register specific nested mode notifiers and memory_listener

2018-09-21 Thread Eric Auger
In nested mode, legacy vfio_iommu_map_notify MAP/UNMAP notifier cannot be used anymore. Indeed there is no caching mode in place that allows to trap MAP events. Only configuration change and UNMAP events can be trapped. As such we register - one configuration notifier, whose role is to propagate th

[Qemu-devel] [PATCH 3/5] hyperv: factor out arch-independent API into hw/hyperv

2018-09-21 Thread Roman Kagan
A significant part of hyperv.c is not actually tied to x86, and can be moved to hw/. This will allow to maintain most of Hyper-V and VMBus target-independent, and to avoid conflicts with inclusion of arch-specific headers down the road in VMBus implementation. Also this stuff can now be opt-out w

[Qemu-devel] [PATCH 1/2] monitor: guard iothread access by mon->use_io_thread

2018-09-21 Thread Wolfgang Bumiller
monitor_resume() and monitor_suspend() both want to "kick" the I/O thread if it is there, but in monitor_suspend() lacked the use_io_thread flag condition. This is required when we later only spawn the thread on first use. Signed-off-by: Wolfgang Bumiller --- monitor.c | 2 +- 1 file changed, 1

[Qemu-devel] [RFC v2 24/28] memory: Introduce IOMMU_NOTIFIER_INIT_CFG IOMMU Config Notifier

2018-09-21 Thread Eric Auger
This patch adds a new IOMMU config notifier. It aims at configuring the fault reporting from host to guest. Signed-off-by: Eric Auger --- I acknowledge I am not a big fan of having a vfio uapi struct referenced in IOMMUConfig. However this config really sets something at VFIO layer. Also I may

[Qemu-devel] [RFC v2 26/28] hw/vfio/common: Handle fault_handler

2018-09-21 Thread Eric Auger
We introduce a new IOMMU notifier, whose role is to register the fault notifier. The patch also implements the userspace fault handler. When the eventfd is signalled, the fault handler injects the set of collected faults into the IOMMU memory region. Signed-off-by: Eric Auger --- hw/vfio/common

[Qemu-devel] [RFC v2 22/28] vfio/pci: Always set up MSI route before enabling vectors

2018-09-21 Thread Eric Auger
As we enable the vectors, we shall have an MSI route setup. The notification of the stage 1 binding is done on MSI route setup. Signed-off-by: Eric Auger --- hw/vfio/pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 866f0deeb7..842b0921d4 100644 --- a/

[Qemu-devel] [RFC v2 25/28] memory: Introduce IOMMU Memory Region inject_faults API

2018-09-21 Thread Eric Auger
This new API allows to inject @count iommu_faults into the IOMMU memory region. Signed-off-by: Eric Auger --- include/exec/memory.h | 26 ++ memory.c | 12 2 files changed, 38 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memor

[Qemu-devel] [RFC v2 28/28] hw/arm/smmuv3: Implement fault injection

2018-09-21 Thread Eric Auger
We convert iommu_fault structs received from the kernel into the data struct used by the emulation code and record the evnts into the virtual event queue. Signed-off-by: Eric Auger --- Exhaustive mapping remains to be done --- hw/arm/smmuv3.c | 76 ++

[Qemu-devel] [RFC v2 20/28] hw/vfio/common: Register MAP notifier for MSI binding

2018-09-21 Thread Eric Auger
Register a MAP notifier to propage MSI stage 1 bindings to the host. When the notifier gets called, we pass the guest stage 1 MSI binding to the host. The host can then build a S2 binding whose entry is the guest MSI doorbell GPA. Signed-off-by: Eric Auger --- hw/vfio/common.c | 29 +

[Qemu-devel] [RFC v2 27/28] hw/arm/smmuv3: Init fault handling

2018-09-21 Thread Eric Auger
We configure the kernel fault event fifo when the guest sizes the event queue. Signed-off-by: Eric Auger --- At the moment we arbitrarily cap the fifo size to 2^5 events --- hw/arm/smmuv3.c | 20 1 file changed, 20 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv

[Qemu-devel] [PATCH 04/10] hyperv: make overlay pages for SynIC

2018-09-21 Thread Roman Kagan
Per Hyper-V spec, SynIC message and event flag pages are to be implemented as so called overlay pages. That is, they are owned by the hypervisor and, when mapped into the guest physical address space, overlay the guest physical pages such that 1) the overlaid guest page becomes invisible to the g

[Qemu-devel] [RFC v2 23/28] hw/arm/smmuv3: Remove warning about unsupported MAP notifiers

2018-09-21 Thread Eric Auger
SMMUv3 now is integrated with VFIO by enable the 2 stages of the physical SMMUv3. This relies on a MAP notifier for MSI stage 1 binding notification. So let's remove this warning. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/arm/smmu

[Qemu-devel] [PATCH 01/10] hyperv:synic: split capability testing and setting

2018-09-21 Thread Roman Kagan
Put a bit more consistency into handling KVM_CAP_HYPERV_SYNIC capability, by checking its availability and determining the feasibility of hv-synic property first, and enabling it later. Signed-off-by: Roman Kagan --- target/i386/kvm.c | 20 1 file changed, 16 insertions(+),

[Qemu-devel] [PATCH v2 2/5] display/edid: add qemu_edid_size()

2018-09-21 Thread Gerd Hoffmann
Helper function to figure the size of a edid blob, by checking how many extensions are present. Both the base edid blob and the extensions are 128 bytes in size. Signed-off-by: Gerd Hoffmann --- include/hw/display/edid.h | 1 + hw/display/edid-generate.c | 14 ++ 2 files changed,

[Qemu-devel] [PATCH 05/10] hyperv: add synic message delivery

2018-09-21 Thread Roman Kagan
Add infrastructure to deliver SynIC messages to the SynIC message page. Note that KVM may also want to deliver (SynIC timer) messages to the same message slot. The problem is that the access to a SynIC message slot is controlled by the value of its .msg_type field which indicates if the slot is b

Re: [Qemu-devel] [PATCH v2 4/4] hw/core/machine: Officially deprecate the enforce-config-section parameter

2018-09-21 Thread Thomas Huth
On 2018-09-20 20:13, Markus Armbruster wrote: > Thomas Huth writes: > >> Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter >> to the documentation, including a note that it is deprecated. But it >> has never been added to the "Deprecated features" appendix, which is >> our offi

[Qemu-devel] [PATCH v2 3/5] display/edid: add region helper.

2018-09-21 Thread Gerd Hoffmann
Create a io region for an EDID data block. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé --- include/hw/display/edid.h | 4 hw/display/edid-region.c | 33 + hw/display/Makefile.objs | 1 + 3 files changed, 38 insertions(+) create mode

[Qemu-devel] [PATCH 06/10] hyperv: add synic event flag signaling

2018-09-21 Thread Roman Kagan
Add infrastructure to signal SynIC event flags by atomically setting the corresponding bit in the event flags page and firing a SINT if necessary. Signed-off-by: Roman Kagan --- include/hw/hyperv/hyperv.h | 4 hw/hyperv/hyperv.c | 32 2 files change

[Qemu-devel] [PATCH 03/10] hyperv: only add SynIC in compatible configurations

2018-09-21 Thread Roman Kagan
Certain configurations do not allow SynIC to be used in QEMU. In particular, - when hyperv_vpindex is off, SINT routes can't be used as they refer to the destination vCPU by vp_index - older KVM (which doesn't expose KVM_CAP_HYPERV_SYNIC2) zeroes out SynIC message and event pages on every ms

[Qemu-devel] [PATCH 08/10] hyperv: add support for KVM_HYPERV_EVENTFD

2018-09-21 Thread Roman Kagan
When setting up a notifier for Hyper-V event connection, try to use the KVM-assisted one first, and fall back to userspace handling of the hypercall if the kernel doesn't provide the requested feature. Signed-off-by: Roman Kagan --- hw/hyperv/hyperv.c | 27 ++- 1 file cha

Re: [Qemu-devel] [PATCH v3 17/22] virtio-pmem: prototype

2018-09-21 Thread Pankaj Gupta
> > On 21/09/2018 10:07, Markus Armbruster wrote: > > Quick review of just the QAPI part. > > > > David Hildenbrand writes: > > > >> From: Pankaj Gupta > >> > >> This is the current protoype of virtio-pmem. Support will require > >> machine changes for the architectures that will support it,

[Qemu-devel] [PATCH 09/10] hyperv: process POST_MESSAGE hypercall

2018-09-21 Thread Roman Kagan
Add handling of POST_MESSAGE hypercall. For that, add an interface to regsiter a handler for the messages arrived from the guest on a particular connection id (IOW set up a message connection in Hyper-V speak). Signed-off-by: Roman Kagan --- include/hw/hyperv/hyperv.h | 18 hw/hyperv/h

[Qemu-devel] [PATCH 07/10] hyperv: process SIGNAL_EVENT hypercall

2018-09-21 Thread Roman Kagan
Add handling of SIGNAL_EVENT hypercall. For that, provide an interface to associate an EventNotifier with an event connection number, so that it's signaled when the SIGNAL_EVENT hypercall with the matching connection ID is called by the guest. Support for using KVM functionality for this will be

Re: [Qemu-devel] [PATCH v3 17/22] virtio-pmem: prototype

2018-09-21 Thread David Hildenbrand
On 21/09/2018 10:07, Markus Armbruster wrote: > Quick review of just the QAPI part. > > David Hildenbrand writes: > >> From: Pankaj Gupta >> >> This is the current protoype of virtio-pmem. Support will require >> machine changes for the architectures that will support it, so it will >> not yet

[Qemu-devel] [PATCH 10/10] hyperv_testdev: add SynIC message and event testmodes

2018-09-21 Thread Roman Kagan
Add testmodes for SynIC messages and events. The message or event connection setup / teardown is initiated by the guest via new control codes written to the test device port. Then the test connections bounce the respective operations back to the guest, i.e. the incoming messages are posted or the

Re: [Qemu-devel] [PATCH v3 14/22] memory-device: trace when pre_assigning/assigning/unassigning addresses

2018-09-21 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:35PM +0200, David Hildenbrand wrote: > Let's trace the address when pre_pluggin/plugging/unplugging a memory device. > > Trace it when pre_plugging as well as when plugging, so we really know > when a specific address is actually used. > > Signed-off-by: David Hilden

Re: [Qemu-devel] [PATCH v3 12/22] memory-device: complete factoring out plug handling

2018-09-21 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:33PM +0200, David Hildenbrand wrote: > With the new memory device functions in place, we can factor out > plugging of memory devices completely. > > Signed-off-by: David Hildenbrand Reviewed-by: David Gibson > --- > hw/mem/memory-device.c | 10 +++---

Re: [Qemu-devel] [PATCH v3 11/22] memory-device: complete factoring out pre_plug handling

2018-09-21 Thread David Gibson
On Thu, Sep 20, 2018 at 12:32:32PM +0200, David Hildenbrand wrote: > With all required memory device class functions in place, we can factor > out pre_plug handling of memory devices. Take proper care of errors. We > still have to carry along legacy_align required for pc compatibility > handling. >

[Qemu-devel] [PATCH 2/2] monitor: delay monitor iothread creation

2018-09-21 Thread Wolfgang Bumiller
Commit d32749deb615 moved the call to monitor_init_globals() to before os_daemonize(), making it an unsuitable place to spawn the monitor iothread as it won't be inherited over the fork() in os_daemonize(). We now spawn the thread the first time we instantiate a monitor which actually has use_io_t

[Qemu-devel] [PATCH v2 4/5] display/edid: add DEFINE_EDID_PROPERTIES

2018-09-21 Thread Gerd Hoffmann
Add a define for edid monitor properties. Signed-off-by: Gerd Hoffmann --- include/hw/display/edid.h | 4 1 file changed, 4 insertions(+) diff --git a/include/hw/display/edid.h b/include/hw/display/edid.h index b7fe56a958..bd51d26916 100644 --- a/include/hw/display/edid.h +++ b/include/hw/

Re: [Qemu-devel] [PATCH v3 07/22] memory-device: add and use memory_device_get_region_size()

2018-09-21 Thread David Gibson
On Fri, Sep 21, 2018 at 09:15:09AM +0200, David Hildenbrand wrote: > > >> > >> -mr = ddc->get_memory_region(dimm, errp); > >> -if (!mr) { > >> +value = memory_device_get_region_size(MEMORY_DEVICE(obj), errp); > > > > Given the below, that should be &local_err above, no? > > Yes, ve

[Qemu-devel] [PATCH v2 1/5] display/edid: add edid generator to qemu.

2018-09-21 Thread Gerd Hoffmann
EDID is a metadata format to describe monitors. On physical hardware the monitor has an eeprom with that data block which can be read over i2c bus. On a linux system you can usually find the EDID data block in /sys/class/drm/$card/$connector/edid. xorg ships a edid-decode utility which you can u

[Qemu-devel] [PATCH v2 0/5] hw/display: add edid support to stdvga

2018-09-21 Thread Gerd Hoffmann
This series adds edid support to stdvga. The biggest chunk is the actual edid generator code (patch #1). Some helper functions follow, and the final patch implements edid support for stdvga. Gerd Hoffmann (5): display/edid: add edid generator to qemu. display/edid: add qemu_edid_size() dis

[Qemu-devel] [PATCH v2 5/5] display/stdvga: add edid support.

2018-09-21 Thread Gerd Hoffmann
This patch adds edid support to the qemu stdvga. It is turned off by default and can be enabled with the new edid property. The patch also adds xres and yres properties to specify the video mode you want the guest use. Works only with edid enabled and updated guest driver. The mmio bar of the s

[Qemu-devel] [Bug 1791947] Re: isochronous usb device forwarding with windows 10 and xhci freezes

2018-09-21 Thread Florian Kaiser
How to reproduce: 1. download windows 10 iso april 2018 from here: https://www.microsoft.com/en-us/software-download/windows10ISO?NavToggle=True 2. create a VM with virtmanager with q35 chipset and configure two usb redirect devices (3. modify xml to use an xhci controller) 4. Install windows 5.

Re: [Qemu-devel] [PATCH RFC v3 7/7] qemu_thread_create: propagate the error to callers to handle

2018-09-21 Thread Fei Li
On 09/21/2018 09:05 AM, Fam Zheng wrote: On Thu, 09/20 18:19, Fei Li wrote: On 09/19/2018 11:51 PM, Fam Zheng wrote: On Wed, 09/19 21:35, Fei Li wrote: Make qemu_thread_create() return a Boolean to indicate if it succeeds rather than failing with an error. And add an Error parameter to hol

Re: [Qemu-devel] [PATCH] dirty-bitmaps: allow merging to disabled bitmaps

2018-09-21 Thread Vladimir Sementsov-Ogievskiy
19.09.2018 22:58, John Snow wrote: We wish to prohibit merging to read-only bitmaps and frozen bitmaps, but "disabled" bitmaps only preclude their recording of live, new information. It does not prohibit them from manual writes at the behest of the user, as is the case for merge operations. Repo

Re: [Qemu-devel] [PATCH v5 5/6] qmp: add pmemload command

2018-09-21 Thread Simon Ruderich
On Tue, Aug 21, 2018 at 02:38:02PM +0200, Simon Ruderich wrote: > Hello, > > I've adapted the patch to error out if a char/block device is > used. I think that's the simplest fix for the issue mentioned by > Eric Blake. > > Are the any other issues remaining? All other patches are > unchanged, shou

Re: [Qemu-devel] [PATCH v4 3/3] x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES

2018-09-21 Thread Eduardo Habkost
On Fri, Sep 21, 2018 at 01:19:23PM +0800, Robert Hoo wrote: > On Thu, 2018-09-20 at 14:18 -0300, Eduardo Habkost wrote: > > On Thu, Sep 20, 2018 at 05:55:48PM +0800, Robert Hoo wrote: > > > On Thu, 2018-09-20 at 00:13 -0300, Eduardo Habkost wrote: > > > > On Sun, Sep 02, 2018 at 07:46:07PM +0800, R

Re: [Qemu-devel] [PATCH] Deprecate QMP `cpu-add`

2018-09-21 Thread Eduardo Habkost
On Fri, Sep 21, 2018 at 08:30:54AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Thu, Sep 20, 2018 at 02:27:02PM +0200, Markus Armbruster wrote: > >> Kashyap Chamarthy writes: > > [...] > >> > --- > >> > qapi/misc.json | 6 +- > >> > qemu-deprecated.texi | 5 +

[Qemu-devel] [PATCH 0/2] RFC: object: recommend a few type check macros

2018-09-21 Thread Marc-André Lureau
Hi, This is a readability suggestion. See the first patch for the doc change, and the second patch for an example of usage and readability improvement. thanks Marc-André Lureau (2): object: recommend a few type check macros nvdimm: use IS_NVDIMM macro include/hw/mem/nvdimm.h | 1 + includ

[Qemu-devel] [PATCH 1/2] object: recommend a few type check macros

2018-09-21 Thread Marc-André Lureau
I sometime regret that we have to resort to long object{_class}_dynamic_cast() calls instead of having a shorter and more readable macros available, similar to the one recommended by GObject (https://developer.gnome.org/gobject/stable/gtype-conventions.html). Signed-off-by: Marc-André Lureau ---

[Qemu-devel] [PATCH 2/2] nvdimm: use IS_NVDIMM macro

2018-09-21 Thread Marc-André Lureau
Put into use the macros proposed in the previous Object documentation change. Signed-off-by: Marc-André Lureau --- include/hw/mem/nvdimm.h | 1 + hw/acpi/ich9.c | 2 +- hw/acpi/nvdimm.c| 2 +- hw/acpi/piix4.c | 2 +- hw/i386/pc.c| 8 +++- hw/mem/pc-dimm.c

Re: [Qemu-devel] [PATCH 2/2] Acceptance tests: add make rule for running them

2018-09-21 Thread Eduardo Habkost
On Fri, Sep 21, 2018 at 08:36:22AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Thu, Sep 20, 2018 at 11:19:56AM -0400, Cleber Rosa wrote: > >> The acceptance (aka functional, aka Avocado-based) tests are > >> Python files located in "tests/acceptance" that need to be run > >

Re: [Qemu-devel] [PATCH v9 2/9] include: Add a lookup table of sizes

2018-09-21 Thread Alberto Garcia
On Tue 18 Sep 2018 05:29:16 PM CEST, Leonid Bloch wrote: > Adding a lookup table for the powers of two, with the appropriate size > prefixes. This is needed when a size has to be stringified, in which > case something like '(1 * KiB)' would become a literal '(1 * (1L << > 10))' string. Powers of tw

Re: [Qemu-devel] [PATCH v12 6/6] tpm: add ACPI memory clear interface

2018-09-21 Thread Marc-André Lureau
Hi On Mon, Sep 10, 2018 at 12:47 PM Marc-André Lureau wrote: > > This allows to pass the last failing test from the Windows HLK TPM 2.0 > TCG PPI 1.3 tests. > > The interface is described in the "TCG Platform Reset Attack > Mitigation Specification", chapter 6 "ACPI _DSM Function". According > to

Re: [Qemu-devel] [PATCH v3 17/22] virtio-pmem: prototype

2018-09-21 Thread Markus Armbruster
David Hildenbrand writes: > On 21/09/2018 10:07, Markus Armbruster wrote: >> Quick review of just the QAPI part. >> >> David Hildenbrand writes: >> >>> From: Pankaj Gupta >>> >>> This is the current protoype of virtio-pmem. Support will require >>> machine changes for the architectures that w

Re: [Qemu-devel] [PATCH v2 0/3] HMP/snapshot changes - do not use ID anymore

2018-09-21 Thread Dr. David Alan Gilbert
* Daniel Henrique Barboza (danielhb...@gmail.com) wrote: > changes in v2: > - removed the "RFC" marker; > - added a new patch (patch 2) that removes > bdrv_snapshot_delete_by_id_or_name from the code; > - made changes in patch 1 as suggested by Murilo; > - previous patch set link: > https://lists.g

Re: [Qemu-devel] [PATCH v3 17/22] virtio-pmem: prototype

2018-09-21 Thread David Hildenbrand
On 21/09/2018 14:28, Markus Armbruster wrote: > David Hildenbrand writes: > >> On 21/09/2018 10:07, Markus Armbruster wrote: >>> Quick review of just the QAPI part. >>> >>> David Hildenbrand writes: >>> From: Pankaj Gupta This is the current protoype of virtio-pmem. Support will

Re: [Qemu-devel] [PATCH v9 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-21 Thread Alberto Garcia
On Tue 18 Sep 2018 05:29:22 PM CEST, Leonid Bloch wrote: > /* New interval for cache cleanup timer */ > r->cache_clean_interval = > qemu_opt_get_number(opts, QCOW2_OPT_CACHE_CLEAN_INTERVAL, > -s->cache_clean_interval); > +DE

Re: [Qemu-devel] virtio-vhost-user with virtio-scsi: end-to-end setup

2018-09-21 Thread Wodkowski, PawelX
Hi Nikos, About SPKD backtrace you got. There is something wrong with IO channel allocation. SPKD vhost-scsi should check the result of spdk_scsi_dev_allocate_io_channels() in spdk_vhost_scsi_dev_add_tgt(). But this result is not checked :( You can add some check or assert there. Paweł > > B

[Qemu-devel] [Bug 1793635] [NEW] Using pflash with u-boot, when CONFIG_SYS_FLASH_USE_BUFFER_WRITE were defined, envirment args won't be able to save correctly

2018-09-21 Thread prosup
Public bug reported: Generated a u-boot image with qemu_arm_defconfig,did some modification to qemu-arm.h. Before added "CONFIG_SYS_FLASH_USE_BUFFER_WRITE",call saveenv in u-boot command line can save the envirment but painful slow. after added it,seems the action took no time,but the data won'

Re: [Qemu-devel] [PATCH v9 8/9] qcow2: Set the default cache-clean-interval to 10 minutes

2018-09-21 Thread Kevin Wolf
Am 21.09.2018 um 14:35 hat Alberto Garcia geschrieben: > On Tue 18 Sep 2018 05:29:22 PM CEST, Leonid Bloch wrote: > > /* New interval for cache cleanup timer */ > > r->cache_clean_interval = > > qemu_opt_get_number(opts, QCOW2_OPT_CACHE_CLEAN_INTERVAL, > > -

  1   2   >