[PATCH RFC v5 08/12] target/riscv: Handle KVM_EXIT_RISCV_SBI exit

2021-04-11 Thread Yifei Jiang
Use char-fe to handle console sbi call, which implement early console io while apply 'earlycon=sbi' into kernel parameters. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/kvm.c | 42 - target/riscv/sbi_ecall_interface.h | 72 +++

[PATCH RFC v5 11/12] target/riscv: Implement virtual time adjusting with vm state changing

2021-04-11 Thread Yifei Jiang
We hope that virtual time adjusts with vm state changing. When a vm is stopped, guest virtual time should stop counting and kvm_timer should be stopped. When the vm is resumed, guest virtual time should continue to count and kvm_timer should be restored. Signed-off-by: Yifei Jiang Signed-off-by:

[PATCH RFC v5 00/12] Add riscv kvm accel support

2021-04-11 Thread Yifei Jiang
This series adds both riscv32 and riscv64 kvm support, and implements migration based on riscv. It is based on temporarily unaccepted kvm: https://github.com/kvm-riscv/linux (lastest version v17). This series depends on above pending changes which haven't yet been accepted, so this QEMU patch seri

[PATCH RFC v5 04/12] target/riscv: Implement kvm_arch_get_registers

2021-04-11 Thread Yifei Jiang
Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/kvm.c | 150 - 1 file changed, 149 insertions(+), 1 deletion(-) diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c

[PATCH RFC v5 07/12] hw/riscv: PLIC update external interrupt by KVM when kvm enabled

2021-04-11 Thread Yifei Jiang
Only support supervisor external interrupt currently. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- hw/intc/sifive_plic.c| 29 - target/riscv/kvm-stub.c | 5 + target/riscv/kvm.c | 20 target/riscv/kvm_riscv.h | 1 + 4

[PATCH RFC v5 05/12] target/riscv: Implement kvm_arch_put_registers

2021-04-11 Thread Yifei Jiang
Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/kvm.c | 142 - 1 file changed, 141 insertions(+), 1 deletion(-) diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c in

[PATCH RFC v5 06/12] target/riscv: Support start kernel directly by KVM

2021-04-11 Thread Yifei Jiang
Get kernel and fdt start address in virt.c, and pass them to KVM when cpu reset. In addition, add kvm_riscv.h to place riscv specific interface. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- hw/riscv/boot.c | 11 +++ hw/riscv/virt.c | 7 +++ include/hw/

[PATCH RFC v5 09/12] target/riscv: Add host cpu type

2021-04-11 Thread Yifei Jiang
'host' type cpu is set isa to RVXLEN simply, more isa info will obtain from KVM in kvm_arch_init_vcpu() Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/cpu.c | 9 + target/riscv/cpu.h | 1 + 2 files changed, 10 insertions(+) diff --git a/target/riscv/cpu.c b/targe

[PATCH RFC v5 01/12] linux-header: Update linux/kvm.h

2021-04-11 Thread Yifei Jiang
Update linux-headers/linux/kvm.h from https://github.com/avpatel/linux/tree/riscv_kvm_v17. Only use this header file, so here do not update all linux headers by update-linux-headers.sh until above KVM series is accepted. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- linux-headers/lin

[PATCH RFC v5 02/12] target/riscv: Add target/riscv/kvm.c to place the public kvm interface

2021-04-11 Thread Yifei Jiang
Add target/riscv/kvm.c to place kvm_arch_* function needed by kvm/kvm-all.c. Meanwhile, add kvm support in meson.build file. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin Reviewed-by: Alistair Francis --- meson.build | 2 + target/riscv/kvm.c | 133 +

[PATCH RFC v5 03/12] target/riscv: Implement function kvm_arch_init_vcpu

2021-04-11 Thread Yifei Jiang
Get isa info from kvm while kvm init. Signed-off-by: Yifei Jiang Signed-off-by: Yipeng Yin --- target/riscv/kvm.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/target/riscv/kvm.c b/target/riscv/kvm.c index 687dd4b621..0d924be33f 100644 --- a/tar

Re: [RFC PATCH 0/4] target/ppc: add disable-tcg option

2021-04-11 Thread David Gibson
For future reference, please CC me explicitly on things you'd like me to review. I do scan the qemu-...@nongnu.org list, but it makes it easier for me to find (and less likely that I'll accidentally overlook it) if I'm also CCed directly. On Fri, Apr 09, 2021 at 12:19:12PM -0300, Bruno Larsen (bi

Re: [PATCH 2/4] target/ppc: added solutions for building with disable-tcg

2021-04-11 Thread David Gibson
On Fri, Apr 09, 2021 at 12:19:14PM -0300, Bruno Larsen (billionai) wrote: > this commit presents 2 possible solutions for substituting TCG emulation > with KVM calls. One - used in machine.c and arch_dump.c - explicitly > adds the KVM function and has the possibility of adding the TCG one > for mor

Re: [RFC PATCH 0/4] target/ppc: add disable-tcg option

2021-04-11 Thread David Gibson
On Fri, Apr 09, 2021 at 08:57:48AM -0700, no-re...@patchew.org wrote: > Patchew URL: > https://patchew.org/QEMU/20210409151916.97326-1-bruno.lar...@eldorado.org.br/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Type: series

Re: [PATCH 1/4] target/ppc: Code motion required to build disabling tcg

2021-04-11 Thread David Gibson
On Fri, Apr 09, 2021 at 04:48:41PM -0300, Fabiano Rosas wrote: > "Bruno Larsen (billionai)" writes: > > A general advice for this whole series is: make sure you add in some > words explaining why you decided to make a particular change. It will be > much easier to review if we know what were the

[PATCH v3 09/11] Acceptance Tests: add basic documentation on LinuxTest base class

2021-04-11 Thread Cleber Rosa
Signed-off-by: Cleber Rosa Reviewed-by: Marc-André Lureau Reviewed-by: Willian Rampazzo Reviewed-by: Eric Auger Reviewed-by: Wainer dos Santos Moschetta --- docs/devel/testing.rst | 26 ++ 1 file changed, 26 insertions(+) diff --git a/docs/devel/testing.rst b/docs/dev

Re: Better alternative to strncpy in QEMU.

2021-04-11 Thread Thomas Huth
On 11/04/2021 15.50, Chetan wrote: Hello All, This mail is in reference to one of the tasks mentioned in '/Contribute/BiteSizedTasks/' in QEMU wiki, under '/API conversion/' which states to introduce a better alternative to strncpy function. Looks like this task has been added by Paolo, so I

[PATCH v3 07/11] Acceptance Tests: set up SSH connection by default after boot for LinuxTest

2021-04-11 Thread Cleber Rosa
The LinuxTest specifically targets users that need to interact with Linux guests. So, it makes sense to give a connection by default, and avoid requiring it as boiler-plate code. Signed-off-by: Cleber Rosa Reviewed-by: Marc-André Lureau Reviewed-by: Willian Rampazzo --- tests/acceptance/avoca

[PATCH v3 04/11] Acceptance Tests: move useful ssh methods to base class

2021-04-11 Thread Cleber Rosa
Both the virtiofs submounts and the linux ssh mips malta tests contains useful methods related to ssh that deserve to be made available to other tests. Let's move them to an auxiliary, mix-in class that will be used on the base LinuxTest class. The method that helps with setting up an ssh connect

[PATCH v3 11/11] tests/acceptance/virtiofs_submounts.py: fix setup of SSH pubkey

2021-04-11 Thread Cleber Rosa
The public key argument should be a path to a file, and not the public key data. Reported-by: Wainer dos Santos Moschetta Signed-off-by: Cleber Rosa --- tests/acceptance/virtiofs_submounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/virtiofs_submounts

[PATCH v3 10/11] Acceptance Tests: introduce CPU hotplug test

2021-04-11 Thread Cleber Rosa
Even though there are qtest based tests for hotplugging CPUs (from which this test took some inspiration from), this one adds checks from a Linux guest point of view. It should also serve as an example for tests that follow a similar pattern and need to interact with QEMU (via qmp) and with the Li

[PATCH v3 06/11] Acceptance Tests: make username/password configurable

2021-04-11 Thread Cleber Rosa
This makes the username/password used for authentication configurable, because some guest operating systems may have restrictions on accounts to be used for logins, and it just makes it better documented. Signed-off-by: Cleber Rosa Reviewed-by: Marc-André Lureau Reviewed-by: Eric Auger Reviewed

[PATCH v3 02/11] tests/acceptance/virtiofs_submounts.py: evaluate string not length

2021-04-11 Thread Cleber Rosa
If the vmlinuz variable is set to anything that evaluates to True, then the respective arguments should be set. If the variable contains an empty string, than it will evaluate to False, and the extra arguments will not be set. This keeps the same logic, but improves readability a bit. Signed-off

[PATCH v3 08/11] tests/acceptance/virtiofs_submounts.py: remove launch_vm()

2021-04-11 Thread Cleber Rosa
The LinuxTest class' launch_and_wait() method now behaves the same way as this test's custom launch_vm(), so let's just use the upper layer (common) method. Signed-off-by: Cleber Rosa Reviewed-by: Marc-André Lureau Reviewed-by: Eric Auger Reviewed-by: Willian Rampazzo --- tests/acceptance/vir

[PATCH v3 05/11] Acceptance Tests: add port redirection for ssh by default

2021-04-11 Thread Cleber Rosa
For users of the LinuxTest class, let's set up the VM with the port redirection for SSH, instead of requiring each test to set the same arguments. It also sets the network device, by default, to virtio-net. Signed-off-by: Cleber Rosa Reviewed-by: Marc-André Lureau Reviewed-by: Eric Auger Revie

[PATCH v3 03/11] Python: add utility function for retrieving port redirection

2021-04-11 Thread Cleber Rosa
Slightly different versions for the same utility code are currently present on different locations. This unifies them all, giving preference to the version from virtiofs_submounts.py, because of the last tweaks added to it. While at it, this adds a "qemu.utils" module to host the utility function

[PATCH v3 00/11] Acceptance Test: introduce base class for Linux based tests

2021-04-11 Thread Cleber Rosa
This introduces a base class for tests that need to interact with a Linux guest. It generalizes the "boot_linux.py" code, already been used by the "virtiofs_submounts.py" and also SSH related code being used by that and "linux_ssh_mips_malta.py". While at it, a number of fixes on hopeful improvem

[PATCH v3 01/11] tests/acceptance/virtiofs_submounts.py: add missing accel tag

2021-04-11 Thread Cleber Rosa
The tag is useful to select tests that depend/use a particular feature. Signed-off-by: Cleber Rosa Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Willian Rampazzo Reviewed-by: Eric Auger --- tests/acceptance/virtiofs_submounts.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test

Re: [PATCH v2 00/10] Acceptance Test: introduce base class for Linux based tests

2021-04-11 Thread Cleber Rosa
On Thu, Mar 25, 2021 at 04:45:51PM -0300, Wainer dos Santos Moschetta wrote: > Hi, > > On 3/23/21 7:15 PM, Cleber Rosa wrote: > > This introduces a base class for tests that need to interact with a > > Linux guest. It generalizes the "boot_linux.py" code, already been > > used by the "virtiofs_su

Re: [PATCH v2 09/10] Acceptance Tests: add basic documentation on LinuxTest base class

2021-04-11 Thread Cleber Rosa
On Thu, Mar 25, 2021 at 03:14:58PM -0300, Wainer dos Santos Moschetta wrote: > Hi, > > On 3/23/21 7:15 PM, Cleber Rosa wrote: > > Signed-off-by: Cleber Rosa > > Reviewed-by: Marc-André Lureau > > Reviewed-by: Willian Rampazzo > > --- > > docs/devel/testing.rst | 25 + >

Re: [PATCH v2 05/10] Acceptance Tests: add port redirection for ssh by default

2021-04-11 Thread Cleber Rosa
On Thu, Mar 25, 2021 at 02:57:48PM -0300, Wainer dos Santos Moschetta wrote: > Hi, > > On 3/24/21 6:10 AM, Auger Eric wrote: > > Hi Cleber, > > > > On 3/23/21 11:15 PM, Cleber Rosa wrote: > > > For users of the LinuxTest class, let's set up the VM with the port > > > redirection for SSH, instead

Re: [PATCH v2 04/10] Acceptance Tests: move useful ssh methods to base class

2021-04-11 Thread Cleber Rosa
On Wed, Mar 24, 2021 at 10:07:31AM +0100, Auger Eric wrote: > Hi Cleber, > > On 3/23/21 11:15 PM, Cleber Rosa wrote: > > Both the virtiofs submounts and the linux ssh mips malta tests > > contains useful methods related to ssh that deserve to be made > > available to other tests. Let's move them

Re: [PATCH 2/2] target/arm: Initlaize PMU feature for scratch vcpu

2021-04-11 Thread Gavin Shan
Hi Peter, On 4/7/21 5:38 PM, Peter Maydell wrote: On Wed, 7 Apr 2021 at 03:01, Gavin Shan wrote: If the scratch vCPU is initialized without PMU feature, we receive error on reading PMCR_EL0 as it's invisible in this case. It leads to host probing failure. This fixes the issue by initializing

Re: [PATCH v2 03/10] Python: add utility function for retrieving port redirection

2021-04-11 Thread Cleber Rosa
On Thu, Mar 25, 2021 at 02:10:19PM -0400, John Snow wrote: > On 3/23/21 6:15 PM, Cleber Rosa wrote: > > Slightly different versions for the same utility code are currently > > present on different locations. This unifies them all, giving > > preference to the version from virtiofs_submounts.py, be

Re: [PATCH v1 5/8] target/riscv: Implementation of enhanced PMP (ePMP)

2021-04-11 Thread Alistair Francis
On Fri, Apr 9, 2021 at 2:24 PM Bin Meng wrote: > > On Fri, Apr 2, 2021 at 8:50 PM Alistair Francis > wrote: > > > > From: Hou Weiying > > > > This commit adds support for ePMP v0.9.1. > > > > The ePMP spec can be found in: > > https://docs.google.com/document/d/1Mh_aiHYxemL0umN3GTTw8vsbmzHZ_nxZX

Re: [PATCH 1/1] Set TARGET_PAGE_BITS to be 10 instead of 8 bits

2021-04-11 Thread Richard Henderson
On 4/10/21 10:24 AM, Michael Rolnik wrote: Please review. The first 256b is i/o, the next 768b are ram. But having changed the page size, it should mean that the first 1k are now treated as i/o. We do have a path by which instructions in i/o pages can be executed. This happens on some AR

Better alternative to strncpy in QEMU.

2021-04-11 Thread Chetan
Hello All, This mail is in reference to one of the tasks mentioned in ' *Contribute/BiteSizedTasks*' in QEMU wiki, under '*API conversion*' which states to introduce a better alternative to strncpy function. I've drafted and tested below implementation for the same. Before proceeding with any chan

[RFC v9 28/29] pci: Add return_page_response pci ops

2021-04-11 Thread Eric Auger
Add a new PCI operation that allows to return page responses to registered VFIO devices Signed-off-by: Eric Auger --- include/hw/iommu/iommu.h | 8 include/hw/pci/pci.h | 4 hw/pci/pci.c | 16 3 files changed, 28 insertions(+) diff --git a/includ

