Re: QEMU SMMUv3 stage 2 translation

2021-05-20 Thread Auger Eric
Hi Shashi, [ fixing my email address ] On 5/13/21 4:25 PM, Shashi Mallela wrote: > Hi, > > Since the current SMMUv3 qemu implementation only supports stage 1 > translation,wanted to understand if the implementation could be extended > to stage 2 translation support and if yes what is the overall

Re: [PATCH] hw/arm/smmuv3: Another range invalidation fix

2021-05-10 Thread Auger Eric
Hi Peter, On 5/10/21 1:31 PM, Peter Maydell wrote: > On Wed, 21 Apr 2021 at 18:29, Eric Auger wrote: >> >> 6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") >> failed to completely fix misalignment issues with range >> invalidation. For instance invalidations patterns lik

Re: [PATCH] virtio-gpu: handle partial maps properly

2021-05-06 Thread Auger Eric
too, we have to explicitly pass around > the iov length now. > > Reported-by: Auger Eric > Signed-off-by: Gerd Hoffmann > --- > include/hw/virtio/virtio-gpu.h | 3 +- > hw/display/virtio-gpu-3d.c | 7 ++-- > hw/display/virtio-gpu.c| 75 +++

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

2021-04-29 Thread Auger Eric
Hi Kunkun, On 4/28/21 11:51 AM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/4/27 3:16, Auger Eric wrote: >> Hi Kunkun, >> >> On 4/15/21 4:03 AM, Kunkun Jiang wrote: >>> Hi Eric, >>> >>> On 2021/4/14 16:05, Auger Eric wrote: >>&g

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

2021-04-26 Thread Auger Eric
Hi Kunkun, On 4/15/21 4:03 AM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/4/14 16:05, Auger Eric wrote: >> Hi Kunkun, >> >> On 4/14/21 3:45 AM, Kunkun Jiang wrote: >>> On 2021/4/13 20:57, Auger Eric wrote: >>>> Hi Kunkun, >>>>

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

2021-04-26 Thread Auger Eric
Hi Kunkun, On 4/14/21 3:45 AM, Kunkun Jiang wrote: > On 2021/4/13 20:57, Auger Eric wrote: >> Hi Kunkun, >> >> On 4/13/21 2:10 PM, Kunkun Jiang wrote: >>> Hi Eric, >>> >>> On 2021/4/11 20:08, Eric Auger wrote: >>>> In nested mode, leg

Re: [PATCH 2/3] Acceptance Tests: move definition of distro checksums to the framework

2021-04-22 Thread Auger Eric
Hi Cleber, On 4/15/21 12:14 AM, Cleber Rosa wrote: > Instead of having, by default, the checksum in the tests, and the > definition of tests in the framework, let's keep them together. > > A central definition for distributions is available, and it should > allow other known distros to be added m

Re: [PATCH 1/3] Acceptance Tests: rename attribute holding the distro image checksum

2021-04-19 Thread Auger Eric
Hi Cleber, On 4/15/21 12:14 AM, Cleber Rosa wrote: > This renames the attribute that holds the checksum for the image Linux > distribution image used. > > The current name of the attribute is not very descriptive. Also, in > preparation for making the distribution used configurable, which will u

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

2021-04-19 Thread Auger Eric
Hi Cleber, On 4/12/21 6:46 AM, Cleber Rosa wrote: > 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(

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

2021-04-19 Thread Auger Eric
Hi Cleber, On 4/12/21 6:46 AM, Cleber Rosa wrote: > 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é Lur

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

2021-04-14 Thread Auger Eric
Hi Kunkun, On 4/14/21 3:45 AM, Kunkun Jiang wrote: > On 2021/4/13 20:57, Auger Eric wrote: >> Hi Kunkun, >> >> On 4/13/21 2:10 PM, Kunkun Jiang wrote: >>> Hi Eric, >>> >>> On 2021/4/11 20:08, Eric Auger wrote: >>>> In nested mode, leg

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

2021-04-13 Thread Auger Eric
Hi Kunkun, On 4/13/21 2:10 PM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/4/11 20:08, Eric Auger wrote: >> 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 >> t

Re: [PATCH RFC RESEND v2 4/6] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-04-13 Thread Auger Eric
Hi Xingang, On 3/25/21 8:22 AM, Wang Xingang wrote: > From: Xingang Wang > > The idmap of smmuv3 and root complex covers the whole RID space for now, > this patch add explicit idmap info according to root bus number range. > This add smmuv3 idmap for certain bus which has enabled the iommu prope

Re: [PATCH RFC RESEND v2 3/6] hw/pci: Add pci_root_bus_max_bus

2021-04-13 Thread Auger Eric
Hi Xingang, On 3/25/21 8:22 AM, Wang Xingang wrote: > From: Xingang Wang > > This helps to find max bus number of a root bus. s/max bus number of a root bus/highest bus number of a bridge hierarchy? > > Signed-off-by: Xingang Wang > Signed-off-by: Jiahui Cen > --- > hw/pci/pci.c | 34

Re: [PATCH RFC RESEND v2 2/6] hw/pci: Add iommu option for pci root bus

2021-04-12 Thread Auger Eric
Hi Wang, On 3/25/21 8:22 AM, Wang Xingang wrote: > From: Xingang Wang > > This add iommu option for pci root bus, including primary bus > and pxb root bus. The option is valid only if there is a virtual > iommu device. > > Signed-off-by: Xingang Wang > Signed-off-by: Jiahui Cen same in this

Re: [PATCH RFC RESEND v2 1/6] hw/pci/pci_host: Add iommu property for pci host

2021-04-12 Thread Auger Eric
Hi Wang, On 3/25/21 8:22 AM, Wang Xingang wrote: > From: Xingang Wang > > The pci host iommu property is useful to check whether > the iommu is enabled on the pci root bus. > > Signed-off-by: Xingang Wang > Signed-off-by: Jiahui Cen > --- > hw/pci/pci.c | 18 +- >

Re: [RFC PATCH 0/3] Add migration support for VFIO PCI devices in SMMUv3 nested stage mode

2021-04-12 Thread Auger Eric
Hi Kunkun, On 2/19/21 10:42 AM, Kunkun Jiang wrote: > Hi all, > > Since the SMMUv3's nested translation stages[1] has been introduced by Eric, > we > need to pay attention to the migration of VFIO PCI devices in SMMUv3 nested > stage > mode. At present, it is not yet supported in QEMU. There ar

Re: [RFC PATCH 3/3] hw/arm/smmuv3: Post-load stage 1 configurations to the host

2021-04-12 Thread Auger Eric
Hi Kunkun, On 2/19/21 10:42 AM, Kunkun Jiang wrote: > In nested mode, we call the set_pasid_table() callback on each STE > update to pass the guest stage 1 configuration to the host and > apply it at physical level. > > In the case of live migration, we need to manual call the s/manual/manually >

Re: [RFC PATCH 2/3] vfio: Add vfio_prereg_listener_log_sync in nested stage

2021-04-08 Thread Auger Eric
Hi Kunkun, On 2/19/21 10:42 AM, Kunkun Jiang wrote: > On Intel, the DMA mapped through the host single stage. Instead > we set up the stage 2 and stage 1 separately in nested mode as there > is no "Caching Mode". You need to rewrite the above sentences, Missing ARM and also the 1st sentences miss

Re: [RFC PATCH 1/3] vfio: Introduce helpers to mark dirty pages of a RAM section

2021-04-08 Thread Auger Eric
Hi Kunkun, On 2/19/21 10:42 AM, Kunkun Jiang wrote: > Extract part of the code from vfio_sync_dirty_bitmap to form a > new helper, which allows to mark dirty pages of a RAM section. > This helper will be called for nested stage. > > Signed-off-by: Kunkun Jiang > --- > hw/vfio/common.c | 22

Re: A question about the translation granule size supported by the vSMMU

2021-04-08 Thread Auger Eric
Hi Kunkun, On 4/7/21 11:26 AM, Kunkun Jiang wrote: > Hi Eric, > > On 2021/4/7 3:50, Auger Eric wrote: >> Hi Kunkun, >> >> On 3/27/21 3:24 AM, Kunkun Jiang wrote: >>> Hi all, >>> >>> Recently, I did some tests on SMMU nested mode. Her

Re: [PATCH] hw/arm/smmuv3: Support 16K translation granule

2021-04-07 Thread Auger Eric
Hi Kunkun, On 3/31/21 8:47 AM, Kunkun Jiang wrote: > The driver can query some bits in SMMUv3 IDR5 to learn which > translation granules are supported. Arm recommends that SMMUv3 > implementations support at least 4K and 64K granules. But in > the vSMMUv3, there seems to be no reason not to suppor

Re: A question about the translation granule size supported by the vSMMU

2021-04-06 Thread Auger Eric
Hi Kunkun, On 3/27/21 3:24 AM, Kunkun Jiang wrote: > Hi all, > > Recently, I did some tests on SMMU nested mode. Here is > a question about the translation granule size supported by > vSMMU. > > There is such a code in SMMUv3_init_regs(): > >>    /* 4K and 64K granule support */ >>     s->idr[5

Re: [PATCH] hw/arm/virt-acpi-build: Fix GSIV values of the {GERR, Sync} interrupts

2021-04-06 Thread Auger Eric
Hi Peter, On 4/6/21 2:31 PM, Peter Maydell wrote: > On Tue, 6 Apr 2021 at 13:23, Auger Eric wrote: >> >> Hi Peter, >> >> On 4/6/21 12:44 PM, Peter Maydell wrote: >>> On Tue, 6 Apr 2021 at 11:10, Auger Eric wrote: >>>> >>>> Hi Zenghu

Re: [PATCH] hw/arm/virt-acpi-build: Fix GSIV values of the {GERR, Sync} interrupts

2021-04-06 Thread Auger Eric
Hi Peter, On 4/6/21 12:44 PM, Peter Maydell wrote: > On Tue, 6 Apr 2021 at 11:10, Auger Eric wrote: >> >> Hi Zenghui, >> >> On 4/2/21 10:47 AM, Zenghui Yu wrote: >>> The GSIV values in SMMUv3 IORT node are not correct as they don't match >>> the

Re: [PATCH] hw/arm/virt-acpi-build: Fix GSIV values of the {GERR, Sync} interrupts

2021-04-06 Thread Auger Eric
Hi Zenghui, On 4/2/21 10:47 AM, Zenghui Yu wrote: > The GSIV values in SMMUv3 IORT node are not correct as they don't match > the SMMUIrq enumeration, which describes the IRQ<->PIN mapping used by > our emulated vSMMU. > > Fixes: a703b4f6c1ee ("hw/arm/virt-acpi-build: Add smmuv3 node in IORT tabl

Re: [PATCH] hw/arm/smmuv3: Emulate CFGI_STE_RANGE for an aligned range of StreamIDs

2021-04-06 Thread Auger Eric
Hi Zenghui, On 4/2/21 12:04 PM, Zenghui Yu wrote: > In emulation of the CFGI_STE_RANGE command, we now take StreamID as the > start of the invalidation range, regardless of whatever the Range is, > whilst the spec clearly states that > > - "Invalidation is performed for an *aligned* range of 2^(

Re: [PATCH for-6.0 1/4] include/hw/boards.h: Document machine_class_allow_dynamic_sysbus_dev()

2021-03-26 Thread Auger Eric
Hi Peter, On 3/26/21 11:20 AM, Peter Maydell wrote: > On Fri, 26 Mar 2021 at 09:27, Auger Eric wrote: >> >> Hi Peter, >> >> On 3/25/21 4:33 PM, Peter Maydell wrote: >>> The function machine_class_allow_dynamic_sysbus_dev() is currently >>> undocumen

Re: [PATCH for-6.0 4/4] hw/ppc/e500plat: Only try to add valid dynamic sysbus devices to platform bus

2021-03-26 Thread Auger Eric
is not supported by this machine yet. > > Signed-off-by: Peter Maydell Reviewed-by: Eric Auger Eric > --- > hw/ppc/e500plat.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c > index bddd5e7c48f..fc911b

Re: [PATCH for-6.0 3/4] hw/arm/virt: Only try to add valid dynamic sysbus devices to platform bus

2021-03-26 Thread Auger Eric
Hi Peter, On 3/25/21 4:33 PM, Peter Maydell wrote: > The virt machine device plug callback currently calls > platform_bus_link_device() for any sysbus device. This is overly > broad, because platform_bus_link_device() will unconditionally grab > the IRQs and MMIOs of the device it is passed, whet

Re: [PATCH for-6.0 2/4] machine: Provide a function to check the dynamic sysbus whitelist

2021-03-26 Thread Auger Eric
Hi Peter, On 3/25/21 4:33 PM, Peter Maydell wrote: > Provide a new function dynamic_sysbus_dev_allowed() which checks > the per-machine whitelist of dynamic sysbus devices and returns > a boolean result indicating whether the device is whitelisted. > We can use this in the implementation of valida

Re: [PATCH for-6.0 1/4] include/hw/boards.h: Document machine_class_allow_dynamic_sysbus_dev()

2021-03-26 Thread Auger Eric
Hi Peter, On 3/25/21 4:33 PM, Peter Maydell wrote: > The function machine_class_allow_dynamic_sysbus_dev() is currently > undocumented; add a doc comment. > > Signed-off-by: Peter Maydell > --- > include/hw/boards.h | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/inclu

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

2021-03-26 Thread Auger Eric
Hi Wainer, On 3/25/21 8:45 PM, 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_submounts.py" a

Re: [PATCH v3 6/7] hw/arm/smmuv3: Fix SMMU_CMD_CFGI_STE_RANGE handling

2021-03-25 Thread Auger Eric
Hi Zenghui, On 3/25/21 3:18 PM, Zenghui Yu wrote: > On 2021/3/9 18:27, Eric Auger wrote: >> If the whole SID range (32b) is invalidated (SMMU_CMD_CFGI_ALL), >> @end overflows and we fail to handle the command properly. >> >> Once this gets fixed, the current code really is awkward in the >> sense

Re: [PATCH] hw/arm/smmuv3: Drop unused CDM_VALID() and is_cd_valid()

2021-03-25 Thread Auger Eric
Hi Zenghui, On 3/25/21 3:27 PM, Zenghui Yu wrote: > They were introduced in commit 9bde7f0674fe ("hw/arm/smmuv3: Implement > translate callback") but never actually used. Drop them. > > Signed-off-by: Zenghui Yu > --- > hw/arm/smmuv3-internal.h | 7 --- > 1 file changed, 7 deletions(-) > >

Re: [PATCH 1/1] avocado_qemu: Add SMMUv3 tests

2021-03-25 Thread Auger Eric
Hi Cleber, On 3/25/21 3:36 PM, Cleber Rosa wrote: > On Thu, Mar 25, 2021 at 10:57:12AM +0100, Eric Auger wrote: >> Add new tests checking the good behavior of the SMMUv3 protecting >> 2 virtio pci devices (block and net). We check the guest boots and >> we are able to install a package. Different

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

2021-03-25 Thread Auger Eric
Hi Cleber, On 3/24/21 11:23 PM, Cleber Rosa wrote: > 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 use

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

2021-03-24 Thread Auger Eric
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 of requiring each test to set the same > arguments. > > Signed-off-by: Cleber Rosa > --- > tests/acceptance/avocado_qemu/__init__.py | 4 +++- >

Re: [PATCH v2 10/10] Acceptance Tests: introduce CPU hotplug test

2021-03-24 Thread Auger Eric
ollow a similar > pattern and need to interact with QEMU (via qmp) and with the Linux > guest via SSH. > > Signed-off-by: Cleber Rosa > Reviewed-by: Marc-André Lureau > Reviewed-by: Willian Rampazzo Reviewed-by: Eric Auger Eric > --- >

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

2021-03-24 Thread Auger Eric
Hi, On 3/23/21 11:15 PM, Cleber Rosa wrote: > Signed-off-by: Cleber Rosa > Reviewed-by: Marc-André Lureau > Reviewed-by: Willian Rampazzo Reviewed-by: Eric Auger Eric > --- > docs/devel/testing.rst | 25 + > 1 file changed, 25 insertions(+) >

Re: [PATCH v2 08/10] tests/acceptance/virtiofs_submounts.py: remove launch_vm()

2021-03-24 Thread Auger Eric
Hi, On 3/23/21 11:15 PM, Cleber Rosa wrote: > 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: Eric Auger

Re: [PATCH v2 07/10] Acceptance Tests: set up SSH connection by default after boot for LinuxTest

2021-03-24 Thread Auger Eric
Hi Cleber, On 3/23/21 11:15 PM, Cleber Rosa wrote: > 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 > --- > tests/acceptance/av

Re: [PATCH v2 06/10] Acceptance Tests: make username/password configurable

2021-03-24 Thread Auger Eric
sa Reviewed-by: Eric Auger Eric > --- > tests/acceptance/avocado_qemu/__init__.py | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tests/acceptance/avocado_qemu/__init__.py > b/tests/acceptance/avocado_qemu/__init__.py > index e75b002

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

2021-03-24 Thread Auger Eric
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 of requiring each test to set the same also sets the network device to virtio-net. This may be worth mentioning here in the commit msg. > argument

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

2021-03-24 Thread Auger Eric
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 to the base LinuxTest nit: strictly speaking they are moved to another c

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

2021-03-24 Thread Auger Eric
Hi Cleber, On 3/23/21 11: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, because of the > last tweaks added to it. > > While at

Re: [PATCH v2 01/10] tests/acceptance/virtiofs_submounts.py: add missing accel tag

2021-03-24 Thread Auger Eric
Hi Cleber, On 3/23/21 11:15 PM, Cleber Rosa wrote: > 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 > --- > tests/acceptance/virtiofs_submounts.py | 1 + > 1 fi

Re: [PATCH v2 02/10] tests/acceptance/virtiofs_submounts.py: evaluate string not length

2021-03-24 Thread Auger Eric
Hi Cleber, On 3/23/21 11:15 PM, Cleber Rosa wrote: > 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 s/than/then > arguments will not be set.

Re: [RFC RESEND PATCH 2/4] hw/pci: Add iommu option for pci root bus

2021-03-14 Thread Auger Eric
Hi Xingang On 3/11/21 1:24 PM, Wang Xingang wrote: > Hi Eric, > > On 2021/3/10 18:24, Auger Eric wrote: >> Hi Xingang, >> >> On 2/27/21 9:33 AM, Wang Xingang wrote: >>> From: Xingang Wang >>> >>> This add iommu option for pci root bus, incl

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-14 Thread Auger Eric
Hi Xingang, On 3/11/21 12:57 PM, Wang Xingang wrote: > Hi Eric, > > On 2021/3/10 18:18, Auger Eric wrote: >> Hi Xingang, >> >> On 3/10/21 3:13 AM, Wang Xingang wrote: >>> Hi Eric, >>> >>> On 2021/3/9 22:36, Auger Eric wrote: >>&g

Re: [PATCH v2 2/2] hw/arm/virt: KVM: The IPA lower bound is 32

2021-03-10 Thread Auger Eric
Hi Drew, On 3/10/21 2:52 PM, Andrew Jones wrote: > The virt machine already checks KVM_CAP_ARM_VM_IPA_SIZE to get the > upper bound of the IPA size. If that bound is lower than the highest > possible GPA for the machine, then QEMU will error out. However, the > IPA is set to 40 when the highest GP

Re: [PATCH v2 1/2] accel: kvm: Fix kvm_type invocation

2021-03-10 Thread Auger Eric
lude/hw/boards.h > @@ -128,6 +128,7 @@ typedef struct { > * @kvm_type: > *Return the type of KVM corresponding to the kvm-type string option or > *computed based on other criteria such as the host kernel capabilities. > + *kvm-type may be NULL if it is not needed. > * @numa_mem_supported: > *true if '--numa node.mem' option is supported and false otherwise > * @smp_parse: > Reviewed-by: Eric Auger Eric

Re: [RFC RESEND PATCH 1/4] pci: Add PCI_BUS_IOMMU property

2021-03-10 Thread Auger Eric
Hi Xingang, On 2/27/21 9:33 AM, Wang Xingang wrote: > From: Xingang Wang > > This Property can be useful to check whether this bus is attached to iommu. Strictly speaking this is not a Property (QEMU property) but a flag > > Signed-off-by: Xingang Wang > Signed-off-by: Jiahui Cen > --- > in

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-10 Thread Auger Eric
Hi Xingang, On 3/10/21 3:13 AM, Wang Xingang wrote: > Hi Eric, > > On 2021/3/9 22:36, Auger Eric wrote: >> Hi, >> On 2/27/21 9:33 AM, Wang Xingang wrote: >>> From: Xingang Wang >>> >>> These patches add support for configure iommu on/off for pci

Re: [RFC RESEND PATCH 2/4] hw/pci: Add iommu option for pci root bus

2021-03-10 Thread Auger Eric
Hi Xingang, On 2/27/21 9:33 AM, Wang Xingang wrote: > From: Xingang Wang > > This add iommu option for pci root bus, including primary bus > and pxb root bus. Default option is set to true, and the option > is valid only if the iommu option for machine is properly set. > > Signed-off-by: Xingan

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-09 Thread Auger Eric
Hi, On 2/27/21 9:33 AM, Wang Xingang wrote: > From: Xingang Wang > > These patches add support for configure iommu on/off for pci root bus, > including primary bus and pxb root bus. At present, All root bus will go > through iommu when iommu is configured, which is not flexible. > > So this add

Re: [PATCH v2 4/7] hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is not set

2021-03-09 Thread Auger Eric
Hi Peter, On 3/8/21 5:37 PM, Peter Maydell wrote: > On Thu, 25 Feb 2021 at 09:15, Eric Auger wrote: >> >> If the asid is not set, do not attempt to locate the key directly >> as all inserted keys have a valid asid. >> >> Use g_hash_table_foreach_remove instead. >> >> Signed-off-by: Eric Auger >>

Re: [PATCH v2 1/7] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate

2021-02-25 Thread Auger Eric
Hi Philippe, On 2/25/21 11:08 AM, Philippe Mathieu-Daudé wrote: > On 2/25/21 10:14 AM, Eric Auger wrote: >> With -Werror=maybe-uninitialized configuration we get >> ../hw/i386/intel_iommu.c: In function ‘vtd_context_device_invalidate’: >> ../hw/i386/intel_iommu.c:1888:10: error: ‘mask’ may be used

Re: [RFC v7 26/26] vfio/pci: Implement return_page_response page response callback

2021-02-24 Thread Auger Eric
Hi Shameer, On 2/18/21 2:32 PM, Auger Eric wrote: > Hi Shameer, > > On 2/18/21 12:46 PM, Shameerali Kolothum Thodi wrote: >> >> Hi Eric, >> >>> -Original Message- >>> From: Auger Eric [mailto:eric.au...@redhat.com] >>> Sent: 18

Re: [PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Auger Eric
Hi Peter, On 2/18/21 6:48 PM, Peter Xu wrote: > On Thu, Feb 18, 2021 at 06:18:22PM +0100, Auger Eric wrote: >> Hi Peter, >> >> On 2/18/21 5:42 PM, Peter Xu wrote: >>> Eric, >>> >>> On Thu, Feb 18, 2021 at 03:16:50PM +0100, Eric Aug

Re: [PATCH] virtio-iommu: Handle non power of 2 range invalidations

2021-02-18 Thread Auger Eric
Hi Peter, On 2/18/21 5:42 PM, Peter Xu wrote: > Eric, > > On Thu, Feb 18, 2021 at 03:16:50PM +0100, Eric Auger wrote: >> @@ -164,12 +166,27 @@ static void >> virtio_iommu_notify_unmap(IOMMUMemoryRegion *mr, hwaddr virt_start, >> >> event.type = IOMMU_NOTIFIER_UNMAP; >> event.entry.ta

Re: [RFC v7 26/26] vfio/pci: Implement return_page_response page response callback

2021-02-18 Thread Auger Eric
Hi Shameer, On 2/18/21 12:46 PM, Shameerali Kolothum Thodi wrote: > > Hi Eric, > >> -Original Message- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 18 February 2021 10:42 >> To: Shameerali Kolothum Thodi ; >> eric.auger

Re: [RFC v7 26/26] vfio/pci: Implement return_page_response page response callback

2021-02-18 Thread Auger Eric
Hi Shameer, On 2/18/21 11:19 AM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 16 November 2020 18:14 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> qemu-devel@nongnu.org; qemu-...@nongnu.org; >>

Re: [PATCH] vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support

2021-02-09 Thread Auger Eric
Hi, On 2/9/21 4:12 AM, Jason Wang wrote: > > On 2021/2/9 上午2:37, Peter Xu wrote: >> On Mon, Feb 08, 2021 at 11:21:23AM +0800, Jason Wang wrote: >> >> [...] >> I'm not sure I remember it right, but we seem to have similar discussion previously on "what if the user didn't specify ats

Re: [PATCH] vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support

2021-02-08 Thread Auger Eric
Hi, On 2/7/21 3:47 PM, Peter Xu wrote: > Hi, Kevin, > > On Sun, Feb 07, 2021 at 09:04:55AM +, Tian, Kevin wrote: >>> From: Peter Xu >>> Sent: Friday, February 5, 2021 11:31 PM >>> > > >> or virtio-iommu >> since dev-iotlb (or PCIe ATS) > > > We may need to add this

Re: [PATCH] vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support

2021-02-08 Thread Auger Eric
Hi, [Adding David and Greg in CC] On 2/8/21 7:37 PM, Peter Xu wrote: > On Mon, Feb 08, 2021 at 11:21:23AM +0800, Jason Wang wrote: > > [...] > >>> I'm not sure I remember it right, but we seem to have similar discussion >>> previously on "what if the user didn't specify ats=on" - I think at th

Re: [PATCH] vhost: Unbreak SMMU and virtio-iommu on dev-iotlb support

2021-02-05 Thread Auger Eric
Hi, On 2/5/21 4:16 AM, Jason Wang wrote: > > On 2021/2/5 上午3:12, Peter Xu wrote: >> Previous work on dev-iotlb message broke vhost on either SMMU > > > Have a quick git grep and it looks to me v3 support ATS and have command > for device iotlb (ATC) invalidation. Yes I will do that. Should no

Re: [PATCH v2] hw/arm/smmuv3: Fix addr_mask for range-based invalidation

2021-01-31 Thread Auger Eric
Hi Zenghui, On 1/30/21 5:32 AM, Zenghui Yu wrote: > When handling guest range-based IOTLB invalidation, we should decode the TG > field into the corresponding translation granule size so that we can pass > the correct invalidation range to backend. Set @granule to (tg * 2 + 10) to > properly emula

Re: [PATCH] hw/arm/smmuv3: Fix addr_mask for range-based invalidation

2021-01-29 Thread Auger Eric
Hi Zenghui, On 1/29/21 1:15 PM, Zenghui Yu wrote: > Hi Eric, > > On 2021/1/29 5:30, Auger Eric wrote: >> Hi Zenghui, >> >> On 1/28/21 9:25 AM, Auger Eric wrote: >>> Hi Zenghui, >>> >>> On 12/25/20 10:50 AM, Zenghui Yu wrote: >>>>

Re: [PATCH] hw/arm/smmuv3: Fix addr_mask for range-based invalidation

2021-01-28 Thread Auger Eric
Hi Zenghui, On 1/28/21 9:25 AM, Auger Eric wrote: > Hi Zenghui, > > On 12/25/20 10:50 AM, Zenghui Yu wrote: >> When performing range-based IOTLB invalidation, we should decode the TG >> field into the corresponding translation granule size so that we can pass >> the co

Re: [PATCH] hw/arm/smmuv3: Fix addr_mask for range-based invalidation

2021-01-28 Thread Auger Eric
Hi Zenghui, On 12/25/20 10:50 AM, Zenghui Yu wrote: > When performing range-based IOTLB invalidation, we should decode the TG > field into the corresponding translation granule size so that we can pass > the correct invalidation range to backend. Set @granule to (tg * 2 + 10) to > properly emulate

Re: [RFC v7 09/26] vfio: Force nested if iommu requires it

2020-12-01 Thread Auger Eric
Hi Kunkun, On 11/28/20 10:01 AM, Kunkun Jiang wrote: > Hi Eric, >> @@ -1668,6 +1679,14 @@ static int vfio_connect_container(VFIOGroup *group, >> AddressSpace *as, >> VFIOContainer *container; >> int ret, fd; >> VFIOAddressSpace *space; >> +IOMMUMemoryRegion *iommu_mr; >> +b

Re: [PATCH] hw/arm/smmuv3: Fix up L1STD_SPAN decoding

2020-11-30 Thread Auger Eric
Hi Kunkun, Peter, On 11/30/20 12:29 PM, Peter Maydell wrote: > On Tue, 24 Nov 2020 at 02:37, Kunkun Jiang wrote: >> >> Accroding to the SMMUv3 spec, the SPAN field of Level1 Stream Table >> Descriptor is 5 bits([4:0]). >> >> Fixes: 9bde7f0674f(hw/arm/smmuv3: Implement translate callback) >> Signe

Re: [PATCH v2] hw/arm/virt enable support for virtio-mem

2020-11-09 Thread Auger Eric
Hi Jonathan, On 11/5/20 6:43 PM, Jonathan Cameron wrote: > Basically a cut and paste job from the x86 support with the exception of > needing a larger block size as the Memory Block Size (MIN_SECTION_SIZE) > on ARM64 in Linux is 1G. > > Tested: > * In full emulation and with KVM on an arm64 serve

Re: [PATCH-for-5.2 v3 0/7] util/vfio-helpers: Generic code strengthening

2020-11-03 Thread Auger Eric
Hi Philippe, On 11/3/20 3:07 AM, Philippe Mathieu-Daudé wrote: > v3: > - Extract reviewed patches from > "util/vfio-helpers: Allow using multiple MSIX IRQs" > - Added "Assert offset is aligned to page size" > which would have helped debugging: > "block/nvme: Fix use of write-only doorbells pa

Re: [PATCH-for-5.2] hw/arm/smmuv3: Fix potential integer overflow (CID 1432363)

2020-10-30 Thread Auger Eric
Hi Philippe, On 10/30/20 3:46 PM, Philippe Mathieu-Daudé wrote: > Use the BIT_ULL() macro to ensure we use 64-bit arithmetic. > This fixes the following Coverity issue (OVERFLOW_BEFORE_WIDEN): > > CID 1432363 (#1 of 1): Unintentional integer overflow: > > overflow_before_widen: > Potenti

Re: [PATCH 00/25] block/nvme: Fix Aarch64 host

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Add a bit of tracing, clean around to finally fix few bugs. > In particular, restore NVMe on Aarch64 host. > > Eric Auger (4): > block/nvme: Change size and alignment of IDENTIFY response buffer > block/nvme: Change size and al

Re: [RFC PATCH 25/25] block/nvme: Fix use of write-only doorbells page on Aarch64 arch

2020-10-28 Thread Auger Eric
set of 4K which > broke this contract on Aarch64 arch. > > Fix by mapping at offset 0, and and accessing doorbells at offset=4K. > > Fixes: f68453237b9 ("block/nvme: Map doorbells pages write-only") > Reported-by: Eric Auger > Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH 18/25] block/nvme: Pass AioContext argument to nvme_add_io_queue()

2020-10-28 Thread Auger Eric
nvme_init(BlockDriverState *bs, const char > *device, int namespace, > } > > /* Set up command queues. */ > -if (!nvme_add_io_queue(bs, errp)) { > + if (!nvme_add_io_queue(bs, aio_context, errp)) { > ret = -EIO; > } > out: > Besides Reviewed-by: Eric Auger Eric

Re: [PATCH 17/25] block/nvme: Simplify nvme_cmd_sync()

2020-10-28 Thread Auger Eric
On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > As all commands use the ADMIN queue, it is pointless to pass > it as argument each time. Remove the argument. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Eric > --- > block/nvme.c | 15 +++

Re: [PATCH 16/25] block/nvme: Simplify ADMIN queue access

2020-10-28 Thread Auger Eric
o_queue().> > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Eric > --- > block/nvme.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/block/nvme.c b/block/nvme.c > index d5df30ec074..2d3648694b0 100644 > ---

Re: [PATCH 15/25] block/nvme: Correctly initialize Admin Queue Attributes

2020-10-28 Thread Auger Eric
sed value. > > This bug has never been hit because the device initialization > uses a single command synchronously :) > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Eric > --- > block/nvme.c | 6 +++--- > 1 file changed, 3 insertions(+), 3

Re: [PATCH 14/25] block/nvme: Use definitions instead of magic values in add_io_queue()

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Replace magic values by definitions, and simplifiy since the > number of queues will never reach 64K. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Eric > --- > block/nvme.c | 9 +

Re: [PATCH 13/25] block/nvme: Introduce Completion Queue definitions

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Rename Submission Queue flags with 'Sq' ... to differentiate submission queue flags from command queue flags. and introduce > Completion Queue flag definitions. besides Reviewed-by: Eric Auger Thanks Eric > > Signed-off-by: Philippe M

Re: [PATCH 12/25] block/nvme: Make nvme_init_queue() return boolean indicating error

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Just for consistency, following the example documented since > commit e3fe3988d7 ("error: Document Error API usage rules"), > return a boolean value indicating an error is set or not. > This simplifies a bit nvme_create_queue_pair(). also dir

Re: [PATCH 11/25] block/nvme: Make nvme_identify() return boolean indicating error

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Just for consistency, following the example documented since > commit e3fe3988d7 ("error: Document Error API usage rules"), > return a boolean value indicating an error is set or not. Then I think the returned value should be used by the cal

Re: [PATCH 10/25] block/nvme: Use unsigned integer for queue counter/size

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > We can not have negative queue count/size/index, use unsigned type. > Rename 'nr_queues' as 'queue_count' to match the spec naming. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Thanks Eric > --- > block/nvme.c

Re: [PATCH 09/25] block/nvme: Move definitions before structure declarations

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > To be able to use some definitions in structure declarations, > move them earlier. No logical change. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Eric > --- > block/nvme.c | 19 ++-

Re: [PATCH 04/25] block/nvme: Trace controller capabilities

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/28/20 11:25 AM, Philippe Mathieu-Daudé wrote: > On 10/28/20 11:20 AM, Auger Eric wrote: >> Hi Philippe, >> >> On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: >>> Controllers have different capabilities and report them in the >>> CAP regi

Re: [PATCH 06/25] block/nvme: Improve nvme_free_req_queue_wait() trace information

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > What we want to trace is the block driver state and the queue index. > > Suggested-by: Stefan Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Thanks Eric > --- > block/nvme.c | 2 +- > block/trace-event

Re: [PATCH 04/25] block/nvme: Trace controller capabilities

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Controllers have different capabilities and report them in the > CAP register. We are particularly interested by the page size > limits. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme

Re: [PATCH 07/25] block/nvme: Trace queue pair creation/deletion

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Thanks Eric > --- > block/nvme.c | 3 +++ > block/trace-events | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/block/nvme.c b/block/nvme.c > inde

Re: [PATCH 05/25] block/nvme: Trace nvme_poll_queue() per queue

2020-10-28 Thread Auger Eric
Hi, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > As we want to enable multiple queues, report the event > in each nvme_poll_queue() call, rather than once in > the callback calling nvme_poll_queues(). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Thanks Eric > ---

Re: [PATCH 03/25] block/nvme: Report warning with warn_report()

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Instead of displaying warning on stderr, use warn_report() > which also displays it on the monitor. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Thanks Eric > --- > block/nvme.c | 4 ++-- > 1 file changed

Re: [PATCH 02/25] block/nvme: Use hex format to display offset in trace events

2020-10-28 Thread Auger Eric
Hi Philippe, On 10/27/20 2:55 PM, Philippe Mathieu-Daudé wrote: > Use the same format used for the hw/vfio/ trace events. > > Suggested-by: Eric Auger > Signed-off-by: Philippe Mathieu-Daudé > --- > block/trace-events | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > di

Re: [PATCH] arm/trace: Fix hex printing

2020-10-27 Thread Auger Eric
Hi Peter, On 10/27/20 11:38 AM, Peter Maydell wrote: > OK; I'll apply this patch to target-arm.next; feel free to send > a patch updating the other tracepoints to hex. sure, I will. Thanks Eric

Re: [PATCH] arm/trace: Fix hex printing

2020-10-27 Thread Auger Eric
Hi Peter, On 10/19/20 9:26 PM, Peter Maydell wrote: > On Wed, 14 Oct 2020 at 20:36, Dr. David Alan Gilbert (git) > wrote: >> >> From: "Dr. David Alan Gilbert" >> >> Use of 0x%d - make up our mind as 0x%x >> >> Signed-off-by: Dr. David Alan Gilbert >> --- >> hw/arm/trace-events | 2 +- >> 1 fil

Re: [PATCH v2 16/19] util/vfio-helpers: Introduce qemu_vfio_pci_msix_init_irqs()

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:55 AM, Philippe Mathieu-Daudé wrote: > qemu_vfio_pci_init_irq() allows us to initialize any type of IRQ, > but only one. Introduce qemu_vfio_pci_msix_init_irqs() which is > specific to MSIX IRQ type, and allow us to use multiple IRQs > (thus passing multiple eventfd not

Re: [PATCH v2 18/19] block/nvme: Switch to using the MSIX API

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:55 AM, Philippe Mathieu-Daudé wrote: > In preparation of using multiple IRQs, switch to using the recently > introduced MSIX API. Instead of allocating and assigning IRQ in > a single step, we now have to use two distinct calls. > > Reviewed-by: Stefan Hajnoczi > Sign

Re: [PATCH v2 11/19] util/vfio-helpers: Let qemu_vfio_dma_map() propagate Error

2020-10-26 Thread Auger Eric
Hi Philippe, On 10/26/20 11:54 AM, Philippe Mathieu-Daudé wrote: > Currently qemu_vfio_dma_map() displays errors on stderr. > When using management interface, this information is simply > lost. Pass qemu_vfio_dma_map() an Error* argument so it can Error** or simply error handle > propagate the err

  1   2   3   4   5   6   7   8   9   10   >