[PATCH 1/6] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-01-28 Thread Anshuman Khandual
This adds basic building blocks required for ID_PFR2 CPU register which provides information about the AArch32 programmers model which must be interpreted along with ID_PFR0 and ID_PFR1 CPU registers. Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: James Morse Cc: Suzuki K Poulose

[PATCH 0/6] Introduce ID_PFR2 and other CPU feature changes

2020-01-28 Thread Anshuman Khandual
This series is primarily motivated from an adhoc list from Mark Rutland during our ID_ISAR6 discussion [1]. Besides, it also includes a patch which does macro replacement for various open bits shift encodings in various CPU ID registers. This series is based on linux-next 20200124. [1]

[kvm-unit-tests PATCH v3 11/14] arm/arm64: ITS: INT functional tests

2020-01-28 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 --- v2 -> v3: - add comments - keep

[kvm-unit-tests PATCH v3 10/14] arm/arm64: ITS: commands

2020-01-28 Thread Eric Auger
Implement main ITS commands. The code is largely inherited from the ITS driver. Signed-off-by: Eric Auger --- v2 -> v3: - do not use report() anymore - assert if cmd_write exceeds the queue capacity v1 -> v2: - removed its_print_cmd_state --- arm/Makefile.arm64 | 2 +-

[kvm-unit-tests PATCH v3 13/14] arm/arm64: ITS: migration tests

2020-01-28 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 --- arm/gic.c| 59

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

2020-01-28 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 --- v2 -> v3: - tests belong to both its and migration groups --- arm/gic.c | 150

[kvm-unit-tests PATCH v3 09/14] arm/arm64: ITS: Device and collection Initialization

2020-01-28 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 v3 12/14] arm/run: Allow Migration tests

2020-01-28 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

[kvm-unit-tests PATCH v3 07/14] arm/arm64: gicv3: Enable/Disable LPIs at re-distributor level

2020-01-28 Thread Eric Auger
This helper function controls the signaling of LPIs at redistributor level. Signed-off-by: Eric Auger --- v2 -> v3: - move the helper in lib/arm/gic-v3.c - rename the function with gicv3_lpi_ prefix - s/report_abort/assert --- lib/arm/asm/gic-v3.h | 1 + lib/arm/gic-v3.c | 17

[kvm-unit-tests PATCH v3 06/14] arm/arm64: gicv3: Set the LPI config and pending tables

2020-01-28 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 ->

[kvm-unit-tests PATCH v3 01/14] libcflat: Add other size defines

2020-01-28 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 +++

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

2020-01-28 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

[kvm-unit-tests PATCH v3 05/14] arm/arm64: ITS: Introspection tests

2020-01-28 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. Also parse the BASER registers. This is our first ITS test, belonging to a new "its" group. Signed-off-by: Eric Auger

[kvm-unit-tests PATCH v3 08/14] arm/arm64: ITS: its_enable_defaults

2020-01-28 Thread Eric Auger
its_enable_defaults() is the top init function that allocates the command queue and all the requested tables (device, collection, lpi config and pending tables), enable LPIs at distributor level and ITS level. gicv3_enable_defaults must be called before. Signed-off-by: Eric Auger --- v2 ->

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

2020-01-28 Thread Eric Auger
PROPBASER, PENDBASE and GICR_CTRL will be used for LPI management. Signed-off-by: Eric Auger --- lib/arm/asm/gic-v3.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/arm/asm/gic-v3.h b/lib/arm/asm/gic-v3.h index 6beeab6..ffb2e26 100644 --- a/lib/arm/asm/gic-v3.h +++

[kvm-unit-tests PATCH v3 02/14] arm: gic: Provide per-IRQ helper functions

2020-01-28 Thread Eric Auger
From: Andre Przywara A common theme when accessing per-IRQ parameters in the GIC distributor is to set fields of a certain bit width in a range of MMIO registers. Examples are the enabled status (one bit per IRQ), the level/edge configuration (2 bits per IRQ) or the priority (8 bits per IRQ).

[kvm-unit-tests PATCH v3 00/14] arm/arm64: Add ITS tests

2020-01-28 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

Re: [PATCH v5 3/3] arm64: perf: Add support for ARMv8.5-PMU 64-bit counters

2020-01-28 Thread Andrew Murray
On Mon, Jan 27, 2020 at 12:32:22PM +, Marc Zyngier wrote: > On 2020-01-27 11:44, Andrew Murray wrote: > > At present ARMv8 event counters are limited to 32-bits, though by > > using the CHAIN event it's possible to combine adjacent counters to > > achieve 64-bits. The perf config1:0 bit can be