[RFC v9 25/29] hw/arm/smmuv3: Pass stage 1 configurations to the host

2021-04-11 Thread Eric Auger
In case PASID PciOps are set for the device we call the set_pasid_table() callback on each STE update. This allows to pass the guest stage 1 configuration to the host and apply it at physical level. Signed-off-by: Eric Auger --- v4 -> v5: - Use PciOps instead of config notifiers v3 -> v4: - f

[RFC v9 24/29] hw/arm/smmuv3: Fill the IOTLBEntry leaf field on NH_VA invalidation

2021-04-11 Thread Eric Auger
Let's propagate the leaf attribute throughout the invalidation path. This hint is used to reduce the scope of the invalidations to the last level of translation. Not enforcing it induces large performance penalties in nested mode. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 9 + 1 fi

[RFC v9 29/29] vfio/pci: Implement return_page_response page response callback

2021-04-11 Thread Eric Auger
This patch implements the page response path. The response is written into the page response ring buffer and then update header's head index is updated. This path is not used by this series. It is introduced here as a POC for vSVA/ARM integration. Signed-off-by: Eric Auger --- v11 -> v12: - use

[RFC v9 21/29] hw/arm/smmuv3: Advertise MSI_TRANSLATE attribute

2021-04-11 Thread Eric Auger
The SMMUv3 has the peculiarity to translate MSI transactionss. let's advertise the corresponding attribute. Signed-off-by: Eric Auger --- --- hw/arm/smmuv3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 7166008ab0..1ee81a25e9 100644 --- a/hw/arm

[RFC v9 26/29] hw/arm/smmuv3: Implement fault injection

2021-04-11 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 --- v3 -> v4: - fix compil issue on mingw Exhaustive mapping remains to be done --- hw/arm/smmuv3.c | 71 +++

[RFC v9 27/29] hw/arm/smmuv3: Allow MAP notifiers

2021-04-11 Thread Eric Auger
We now have all bricks to support nested paging. This uses MAP notifiers to map the MSIs. So let's allow MAP notifiers to be registered. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 53b71c895c..ca

[RFC v9 19/29] vfio/pci: Set up the DMA FAULT region

2021-04-11 Thread Eric Auger
Set up the fault region which is composed of the actual fault queue (mmappable) and a header used to handle it. The fault queue is mmapped. Signed-off-by: Eric Auger --- v4 -> v5: - use a single DMA FAULT region. No version selection anymore --- hw/vfio/pci.h | 1 + hw/vfio/pci.c | 64 +++

[RFC v9 17/29] vfio: Helper to get IRQ info including capabilities

2021-04-11 Thread Eric Auger
As done for vfio regions, add helpers to retrieve irq info including their optional capabilities. Signed-off-by: Eric Auger --- include/hw/vfio/vfio-common.h | 7 +++ hw/vfio/common.c | 97 +++ hw/vfio/trace-events | 1 + 3 files changed, 1

[RFC v9 23/29] hw/arm/smmuv3: Fill the IOTLBEntry arch_id on NH_VA invalidation

2021-04-11 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 and accordingly set the flags to indicate its presence. Signed-off-by: Eric Auger

[RFC v9 16/29] vfio: Pass stage 1 MSI bindings to the host

2021-04-11 Thread Eric Auger
We register the stage1 MSI bindings when enabling the vectors and we unregister them on msi disable. Signed-off-by: Eric Auger --- v7 -> v8: - add unregistration on msix_diable - remove vfio_container_unbind_msis() v4 -> v5: - use VFIO_IOMMU_SET_MSI_BINDING v2 -> v3: - only register the notif

[RFC v9 12/29] vfio: Force nested if iommu requires it

2021-04-11 Thread Eric Auger
In case we detect the address space is translated by a virtual IOMMU which requires HW nested paging to integrate with VFIO, let's set up the container with the VFIO_TYPE1_NESTING_IOMMU iommu_type. Signed-off-by: Eric Auger --- v7 -> v8 - remove as != &address_space_memory as memory_region_is

