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 B9507D3A696 for ; Tue, 29 Oct 2024 19:53:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40A906B008A; Tue, 29 Oct 2024 15:53:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BA0C6B0092; Tue, 29 Oct 2024 15:53:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 282116B0096; Tue, 29 Oct 2024 15:53:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 09F566B008A for ; Tue, 29 Oct 2024 15:53:59 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id AD69140253 for ; Tue, 29 Oct 2024 19:53:58 +0000 (UTC) X-FDA: 82727688876.20.B7BAE32 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) by imf17.hostedemail.com (Postfix) with ESMTP id AF31A40021 for ; Tue, 29 Oct 2024 19:53:37 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="kQl/cL/a"; spf=pass (imf17.hostedemail.com: domain of yuzhao@google.com designates 209.85.217.49 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730231582; 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=wF8AVBE566042dEisFc0/QOULIDtd917EPRX8LpaS4Q=; b=ROl59EJWYCapOBZH7RnzE0ER22ZFeC7weC/ClN6SxQsr4wCqBFzH7kAkrMl08bqSauumO4 FIrMlwmy4VzBH/X8F/flOSizzybZk6ZDm1p4WU8BiVkbmAoYOahh+7QXIsi4HJJO84Sh2v JwqGdSBeKfc2rVAT3dWi/V0Ip5kctK0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="kQl/cL/a"; spf=pass (imf17.hostedemail.com: domain of yuzhao@google.com designates 209.85.217.49 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730231582; a=rsa-sha256; cv=none; b=5vgEs6YWM3dgbdFGbmvOEFeHz/Oe2lqyD/P6AT/tNOzaEXg3ds79i45VKOUmTGZQCxHgMM XP5QPRFr1IrTmxtfrClwnOfyMUEHg1n5kkzmjPN1QdSxfNk6SmCoxluaZSV1YOX7DWw1U+ PTzTl3qoK9pSvOlpEK1C+vHaooVwWb0= Received: by mail-vs1-f49.google.com with SMTP id ada2fe7eead31-4a46d36c044so101744137.1 for ; Tue, 29 Oct 2024 12:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730231636; x=1730836436; darn=kvack.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wF8AVBE566042dEisFc0/QOULIDtd917EPRX8LpaS4Q=; b=kQl/cL/avvQqceCwr9xYtrQ/TI9SGpK4yvkvlkUFWFEGVyW2pNIaqWqMlIru1mw+Su U7AE2IvShj2n2aYQ/Z/g+6TtMs8LI6VA9K+vQm1alKvafmzGtHyVQg2gk18Ybj9w8MZm fwgXOCs8OaPsoBTFvG1t6uKqKwmZR86Mnz5DkxuLIFmIoR4PGfdN3/CWr1ZrHCdzb+1k fHMNWSCO73pf+vrVeW0Vk7QWfr80rnRejnxKTLyF5DZ/GnlaspxfJ9MlXP+oWHlgz7oy BSK9EIITOCvnVfoMWsqyJLc8e66EQtjLlGE8IJoaIvVcp1nPmKtJ1sqfqnqKgKX7qzxr VaVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730231636; x=1730836436; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wF8AVBE566042dEisFc0/QOULIDtd917EPRX8LpaS4Q=; b=pBfAamtzYENxoP4b5q5Est/DxeEoUB2IOJXqgNhvhMGCkP3E0WCbSNrmonfqcVP18s K8QTPk4RXBvJFUERR70GP11u/fK43tKlB3ZDHN87VFJmEoRTd9qP95VsVjylgeffqtCB WSyckj73wYIAYgqujFki8fpFXmO7OSGQw6m7urqzsMFA5M7WFt3zklOVih0pxCSt5EuV IvsRHT2TtZLo8T84IvPDyOlERx3B89Q2TFZg7DJPzMgjL+WROnU6Bh2bpOS697lraK9k Zo2mrHb5Y16Ie0ZQASHGSEMSbxSqbKQPvqJhZocLjn4auj/lrV/twkPziX0f+mu7SwfP iPqg== X-Forwarded-Encrypted: i=1; AJvYcCUWBOTQRLWtGr0OUU1nYyOzSkLTO+nLPtYwW1e8JWxcOcBXWl2Q3V8VVPC24xg1Vshtg8TjAi4gDg==@kvack.org X-Gm-Message-State: AOJu0YzU5po4lP20MEtLHABU+KKY4T2k7f3rvXod0gKOq9XXoxlxPChD 2J1av122f+Cib5t3PrhkeAC0NCDhipGd92hqwK0ec9enChxTuOGRv1FbacmqY49Zr08wEVq/5Cu xpdgjGFKJbLD9Q6YBtV6fKxf5kxrK70DvOOJs X-Google-Smtp-Source: AGHT+IGiqS8zkowA0hhH1G9zpWHqiGgjCkwEqm4HQq3vuHcJXKhYb0OieWP/5MMHrb/rtD2no9MHT8oFzOwREShVmNE= X-Received: by 2002:a05:6102:a52:b0:4a4:77c7:9471 with SMTP id ada2fe7eead31-4a8f67c4340mr2620516137.5.1730231635771; Tue, 29 Oct 2024 12:53:55 -0700 (PDT) MIME-Version: 1.0 References: <20241021042218.746659-1-yuzhao@google.com> <20241021042218.746659-4-yuzhao@google.com> <86a5ew41tp.wl-maz@kernel.org> <86h6902m7y.wl-maz@kernel.org> <864j4u3f7l.wl-maz@kernel.org> In-Reply-To: <864j4u3f7l.wl-maz@kernel.org> From: Yu Zhao Date: Tue, 29 Oct 2024 13:53:17 -0600 Message-ID: Subject: Re: [PATCH v1 3/6] irqchip/gic-v3: support SGI broadcast To: Marc Zyngier 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Stat-Signature: csspsuw165p6nj3jz145d6mw1enac5sa X-Rspamd-Queue-Id: AF31A40021 X-Rspamd-Server: rspam11 X-HE-Tag: 1730231617-967592 X-HE-Meta: U2FsdGVkX1/dE5YK7bQtFEKh3Pim0pHxR4hS/5E3IHCB9ciBLdKcup4I+J2Mxsh5u6vAC+tUZvIYO4kuPxhlIDjnpkJPNEzZa/foQ4U3UzClOdbJ5h02Lxdy49S49xYi/1WepZmJRuVIiCD58HtyR7f9irVAM1eNL9c5Pzfh4LMF9Qoesfk5y0R2woUNzfPRpSH5HxbvuNAtUP0SaVheYHYoBYd4f/egwZ2Jq9LCEBrskKc/FtsOw0BKcrfCfWaMvsKuodA0fCT4K6idzyh4iPtq6O0jFAuw4zq+buy7rF7au9dFohR5D9e1Sa51zWuJF1Upxqr4+jXDvTdBa/T0u+ksBs0XCr7EiQ/4tnDK5PqJa8TbeqapHb4DunVNe2U/WkHss/TUqZP+NNYjGXcacblbEpEmGKg87QNRijsFkwIFahNJEXJpUUxVURZoV1DOi6c/QLtAXdApsEbQ1879/qmQqFZmJZUw4yzc7A+bFXJCqpeD59k6tLuluJIf1k4F+768ChqzKCxiNNZnByljHyg88C/cWQRx3jTTAJj/uZvSXAGRXCcGiuvFKad44XDPV9yftVmWnOZUo0C1a2y95WNeFof0CVCl/9C8gkPnEbI62DiEC3JHYRWxNSrw6BE++X2oDWArm3EV47x6jBVW6gz4jOKzCMKDs8iMF19AOf+1Cu87GuLNOcJa/Ic44lrfHXC8d/eYDIGlmhRF+WZlz/qAJkyMPur286VwOqHrYFwosDW/7Aqq9EZCX8mnK/i+szOC/OzcZkfPP569zbL1mOk1WjxYOK7o/qdp1hY/O0eh42qRbCiJJ8PwPAo/EIQDouQyh8D7qZ5utyMrNxOYK7j8q6/1ygsNfgWWeuEcD/BqC1HC/gIFxI9wM7pvt+VwlMwno6EF/K1e3f/IxjPtKDtdxKSQHF2FQ6BZFAD9dXEeVVUkAw7cY5Mxi4TO6EJxb00ZSj96uFMZuV3svho tlI2jsey zXIgfWSDR2UdovKCu2+eNM7iEa79/4LsKHfqo7/P2G2/yNHOHTWEaxHGxda3R7D1tGMINeZoYs8+65BRwGRPXCycB3MxF77P0VvVUn57+O0KYMoFG4OJhjalAwWIBMf7EhNt146BS9nk4Y/HNVU/1CKpfXMi3azx6BSqMyqjeVJXRRQnfi8hAj30HzBkgLhgFOuResgRJStGfBCL7V2ilrjhMnqsWF76eewjChuY7Lki2lHluUhBwztNSaw== 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 Tue, Oct 29, 2024 at 1:02=E2=80=AFPM Marc Zyngier wrote= : > > On Fri, 25 Oct 2024 18:31:01 +0100, > Yu Zhao wrote: > > > > On Fri, Oct 25, 2024 at 10:15=E2=80=AFAM Marc Zyngier = wrote: > > > > > > 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= _data *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 t= he > > > > > 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 route= d > > > > to all PEs in the system, excluding self") is that it broadcasts IP= Is 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. > > > > Thanks for clarifying. > > > > > Offline CPUs are not known to the kernel. > > > > 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. Right, this makes sense now. > 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. > > -- > Without deviation from the norm, progress is not possible.