From cb3eb802171cbe5fa628ff7a8403b2da66807973 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 16 Jul 2022 12:07:55 +0000 Subject: [PATCH] Fix IPIs on systems with multiple clusters where the CPU interface numbers don't necessarily match the CPU numbers used by our kernel. Seen on an Amlogic S922X SoC where cluster 0 consists of two Cortex-A53 cores and cluster 1 consists of four Cortes-A73 cores. ok anton@ --- sys/arch/arm64/dev/ampintc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm64/dev/ampintc.c b/sys/arch/arm64/dev/ampintc.c index 45a15dd2d57..df59eaf8635 100644 --- a/sys/arch/arm64/dev/ampintc.c +++ b/sys/arch/arm64/dev/ampintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ampintc.c,v 1.28 2022/07/13 09:28:18 kettenis Exp $ */ +/* $OpenBSD: ampintc.c,v 1.29 2022/07/16 12:07:55 kettenis Exp $ */ /* * Copyright (c) 2007,2009,2011 Dale Rahn * @@ -1104,7 +1104,7 @@ ampintc_send_ipi(struct cpu_info *ci, int id) sc->sc_ipi_reason[ci->ci_cpuid] = id; /* currently will only send to one cpu */ - sendmask = 1 << (16 + ci->ci_cpuid); + sendmask = sc->sc_cpu_mask[ci->ci_cpuid] << 16; sendmask |= sc->sc_ipi_num[id]; bus_space_write_4(sc->sc_iot, sc->sc_d_ioh, ICD_SGIR, sendmask); -- 2.20.1