Re: [PATCH v2 2/2] KVM: arm64: Document PMU filtering API

2020-03-09 Thread Auger Eric
Hi Marc, On 3/9/20 1:48 PM, Marc Zyngier wrote: > Add a small blurb describing how the event filtering API gets used. > > Signed-off-by: Marc Zyngier > --- > Documentation/virt/kvm/devices/vcpu.rst | 40 + > 1 file changed, 40 insertions(+) > > diff --git a/Documentatio

Re: [PATCH v2 1/2] KVM: arm64: Add PMU event filtering infrastructure

2020-03-09 Thread Auger Eric
Hi Marc, On 3/9/20 1:48 PM, Marc Zyngier wrote: > It can be desirable to expose a PMU to a guest, and yet not want the > guest to be able to count some of the implemented events (because this > would give information on shared resources, for example. > > For this, let's extend the PMUv3 device AP

Re: [PATCH 12/18] arm64: kernel: Convert to modern annotations for assembly functions

2020-03-09 Thread Mark Brown
On Mon, Mar 09, 2020 at 05:52:03PM +, Catalin Marinas wrote: > I queued this series for 5.7, apart from patch 12. I'll try to fix any > conflicts with whatever patches I'm adding but may drop some of them if > they conflict badly with code in -next (not likely). We'll revisit at > -rc1 to see

Re: [PATCH 12/18] arm64: kernel: Convert to modern annotations for assembly functions

2020-03-09 Thread Catalin Marinas
On Fri, Feb 28, 2020 at 03:22:19PM +, Mark Brown wrote: > On Fri, Feb 28, 2020 at 01:37:18PM +, Catalin Marinas wrote: > > I wonder whether it would be easier to merge all these patches at > > 5.7-rc1, once most of the major changes went in. > > Only thing I can think that doing that might

[PATCH v2 2/2] KVM: arm64: Document PMU filtering API

2020-03-09 Thread Marc Zyngier
Add a small blurb describing how the event filtering API gets used. Signed-off-by: Marc Zyngier --- Documentation/virt/kvm/devices/vcpu.rst | 40 + 1 file changed, 40 insertions(+) diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcp

[PATCH v2 1/2] KVM: arm64: Add PMU event filtering infrastructure

2020-03-09 Thread Marc Zyngier
It can be desirable to expose a PMU to a guest, and yet not want the guest to be able to count some of the implemented events (because this would give information on shared resources, for example. For this, let's extend the PMUv3 device API, and offer a way to setup a bitmap of the allowed events

[PATCH v2 0/2] KVM: arm64: Filtering PMU events

2020-03-09 Thread Marc Zyngier
It is at times necessary to prevent a guest from being able to sample certain events if multiple CPUs share resources such as a cache level. In this case, it would be interesting if the VMM could simply prevent certain events from being counted instead of hiding the PMU. Given that most events are

Re: [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add ITS tests

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 12:57:51PM +0100, Andrew Jones wrote: > This looks pretty good to me. It just needs some resquashing cleanups. > Does Andre plan to review? I've only been reviewing with respect to > the framework, not ITS. If no other reviews are expected, then I'll > queue the next version

Re: [kvm-unit-tests PATCH v4 00/13] arm/arm64: Add ITS tests

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 11:24:07AM +0100, Eric Auger wrote: > This series is a revival of an RFC series sent in Dec 2016 [1]. > Given the amount of code and the lack of traction at that time, > I haven't respinned until now. However a recent bug found related > to the ITS migration convinced me tha

Re: [kvm-unit-tests PATCH v4 07/13] arm/arm64: ITS: its_enable_defaults

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 12:45:34PM +0100, Auger Eric wrote: > >> - for_each_present_cpu(cpu) { > >> + for (cpu = 0; cpu < nr_cpus; cpu++) { > > > > You don't mention this change in the changelog. > Hey, you can see the changelog is pretty long already & accurate. But > you're right I missed that

Re: [kvm-unit-tests PATCH v4 06/13] arm/arm64: ITS: Introspection tests

2020-03-09 Thread Auger Eric
Hi, On 3/9/20 12:19 PM, Andrew Jones wrote: > On Mon, Mar 09, 2020 at 11:24:13AM +0100, Eric Auger wrote: >> Detect the presence of an ITS as part of the GICv3 init >> routine, initialize its base address and read few registers >> the IIDR, the TYPER to store its dimensioning parameters. >> Parse

Re: [RFC] KVM: arm64: support enabling dirty log graually in small chunks

2020-03-09 Thread Marc Zyngier
Kegian, In the future, please Cc me on your KVM/arm64 patches, as well as all the reviewers mentioned in the MAINTAINERS file. On 2020-03-09 08:57, Keqian Zhu wrote: There is already support of enabling dirty log graually gradually? in small chunks for x86. This adds support for arm64. Un

Re: [kvm-unit-tests PATCH v4 07/13] arm/arm64: ITS: its_enable_defaults

2020-03-09 Thread Auger Eric
Hi Drew, On 3/9/20 12:39 PM, Andrew Jones wrote: > On Mon, Mar 09, 2020 at 11:24:14AM +0100, Eric Auger wrote: >> its_enable_defaults() enable LPIs at distributor level >> and ITS level. >> >> gicv3_enable_defaults must be called before. >> >> Signed-off-by: Eric Auger >> >> --- >> v3 -> v4: >> -

Re: [kvm-unit-tests PATCH v4 10/13] arm/arm64: ITS: INT functional tests

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 11:24:17AM +0100, Eric Auger wrote: ... > diff --git a/lib/arm/asm/gic-v3-its.h b/lib/arm/asm/gic-v3-its.h > index 0096de6..956d7b8 100644 > --- a/lib/arm/asm/gic-v3-its.h > +++ b/lib/arm/asm/gic-v3-its.h > @@ -5,9 +5,8 @@ > * > * This work is licensed under the terms of

Re: [kvm-unit-tests PATCH v4 07/13] arm/arm64: ITS: its_enable_defaults

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 11:24:14AM +0100, Eric Auger wrote: > its_enable_defaults() enable LPIs at distributor level > and ITS level. > > gicv3_enable_defaults must be called before. > > Signed-off-by: Eric Auger > > --- > v3 -> v4: > - use GITS_BASER_INDIRECT & GITS_BASER_VALID in its_setup_ba

Re: [kvm-unit-tests PATCH v4 07/13] arm/arm64: ITS: its_enable_defaults

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 11:24:14AM +0100, Eric Auger wrote: > its_enable_defaults() enable LPIs at distributor level > and ITS level. > > gicv3_enable_defaults must be called before. > > Signed-off-by: Eric Auger > > --- > v3 -> v4: > - use GITS_BASER_INDIRECT & GITS_BASER_VALID in its_setup_ba

Re: [kvm-unit-tests PATCH v4 06/13] arm/arm64: ITS: Introspection tests

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 11:24:13AM +0100, Eric Auger wrote: > Detect the presence of an ITS as part of the GICv3 init > routine, initialize its base address and read few registers > the IIDR, the TYPER to store its dimensioning parameters. > Parse the BASER registers. As part of the init sequence w

Re: [kvm-unit-tests PATCH v4 03/13] arm/arm64: gic: Introduce setup_irq() helper

2020-03-09 Thread Andrew Jones
On Mon, Mar 09, 2020 at 11:24:10AM +0100, Eric Auger wrote: > ipi_enable() code would be reusable for other interrupts > than IPI. Let's rename it setup_irq() and pass an interrupt > handler pointer. > > Signed-off-by: Eric Auger > > --- > > v2 -> v3: > - do not export setup_irq anymore > --- >

[kvm-unit-tests PATCH v4 12/13] arm/arm64: ITS: migration tests

2020-03-09 Thread Eric Auger
This test maps LPIs (populates the device table, the collection table, interrupt translation tables, configuration table), migrates and make sure the translation is correct on the destination. Signed-off-by: Eric Auger --- v3 -> v4: - assert in its_get_device/collection if the id is not found -

[kvm-unit-tests PATCH v4 04/13] arm/arm64: gicv3: Add some re-distributor defines

2020-03-09 Thread Eric Auger
PROPBASER, PENDBASE and GICR_CTRL will be used for LPI management. Signed-off-by: Eric Auger Reviewed-by: Zenghui Yu --- v3 -> v4: - replace some spaces by tabs and added Zenghui's R-b --- lib/arm/asm/gic-v3.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/arm/asm/gic-v3.h b/li

[kvm-unit-tests PATCH v4 10/13] arm/arm64: ITS: INT functional tests

2020-03-09 Thread Eric Auger
Triggers LPIs through the INT command. the test checks the LPI hits the right CPU and triggers the right LPI intid, ie. the translation is correct. Updates to the config table also are tested, along with inv and invall commands. Signed-off-by: Eric Auger --- v3 -> v4: - assert in lpi_handler

[kvm-unit-tests PATCH v4 13/13] arm/arm64: ITS: pending table migration test

2020-03-09 Thread Eric Auger
Add two new migration tests. One testing the migration of a topology where collection were unmapped. The second test checks the migration of the pending table. Signed-off-by: Eric Auger --- v3 -> v4: - do not talk about odd/even CPUs, use pe0 and pe1 - comment the delay v2 -> v3: - tests belon

[kvm-unit-tests PATCH v4 07/13] arm/arm64: ITS: its_enable_defaults

2020-03-09 Thread Eric Auger
its_enable_defaults() enable LPIs at distributor level and ITS level. gicv3_enable_defaults must be called before. Signed-off-by: Eric Auger --- v3 -> v4: - use GITS_BASER_INDIRECT & GITS_BASER_VALID in its_setup_baser() - don't parse BASERs again in its_enable_defaults - rename its_setup_baser

[kvm-unit-tests PATCH v4 09/13] arm/arm64: ITS: Commands

2020-03-09 Thread Eric Auger
Implement main ITS commands. The code is largely inherited from the ITS driver. Signed-off-by: Eric Auger --- v3 -> v4: - device's itt now is a VGA - pass verbose to choose whether we shall print the cmd - use printf instead of report_info v2 -> v3: - do not use report() anymore - assert if cm

[kvm-unit-tests PATCH v4 01/13] libcflat: Add other size defines

2020-03-09 Thread Eric Auger
Introduce additional SZ_256, SZ_8K, SZ_16K macros that will be used by ITS tests. Signed-off-by: Eric Auger Reviewed-by: Thomas Huth --- lib/libcflat.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libcflat.h b/lib/libcflat.h index ea19f61..7092af2 100644 --- a/lib/libcflat.h +++ b

[kvm-unit-tests PATCH v4 06/13] arm/arm64: ITS: Introspection tests

2020-03-09 Thread Eric Auger
Detect the presence of an ITS as part of the GICv3 init routine, initialize its base address and read few registers the IIDR, the TYPER to store its dimensioning parameters. Parse the BASER registers. As part of the init sequence we also init all the requested tables. This is our first ITS test, b

[kvm-unit-tests PATCH v4 05/13] arm/arm64: gicv3: Set the LPI config and pending tables

2020-03-09 Thread Eric Auger
Allocate the LPI configuration and per re-distributor pending table. Set redistributor's PROPBASER and PENDBASER. The LPIs are enabled by default in the config table. Also introduce a helper routine that allows to set the pending table bit for a given LPI. Signed-off-by: Eric Auger --- v2 -> v

[kvm-unit-tests PATCH v4 08/13] arm/arm64: ITS: Device and collection Initialization

2020-03-09 Thread Eric Auger
Introduce an helper functions to register - a new device, characterized by its device id and the max number of event IDs that dimension its ITT (Interrupt Translation Table). The function allocates the ITT. - a new collection, characterized by its ID and the target processing engine (PE).

[kvm-unit-tests PATCH v4 00/13] arm/arm64: Add ITS tests

2020-03-09 Thread Eric Auger
This series is a revival of an RFC series sent in Dec 2016 [1]. Given the amount of code and the lack of traction at that time, I haven't respinned until now. However a recent bug found related to the ITS migration convinced me that this work may deserve to be respinned and enhanced. Tests exercis

[kvm-unit-tests PATCH v4 03/13] arm/arm64: gic: Introduce setup_irq() helper

2020-03-09 Thread Eric Auger
ipi_enable() code would be reusable for other interrupts than IPI. Let's rename it setup_irq() and pass an interrupt handler pointer. Signed-off-by: Eric Auger --- v2 -> v3: - do not export setup_irq anymore --- arm/gic.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions

[kvm-unit-tests PATCH v4 02/13] page_alloc: Introduce get_order()

2020-03-09 Thread Eric Auger
Compute the power of 2 order of a size. Use it in page_memalign. Other users are looming. Signed-off-by: Eric Auger --- lib/alloc_page.c | 7 ++- lib/alloc_page.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/alloc_page.c b/lib/alloc_page.c index ed23638..7c8461a 1

[kvm-unit-tests PATCH v4 11/13] arm/run: Allow Migration tests

2020-03-09 Thread Eric Auger
Let's link getchar.o to use puts and getchar from the tests. Then allow tests belonging to the migration group to trigger the migration from the test code by putting "migrate" into the uart. Then the code can wait for the migration completion by using getchar(). The __getchar implement is minimal

[RFC] KVM: arm64: support enabling dirty log graually in small chunks

2020-03-09 Thread Keqian Zhu
There is already support of enabling dirty log graually in small chunks for x86. This adds support for arm64. Under the Huawei Kunpeng 920 2.6GHz platform, I did some tests with a 128G linux VM and counted the time taken of memory_global_dirty_log_start, here is the numbers: VM SizeBefore

Re: [PATCH v5 00/23] irqchip/gic-v4: GICv4.1 architecture support

2020-03-09 Thread Marc Zyngier
On 2020-03-09 08:17, Zenghui Yu wrote: On 2020/3/5 4:33, Marc Zyngier wrote: On the other hand, public documentation is not available yet, so that's a bit annoying... The IHI0069F is now available. People can have a look at: https://developer.arm.com/docs/ihi0069/latest Party! ;-)

Re: [PATCH v5 00/23] irqchip/gic-v4: GICv4.1 architecture support

2020-03-09 Thread Zenghui Yu
On 2020/3/5 4:33, Marc Zyngier wrote: On the other hand, public documentation is not available yet, so that's a bit annoying... The IHI0069F is now available. People can have a look at: https://developer.arm.com/docs/ihi0069/latest Thanks, Zenghui ___