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=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 89400C4741F for ; Fri, 30 Oct 2020 08:21:30 +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 F3A8822210 for ; Fri, 30 Oct 2020 08:21:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hAKD6yqW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="NqAZTqVP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3A8822210 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-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=Z7jB2a+EifxMliqLJJlhTKdnPd9UagPpaDxgMfqwHjQ=; b=hAKD6yqW2RZ5iRo6oAsUKOSK/ fyguoqxHDdCHId9m7IIh/62HqU51WNsbfWFvFxQfCVpcN/AgxpyprbhbWjg9DRsQRxJWmiuf0Sofh Wt79teCtjoCJyg6awpqXuOv3DlaatdQn+tEfr4KVGVq/nXyGiDzghSyTh2HdZrStdyz6neMGqGLXA Lk3H/wvPFVb3ChJPq+w2GzjOFOM4JTGyYotYdbVzlkd8oawcwDE4PMAqpy3DiyJvil5s8iwyky7V7 Hrle1OwA14yIzj7Y23Tqx4WUx5qzpTgmu+Auqui1gtU0/EFYTNhg2p9NUbFWA1cG55jVIcRCw9Odh mvALFDEMA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYPe1-00038x-PA; Fri, 30 Oct 2020 08:20:21 +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 1kYPdz-00038D-Ep for linux-arm-kernel@lists.infradead.org; Fri, 30 Oct 2020 08:20:20 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (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 70DDF22210; Fri, 30 Oct 2020 08:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604046018; bh=jz2nrMDNAdbfuzWh4uO0aSdVQigN1U8vdrvthN7Q3nw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NqAZTqVPijbolh/JH+KJSzAKJIGgB4hcFfx+i4pevVMsiitSIWvWiKkix6XWPPJqD rsxz9l5rqblxN+E4KQg5XswOVkBJR19zwsejcgPtEabKmMCb64OOIQWyuDRlsLhzUg STdhKUQTIVJt2+mFTgvx1ePAuEQswuRm8mnYDsrs= Date: Fri, 30 Oct 2020 08:20:14 +0000 From: Will Deacon To: Mark Rutland Subject: Re: [PATCHv2 2/3] arm64: cpufeature: reorder cpus_have_{const,final}_cap() Message-ID: <20201030082013.GC32066@willie-the-truck> References: <20201026134931.28246-1-mark.rutland@arm.com> <20201026134931.28246-3-mark.rutland@arm.com> <20201030081848.GB32066@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201030081848.GB32066@willie-the-truck> 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-20201030_042019_596913_25E32607 X-CRM114-Status: GOOD ( 23.62 ) 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: maz@kernel.org, dbrazdil@google.com, kvmarm@lists.cs.columbia.edu, 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, Oct 30, 2020 at 08:18:48AM +0000, Will Deacon wrote: > On Mon, Oct 26, 2020 at 01:49:30PM +0000, Mark Rutland wrote: > > In a subsequent patch we'll modify cpus_have_const_cap() to call > > cpus_have_final_cap(), and hence we need to define cpus_have_final_cap() > > first. > > > > To make subsequent changes easier to follow, this patch reorders the two > > without making any other changes. > > > > There should be no functional change as a result of this patch. > > You say this... > > > > > Signed-off-by: Mark Rutland > > Cc: David Brazdil > > Cc: Marc Zyngier > > Cc: Will Deacon > > --- > > arch/arm64/include/asm/cpufeature.h | 16 ++++++++-------- > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > > index f7e7144af174c..5d18c54507e6a 100644 > > --- a/arch/arm64/include/asm/cpufeature.h > > +++ b/arch/arm64/include/asm/cpufeature.h > > @@ -428,35 +428,35 @@ static __always_inline bool __cpus_have_const_cap(int num) > > } > > > > /* > > - * Test for a capability, possibly with a runtime check. > > + * Test for a capability without a runtime check. > > * > > - * Before capabilities are finalized, this behaves as cpus_have_cap(). > > + * Before capabilities are finalized, this will BUG(). > > * After capabilities are finalized, this is patched to avoid a runtime check. > > * > > * @num must be a compile-time constant. > > */ > > -static __always_inline bool cpus_have_const_cap(int num) > > +static __always_inline bool cpus_have_final_cap(int num) > > { > > if (system_capabilities_finalized()) > > return __cpus_have_const_cap(num); > > else > > - return cpus_have_cap(num); > > + BUG(); > > ... but isn't the failure case of calling cpus_have_final_cap() early now > different? What does BUG() do at EL2 w/ nVHE? Ah no, sorry, I see you're just moving things around and the diff makes it look confusing (that and I've been up since 5:30 for KVM Forum). So on closer inspection: Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel