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 76148C00A5A for ; Thu, 19 Jan 2023 09:14:15 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3qtkEqqyW+bQE1fmduCrjeFzIlCyADJ/oLCJ6CpvE9E=; b=lzuBc/Y9cfCLKP lwRvjVX9g6+M/k9PQO1mlzqgdQ2DBDVrKhRpggD2+3fab5YKnlijd29xz7V6+tqTvURHTlpmn/RzO wpvHCTrpN4QLWjH4CNY8fYPkQ0zDgKK8hBVs9ZROT8eObiePCz+MhtDFj9lrnj4kvswXLphNyJTcC /bBJwacQTMkn9oHa5TehX+FaiKpDMa5Qr4/W+2NYgjE3VcAXr7sCm6IAHM2m0rX+8d0IE1jEIx0Zu nA4XvJkVhDlvsxJE6xCtNj0Y6Wi2dtbwEru24PEaP/8ZcQSghe9mJzMaMmRgjJiGottlg7R9hvvkF Aosne6aihSppGjCC9aOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIQyq-004Br5-92; Thu, 19 Jan 2023 09:13:08 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIQyl-004BqW-T0 for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2023 09:13:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BECA41758; Thu, 19 Jan 2023 01:13:39 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.47.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B1D833F71A; Thu, 19 Jan 2023 01:12:56 -0800 (PST) Date: Thu, 19 Jan 2023 09:12:48 +0000 From: Mark Rutland To: Joel Fernandes Cc: Will Deacon , "Paul E. McKenney" , Zhouyi Zhou , "moderated list:ARM/STM32 ARCHITECTURE" , Marc Zyngier , Catalin Marinas , rcu , Frederic Weisbecker Subject: Re: arm64 torture test hotplug failures (offlining causes -EBUSY) Message-ID: References: <20230117043011.GD2948950@paulmck-ThinkPad-P17-Gen-1> <24953EEA-5B3E-4046-B106-7A7FBE8B8995@joelfernandes.org> <20230117045456.GG2948950@paulmck-ThinkPad-P17-Gen-1> <20230117204231.GP2948950@paulmck-ThinkPad-P17-Gen-1> <20230118040058.GV2948950@paulmck-ThinkPad-P17-Gen-1> <20230118165121.GB19026@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230119_011304_053827_01DF8A12 X-CRM114-Status: GOOD ( 32.55 ) 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 Hi Joel, Will, On Wed, Jan 18, 2023 at 10:01:07PM +0000, Joel Fernandes wrote: > On Wed, Jan 18, 2023 at 4:51 PM Will Deacon wrote: > > On Tue, Jan 17, 2023 at 08:00:58PM -0800, Paul E. McKenney wrote: > > > On Wed, Jan 18, 2023 at 02:17:06AM +0000, Joel Fernandes wrote: > > > > > > I would be happier to forgive failure to offline housekeeping CPUs than > > > blanket forgiveness of CPU 0. Especially given that I recently got > > > burned by a non-zero boot cpu. ;-) > > > > > > But wouldn't it be even better for cpu_is_hotpluggable() to know the > > > NO_HZ_FULL rules of the road? > > > > > > > Adding Frederic to CC as well as we are talking about > > > > housekeeping/isolation stuff. > > > > > > But as you say, perhaps Frederic has a better idea. > > > > > > > > And topology_init() sets this based on platform_can_hotplug_cpu(cpu). > > > > > And this function sets CPU 0 as !cpu_is_hotpluggable() unless the > > > > > architecture specifies a .cpu_can_disable() function. > > > > > > > > Ah, that is 32-bit ARM code only. This issue is on 64-bit ARM (arch/arm64/). > > > > > > Apologies! I will look more carefully at the pathnames next time! > > > > > > But maybe arm64 needs something similar? > > > > Just chiming quickly from the arm64 side here, but there's nothing in the > > architecture that precludes offlining CPU 0 and it certainly works on some > > platforms, so I'd be hesitant to rule it out entirely for testing. > > > > One reason why hotplug can fail in practice is if a trusted OS (i.e. code > > running on the secure side of the fence outside of Linux's view of the > > world) is resident on a core and rejects firmware requests to power it > > off. The PSCI code (drivers/firmware/psci/) should detect this and return > > -EPERM, although earlier in this thread there was mention of -EBUSY so it > > sounds like something else... > > Thank you for the heads up on that. To give you context, I am > currently testing rcutorture on stable kernels 5.10, 5.15, 6.1 on my > ARM64 QC7180 board. I certainly don't want to hit the -EPERM in the > future on this or other ARM64 hardware. It would be great if > cpu_psci_cpu_can_disable() in arm64 can return false if hotplugging > causes -EPERM indefinitely. Then we do not need to make any changes. That should already be the case, and I think we're good on that front. A trusted OS (which blocks offlining a CPU) will always be resident on a specific CPU (since we don't have any code to migrate trusted OSs across CPUs as this is not standardised, and we don't have code to instantiate a trusted OS from Linux). Where a non-migrateable trusted OS is present, it's going to have been instantiated prior to booting Linux, and therefore will be on CPU0 (or a CPU that Linux is not using at all). Given the above, the return value of cpu_psci_cpu_can_disable() should not change for a given CPU, and it should only be able to return false on CPU0. Most systems don't have a trusted OS blocking PSCI CPU_OFF, and CPU0 can be offlined. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel