RE: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Tuesday, September 4, 2018 5:53 PM > > On 04/09/2018 09:41, Auger Eric wrote: > > I think the confusion comes from the different terminology used in VTD > > and ARM SMMU spec. > > > > Your PASID table ~ ARM SMMU Context

[PATCH] KVM: arm/arm64: Check memslot bounds before mapping hugepages

2018-09-04 Thread Lukas Braun
Userspace can create a memslot with memory backed by (transparent) hugepages, but with bounds that do not align with hugepages. In that case, we cannot map the entire region in the guest as hugepages without exposing additional host memory to the guest and potentially interfering with other

[PATCH kvm-unit-tests v3 1/2] arm/arm64: add GICD_IIDR definition

2018-09-04 Thread Andrew Jones
From: Shih-Wei Li Signed-off-by: Shih-Wei Li Signed-off-by: Andrew Jones --- lib/arm/asm/gic.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/arm/asm/gic.h b/lib/arm/asm/gic.h index 2eb4af8d6c81..3b9982b0e7b5 100644 --- a/lib/arm/asm/gic.h +++ b/lib/arm/asm/gic.h @@ -10,6 +10,7 @@

[PATCH kvm-unit-tests v3 0/2] Support micro operation measurement on arm64

2018-09-04 Thread Andrew Jones
I dropped the version numbers, but this is v4 of Shih-Wei Li's series of the same name, last posted in January. I took the liberty of incorporating all the comments v3 had, plus making some other cleanup tweaks. These tests are too nice to let them slip away, let's get them reviewed and merged.

[PATCH kvm-unit-tests v3 2/2] arm64: add micro-bench

2018-09-04 Thread Andrew Jones
From: Shih-Wei Li Here we provide the support for measuring various micro level operations on arm64. Measurements are currently obtained using timer counters. Further modifications in KVM will be required to support timestamping using cycle counters, as KVM now disables accesses to the PMU

Re: [PATCH kvm-unit-tests 2/2] arm64: add micro-bench

2018-09-04 Thread Andrew Jones
On Tue, Sep 04, 2018 at 11:02:43AM -0400, Shih-Wei Li wrote: > I've tested patch v2 along with the fix in the switch case. The > performance numbers look sane on my seattle server. > > Tested-by: Shih-Wei Li Thanks Shih-Wei. I'll send v3 now with the breaks and add yours and Christoffer's

Re: [PATCH kvm-unit-tests 2/2] arm64: add micro-bench

2018-09-04 Thread Shih-Wei Li
I've tested patch v2 along with the fix in the switch case. The performance numbers look sane on my seattle server. Tested-by: Shih-Wei Li Thanks, Shih-Wei On Mon, Sep 3, 2018 at 11:38 PM, Shih-Wei Li wrote: > On Mon, Sep 3, 2018 at 12:31 PM, Andrew Jones wrote: >> On Mon, Sep 03, 2018 at

Re: [PATCH kvm-unit-tests v2] arm/arm64: gicv3: support up to 8 redistributor regions regions

2018-09-04 Thread Andrew Jones
On Tue, Sep 04, 2018 at 03:29:26PM +0200, Christoffer Dall wrote: > On Tue, Sep 04, 2018 at 10:13:36AM +0200, Andrew Jones wrote: > > We need to support at least two redistributor regions in order to > > support more than 123 vcpus (we select 8 because that should be > > plenty). Also bump NR_CPUS

Re: [PATCH] KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW

2018-09-04 Thread Christoffer Dall
On Tue, Sep 04, 2018 at 12:07:37PM +0100, Punit Agrawal wrote: > Christoffer Dall writes: > > > On Mon, Sep 03, 2018 at 06:29:30PM +0100, Punit Agrawal wrote: > >> Christoffer Dall writes: > >> > >> > [Adding Andrea and Steve in CC] > >> > > >> > On Thu, Aug 23, 2018 at 04:33:42PM +0100, Marc

Re: [PATCH kvm-unit-tests v2 0/2] Support micro operation measurement on arm64

2018-09-04 Thread Christoffer Dall
On Mon, Sep 03, 2018 at 02:20:00PM +0200, Andrew Jones wrote: > I dropped the version numbers, but this is v4 of Shih-Wei Li's series of > the same name, last posted in January. I took the liberty of > incorporating all the comments v3 had, plus making some other cleanup > tweaks. These tests are

Re: [PATCH kvm-unit-tests v2] arm/arm64: gicv3: support up to 8 redistributor regions regions

2018-09-04 Thread Christoffer Dall
On Tue, Sep 04, 2018 at 10:13:36AM +0200, Andrew Jones wrote: > We need to support at least two redistributor regions in order to > support more than 123 vcpus (we select 8 because that should be > plenty). Also bump NR_CPUS to 512, since that's what KVM currently > supports. > > Signed-off-by:

Re: [PULL 2/4] arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD

2018-09-04 Thread Christoffer Dall
On Tue, Sep 04, 2018 at 12:39:54PM +0100, Dave Martin wrote: > On Mon, Sep 03, 2018 at 03:45:14PM +0200, Christoffer Dall wrote: > > From: Marc Zyngier > > > > If trapping FPSIMD in the context of an AArch32 guest, it is critical > > to set FPEXC32_EL2.EN to 1 so that the trapping is taken to

