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 764E0C27C53 for ; Wed, 19 Jun 2024 12:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=e5jFH3/w3XmV0ylHhXircdD3vYPdoHOogmq6CYTKsFk=; b=vBovIGJYgYKPOlYGNjksB6CMCF ylS0QyMwgfYoqNkYzd2jM+qZBeluxdLH2rbLa0ghawHSAjqnk404JjMyeqlyo85rm2qd2nN1tz2fE KlsiFXfS2D0AO2zlrJLQCF81tkqJGeWzi5GsAV+9HPxqQiSC3jql/Njy3qp8wEL5JerigDneTb+QX 79gv58VexdXTYTL7NQGqvh4pZf0eWuNYSMnYXrFxMcpyYB5VOFKWWSo3lOZ3ySO0O5kMvPTRaGSOG N2/nn2/n/5MQb6pq9MYEUvQO9EG6R8d13Z+JPBKJfp01txlTQamvIP2rl6cG6tX6yIuZyrRp0Fth7 z3dJQCXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJu9D-000000016iY-3aJg; Wed, 19 Jun 2024 12:10: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 1sJu9B-000000016gu-1tFk for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 12:10:42 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7201561B40; Wed, 19 Jun 2024 12:10:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F498C2BBFC; Wed, 19 Jun 2024 12:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718799040; bh=ALeYzxeS3iOY2rx4/Kx+ydsSavqKfiI2lPUx7xtO4Lo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BhWiNJ0+B3Q4eHQ1K7y8i+X17whuMCJeFlKi9b8MGlUccFDRcokvvQb6YrbkjfgTa cHVPfzP+fAWgVmJOujiYoRkbS5WAMR8WfGthqljGJsAP8CtGBeqKc0XZKG00yQLstP qbO5Wn5qV47nujprFxnzPCSMS4r546QuEP6PdYfDbWMX/BVe9X6QnwIskwq8R5cphm GzgQU60LmN52ts2ygjfjDKheMcc5LN95Tjj1vfumM80dJaqtrPovkDTOky1V+DwU2+ SyveyxTMRowvWN3OMX1KUNfx/cluUsknBPyuiWq/ML8tHU7RO56XhRTTkmhfVF/o1C dGTsLLBemPaZg== 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 1sJu97-005RVc-6I; Wed, 19 Jun 2024 13:10:37 +0100 Date: Wed, 19 Jun 2024 13:10:36 +0100 Message-ID: <868qz1jfpf.wl-maz@kernel.org> From: Marc Zyngier To: Jonathan Cameron Cc: Will Deacon , Catalin Marinas , , , , , , Mark Rutland , Thomas Gleixner , Peter Zijlstra , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Hanjun Guo , Gavin Shan , Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: Re: [PATCH v10 14/19] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs In-Reply-To: <20240529133446.28446-15-Jonathan.Cameron@huawei.com> References: <20240529133446.28446-1-Jonathan.Cameron@huawei.com> <20240529133446.28446-15-Jonathan.Cameron@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/29.2 (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=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: Jonathan.Cameron@huawei.com, will@kernel.org, catalin.marinas@arm.com, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, mark.rutland@arm.com, tglx@linutronix.de, peterz@infradead.org, loongarch@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, guohanjun@huawei.com, gshan@redhat.com, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, linuxarm@huawei.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-20240619_051041_596594_BFC62C03 X-CRM114-Status: GOOD ( 29.65 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 29 May 2024 14:34:41 +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 redistributor is one that is marked as > either enabled, or online capable. The meaning of the > acpi_gicc_is_usable() would become less clear than just checking the > pair of flags at call sites. As such, drop that helper function. > The test in gic_acpi_match_gicc() remains as 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. > Rather than modifying cpu masks that may already have been used, > register a new cpuhp callback to fail this case. This must run earlier > than the main gic_starting_cpu() so that this case can be rejected > before the section of cpuhp that runs on the CPU that is coming up as > that is not allowed to fail. This solution keeps the handling of this > broken firmware corner case local to the GIC driver. As precise ordering > of this callback doesn't need to be controlled as long as it is > in that initial prepare phase, use CPUHP_BP_PREPARE_DYN. > > 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. > > Suggested-by: Marc Zyngier > Signed-off-by: James Morse > Signed-off-by: Russell King (Oracle) > Tested-by: Miguel Luis > Co-developed-by: Jonathan Cameron > Signed-off-by: Jonathan Cameron Acked-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible.