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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1EB65C4345F for ; Tue, 23 Apr 2024 12:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dDRNqHG4bF+2OciCTBUTiehRhNj/hTvnQineQca1wT4=; b=WZGWd29bOA3kum zQOhTTu2ZjhQzc8uJZgGNI3iTMPn+JOeXDVoRyuerv3KqbZ6Exfh8doOC6PdhgHn8mt05MZIIXYXV FVmaBWc7bw9xLYft+fnLldWAKu6z2i6iziMg9euXfu2rN+tNpWVwUFWHSTcWYIzqrx8hxN4HSadnI 58TsUCmj/n7aznJMnA6VSC2sc+CNizCd6mZcMtGyaZvBkkNzlxHLe8C7vymtfUsvOadKTxhK4sIqk /uH8UfLS181iRqgaI+rNhf2/tjD46wmq1g74TxAqgMwRAQLGD/2IiC9by1cPI+/oxJiDT2a1yKS1w IzNh+Zk0x8NiYFfQDvVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzEqE-0000000HGYC-3JIB; Tue, 23 Apr 2024 12:01:43 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzEq7-0000000HGS2-3LN2 for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2024 12:01:40 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EDA3761444; Tue, 23 Apr 2024 12:01:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90BFCC116B1; Tue, 23 Apr 2024 12:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713873691; bh=DDAVN6UUdbMZmiRDg1+v0ARBePCm07Nc9Am7Qi6YmbI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ug+r3g67sxsNaAlfzqqcRAxtn4LeOufWDtv96Fw18y8rKb19cz5iK7HbuFxrDKbIL AT5cOJ+nFHfwl9Qc42GlCM6f54kcbeFOhLiLXdjOu3FeyqiGHEuRWItweAMmfryjiD Cj3GnwEu8ZO8HzK8AmouONW+R2PLswDGx6ghqPkpHWDVdl9bDXIW9ULlTctR9h/FAz UFmJM0z6rQAJ1197NZaSlHAwfpZ7iHduUSCKQvCEyk+TOk//ITdX9CpAh/Dy/1zzst hQmkBU4QGPSCymKDiMkOkRNZTDHTLbn2I1c67agLr7y5l38i3n213dFVo7zOE+1+1l cAVFvYd/qizzg== Received: from [12.161.88.66] (helo=wait-a-minute.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 1rzEq1-007AX6-0Y; Tue, 23 Apr 2024 13:01:29 +0100 Date: Tue, 23 Apr 2024 13:01:21 +0100 Message-ID: <87plugthim.wl-maz@kernel.org> From: Marc Zyngier To: Jonathan Cameron Cc: Thomas Gleixner , Peter Zijlstra , , , , , , , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , "James Morse" , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , , Ingo Molnar , Borislav Petkov , "Dave\ Hansen" , , Subject: Re: [PATCH v7 11/16] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs In-Reply-To: <20240422114020.0000294f@Huawei.com> References: <20240418135412.14730-1-Jonathan.Cameron@huawei.com> <20240418135412.14730-12-Jonathan.Cameron@huawei.com> <20240422114020.0000294f@Huawei.com> 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/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 12.161.88.66 X-SA-Exim-Rcpt-To: Jonathan.Cameron@Huawei.com, tglx@linutronix.de, peterz@infradead.org, linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux@armlinux.org.uk, rafael@kernel.org, miguel.luis@oracle.com, james.morse@arm.com, salil.mehta@huawei.com, jean-philippe@linaro.org, catalin.marinas@arm.com, will@kernel.org, linuxarm@huawei.com, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, justin.he@arm.com, jianyong.wu@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240423_050136_516233_5EAC08B7 X-CRM114-Status: GOOD ( 41.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 22 Apr 2024 11:40:20 +0100, Jonathan Cameron wrote: > > On Thu, 18 Apr 2024 14:54:07 +0100 > Jonathan Cameron wrote: > > > From: James Morse > > > > To support virtual CPU hotplug, ACPI has added an 'online capable' bit > > to the MADT GICC entries. This indicates a disabled CPU entry may not > > be possible to online via PSCI until firmware has set enabled bit in > > _STA. > > > > This means that a "usable" GIC is one that is marked as either enabled, > > or online capable. Therefore, change acpi_gicc_is_usable() to check both > > bits. However, we need to change the test in gic_acpi_match_gicc() back > > to testing just the enabled bit so the count of enabled distributors is > > correct. > > > > What about the redistributor in the GICC entry? ACPI doesn't want to say. > > Assume the worst: When a redistributor is described in the GICC entry, > > but the entry is marked as disabled at boot, assume the redistributor > > is inaccessible. > > > > The GICv3 driver doesn't support late online of redistributors, so this > > means the corresponding CPU can't be brought online either. Clear the > > possible and present bits. > > > > Systems that want CPU hotplug in a VM can ensure their redistributors > > are always-on, and describe them that way with a GICR entry in the MADT. > > > > When mapping redistributors found via GICC entries, handle the case > > where the arch code believes the CPU is present and possible, but it > > does not have an accessible redistributor. Print a warning and clear > > the present and possible bits. > > > > Signed-off-by: James Morse > > Signed-off-by: Russell King (Oracle) > > Signed-off-by: Jonathan Cameron > > +CC Marc, > > Whilst this has been unchanged for a long time, I'm not 100% sure > we've specifically drawn your attention to it before now. > > Jonathan > > > > > --- > > v7: No Change. > > --- > > drivers/irqchip/irq-gic-v3.c | 21 +++++++++++++++++++-- > > include/linux/acpi.h | 3 ++- > > 2 files changed, 21 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c > > index 10af15f93d4d..66132251c1bb 100644 > > --- a/drivers/irqchip/irq-gic-v3.c > > +++ b/drivers/irqchip/irq-gic-v3.c > > @@ -2363,11 +2363,25 @@ gic_acpi_parse_madt_gicc(union acpi_subtable_headers *header, > > (struct acpi_madt_generic_interrupt *)header; > > u32 reg = readl_relaxed(acpi_data.dist_base + GICD_PIDR2) & GIC_PIDR2_ARCH_MASK; > > u32 size = reg == GIC_PIDR2_ARCH_GICv4 ? SZ_64K * 4 : SZ_64K * 2; > > + int cpu = get_cpu_for_acpi_id(gicc->uid); > > void __iomem *redist_base; > > > > if (!acpi_gicc_is_usable(gicc)) > > return 0; > > > > + /* > > + * Capable but disabled CPUs can be brought online later. What about > > + * the redistributor? ACPI doesn't want to say! > > + * Virtual hotplug systems can use the MADT's "always-on" GICR entries. > > + * Otherwise, prevent such CPUs from being brought online. > > + */ > > + if (!(gicc->flags & ACPI_MADT_ENABLED)) { > > + pr_warn_once("CPU %u's redistributor is inaccessible: this CPU can't be brought online\n", cpu); > > + set_cpu_present(cpu, false); > > + set_cpu_possible(cpu, false); > > + return 0; > > + } It seems dangerous to clear those this late in the game, given how disconnected from the architecture code this is. Are we sure that nothing has sampled these cpumasks beforehand? Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel