From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A535ED3A690 for ; Tue, 29 Oct 2024 19:02:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CBB8C6B0096; Tue, 29 Oct 2024 15:02:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6AC46B0099; Tue, 29 Oct 2024 15:02:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B33276B009A; Tue, 29 Oct 2024 15:02:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 95F7F6B0096 for ; Tue, 29 Oct 2024 15:02:28 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1771A120431 for ; Tue, 29 Oct 2024 19:02:28 +0000 (UTC) X-FDA: 82727560272.18.061DD53 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id 6F97C160040 for ; Tue, 29 Oct 2024 19:02:09 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WzubmDqO; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of maz@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=maz@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730228416; a=rsa-sha256; cv=none; b=HdxaaQVMT7pgzPRiXeio3/ahsu9ZJJMpPyzKviD4Xcy0NVEagZYdpMQbypxmPnYSW/2od7 f1ZrDZBlhDDkT4hye1/Y7hIE0qtRaNwaFY+yoNeaaMZlbv8bTc+xmq7zZk+Hb8zjbcVK0p y0+jXa2O6b8VFXW7zF2xDC376fX5MR8= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WzubmDqO; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf08.hostedemail.com: domain of maz@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=maz@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730228416; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EMsmKbaTSbCtvLlgYo2qZSTGcrEE2vsw4c80qevMoSw=; b=21JX11MYqyEeoz7tKMP+tfqCj/F7oOa73o7T3+dPAX8a1agf3i5U5u+JZ5KGVxdmumUKOk q8H6cowAdvX3rWz6816ZvCpW/cfNciztSwmYSeHUnTcHD0sZx37Up9WBlwXi1qrblDO9QT u0sB92oAEgJYQF4WmzMnO2qOXCerS+0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 000BC5C5846; Tue, 29 Oct 2024 19:01:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C982CC4CECD; Tue, 29 Oct 2024 19:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730228544; bh=c3B6zM0g76ktl69lbL9/91FTBSkAtle6ro7RJaPmxWY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WzubmDqOVvPIBDYTPKHnrbCuEngf55eh4KgIMF7AzODVZnGA9G3qv7CutXGTGPFDh Y3Xgo9b8ryQSaeDVbedWE0IY5mb54FNHd8Y/23J+WxqbhW9N4GpQFyaW8Y6UbCNSI1 GpyGgSH1fhyiGFd/K5dhdImQbZCRePwY5fZyT5yA5YurAl4lkPfc2iTeqy3q6RBSUf 9ZtVkKTF6/4MPKHOqsRAVMnwUDHZzIW70vVHhWERB8oDKx6WHHvrdvqtyEIjFlwgsE Qu2w98WUF+iz6cVlwLSsutRUrtRlyTw3f5PNtLgXwn8ACG1326UI/ikDEzOJYo2WZu 5JYXxP0zh4cfw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t5rTy-0081t7-Pc; Tue, 29 Oct 2024 19:02:22 +0000 Date: Tue, 29 Oct 2024 19:02:22 +0000 Message-ID: <864j4u3f7l.wl-maz@kernel.org> From: Marc Zyngier To: Yu Zhao Cc: Andrew Morton , Catalin Marinas , Muchun Song , Thomas Gleixner , Will Deacon , Douglas Anderson , Mark Rutland , Nanyong Sun , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 3/6] irqchip/gic-v3: support SGI broadcast In-Reply-To: References: <20241021042218.746659-1-yuzhao@google.com> <20241021042218.746659-4-yuzhao@google.com> <86a5ew41tp.wl-maz@kernel.org> <86h6902m7y.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: yuzhao@google.com, akpm@linux-foundation.org, catalin.marinas@arm.com, muchun.song@linux.dev, tglx@linutronix.de, will@kernel.org, dianders@chromium.org, mark.rutland@arm.com, sunnanyong@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6F97C160040 X-Stat-Signature: gmbuw7wnhfqsyyo9a41xyhynrbpf4dkp X-Rspam-User: X-HE-Tag: 1730228529-531491 X-HE-Meta: U2FsdGVkX1+39zVnOzHDFZBHE8vRLNOaHv4pzEveW3WP2ZF0dclKiMXP+KklXcXBuXRni9kI4NZtKvRjfRfJ5N2nYdWeE0s/3nSVDf7wWuV5dfjkvQbjYNOqOCQJVV1YL6fuHa57a52ZMvrK/EDgsxxYFTt5k3/1zfLZrigkjeBjbdvnjPw96hjj90OUB7Kiegrz0lmQFdq+wlZTKCCtH30zrnsR+Sv1CKIviAItVq1dFQNVvmehGdaM3iuJ23/MVMbq9TOOS379BSe5kQGczLwsbJQab+4ObTh6Is52id/l4/zBMnQ1oSSYR1j4G+yeUaJS7VV6G81qy4+FsN6YeGOdfPYT3cC2FBeZHwcGedH6nQxDEil64rZK917Us1POI7VbchfiSlqGymwzLfBL7X4Vrgn7my5kNQX5aeE5vwroudKCoTHX5e0xFD+PDX3otxHqlaVMfZtWWs1iJyIwTNkxeptTlvP9uaQ6D3p/8dM89S+x5rJJrNHp4YjZL7+tNWFoR1QVA/Zxvr/JaZiIk6C9LT6Yj8JKBN9L9BdF+s1EJlK89/5HEQhUtyIK7h0clAsAkzgfoHO99u42Jxjcf/t//lDOYzE/AEUyNw8Me5K9qzSwWqc7srkj7T1C9mDvBWoS3Ikq+GLxPhQ3olpat2nQnXqLkaChdvOrE1YEh/MScWj324mmzAKWbHwgmVqNCjAcsM3qB6wJz2LZDDIFbFo+3HDnTLvfWV7NdbMEgDSzpK9UYdyB9pfxxvZ/ep6RFz+f8pSnPQ7LUL6GbK9VSb60QHCI7eEAWV3MEieTgsLQNxlplTAbourNrdlLMujcGuCcOZ4Ul4pvrHdQ8dk8HV/ifDvn3pMbt+uT5rAUpS18GHUeYhT8YffMTetFa4qmadinFPmJTg7vqQiNxIa+5mJIdvADF4NV+jFoYhLX71V6Sz0mtnLsaZD6WxxSoMjyNQhrDidKJwpE8KdVN0Q s6kNrEYt +ZpZJSFjagMEyCi1HVddbYlzwbUm2kOb53PNpzi1+GSFJ9DKjpc2/qBzUX/zR6YMBF1O36CTKkxngWPNyrrszATt3ZMrFh4BZRR0GGNDwEdvtMAEskVc8lI/PKENccZeIHwmk96Zl0bLMHboyDT15uxfKXhkAQFUliRh0iF6WlxMRWoeZzCtTMgrDfcEelD/FS14Otu7TW+Cn+pc7epESOKFMtC3wv598RCcRMO4h8JV95nMEwv2ItUHaurUvfTzQgJZ76v2PZZgMuM8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, 25 Oct 2024 18:31:01 +0100, Yu Zhao wrote: >=20 > On Fri, Oct 25, 2024 at 10:15=E2=80=AFAM Marc Zyngier wr= ote: > > > > On Fri, 25 Oct 2024 06:07:45 +0100, > > Yu Zhao wrote: > > > > > > Hi Marc, > > > > > > On Tue, Oct 22, 2024 at 9:03=E2=80=AFAM Marc Zyngier = wrote: > > > > > > > > On Mon, 21 Oct 2024 05:22:15 +0100, > > > > Yu Zhao wrote: > > > > > > > > > > @@ -1407,6 +1418,13 @@ static void gic_ipi_send_mask(struct irq_d= ata *d, const struct cpumask *mask) > > > > > */ > > > > > dsb(ishst); > > > > > > > > > > + cpumask_copy(&broadcast, cpu_present_mask); > > > > > > > > Why cpu_present_mask? I'd expect that cpu_online_mask should be the > > > > correct mask to use -- we don't IPI offline CPUs, in general. > > > > > > This is exactly because "we don't IPI offline CPUs, in general", > > > assuming "we" means the kernel, not GIC. > > > > > > My interpretation of what the GIC spec says ("0b1: Interrupts routed > > > to all PEs in the system, excluding self") is that it broadcasts IPIs= to > > > "cpu_present_mask" (minus the local one). So if the kernel uses > > > "cpu_online_mask" here, GIC would send IPIs to offline CPUs > > > (cpu_present_mask ^ cpu_online_mask), which I don't know whether it's > > > a defined behavior. >=20 > Thanks for clarifying. >=20 > > Offline CPUs are not known to the kernel. >=20 > I assume it wouldn't matter to firmware either, correct? IOW, we Firmware is on the secure side of the stack. > wouldn't cause firmware any trouble by letting GIC send IPIs to > (cpu_present_mask ^ cpu_online_mask), assuming those two masks can be > different on arm64 when hotplug is enabled? You can't send SGIs from non-secure to secure using ICC_SGI1R_EL1. You would need to use ICC_ASGI1R_EL1, and have secure to allow such brokenness via a configuration of GICR_NSACR. Linux doesn't use the former, and no sane software touches the latter. M. --=20 Without deviation from the norm, progress is not possible.