[RFC v9 15/29] vfio: Set up nested stage mappings

2021-04-11 Thread Eric Auger
In nested mode, legacy vfio_iommu_map_notify cannot be used as there is no "caching" mode and we do not trap on map. On Intel, vfio_iommu_map_notify was used to DMA map the RAM through the host single stage. With nested mode, we need to setup the stage 2 and the stage 1 separately. This patch int

[RFC v9 22/29] hw/arm/smmuv3: Store the PASID table GPA in the translation config

2021-04-11 Thread Eric Auger
For VFIO integration we will need to pass the Context Descriptor (CD) table GPA to the host. The CD table is also referred to as the PASID table. Its GPA corresponds to the s1ctrptr field of the Stream Table Entry. So let's decode and store it in the configuration structure. Signed-off-by: Eric Au

[RFC v9 14/29] vfio: Introduce helpers to DMA map/unmap a RAM section

2021-04-11 Thread Eric Auger
Let's introduce two helpers that allow to DMA map/unmap a RAM section. Those helpers will be called for nested stage setup in another call site. Also the vfio_listener_region_add/del() structure may be clearer. Signed-off-by: Eric Auger --- v8 -> v9 - rebase on top of 1eb7f642750c ("vfio: Sup

[RFC v9 13/29] vfio: Introduce hostwin_from_range helper

2021-04-11 Thread Eric Auger
Let's introduce a hostwin_from_range() helper that returns the hostwin encapsulating an IOVA range or NULL if none is found. This improves the readibility of callers and removes the usage of hostwin_found. Signed-off-by: Eric Auger --- hw/vfio/common.c | 36 +---

[RFC v9 08/29] memory: Add IOMMU_ATTR_MSI_TRANSLATE IOMMU memory region attribute

2021-04-11 Thread Eric Auger
We introduce a new IOMMU Memory Region attribute, IOMMU_ATTR_MSI_TRANSLATE which tells whether the virtual IOMMU translates MSIs. ARM SMMU will expose this attribute since, as opposed to Intel DMAR, MSIs are translated as any other DMA requests. Signed-off-by: Eric Auger --- include/exec/memory.

[RFC v9 20/29] vfio/pci: Implement the DMA fault handler

2021-04-11 Thread Eric Auger
Whenever the eventfd is triggered, we retrieve the DMA fault(s) from the mmapped fault region and inject them in the iommu memory region. Signed-off-by: Eric Auger --- hw/vfio/pci.h | 1 + hw/vfio/pci.c | 50 ++ 2 files changed, 51 insertions(+)

[RFC v9 10/29] iommu: Introduce generic header

2021-04-11 Thread Eric Auger
This header is meant to exposes data types used by several IOMMU devices such as struct for SVA and nested stage configuration. Signed-off-by: Eric Auger --- include/hw/iommu/iommu.h | 28 1 file changed, 28 insertions(+) create mode 100644 include/hw/iommu/iommu.h

[RFC v9 07/29] memory: Add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute

2021-04-11 Thread Eric Auger
We introduce a new IOMMU Memory Region attribute, IOMMU_ATTR_VFIO_NESTED that tells whether the virtual IOMMU requires HW nested paging for VFIO integration. Current Intel virtual IOMMU device supports "Caching Mode" and does not require 2 stages at physical level to be integrated with VFIO. Howev

[RFC v9 18/29] vfio/pci: Register handler for iommu fault

2021-04-11 Thread Eric Auger
We use the new extended IRQ VFIO_IRQ_TYPE_NESTED type and VFIO_IRQ_SUBTYPE_DMA_FAULT subtype to set/unset a notifier for physical DMA faults. The associated eventfd is triggered, in nested mode, whenever a fault is detected at IOMMU physical level. The actual handler will be implemented in subsequ

