Re: [PATCH v3 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412

2020-07-31 Thread Rob Herring
On Wed, Jul 29, 2020 at 10:38 AM Catalin Marinas wrote: > > On Fri, Jul 17, 2020 at 02:52:33PM -0600, Rob Herring wrote: > > diff --git a/arch/arm64/include/asm/kvm_hyp.h > > b/arch/arm64/include/asm/kvm_hyp.h > > index ce3080834bfa..ce5b0d9b12bf 100644 > > --- a/arch/arm64/include/asm/kvm_hyp.h

Re: [PATCH v3 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412

2020-07-31 Thread Rob Herring
On Thu, Jul 30, 2020 at 2:22 AM Will Deacon wrote: > > On Wed, Jul 29, 2020 at 05:38:00PM +0100, Catalin Marinas wrote: > > On Fri, Jul 17, 2020 at 02:52:33PM -0600, Rob Herring wrote: > > > diff --git a/arch/arm64/include/asm/kvm_hyp.h > > > b/arch/arm64/include/asm/kvm_hyp.h > > > index ce30808

Re: [PATCH 2/2] KVM: arm64: nVHE: Don't consume host SErrors with RAS

2020-07-31 Thread Andrew Scull
On Fri, Jul 31, 2020 at 09:00:03AM +0100, Marc Zyngier wrote: > Hi Andrew, > > On 2020-07-30 23:31, Andrew Scull wrote: > > On Thu, Jul 30, 2020 at 04:18:23PM +0100, Andrew Scull wrote: > > > The ESB at the start of the vectors causes any SErrors to be > > > consumed to > > > DISR_EL1. If the exce

Re: [PATCH 02/20] KVM: arm64: Add support for creating kernel-agnostic stage-1 page tables

2020-07-31 Thread Quentin Perret
On Friday 31 Jul 2020 at 09:36:06 (+0100), Quentin Perret wrote: > On Friday 31 Jul 2020 at 09:22:15 (+0100), Will Deacon wrote: > > No, I think you're right. The hyp stage-1 PGD is always a single page, so I > > can simplify the free() path. > > OK, cool. The current code does support concatenate

Re: [PATCH 02/20] KVM: arm64: Add support for creating kernel-agnostic stage-1 page tables

2020-07-31 Thread Quentin Perret
On Friday 31 Jul 2020 at 09:22:15 (+0100), Will Deacon wrote: > No, I think you're right. The hyp stage-1 PGD is always a single page, so I > can simplify the free() path. OK, cool. The current code does support concatenated pgds for the hyp stage 1, which is what confused me. Would you mind addin

Re: [PATCH 02/20] KVM: arm64: Add support for creating kernel-agnostic stage-1 page tables

2020-07-31 Thread Quentin Perret
On Friday 31 Jul 2020 at 09:14:36 (+0100), Quentin Perret wrote: > Hey Will, > > On Thursday 30 Jul 2020 at 16:33:48 (+0100), Will Deacon wrote: > > +void *kvm_pgtable_hyp_alloc_cookie(u32 va_bits) > > +{ > > + struct kvm_pgtable *pgt = kzalloc(sizeof(*pgt), GFP_KERNEL); > > + > > + if (!pgt)

Re: [PATCH 02/20] KVM: arm64: Add support for creating kernel-agnostic stage-1 page tables

2020-07-31 Thread Quentin Perret
Hey Will, On Thursday 30 Jul 2020 at 16:33:48 (+0100), Will Deacon wrote: > +void *kvm_pgtable_hyp_alloc_cookie(u32 va_bits) > +{ > + struct kvm_pgtable *pgt = kzalloc(sizeof(*pgt), GFP_KERNEL); > + > + if (!pgt) > + return NULL; > + > + pgt->ia_bits = va_bits; > + pgt-

Re: [kvm-unit-tests PATCH v3 00/10] arm/arm64: Add IPI/LPI/vtimer latency test

2020-07-31 Thread Andrew Jones
On Fri, Jul 31, 2020 at 03:42:34PM +0800, Jingyi Wang wrote: > With the development of arm gic architecture, we think it will be useful > to add some performance test in kut to measure the cost of interrupts. > In this series, we add GICv4.1 support for ipi latency test and > implement LPI/vtimer l

Re: [GIT PULL] KVM/arm64 fixes for 5.8, take #4

2020-07-31 Thread Paolo Bonzini
On 28/07/20 10:22, Marc Zyngier wrote: > Hi Paolo, > > This is the last batch of fixes for 5.8. One fixes a long standing MMU > issue, while the other addresses a more recent brekage with out-of-line > helpers in the nVHE code. > > Please pull, > > M. > > The following changes since commi

Re: [PATCH 02/20] KVM: arm64: Add support for creating kernel-agnostic stage-1 page tables

2020-07-31 Thread Will Deacon
On Fri, Jul 31, 2020 at 09:19:11AM +0100, Quentin Perret wrote: > On Friday 31 Jul 2020 at 09:14:36 (+0100), Quentin Perret wrote: > > On Thursday 30 Jul 2020 at 16:33:48 (+0100), Will Deacon wrote: > > > +void *kvm_pgtable_hyp_alloc_cookie(u32 va_bits) > > > +{ > > > + struct kvm_pgtable *pgt = kz

Re: [Question] the check of ioeventfd collision in kvm_*assign_ioeventfd_idx

2020-07-31 Thread Zhenyu Ye
On 2020/7/31 14:44, Paolo Bonzini wrote: > On 31/07/20 08:39, Zhenyu Ye wrote: >> On 2020/7/31 2:03, Paolo Bonzini wrote: >>> Yes, I think it's not needed. Probably the deassign check can be turned >>> into an assertion? >>> >>> Paolo >>> >> >> I think we can do this in the same function, and turn

[kvm-unit-tests PATCH v3 05/10] arm64: microbench: its: Add LPI latency test

2020-07-31 Thread Jingyi Wang
Triggers LPIs through the INT command and test the latency. Mostly inherited form commit 0ef02cd6cbaa(arm/arm64: ITS: INT functional tests). Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger --- arm/micro-bench.c | 44 1 file changed, 44 insertions(

Re: [PATCH 2/2] KVM: arm64: nVHE: Don't consume host SErrors with RAS

2020-07-31 Thread Marc Zyngier
Hi Andrew, On 2020-07-30 23:31, Andrew Scull wrote: On Thu, Jul 30, 2020 at 04:18:23PM +0100, Andrew Scull wrote: The ESB at the start of the vectors causes any SErrors to be consumed to DISR_EL1. If the exception came from the host and the ESB caught an SError, it would not be noticed until a

[kvm-unit-tests PATCH v3 10/10] arm64: microbench: Add timer_post() to get actual PPI latency

2020-07-31 Thread Jingyi Wang
For we get the time duration of (10msec timer + injection latency) in timer_exec(), we substract the value of 10msec in timer_post() to get the actual latency. Signed-off-by: Jingyi Wang --- arm/micro-bench.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arm/

[kvm-unit-tests PATCH v3 07/10] arm64: microbench: Add time limit for each individual test

2020-07-31 Thread Jingyi Wang
Besides using separate running times parameter, we add time limit for loop_test to make sure each test should be done in a certain time(5 sec here). Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger --- arm/micro-bench.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-)

[kvm-unit-tests PATCH v3 06/10] arm64: microbench: Allow each test to specify its running times

2020-07-31 Thread Jingyi Wang
For some test in micro-bench can be time consuming, we add a micro-bench test parameter to allow each individual test to specify its running times. Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger --- arm/micro-bench.c | 27 ++- 1 file changed, 14 insertions(+), 13 del

[kvm-unit-tests PATCH v3 03/10] arm64: microbench: gic: Add ipi latency test for gicv4.1 support kvm

2020-07-31 Thread Jingyi Wang
If gicv4.1(sgi hardware injection) is supported in kvm, we test ipi injection via hw/sw way separately. Signed-off-by: Jingyi Wang --- arm/micro-bench.c| 62 ++-- lib/arm/asm/gic-v3.h | 3 +++ lib/arm/asm/gic.h| 1 + 3 files changed, 58 insertion

[kvm-unit-tests PATCH v3 04/10] arm64: its: Handle its command queue wrapping

2020-07-31 Thread Jingyi Wang
Because micro-bench may send a large number of ITS commands, we should handle ITS command queue wrapping as kernel instead of just failing the test. Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger --- lib/arm64/gic-v3-its-cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --

[kvm-unit-tests PATCH v3 08/10] arm64: microbench: Add vtimer latency test

2020-07-31 Thread Jingyi Wang
Trigger PPIs by setting up a 10msec timer and test the latency. Signed-off-by: Jingyi Wang --- arm/micro-bench.c | 53 ++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/arm/micro-bench.c b/arm/micro-bench.c index 09d9d53..1e1bde5 100644

[kvm-unit-tests PATCH v3 00/10] arm/arm64: Add IPI/LPI/vtimer latency test

2020-07-31 Thread Jingyi Wang
With the development of arm gic architecture, we think it will be useful to add some performance test in kut to measure the cost of interrupts. In this series, we add GICv4.1 support for ipi latency test and implement LPI/vtimer latency test. This series of patches has been tested on GICv4.1 suppo

[kvm-unit-tests PATCH v3 09/10] arm64: microbench: Add test->post() to further process test results

2020-07-31 Thread Jingyi Wang
Under certain circumstances, we need to further process microbench test results, so we add test->post() in the microbench framework, later patch will use that. Signed-off-by: Jingyi Wang --- arm/micro-bench.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-)

[kvm-unit-tests PATCH v3 01/10] arm64: microbench: get correct ipi received num

2020-07-31 Thread Jingyi Wang
If ipi_exec() fails because of timeout, we shouldn't increase the number of ipi received. Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger --- arm/micro-bench.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arm/micro-bench.c b/arm/micro-bench.c index 4612f41..794dfac

[kvm-unit-tests PATCH v3 02/10] arm64: microbench: Generalize ipi test names

2020-07-31 Thread Jingyi Wang
Later patches will use these functions for gic(ipi/lpi/timer) tests. Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger --- arm/micro-bench.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/arm/micro-bench.c b/arm/micro-bench.c index