Re: [PULL 2/4] arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD

2018-09-04 Thread Dave Martin
On Mon, Sep 03, 2018 at 03:45:14PM +0200, Christoffer Dall wrote: > From: Marc Zyngier > > If trapping FPSIMD in the context of an AArch32 guest, it is critical > to set FPEXC32_EL2.EN to 1 so that the trapping is taken to EL2 and > not EL1. > > Conversely, it is just as critical *not* to set

Re: [PATCH] KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW

2018-09-04 Thread Punit Agrawal
Christoffer Dall writes: > On Mon, Sep 03, 2018 at 06:29:30PM +0100, Punit Agrawal wrote: >> Christoffer Dall writes: >> >> > [Adding Andrea and Steve in CC] >> > >> > On Thu, Aug 23, 2018 at 04:33:42PM +0100, Marc Zyngier wrote: >> >> When triggering a CoW, we unmap the RO page via an MMU

Re: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Jean-Philippe Brucker
On 04/09/2018 09:41, Auger Eric wrote: > I think the confusion comes from the different terminology used in VTD > and ARM SMMU spec. > > Your PASID table ~ ARM SMMU Context Descriptor (CD) table > Your Root Entry/Context Entry ~ ARM SMMU Stream Table Entry (STE) In past discussions we used

Re: [PATCH] KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW

2018-09-04 Thread Christoffer Dall
On Mon, Sep 03, 2018 at 06:29:30PM +0100, Punit Agrawal wrote: > Christoffer Dall writes: > > > [Adding Andrea and Steve in CC] > > > > On Thu, Aug 23, 2018 at 04:33:42PM +0100, Marc Zyngier wrote: > >> When triggering a CoW, we unmap the RO page via an MMU notifier > >>

RE: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Tian, Kevin
> From: Auger Eric > Sent: Tuesday, September 4, 2018 4:11 PM > > Hi Kevin, > On 09/04/2018 09:57 AM, Tian, Kevin wrote: > >> From: Auger Eric > >> Sent: Friday, August 31, 2018 9:52 PM > >> > >> Hi Jean-Philippe, > >> > >> On 08/31/2018 03:11 PM, Jean-Philippe Brucker wrote: > >>> Hi Eric, > >>>

RE: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Tian, Kevin
> From: Auger Eric > Sent: Tuesday, September 4, 2018 4:41 PM > > Hi Kevin, > > On 09/04/2018 10:34 AM, Tian, Kevin wrote: > >> From: Auger Eric > >> Sent: Tuesday, September 4, 2018 4:11 PM > >> > >> Hi Kevin, > >> On 09/04/2018 09:57 AM, Tian, Kevin wrote: > From: Auger Eric > Sent:

RE: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Tian, Kevin
> From: Auger Eric > Sent: Friday, August 31, 2018 9:52 PM > > Hi Jean-Philippe, > > On 08/31/2018 03:11 PM, Jean-Philippe Brucker wrote: > > Hi Eric, > > > > On 23/08/18 16:25, Auger Eric wrote: > >>> +int iommu_bind_guest_stage(struct iommu_domain *domain, struct > device *dev, > >>> +

Re: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Auger Eric
Hi Kevin, On 09/04/2018 10:34 AM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Tuesday, September 4, 2018 4:11 PM >> >> Hi Kevin, >> On 09/04/2018 09:57 AM, Tian, Kevin wrote: From: Auger Eric Sent: Friday, August 31, 2018 9:52 PM Hi Jean-Philippe, On 08/31/2018

[PATCH kvm-unit-tests v2] arm/arm64: gicv3: support up to 8 redistributor regions regions

2018-09-04 Thread Andrew Jones
We need to support at least two redistributor regions in order to support more than 123 vcpus (we select 8 because that should be plenty). Also bump NR_CPUS to 512, since that's what KVM currently supports. Signed-off-by: Andrew Jones --- v2: - Peter asked if it would be neater to be more

Re: [RFC 01/13] iommu: Introduce bind_guest_stage API

2018-09-04 Thread Auger Eric
Hi Kevin, On 09/04/2018 09:57 AM, Tian, Kevin wrote: >> From: Auger Eric >> Sent: Friday, August 31, 2018 9:52 PM >> >> Hi Jean-Philippe, >> >> On 08/31/2018 03:11 PM, Jean-Philippe Brucker wrote: >>> Hi Eric, >>> >>> On 23/08/18 16:25, Auger Eric wrote: > +int iommu_bind_guest_stage(struct

Re: [PATCH kvm-unit-tests] arm/arm64: gicv3: support two redistributor regions

2018-09-04 Thread Andrew Jones
On Tue, Sep 04, 2018 at 01:49:11AM +0100, Peter Maydell wrote: > On 3 September 2018 at 17:45, Andrew Jones wrote: > > We need to support two redistributor regions in order to support > > more than 123 vcpus. Also bump NR_CPUS to 512, since that's what > > KVM currently supports. > > Wouldn't it