[RFC v9 05/29] hw/arm/smmuv3: Improve stage1 ASID invalidation

2021-04-11 Thread Eric Auger
At the moment ASID invalidation command (CMD_TLBI_NH_ASID) is propagated as a domain invalidation (the whole notifier range is invalidated independently on any ASID information). The new granularity field now allows to be more precise and restrict the invalidation to a peculiar ASID. Set the corre

[RFC v9 09/29] memory: Introduce IOMMU Memory Region inject_faults API

2021-04-11 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 | 24 softmmu/memory.c | 10 ++ 2 files changed, 34 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h

[RFC v9 11/29] pci: introduce PCIPASIDOps to PCIDevice

2021-04-11 Thread Eric Auger
From: Liu Yi L This patch introduces PCIPASIDOps for IOMMU related operations. https://lists.gnu.org/archive/html/qemu-devel/2018-03/msg00078.html https://lists.gnu.org/archive/html/qemu-devel/2018-03/msg00940.html So far, to setup virt-SVA for assigned SVA capable device, needs to configure ho

[RFC v9 06/29] hw/arm/smmu-common: Allow domain invalidation for NH_ALL/NSNH_ALL

2021-04-11 Thread Eric Auger
NH_ALL/NSNH_ALL corresponds to a domain granularity invalidation, ie. all the notifier range gets invalidation, whatever the ASID. So let's set the granularity to IOMMU_INV_GRAN_DOMAIN to allow the consumer to benefit from the info if it can. Signed-off-by: Eric Auger Suggested-by: chenxiang (M)

[RFC v9 03/29] header update against 5.12-rc6 and IOMMU/VFIO nested stage APIs

2021-04-11 Thread Eric Auger
Signed-off-by: Eric Auger --- include/standard-headers/drm/drm_fourcc.h | 23 ++- include/standard-headers/linux/ethtool.h | 54 +++--- include/standard-headers/linux/fuse.h | 3 +- include/standard-headers/linux/input.h| 2 +- .../standard-headers/rdma/vmw_pvrdma-a

[RFC v9 04/29] memory: Add new fields in IOTLBEntry

2021-04-11 Thread Eric Auger
The current IOTLBEntry becomes too simple to interact with some physical IOMMUs. IOTLBs can be invalidated with different granularities: domain, pasid, addr. Current IOTLB entry only offers page selective invalidation. Let's add a granularity field that conveys this information. TLB entries are us

[RFC v9 00/29] vSMMUv3/pSMMUv3 2 stage VFIO integration

2021-04-11 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

[RFC v9 02/29] update-linux-headers: Import iommu.h

2021-04-11 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 1050e36169..b1abafac3c 100755 --- a/s

[RFC v9 01/29] hw/vfio/common: trace vfio_connect_container operations

2021-04-11 Thread Eric Auger
We currently trace vfio_disconnect_container() but we do not trace the container <-> group creation, which can be useful to understand the VFIO topology. Signed-off-by: Eric Auger --- hw/vfio/common.c | 3 +++ hw/vfio/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hw/vfi

Re: [PULL 0/2] x86 and CPU bug fixes for 6.0-rc3

2021-04-11 Thread Peter Maydell
On Fri, 9 Apr 2021 at 21:22, Eduardo Habkost wrote: > > The following changes since commit 471387aa1446e2583f372f79327cc0a8c802b4b4: > > Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210409' > into staging (2021-04-09 17:21:18 +0100) > > are available in the Git repository at

Re: [Question] Binaries of virtio-gpu-wddm-dod?

2021-04-11 Thread Vadim Rozenfeld
On Fri, 2021-04-09 at 09:27 -0400, Mike Ladouceur wrote: > Hi, I'm wondering where I can find binaries of virtio-gpu-wddm-dod to > test? I tried to build but I guess I'm running too new a version of > Windows or VS/SDK/WDK? I've seen mention of prewhql ISO's with > binaries but there's never any li