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=-8.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BEE96C433DF for ; Sat, 1 Aug 2020 11:44:18 +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 7E849206F6 for ; Sat, 1 Aug 2020 11:44:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nt6tbU/G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E849206F6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=F4qm+hRapsscnvuz93BalGrhI40pluH7gW9IzDp13TY=; b=nt6tbU/GeP0Luh0oOmUKg1cFe rvu9H9SorBJShM5xZ7akospVA33NqFFXPk1TVCab812lImpvWPPxE/QksgfP3cqXXk2lLmsEbfw7a au97So3mnqfQmy5DuPh9azeA8n7myTbiUcByPVVrfvmQaZhE6iRICpiMH/4OSpg0yjPtQiKsKXm6V E9PAUUyNKYjTWAU2p72k0ziXkjwI7Cfy26ChEurdAbf1R3SZQwRM4KHJTjWO1c02VYeWCxtKA7KO+ SieZHj9PrvW3FV8LmB1rBAqIJQMMonerNe0hjA2xwWQnsgFgNe3MvsZXjLF5dUHTD6xuP3FuOktMK i1TyIbaYw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1ptn-00035R-5q; Sat, 01 Aug 2020 11:41:59 +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 1k1ptk-00034j-6H for linux-arm-kernel@lists.infradead.org; Sat, 01 Aug 2020 11:41:57 +0000 Received: from gaia (unknown [95.146.230.158]) (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 CDD92206F6; Sat, 1 Aug 2020 11:41:48 +0000 (UTC) Date: Sat, 1 Aug 2020 12:41:46 +0100 From: Catalin Marinas To: Stephen Boyd Subject: Re: [PATCH v2 1/2] arm64: Move handling of erratum 1418040 into C code Message-ID: <20200801114145.GA18774@gaia> References: <20200731083358.50058-1-maz@kernel.org> <20200731083358.50058-2-maz@kernel.org> <20200731104121.GA26500@willie-the-truck> <98dc0a0f6511542eae26b91d925f160e@kernel.org> <20200731113228.GB26500@willie-the-truck> <159621843473.1360974.5165992650144410881@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <159621843473.1360974.5165992650144410881@swboyd.mtv.corp.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200801_074156_329332_3484DA91 X-CRM114-Status: GOOD ( 24.78 ) 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 , kernel-team@android.com, Suzuki K Poulose , Marc Zyngier , dianders@google.com, Will Deacon , linux-arm-kernel@lists.infradead.org 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 Fri, Jul 31, 2020 at 11:00:34AM -0700, Stephen Boyd wrote: > Quoting Will Deacon (2020-07-31 04:32:28) > > On Fri, Jul 31, 2020 at 12:14:40PM +0100, Marc Zyngier wrote: > > > On 2020-07-31 11:41, Will Deacon wrote: > > > > On Fri, Jul 31, 2020 at 09:33:57AM +0100, Marc Zyngier wrote: > > > > > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c > > > > > index 6089638c7d43..8bbf066224ab 100644 > > > > > --- a/arch/arm64/kernel/process.c > > > > > +++ b/arch/arm64/kernel/process.c > > > > > @@ -515,6 +515,40 @@ static void entry_task_switch(struct > > > > > task_struct *next) > > > > > __this_cpu_write(__entry_task, next); > > > > > } > > > > > > > > > > +/* > > > > > + * ARM erratum 1418040 handling, affecting the 32bit view of CNTVCT. > > > > > + * Assuming the virtual counter is enabled at the beginning of times: > > > > > + * > > > > > + * - disable access when switching from a 64bit task to a 32bit task > > > > > + * - enable access when switching from a 32bit task to a 64bit task > > > > > + */ > > > > > +static __always_inline > > > > > > > > Do we need the __always_inline? None of the other calls from > > > > __switch_to() > > > > have it. > > > > > > Suggestion from Stephen. In my experience, it doesn't change much as > > > most things get inlined anyway. Happy to drop it. > > > > Yes, please. We can add it back if it's shown to be a problem. > > Just for my own edification, why is __always_inline undesirable? Should > there be an always inline version of the function that has the static > key so that the erratum path is kept out of the switch_to() default > path? It's rather unnecessary, so it just makes the code a bit more unreadable. I usually go by two questions: 1. Is the function required to be inlined for correct execution? 2. Is there a visible performance benefit by using __always_inline? (e.g. the compiler does a bad job) For a static function called only in one place, the compiler usually inlines it. I can't speak on behalf of Will but from my perspective I'm against adding __always_inline just because it's harmless (and occasionally I edit it out of patches I apply manually). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel