Re: [PATCH 4/5] KVM: arm64: Update comment in kvm_vgic_map_resources()

2020-12-14 Thread Auger Eric
Hi Alexandru, On 12/1/20 4:01 PM, Alexandru Elisei wrote: > vgic_v3_map_resources() returns -EBUSY if the VGIC isn't initialized, > update the comment to kvm_vgic_map_resources() to match what the function > does. > > Signed-off-by: Alexandru Elisei > --- > arch/arm64/kvm/vgic/vgic-init.c | 3

Re: [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset()

2020-12-14 Thread Auger Eric
Alexandru, On 12/1/20 4:01 PM, Alexandru Elisei wrote: > KVM_ARM_VCPU_INIT ioctl calls kvm_reset_vcpu(), which in turn resets the > PMU with a call to kvm_pmu_vcpu_reset(). The function zeroes the PMU > chained counters bitmap and stops all the counters with a perf event > attached. Because it is

Re: [PATCH 3/5] KVM: arm64: Move double-checked lock to kvm_vgic_map_resources()

2020-12-14 Thread Auger Eric
Hi Alexandru, On 12/1/20 4:01 PM, Alexandru Elisei wrote: > kvm_vgic_map_resources() is called when a VCPU if first run and it maps all > the VGIC MMIO regions. To prevent double-initialization, the VGIC uses the > ready variable to keep track of the state of resources and the global KVM > mutex

Re: [PATCH 2/5] KVM: arm64: arch_timer: Remove VGIC initialization check

2020-12-14 Thread Auger Eric
Hi Alexandru, On 12/1/20 4:01 PM, Alexandru Elisei wrote: > kvm_timer_enable() is called in kvm_vcpu_first_run_init() after > kvm_vgic_map_resources() if the VGIC wasn't ready. kvm_vgic_map_resources() > is the only place where kvm->arch.vgic.ready is set to true. > > For a v2 VGIC,

Re: [kvm-unit-tests PATCH 08/10] arm/arm64: gic: Split check_acked() into two functions

2020-12-15 Thread Auger Eric
Hi Alexandru, On 12/10/20 3:45 PM, Alexandru Elisei wrote: > Hi Eric, > > On 12/3/20 1:39 PM, Auger Eric wrote: >> >> On 11/25/20 4:51 PM, Alexandru Elisei wrote: >>> check_acked() has several peculiarities: is the only function among the >>> check_*

Re: [PATCH 5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset()

2020-12-15 Thread Auger Eric
Hi Alexandru, On 12/14/20 3:02 PM, Alexandru Elisei wrote: > Hi Eric, > > Thanks for having a look! > > On 12/14/20 1:48 PM, Auger Eric wrote: >> Alexandru, >> >> On 12/1/20 4:01 PM, Alexandru Elisei wrote: >>> KVM_ARM_VCPU_INIT ioctl calls kvm_rese

Re: [PATCH v13 01/15] iommu: Introduce attach/detach_pasid_table API

2020-11-19 Thread Auger Eric
Hi Jacob, On 11/18/20 5:19 PM, Jacob Pan wrote: > Hi Eric, > > On Wed, 18 Nov 2020 12:21:37 +0100, Eric Auger > wrote: > >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on the guest, >> the physical IOMMU must be programmed to be

Re: [PATCH 1/2] KVM: arm64: vgic: Forbid invalid userspace Redistributor accesses

2020-11-17 Thread Auger Eric
Hi Marc, On 11/17/20 9:49 AM, Marc Zyngier wrote: > Hi Zenghui, > > On 2020-11-16 14:57, Zenghui Yu wrote: >> Hi Marc, >> >> On 2020/11/16 22:10, Marc Zyngier wrote: My take is that only if the "[Re]Distributor base address" is specified in the system memory map, will the user-provided

Re: [PATCH 1/2] KVM: arm64: vgic: Forbid invalid userspace Redistributor accesses

2020-11-17 Thread Auger Eric
Hi Zenghui, On 11/17/20 9:49 AM, Marc Zyngier wrote: > Hi Zenghui, > > On 2020-11-16 14:57, Zenghui Yu wrote: >> Hi Marc, >> >> On 2020/11/16 22:10, Marc Zyngier wrote: My take is that only if the "[Re]Distributor base address" is specified in the system memory map, will the

Re: [PATCH v11 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2020-11-17 Thread Auger Eric
Hi Shameer, On 5/13/20 5:57 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 13 May 2020 14:29 >> To: Shameerali Kolothum Thodi ; >> Zhangfei Gao ; eric.auger

Re: [PATCH v12 04/15] iommu/smmuv3: Dynamically allocate s1_cfg and s2_cfg

2020-11-17 Thread Auger Eric
Hi Shameer, On 11/17/20 12:39 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 16 November 2020 10:43 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> io...@lists.linux-foundation.org;

Re: [PATCH] KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace

2020-11-17 Thread Auger Eric
Hi Zenghui, On 11/17/20 4:16 PM, Zenghui Yu wrote: > It was recently reported that if GICR_TYPER is accessed before the RD base > address is set, we'll suffer from the unset @rdreg dereferencing. Oops... > > gpa_t last_rdist_typer = rdreg->base + GICR_TYPER + >

Re: [PATCH v10 04/11] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type

2020-11-13 Thread Auger Eric
Hi Zenghui, On 9/24/20 10:23 AM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/21 0:19, Eric Auger wrote: >> Add a new specific DMA_FAULT region aiming to exposed nested mode >> translation faults. >> >> The region has a ring buffer that contains the actual fault >> records plus a header allowing to

Re: [PATCH v10 05/11] vfio/pci: Register an iommu fault handler

2020-11-13 Thread Auger Eric
Hi Zenghui, On 9/24/20 10:49 AM, Zenghui Yu wrote: > Hi Eric, > > On 2020/3/21 0:19, Eric Auger wrote: >> Register an IOMMU fault handler which records faults in >> the DMA FAULT region ring buffer. In a subsequent patch, we >> will add the signaling of a specific eventfd to allow the >>

Re: [kvm-unit-tests RFC PATCH v2 2/5] lib/{bitops, alloc_page}.h: Add missing headers

2020-10-30 Thread Auger Eric
Hi Alexandru, On 10/27/20 6:19 PM, Alexandru Elisei wrote: > bitops.h uses the 'bool' and 'size_t' types, but doesn't include the > stddef.h and stdbool.h headers, where the types are defined. This can cause > the following error when compiling: > > In file included from arm/new-test.c:9: >

Re: [kvm-unit-tests RFC PATCH v2 4/5] lib: arm/arm64: Add function to unmap a page

2020-10-30 Thread Auger Eric
Hi Alexandru, On 10/27/20 6:19 PM, Alexandru Elisei wrote: > Being able to cause a stage 1 data abort might be useful for future tests. > Add a function that unmaps a page from the translation tables. > > Signed-off-by: Alexandru Elisei > --- > lib/arm/asm/mmu-api.h | 1 + > lib/arm/mmu.c

Re: [kvm-unit-tests RFC PATCH v2 3/5] arm64: spe: Add introspection test

2020-10-30 Thread Auger Eric
Hi Alexandru, On 10/27/20 6:19 PM, Alexandru Elisei wrote: > From: Eric Auger > > Probe the DTB and the ID registers to get information about SPE, then > compare the register fields with the valid values as defined by ARM DDI > 0487F.b. > > SPE is supported only on AArch64, so make the test

Re: [kvm-unit-tests RFC PATCH v2 3/5] arm64: spe: Add introspection test

2020-10-30 Thread Auger Eric
Hi Alexandru, On 10/30/20 4:59 PM, Alexandru Elisei wrote: > Hi Eric, > > On 10/30/20 3:29 PM, Auger Eric wrote: >> Hi Alexandru, >> >> On 10/27/20 6:19 PM, Alexandru Elisei wrote: >>> From: Eric Auger >>> >>> Probe the DTB and the ID re

Re: [kvm-unit-tests RFC PATCH v2 3/5] arm64: spe: Add introspection test

2020-10-30 Thread Auger Eric
Hi Alexandru, On 10/30/20 6:50 PM, Alexandru Elisei wrote: > Hi Eric, > > On 10/30/20 5:09 PM, Auger Eric wrote: >> Hi Alexandru, >> >> On 10/30/20 4:59 PM, Alexandru Elisei wrote: >> [..] >>>>> + spe.align = 1 << spe.align;

Re: [kvm-unit-tests RFC PATCH v2 0/5] arm64: Statistical Profiling Extension Tests

2020-10-30 Thread Auger Eric
Hi Alexandru, [+ Drew] On 10/27/20 6:19 PM, Alexandru Elisei wrote: > This series implements two basic tests for KVM SPE: one that checks that > the reported features match what is specified in the architecture, > implemented in patch #3 ("arm64: spe: Add introspection test"), and another > test

Re: [kvm-unit-tests RFC PATCH v2 5/5] am64: spe: Add buffer test

2020-10-30 Thread Auger Eric
Hi Alexandru, On 10/27/20 6:19 PM, Alexandru Elisei wrote: > According to ARM DDI 0487F.b, a profiling buffer management event occurs: > > * On a fault. > * On an external abort. > * When the buffer fills. > * When software sets the service bit, PMBSR_EL1.S. Compared to v1 this patch adds 3 new

Re: [kvm-unit-tests RFC PATCH v2 0/5] arm64: Statistical Profiling Extension Tests

2020-11-02 Thread Auger Eric
Hi Alexandru, On 10/30/20 11:31 PM, Alexandru Elisei wrote: > Hi Eric, > > On 10/30/20 6:17 PM, Auger Eric wrote: >> Hi Alexandru, >> >> [+ Drew] >> >> On 10/27/20 6:19 PM, Alexandru Elisei wrote: >>> This series implements two basic tests fo

Re: [PATCH 0/4] KVM: selftests: Add get-reg-list regression test

2020-10-29 Thread Auger Eric
On 10/29/20 9:16 PM, Andrew Jones wrote: > Since Eric complained in his KVM Forum talk that there weren't any > aarch64-specific KVM selftests, now he gets to review one. okay ... :-) Eric This test > was inspired by recent regression report about get-reg-list losing > a register between an

Re: [PATCH 5/9] KVM: arm: move has_run_once after the map_resources

2021-01-14 Thread Auger Eric
Hi Alexandru, On 1/12/21 3:55 PM, Alexandru Elisei wrote: > Hi Eric, > > On 12/12/20 6:50 PM, Eric Auger wrote: >> has_run_once is set to true at the beginning of >> kvm_vcpu_first_run_init(). This generally is not an issue >> except when exercising the code with KVM selftests. Indeed, >> if

Re: [PATCH 1/9] KVM: arm64: vgic-v3: Fix some error codes when setting RDIST base

2021-01-14 Thread Auger Eric
Hi Alexandru, On 1/6/21 5:32 PM, Alexandru Elisei wrote: > Hi Eric, > > On 12/12/20 6:50 PM, Eric Auger wrote: >> KVM_DEV_ARM_VGIC_GRP_ADDR group doc says we should return >> -EEXIST in case the base address of the redist is already set. >> We currently return -EINVAL. >> >> However we need to

Re: [PATCH 8/9] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-01-14 Thread Auger Eric
Hi Alexandru, On 1/12/21 6:02 PM, Alexandru Elisei wrote: > Hi Eric, > > On 12/12/20 6:50 PM, Eric Auger wrote: >> Commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the >> reporting of GICR_TYPER.Last for userspace") temporarily fixed >> a bug identified when attempting to access the GICR_TYPER >>

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Auger Eric
Hi Shameer, Jean-Philippe, On 12/4/20 11:23 AM, Auger Eric wrote: > Hi Shameer, Jean-Philippe, > > On 12/4/20 11:20 AM, Shameerali Kolothum Thodi wrote: >> Hi Jean, >> >>> -Original Message- >>> From: Jean-Philippe Brucker [mailto:jean-phili...@li

Re: [PATCH v13 07/15] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-01-14 Thread Auger Eric
Hi Jean, On 1/14/21 6:33 PM, Jean-Philippe Brucker wrote: > Hi Eric, > > On Thu, Jan 14, 2021 at 05:58:27PM +0100, Auger Eric wrote: >>>> The uacce-devel branches from >>>>> https://github.com/Linaro/linux-kernel-uadk do provide this at the moment >&g

Re: [PATCH 7/9] KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write]

2021-01-13 Thread Auger Eric
Hi Alexandru, On 1/12/21 5:16 PM, Alexandru Elisei wrote: > Hi Eric, > > On 1/12/21 4:04 PM, Alexandru Elisei wrote: >> Hi Eric, >> >> On 12/12/20 6:50 PM, Eric Auger wrote: >>> Instead of converting the vgic_io_device handle to a kvm_io_device >>> handled and then do the oppositive, pass a

Re: [PATCH 6/9] docs: kvm: devices/arm-vgic-v3: enhance KVM_DEV_ARM_VGIC_CTRL_INIT doc

2021-01-13 Thread Auger Eric
Hi Alexandru, On 1/12/21 4:39 PM, Alexandru Elisei wrote: > Hi Eric, > > On 12/12/20 6:50 PM, Eric Auger wrote: >> kvm_arch_vcpu_precreate() returns -EBUSY if the vgic is >> already initialized. So let's document that KVM_DEV_ARM_VGIC_CTRL_INIT >> must be called after all vcpu creations. > >

Re: [PATCH 2/9] KVM: arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION read

2021-01-13 Thread Auger Eric
Hi Alexandru, On 1/6/21 6:12 PM, Alexandru Elisei wrote: > Hi Eric, > > The patch looks correct to me. kvm_vgic_addr() masks out all the bits except > index > from addr, so we don't need to do it in vgic_get_common_attr(): > > Reviewed-by: Alexandru Elisei > > One nitpick below. > > On

Re: [PATCH 3/9] KVM: arm64: vgic-v3: Fix error handling in vgic_v3_set_redist_base()

2021-01-13 Thread Auger Eric
Hi Marc, On 12/28/20 4:35 PM, Marc Zyngier wrote: > Hi Eric, > > On Sat, 12 Dec 2020 18:50:04 +, > Eric Auger wrote: >> >> vgic_register_all_redist_iodevs may succeed while >> vgic_register_all_redist_iodevs fails. For example this can happen > > The same function cannot both fail and

Re: [PATCH 4/9] KVM: arm/arm64: vgic: Reset base address on kvm_vgic_dist_destroy()

2021-01-13 Thread Auger Eric
Hi Marc, On 12/28/20 4:41 PM, Marc Zyngier wrote: > On Sat, 12 Dec 2020 18:50:05 +, > Eric Auger wrote: >> >> On vgic_dist_destroy(), the addresses are not reset. However for >> kvm selftest purpose this would allow to continue the test execution >> even after a failure when running KVM_RUN.

Re: [PATCH 3/6] KVM: arm64: Add handling of AArch32 PCMEID{2, 3} PMUv3 registers

2021-01-15 Thread Auger Eric
Hi Marc, On 1/14/21 11:56 AM, Marc Zyngier wrote: > Despite advertising support for AArch32 PMUv3p1, we fail to handle > the PMCEID{2,3} registers, which conveniently alias with with the top s/with with/with > bits of PMCEID{0,1}_EL1. > > Implement these registers with the usual AA32(HI/LO)

Re: [PATCH 1/6] KVM: arm64: Fix missing RES1 in emulation of DBGBIDR

2021-01-15 Thread Auger Eric
Hi Marc, On 1/14/21 11:56 AM, Marc Zyngier wrote: > The AArch32 CP14 DBGDIDR has bit 15 set to RES1, which our current > emulation doesn't set. Just add the missing bit. > > Reported-by: Peter Maydell > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/sys_regs.c | 2 +- > 1 file changed,

Re: [PATCH 2/6] KVM: arm64: Fix AArch32 PMUv3 capping

2021-01-15 Thread Auger Eric
ID_DFR0_PERFMON_8_1); > + ID_DFR0_PERFMON_SHIFT, > + kvm_vcpu_has_pmu(vcpu) ? > ID_DFR0_PERFMON_8_1 : 0); nit: Maybe you could use the same layout for SYS_ID_AA64DFR0_EL1 andremove cap there. Rev

Re: [PATCH 4/6] KVM: arm64: Refactor filtering of ID registers

2021-01-15 Thread Auger Eric
ous comment here. > - } else if (id == SYS_ID_DFR0_EL1) { > + ID_AA64DFR0_PMUVER_SHIFT, > + kvm_vcpu_has_pmu(vcpu) ? > ID_AA64DFR0_PMUVER_8_1 : 0); > + break; > + cas

Re: [PATCH 5/6] KVM: arm64: Limit the debug architecture to ARMv8.0

2021-01-15 Thread Auger Eric
Hi Marc, On 1/14/21 11:56 AM, Marc Zyngier wrote: > Let's not pretend we support anything but ARMv8.0 as far as the > debug architecture is concerned. > > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Eric > --- > arch/arm64/kvm/sys_regs.c | 3 +++ > 1 file

Re: [PATCH 6/6] KVM: arm64: Upgrade PMU support to ARMv8.4

2021-01-15 Thread Auger Eric
Hi Marc, On 1/14/21 11:56 AM, Marc Zyngier wrote: > Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be > pretty easy. All that is required is support for PMMIR_EL1, which > is read-only, and for which returning 0 is a valid option. > > Let's just do that and adjust what we return to

Re: [PATCH 6/6] KVM: arm64: Upgrade PMU support to ARMv8.4

2021-01-15 Thread Auger Eric
Hi Marc, On 1/15/21 5:42 PM, Marc Zyngier wrote: > Hi Eric, > > On 2021-01-15 14:01, Auger Eric wrote: >> Hi Marc, >> >> On 1/14/21 11:56 AM, Marc Zyngier wrote: >>> Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be >>> pretty easy.

Re: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2021-01-13 Thread Auger Eric
Hi Shameer, On 1/8/21 6:05 PM, Shameerali Kolothum Thodi wrote: > Hi Eric, > >> -Original Message- >> From: Eric Auger [mailto:eric.au...@redhat.com] >> Sent: 18 November 2020 11:22 >> To: eric.auger@gmail.com; eric.au...@redhat.com; >> io...@lists.linux-foundation.org;

Re: [RFC PATCH v1 3/4] KVM: arm64: GICv4.1: Restore VLPI's pending state to physical side

2020-12-16 Thread Auger Eric
Hi Shenming, On 12/1/20 1:15 PM, Shenming Lu wrote: > On 2020/12/1 19:50, Marc Zyngier wrote: >> On 2020-12-01 11:40, Shenming Lu wrote: >>> On 2020/12/1 18:55, Marc Zyngier wrote: On 2020-11-30 07:23, Shenming Lu wrote: Hi Shenming, > We are pondering over this problem

Re: [kvm-unit-tests PATCH 08/10] arm/arm64: gic: Split check_acked() into two functions

2020-12-16 Thread Auger Eric
Hi Alexandru, On 12/16/20 12:40 PM, Alexandru Elisei wrote: > Hi Eric, > > On 12/15/20 1:58 PM, Auger Eric wrote: >> Hi Alexandru, >> >> On 12/10/20 3:45 PM, Alexandru Elisei wrote: >>> Hi Eric, >>> >>> On 12/3/20 1:39 PM, Auger Eric wrote:

Re: [PATCH v13 01/15] iommu: Introduce attach/detach_pasid_table API

2021-02-01 Thread Auger Eric
Hi Keqian, On 2/1/21 12:27 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> In virtualization use case, when a guest is assigned >> a PCI host device, protected by a virtual IOMMU on the guest, >> the physical IOMMU must be programmed to be consistent with >> the

Re: [PATCH v2 6/7] KVM: arm64: Upgrade PMU support to ARMv8.4

2021-01-27 Thread Auger Eric
Hi Marc, On 1/25/21 1:26 PM, Marc Zyngier wrote: > Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be > pretty easy. All that is required is support for PMMIR_EL1, which > is read-only, and for which returning 0 is a valid option as long > as we don't advertise STALL_SLOT as an

Re: [PATCH v2 7/7] KVM: arm64: Use symbolic names for the PMU versions

2021-01-27 Thread Auger Eric
Hi Marc, On 1/25/21 1:26 PM, Marc Zyngier wrote: > Instead of using a bunch of magic numbers, use the existing definitions > that have been added since 8673e02e58410 ("arm64: perf: Add support > for ARMv8.5-PMU 64-bit counters") > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/pmu-emul.c

Re: [PATCH v2 6/7] KVM: arm64: Upgrade PMU support to ARMv8.4

2021-02-03 Thread Auger Eric
Hi, On 2/3/21 12:20 PM, Marc Zyngier wrote: > On 2021-02-03 11:07, Auger Eric wrote: >> Hi Marc, >> On 2/3/21 11:36 AM, Marc Zyngier wrote: >>> Hi Eric, >>> >>> On 2021-01-27 17:53, Auger Eric wrote: >>>> Hi Marc, >>>> >>>

Re: [kvm-unit-tests PATCH v3 04/11] arm/arm64: gic: Remove unnecessary synchronization with stats_reset()

2021-02-03 Thread Auger Eric
he same barrier is executed by readl() after the MMIO read. > Together with the wmb() barrier from writel() when triggering the IPI, > this ensures that the expected memory ordering is respected. > > Signed-off-by: Alexandru Elisei Reviewed-by: Eric Auger Eric > --- > arm/

Re: [kvm-unit-tests PATCH v3 05/11] arm/arm64: gic: Use correct memory ordering for the IPI test

2021-02-03 Thread Auger Eric
t; tools/memory-model/litmus-tests. More examples and explanations can be > found in the Linux source tree, in Documentation/memory-barriers.txt, in > the sections "SMP BARRIER PAIRING" and "READ MEMORY BARRIERS VS LOAD > SPECULATION". > > For consistency with i

Re: [kvm-unit-tests PATCH v3 02/11] lib: arm/arm64: gicv2: Document existing barriers when sending IPIs

2021-02-03 Thread Auger Eric
Hi Alexandru, On 1/29/21 5:36 PM, Alexandru Elisei wrote: > GICv2 generates IPIs with a MMIO write to the GICD_SGIR register. A common > pattern for IPI usage is for the IPI receiver to read data written to > memory by the sender. The armv7 and armv8 architectures implement a > weakly-ordered

Re: [PATCH v2 6/7] KVM: arm64: Upgrade PMU support to ARMv8.4

2021-02-03 Thread Auger Eric
Hi Marc, On 2/3/21 11:36 AM, Marc Zyngier wrote: > Hi Eric, > > On 2021-01-27 17:53, Auger Eric wrote: >> Hi Marc, >> >> On 1/25/21 1:26 PM, Marc Zyngier wrote: >>> Upgrading the PMU code from ARMv8.1 to ARMv8.4 turns out to be >>> pretty easy. All tha

Re: [PATCH v2 4/5] KVM: selftests: Add exception handling support for aarch64

2021-05-12 Thread Auger Eric
Hi Ricardo, On 5/12/21 9:27 AM, Ricardo Koller wrote: > On Fri, May 07, 2021 at 04:08:07PM +0200, Auger Eric wrote: >> Hi Ricardo, >> >> On 5/6/21 9:14 PM, Ricardo Koller wrote: >>> On Thu, May 06, 2021 at 02:30:17PM +0200, Auger Eric wrote: >>>> Hi Ri

Re: [PATCH v2 4/5] KVM: selftests: Add exception handling support for aarch64

2021-05-12 Thread Auger Eric
Hi, On 5/12/21 10:33 AM, Marc Zyngier wrote: > On 2021-05-12 09:19, Auger Eric wrote: >> Hi Ricardo, >> >> On 5/12/21 9:27 AM, Ricardo Koller wrote: >>> On Fri, May 07, 2021 at 04:08:07PM +0200, Auger Eric wrote: >>>> Hi Ricardo, >>>> >

Re: [PATCH 15/56] KVM: arm64: Add build rules for separate VHE/nVHE object files

2021-05-18 Thread Auger Eric
Hi David, Marc, On 5/4/21 4:47 PM, Auger Eric wrote: > Hi David, Marc, > > On 8/5/20 7:56 PM, Marc Zyngier wrote: >> From: David Brazdil >> >> Add new folders arch/arm64/kvm/hyp/{vhe,nvhe} and Makefiles for building code >> that runs in EL2 under VHE/nVHE K

Re: [PATCH] Revert "irqbypass: do not start cons/prod when failed connect"

2021-05-09 Thread Auger Eric
Hi, On 5/8/21 11:29 AM, Marc Zyngier wrote: > On Sat, 08 May 2021 08:11:52 +0100, > Zhu Lingshan wrote: >> >> This reverts commit a979a6aa009f3c99689432e0cdb5402a4463fb88. >> >> The reverted commit may cause VM freeze on arm64 platform. >> Because on arm64 platform, stop a consumer will suspend

Re: Question on guest enable msi fail when using GICv4/4.1

2021-05-09 Thread Auger Eric
Hi, On 5/7/21 1:02 PM, Marc Zyngier wrote: > On Fri, 07 May 2021 10:58:23 +0100, > Shaokun Zhang wrote: >> >> Hi Marc, >> >> Thanks for your quick reply. >> >> On 2021/5/7 17:03, Marc Zyngier wrote: >>> On Fri, 07 May 2021 06:57:04 +0100, >>> Shaokun Zhang wrote: [This letter comes

Re: Question on guest enable msi fail when using GICv4/4.1

2021-05-10 Thread Auger Eric
Hi Marc, On 5/10/21 9:49 AM, Marc Zyngier wrote: > Hi Eric, > > On Sun, 09 May 2021 18:00:04 +0100, > Auger Eric wrote: >> >> Hi, >> On 5/7/21 1:02 PM, Marc Zyngier wrote: >>> On Fri, 07 May 2021 10:58:23 +0100, >>> Shaokun Zhang wrote: >>

Re: [PATCH 15/56] KVM: arm64: Add build rules for separate VHE/nVHE object files

2021-05-10 Thread Auger Eric
Hi Marc, On 5/5/21 8:03 PM, Marc Zyngier wrote: > Hi Eric, > > On Tue, 04 May 2021 15:47:36 +0100, > Auger Eric wrote: >> >> Hi David, Marc, >> >> On 8/5/20 7:56 PM, Marc Zyngier wrote: >>> From: David Brazdil >>> >>> Add new f

Re: [PATCH v2 4/5] KVM: selftests: Add exception handling support for aarch64

2021-05-07 Thread Auger Eric
Hi Ricardo, On 5/6/21 9:14 PM, Ricardo Koller wrote: > On Thu, May 06, 2021 at 02:30:17PM +0200, Auger Eric wrote: >> Hi Ricardo, >> > > Hi Eric, > > Thank you very much for the test. > >> On 5/3/21 9:12 PM, Ricardo Koller wrote: >>> On Mon, May 03,

Re: [PATCH v2 4/5] KVM: selftests: Add exception handling support for aarch64

2021-05-06 Thread Auger Eric
Hi Ricardo, On 5/3/21 9:12 PM, Ricardo Koller wrote: > On Mon, May 03, 2021 at 11:32:39AM +0100, Marc Zyngier wrote: >> On Sat, 01 May 2021 00:24:06 +0100, >> Ricardo Koller wrote: >>> >>> Add the infrastructure needed to enable exception handling in aarch64 >>> selftests. The exception handling

Re: [PATCH v2 2/5] KVM: selftests: Introduce UCALL_UNHANDLED for unhandled vector reporting

2021-05-06 Thread Auger Eric
4 to report unhandled vectors as well. >> >> Tested: Forcing a page fault in the ./x86_64/xapic_ipi_test >> halter_guest_code() shows this: >> >> $ ./x86_64/xapic_ipi_test >> ... >>Unexpected vectored event in guest (vector:0xe) >> >&

Re: [PATCH v2 1/5] KVM: selftests: Rename vm_handle_exception

2021-05-06 Thread Auger Eric
Hi Ricardo, On 5/1/21 1:24 AM, Ricardo Koller wrote: > Rename the vm_handle_exception function to a name that indicates more > clearly that it installs something: vm_install_vector_handler. > > Suggested-by: Marc Zyngier > Suggested-by: Andrew Jones > Signed-off-by: Ricardo Koller

Re: [PATCH v3 0/5] KVM: selftests: arm64 exception handling and debug test

2021-05-13 Thread Auger Eric
Hi Ricardo, On 5/13/21 2:27 AM, Ricardo Koller wrote: > Hi, > > These patches add a debug exception test in aarch64 KVM selftests while > also adding basic exception handling support. > > The structure of the exception handling is based on its x86 counterpart. > Tests use the same calls to

Re: [PATCH v3 3/5] KVM: selftests: Move GUEST_ASSERT_EQ to utils header

2021-05-16 Thread Auger Eric
Hi Ricardo, On 5/13/21 2:28 AM, Ricardo Koller wrote: > Move GUEST_ASSERT_EQ to a common header, kvm_util.h, for other > architectures and tests to use. Also modify __GUEST_ASSERT so it can be > reused to implement GUEST_ASSERT_EQ. > > Signed-off-by: Ricardo Koller Reviewed-by: Eric Auger

Re: [kvm-unit-tests PATCH v2 4/4] arm64: split its-migrate-unmapped-collection into KVM and TCG variants

2021-05-26 Thread Auger Eric
Hi Alex, On 5/25/21 7:26 PM, Alex Bennée wrote: > When running the test in TCG we are basically running on bare metal so > don't rely on having a particular kernel errata applied. > > You might wonder why we handle this with a totally new test name > instead of adjusting the append to take an

Re: [kvm-unit-tests PATCH v2 2/4] scripts/arch-run: don't use deprecated server/nowait options

2021-05-26 Thread Auger Eric
igned-off-by: Alex Bennée > Cc: Shashi Mallela Reviewed-by: Eric Auger Eric > --- > scripts/arch-run.bash | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash > index 5997e38..70693f2 100644 > --- a/

Re: [kvm-unit-tests PATCH v2 3/4] arm64: enable its-migration tests for TCG

2021-05-26 Thread Auger Eric
Hi Alex, On 5/25/21 7:26 PM, Alex Bennée wrote: > With the support for TCG emulated GIC we can also test these now. > > Signed-off-by: Alex Bennée > Cc: Shashi Mallela Reviewed-by: Eric Auger Eric > --- > arm/unittests.cfg | 2 -- > 1 file changed, 2 deletions(-)

Re: [kvm-unit-tests PATCH v2 1/4] arm64: remove invalid check from its-trigger test

2021-05-26 Thread Auger Eric
Hi Alex, On 5/25/21 7:26 PM, Alex Bennée wrote: > While an IRQ is not "guaranteed to be visible until an appropriate > invalidation" it doesn't stop the actual implementation delivering it > earlier if it wants to. This is the case for QEMU's TCG and as tests > should only be checking

Re: [PATCH 15/56] KVM: arm64: Add build rules for separate VHE/nVHE object files

2021-05-04 Thread Auger Eric
Hi David, Marc, On 8/5/20 7:56 PM, Marc Zyngier wrote: > From: David Brazdil > > Add new folders arch/arm64/kvm/hyp/{vhe,nvhe} and Makefiles for building code > that runs in EL2 under VHE/nVHE KVM, repsectivelly. Add an include folder for > hyp-specific header files which will include code

Re: [kvm-unit-tests PATCH v1 1/4] arm64: split its-trigger test into KVM and TCG variants

2021-04-28 Thread Auger Eric
Hi, On 4/28/21 4:36 PM, Marc Zyngier wrote: > On Wed, 28 Apr 2021 15:00:15 +0100, > Alexandru Elisei wrote: >> >> I interpret that as that an INVALL guarantees that a change is >> visible, but it the change can become visible even without the >> INVALL. > > Yes. Expecting the LPI to be

Re: [kvm-unit-tests PATCH v3 10/11] arm64: gic: its-trigger: Don't trigger the LPI while it is pending

2021-02-05 Thread Auger Eric
ired after the invalidation. > Leave the check after the INT command to make sure the INT command still > works for the now re-enabled LPI. > > CC: Auger Eric > Suggested-by: Zenghui Yu > Reviewed-by: Andre Przywara > Signed-off-by: Alexandru Elisei Reviewed-by: Eric Au

Re: [kvm-unit-tests PATCH v3 08/11] arm/arm64: gic: Split check_acked() into two functions

2021-02-05 Thread Auger Eric
Hi Alexandru, On 1/29/21 5:36 PM, Alexandru Elisei wrote: > check_acked() has several peculiarities: is the only function among the > check_* functions which calls report() directly, it does two things > (waits for interrupts and checks for misfired interrupts) and it also > mixes printf,

Re: [kvm-unit-tests PATCH v3 11/11] arm64: gic: Use IPI test checking for the LPI tests

2021-02-05 Thread Auger Eric
Hi Alexandru, On 1/29/21 5:36 PM, Alexandru Elisei wrote: > The LPI code validates a result similarly to the IPI tests, by checking if > the target CPU received the interrupt with the expected interrupt number. > However, the LPI tests invent their own way of checking the test results by >

Re: [PATCH v13 03/15] iommu/arm-smmu-v3: Maintain a SID->device structure

2021-02-01 Thread Auger Eric
Hi Keqian, On 2/1/21 1:26 PM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> From: Jean-Philippe Brucker >> >> When handling faults from the event or PRI queue, we need to find the >> struct device associated to a SID. Add a rb_tree to keep track of SIDs. >> >>

Re: [PATCH v13 05/15] iommu/smmuv3: Get prepared for nested stage support

2021-02-11 Thread Auger Eric
Hi Keqian, On 2/2/21 8:14 AM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> When nested stage translation is setup, both s1_cfg and >> s2_cfg are set. >> >> We introduce a new smmu domain abort field that will be set >> upon guest stage1 configuration passing. >> >>

Re: [PATCH v13 06/15] iommu/smmuv3: Implement attach/detach_pasid_table

2021-02-11 Thread Auger Eric
Hi Keqian, On 2/2/21 9:03 AM, Keqian Zhu wrote: > Hi Eric, > > On 2020/11/18 19:21, Eric Auger wrote: >> On attach_pasid_table() we program STE S1 related info set >> by the guest into the actual physical STEs. At minimum >> we need to program the context descriptor GPA and compute >> whether

Re: [PATCH v14 13/13] iommu/smmuv3: Accept configs with more than one context descriptor

2021-04-01 Thread Auger Eric
Hi Shameer, On 4/1/21 2:38 PM, Shameerali Kolothum Thodi wrote: > > >> -Original Message----- >> From: Auger Eric [mailto:eric.au...@redhat.com] >> Sent: 01 April 2021 12:49 >> To: yuzenghui >> Cc: eric.auger@gmail.com; io...@lists.linux-foundation.

Re: [PATCH v4 7/8] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-04-01 Thread Auger Eric
Hi Marc, On 4/1/21 3:42 PM, Marc Zyngier wrote: > Hi Eric, > > On Thu, 01 Apr 2021 09:52:37 +0100, > Eric Auger wrote: >> >> Commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the >> reporting of GICR_TYPER.Last for userspace") temporarily fixed >> a bug identified when attempting to access the

Re: [PATCH v4 7/8] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-04-01 Thread Auger Eric
Hi Marc, On 4/1/21 7:30 PM, Marc Zyngier wrote: > On Thu, 01 Apr 2021 18:03:25 +0100, > Auger Eric wrote: >> >> Hi Marc, >> >> On 4/1/21 3:42 PM, Marc Zyngier wrote: >>> Hi Eric, >>> >>> On Thu, 01 Apr 2021 09:52:37 +0100, >>> E

Re: [PATCH v3 8/8] KVM: selftests: aarch64/vgic-v3 init sequence tests

2021-03-31 Thread Auger Eric
Hi Drew, On 3/22/21 7:32 PM, Andrew Jones wrote: > On Fri, Mar 12, 2021 at 06:32:02PM +0100, Eric Auger wrote: >> The tests exercise the VGIC_V3 device creation including the >> associated KVM_DEV_ARM_VGIC_GRP_ADDR group attributes: >> >> - KVM_VGIC_V3_ADDR_TYPE_DIST/REDIST >> -

Re: [PATCH v5 7/8] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-04-05 Thread Auger Eric
Hi Marc, On 4/5/21 12:10 PM, Marc Zyngier wrote: > On Sun, 04 Apr 2021 18:22:42 +0100, > Eric Auger wrote: >> >> Commit 23bde34771f1 ("KVM: arm64: vgic-v3: Drop the >> reporting of GICR_TYPER.Last for userspace") temporarily fixed >> a bug identified when attempting to access the GICR_TYPER >>

Re: [PATCH v5 0/8] KVM/ARM: Some vgic fixes and init sequence KVM selftests

2021-04-05 Thread Auger Eric
Hi Marc, On 4/5/21 12:12 PM, Marc Zyngier wrote: > Hi Eric, > > On Sun, 04 Apr 2021 18:22:35 +0100, > Eric Auger wrote: >> >> While writting vgic v3 init sequence KVM selftests I noticed some >> relatively minor issues. This was also the opportunity to try to >> fix the issue laterly reported

Re: [PATCH v6 9/9] KVM: selftests: aarch64/vgic-v3 init sequence tests

2021-04-07 Thread Auger Eric
Hi Drew, On 4/6/21 5:09 PM, Andrew Jones wrote: > > Hi Eric, > > It looks like Marc already picked this patch up, but, FWIW, here's > a few more comments you may consider. I will send a fixup patch on top of the one taken my Marc. Few comments below. > > On Mon, Apr 05, 2021 at 06:39:41PM

Re: [PATCH v14 06/13] iommu/smmuv3: Allow stage 1 invalidation with unmanaged ASIDs

2021-04-01 Thread Auger Eric
Hi Zenghui, On 3/30/21 11:17 AM, Zenghui Yu wrote: > On 2021/2/24 4:56, Eric Auger wrote: >> @@ -1936,7 +1950,12 @@ static void >> arm_smmu_tlb_inv_range_domain(unsigned long iova, size_t size, >>   }, >>   }; >>   -    if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { >> +    if

Re: [PATCH v4 1/8] KVM: arm64: vgic-v3: Fix some error codes when setting RDIST base

2021-04-01 Thread Auger Eric
Hi Marc, On 4/1/21 12:52 PM, Marc Zyngier wrote: > Hi Eric, > > On Thu, 01 Apr 2021 09:52:31 +0100, > Eric Auger wrote: >> >> KVM_DEV_ARM_VGIC_GRP_ADDR group doc says we should return >> -EEXIST in case the base address of the redist is already set. >> We currently return -EINVAL. >> >> However

Re: [PATCH v14 13/13] iommu/smmuv3: Accept configs with more than one context descriptor

2021-04-01 Thread Auger Eric
Hi Zenghui, On 3/30/21 11:23 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> In preparation for vSVA, let's accept userspace provided configs >> with more than one CD. We check the max CD against the host iommu >> capability and also the format (linear versus 2

Re: [PATCH v14 07/13] iommu/smmuv3: Implement cache_invalidate

2021-04-01 Thread Auger Eric
Hi Zenghui, On 4/1/21 8:11 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> +static int >> +arm_smmu_cache_invalidate(struct iommu_domain *domain, struct device >> *dev, >> +  struct iommu_cache_invalidate_info *inv_info) >> +{ >> +    struct

Re: [PATCH v3 1/2] KVM: arm64: Reject VM creation when the default IPA size is unsupported

2021-03-11 Thread Auger Eric
Hi Marc, On 3/11/21 11:00 AM, Marc Zyngier wrote: > KVM/arm64 has forever used a 40bit default IPA space, partially > due to its 32bit heritage (where the only choice is 40bit). > > However, there are implementations in the wild that have a *cough* > much smaller *cough* IPA space, which leads

Re: [PATCH 8/9] KVM: arm64: vgic-v3: Expose GICR_TYPER.Last for userspace

2021-03-12 Thread Auger Eric
Hi Alexandru, On 1/20/21 5:13 PM, Alexandru Elisei wrote: > Hi Eric, > > On 1/14/21 10:16 AM, Auger Eric wrote: >> Hi Alexandru, >> >> On 1/12/21 6:02 PM, Alexandru Elisei wrote: >>> Hi Eric, >>> >>> On 12/12/20 6:50 PM, Eric Auger wrote

Re: [PATCH 5/9] KVM: arm: move has_run_once after the map_resources

2021-03-12 Thread Auger Eric
Hi Alexandru, On 1/20/21 4:56 PM, Alexandru Elisei wrote: > Hi Eric, > > On 1/14/21 10:02 AM, Auger Eric wrote: >> Hi Alexandru, >> >> On 1/12/21 3:55 PM, Alexandru Elisei wrote: >>> Hi Eric, >>> >>> On 12/12/20 6:50 PM, Eric Auger wr

Re: [PATCH v2 2/2] KVM: arm64: Fix exclusive limit for IPA size

2021-03-10 Thread Auger Eric
Hi Marc, On 3/10/21 11:42 AM, Marc Zyngier wrote: > When registering a memslot, we check the size and location of that > memslot against the IPA size to ensure that we can provide guest > access to the whole of the memory. > > Unfortunately, this check rejects memslot that end-up at the exact >

Re: [PATCH v2 1/2] KVM: arm64: Reject VM creation when the default IPA size is unsupported

2021-03-10 Thread Auger Eric
Hi Marc, On 3/10/21 11:42 AM, Marc Zyngier wrote: > KVM/arm64 has forever used a 40bit default IPA space, partially > due to its 32bit heritage (where the only choice is 40bit). > > However, there are implementations in the wild that have a *cough* > much smaller *cough* IPA space, which leads

Re: [kvm-unit-tests PATCH v4 11/11] arm64: gic: Use IPI test checking for the LPI tests

2021-03-12 Thread Auger Eric
Hi Alexandru, On 2/19/21 1:13 PM, Alexandru Elisei wrote: > The LPI code validates a result similarly to the IPI tests, by checking if > the target CPU received the interrupt with the expected interrupt number. > However, the LPI tests invent their own way of checking the test results by >

Re: [PATCH v13 00/15] SMMUv3 Nested Stage Setup (IOMMU part)

2021-03-16 Thread Auger Eric
Hi Krishna, On 3/15/21 7:04 PM, Krishna Reddy wrote: > Tested-by: Krishna Reddy > >> 1) pass the guest stage 1 configuration > > Validated Nested SMMUv3 translations for NVMe PCIe device from Guest VM along > with patch series "v11 SMMUv3 Nested Stage Setup (VFIO part)" and QEMU patch >

Re: [PATCH v14 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2021-03-19 Thread Auger Eric
Hi Krishna, On 3/18/21 1:16 AM, Krishna Reddy wrote: > Tested-by: Krishna Reddy > > Validated nested translations with NVMe PCI device assigned to Guest VM. > Tested with both v12 and v13 of Jean-Philippe's patches as base. Many thanks for that. > >> This is based on Jean-Philippe's >>

Re: [PATCH v14 05/13] iommu/smmuv3: Implement attach/detach_pasid_table

2021-03-19 Thread Auger Eric
Hi Keqian, On 3/2/21 9:35 AM, Keqian Zhu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> On attach_pasid_table() we program STE S1 related info set >> by the guest into the actual physical STEs. At minimum >> we need to program the context descriptor GPA and compute >> whether the

Re: [Linuxarm] Re: [PATCH v14 07/13] iommu/smmuv3: Implement cache_invalidate

2021-03-22 Thread Auger Eric
Hi Chenxiang, On 3/22/21 7:40 AM, chenxiang (M) wrote: > Hi Eric, > > > 在 2021/3/20 1:36, Auger Eric 写道: >> Hi Chenxiang, >> >> On 3/4/21 8:55 AM, chenxiang (M) wrote: >>> Hi Eric, >>> >>> >>> 在 2021/2/24 4:56, Eric Auger 写道: &

Re: [PATCH v14 07/13] iommu/smmuv3: Implement cache_invalidate

2021-03-19 Thread Auger Eric
Hi Chenxiang, On 3/4/21 8:55 AM, chenxiang (M) wrote: > Hi Eric, > > > 在 2021/2/24 4:56, Eric Auger 写道: >> Implement domain-selective, pasid selective and page-selective >> IOTLB invalidations. >> >> Signed-off-by: Eric Auger >> >> --- >> >> v13 -> v14: >> - Add domain invalidation >> - do

Re: [PATCH v14 00/13] SMMUv3 Nested Stage Setup (IOMMU part)

2021-02-25 Thread Auger Eric
Hi Shameer, all On 2/23/21 9:56 PM, Eric Auger wrote: > This series brings the IOMMU part of HW nested paging support > in the SMMUv3. The VFIO part is submitted separately. > > This is based on Jean-Philippe's > [PATCH v12 00/10] iommu: I/O page faults for SMMUv3 >

Re: [PATCH v12 03/13] vfio: VFIO_IOMMU_SET_MSI_BINDING

2021-03-08 Thread Auger Eric
Hi Jean, On 3/5/21 11:45 AM, Jean-Philippe Brucker wrote: > Hi, > > On Tue, Feb 23, 2021 at 10:06:15PM +0100, Eric Auger wrote: >> This patch adds the VFIO_IOMMU_SET_MSI_BINDING ioctl which aim >> to (un)register the guest MSI binding to the host. This latter >> then can use those stage 1

<    3   4   5   6   7   8   9   >