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 X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09C42C433E2 for ; Fri, 11 Sep 2020 17:48:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99B8421D79 for ; Fri, 11 Sep 2020 17:48:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tJQIuMvm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jrws4N3p" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99B8421D79 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dNMdVfKGrssj1sYGyfqzFQoUT6NmvtWgvmHDQ3Kfdbc=; b=tJQIuMvmtrVqSOghqe3rF1fxL Q5D3OvTwpfVcOyHBT4lDrDLnbVryMgfHaq4APt90fd1JZZe6tZgfzwBRYTf7dGACDS/Y/6Sq4VY2A AEWELVtGIBAztXFmNLlBWCsuvB9Mg8gi241rpLoCpXDJQRr4jm8v0qSDPydTiiL/XM3SLolTrhFd3 yeTAZrkoYp0liqDlYPLuoU6CehOHLexE+xAkQ+TQCvuZDxAFUcYxFYIB6LaakPPs8avAOiJN1WS87 Fi2SYxCJHlD22iO0zn+4elshu3FzT2AnO9Yx+qK0KmB/ddEGTLYbL+SW7a+KJZvVfTAj7kcQTaD5X 4R1PNSh3g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGn8i-0004Xt-7F; Fri, 11 Sep 2020 17:47:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGn8g-0004XV-87 for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 17:47:11 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A294121D79; Fri, 11 Sep 2020 17:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599846428; bh=O+cncrSoi7363GcC+hcwt3ZigDGJdrrJ+PM2YEsqJ/c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Jrws4N3pzYlvys6I/2se8jOk6j+o6ha4tlV4L3vL1my3Cn2VB07WpsuMyUuzkON88 c+yNKerJuioSPpJwvQJuCMkm6AkvItbrxCRuLEKrHzShMVuq7EpfLHiJN0xV8m6VQF N+lvs2B9qsZKDlOsI47ORWMG0LeUHzLDNJOtokfg= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kGn8c-00B4TU-NM; Fri, 11 Sep 2020 18:47:06 +0100 MIME-Version: 1.0 Date: Fri, 11 Sep 2020 18:47:06 +0100 From: Marc Zyngier To: Will Deacon Subject: Re: [PATCH v3 0/2] arm64: Allow erratum 1418040 for late CPUs In-Reply-To: <20200911164225.GA21054@willie-the-truck> References: <20200731173824.107480-1-maz@kernel.org> <159803353178.13439.17036526669146072985.b4-ty@arm.com> <3d5f6d5289304c558830d5fb8820e6cb@codeaurora.org> <2ac4ab0817cd4ba26c17b93257ec6dbf@kernel.org> <51c30228d9fe3dd6e2a55991831e95b0@codeaurora.org> <20200911164225.GA21054@willie-the-truck> User-Agent: Roundcube Webmail/1.4.8 Message-ID: <26480071599fb1288a73f6c2d5c1f096@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: will@kernel.org, saiprakash.ranjan@codeaurora.org, dianders@google.com, catalin.marinas@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kernel-team@android.com, swboyd@chromium.org, mka@chromium.org, groeck@chromium.org 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-20200911_134710_440221_B17EAC8A X-CRM114-Status: GOOD ( 34.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sai Prakash Ranjan , Suzuki K Poulose , Catalin Marinas , Doug Anderson , Matthias Kaehlcke , Guenter Roeck , Stephen Boyd , kernel-team@android.com, Linux ARM Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-09-11 17:42, Will Deacon wrote: > On Fri, Sep 11, 2020 at 10:04:24PM +0530, Sai Prakash Ranjan wrote: >> On 2020-09-11 19:00, Marc Zyngier wrote: >> > On 2020-09-10 14:43, Sai Prakash Ranjan wrote: >> > > On 2020-09-09 20:23, Doug Anderson wrote: >> > > > Hi, >> > > > >> > > > On Fri, Aug 21, 2020 at 11:15 AM Catalin Marinas >> > > > wrote: >> > > > > >> > > > > On Fri, 31 Jul 2020 18:38:22 +0100, Marc Zyngier wrote: >> > > > > > Erratum 1418040 currently prevents a late CPU from booting if none >> > > > > > of the early CPUs are affected by it. This is because the handling >> > > > > > is implemented as alternatives, and we have already got rid of them >> > > > > > by the time userspace onlines a new CPU. >> > > > > > >> > > > > > A solution to this is to move everything into C code, and rely on >> > > > > > static keys instead. Once this is done, the feature can be allowed >> > > > > > for late CPUs. >> > > > > > >> > > > > > [...] >> > > > > >> > > > > Applied to arm64 (for-next/fixes), thanks! >> > > > > >> > > > > [1/2] arm64: Move handling of erratum 1418040 into C code >> > > > > https://git.kernel.org/arm64/c/d49f7d7376d0 >> > > > > [2/2] arm64: Allow booting of late CPUs affected by erratum 1418040 >> > > > > https://git.kernel.org/arm64/c/bf87bb0881d0 >> > > > >> > > > NOTE: patch 2 seems to have come in through a stable merge onto >> > > > Chrome >> > > > OS 5.4 and is causing a regression when resuming from suspend. >> > > > In the >> > > > short term we've got a revert going into our tree: >> > > > >> > > > https://crrev.com/c/2399101 >> > > > >> > > > ...but that's obviously not a long term fix. I haven't done any >> > > > debugging of this myself, though I can if there's nobody more >> > > > qualified to do it and/or nobody else has time. I'm just trying to >> > > > make sure that the problem is reported somewhere where others might >> > > > notice it rather than in an obscure Chrome OS tree. ;-) >> > > > >> > > >> > > The rootcause is pretty straightforward however I'm afraid the >> > > solution isn't so but I may be mistaken, so this happens on >> > > big.LITTLE systems with CPUs differing in erratum 1418040 >> > > which was applicable only for big cores and not little cores. >> > > So when trying to bringup little cores during resume, there >> > > is a conflict as below (messages snipped from the internal bug >> > > for more visibility). >> > > >> > > Enabling non-boot CPUs ... >> > > CPU features: CPU1: Detected conflict for capability 35 (ARM erratum >> > > 1418040), System: 1, CPU: 0 >> > > CPU1: will not boot >> > > CPU1: will not boot >> > > CPU1: failed to come online >> > > psci: CPU1 killed (polled 0 ms) >> > > CPU1: died during early boot >> > > Error taking CPU1 up: -5 >> > >> > This is becoming very annoying... By allowing the buggy CPUs to come >> > in late, we have made it impossible for the good ones to work correctly. >> > >> > Can you try this (untested yet, I'm dealing with another bucket of >> > errata at the moment): >> > >> > diff --git a/arch/arm64/kernel/cpu_errata.c >> > b/arch/arm64/kernel/cpu_errata.c >> > index 6c8303559beb..fcf7f763400c 100644 >> > --- a/arch/arm64/kernel/cpu_errata.c >> > +++ b/arch/arm64/kernel/cpu_errata.c >> > @@ -477,6 +477,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = >> > { >> > .capability = ARM64_WORKAROUND_1418040, >> > ERRATA_MIDR_RANGE_LIST(erratum_1418040_list), >> > .type = (ARM64_CPUCAP_SCOPE_LOCAL_CPU | >> > + ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU | >> > ARM64_CPUCAP_PERMITTED_FOR_LATE_CPU), >> > }, >> > #endif >> > >> >> Yes, this works. > > Maybe we should spell it "ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE" and add > a comment about the "feature"? Yeah, that's exactly what it amounts to. Patch incoming. M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel