Commit d82689bd authored by Oliver Upton's avatar Oliver Upton Committed by Marc Zyngier
Browse files

KVM: selftests: Align with kernel's GIC definitions



There are a few subtle incongruencies between the GIC definitions used
by the kernel and selftests. Furthermore, the selftests header blends
implementation detail (e.g. default priority) with the architectural
definitions.

This is all rather annoying, since bulk imports of the kernel header
is not possible. Move selftests-specific definitions out of the
offending header and realign tests on the canonical definitions for
things like sysregs. Finally, haul in a fresh copy of the gicv3 header
to enable a forthcoming ITS selftest.

Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20240422200158.2606761-14-oliver.upton@linux.dev


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent 481c9ee8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ static void reset_stats(void)

static uint64_t gic_read_ap1r0(void)
{
	uint64_t reg = read_sysreg_s(SYS_ICV_AP1R0_EL1);
	uint64_t reg = read_sysreg_s(SYS_ICC_AP1R0_EL1);

	dsb(sy);
	return reg;
@@ -160,7 +160,7 @@ static uint64_t gic_read_ap1r0(void)

static void gic_write_ap1r0(uint64_t val)
{
	write_sysreg_s(val, SYS_ICV_AP1R0_EL1);
	write_sysreg_s(val, SYS_ICC_AP1R0_EL1);
	isb();
}

+554 −32

File changed.

Preview size limit exceeded, changes collapsed.

+12 −1

File changed.

Preview size limit exceeded, changes collapsed.