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=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,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 EB2F2C433C1 for ; Thu, 25 Mar 2021 19:29:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7EEF9619E4 for ; Thu, 25 Mar 2021 19:29:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EEF9619E4 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=desiato.20200630; 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=qeY+Es5eoL3oSSvrT+KWjYoJMCjl8Ei5g2fc01oVx3g=; b=de817+W48hv8oaksrnaN0XQA8 Yll9uivgmKuGAXbWVqTXhtLrf+sL4JAY9Fk/Sc1f37UDDUDQpnWwSQC6rWL4SfG9qI2NO8j/4YQ4c kmCBXUezXwuzk6FN7W+Tx/yQKdc00lu5U7+PzauLTNvfp5pkRmmwspERiLQUOLSyubtKVwIoWkwpw wFGQsFyBSx1xER3OKF8DxHI7Vo1CLVUfpmQD6Ls6FSud0agRv5NGPn4m8R/crfx4Z5O0lEezYKrXt gAjTlAFDZXGjOeRtApt9Ps657D3IFBgZtuD+VeJXhLBNqAUbMO7FVSDi9k0SWDBnjnxgQnEmaJ/5i PWEicIDxQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPVeO-0025Vx-D2; Thu, 25 Mar 2021 19:28:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPVeK-0025Us-D8 for linux-arm-kernel@lists.infradead.org; Thu, 25 Mar 2021 19:28:10 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3EE561A26; Thu, 25 Mar 2021 19:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616700484; bh=XJDBwWdlKjgtrgt0PWV+e5RUoM3/E1Fl6e9Q8Anly0o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UlAft/UxCGzy28RHDwMxRdteb9ffUdnJKXTv9iW4nYC7lut6HHi8CEaVCx9h+flZ/ q6BAmL0LgkueHyZz/vEy/ymVwufzveQrYh4A85vhpCzAKHNUVTbFVfEw8UHFlYZ2dE I/4FLhIzcnK3ouFnWMvPJbDat1B+fwsZNKNzoE2P+AQs6a+bOwpnoWCG804SPgQSNa 4fiQvqA/klmqsAkWmRFPu/CoN61ZQp3Qk7P2EZGH4dWGwpdoIH7/vShW4otkdbj9gD c7y74/Rd1bE0cmTdJu0AINawD/rp2YweVl5bwhraLo27InR6Rp2KOsg5wRBPPkaC0d eQuAqa1czD08A== Date: Thu, 25 Mar 2021 19:27:59 +0000 From: Will Deacon To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, Hector Martin , Arnd Bergmann , Mark Rutland , Catalin Marinas , kernel-team@android.com Subject: Re: [PATCH 1/2] arm64: cpufeature: Allow early filtering of feature override Message-ID: <20210325192759.GA16123@willie-the-truck> References: <20210325124721.941182-1-maz@kernel.org> <20210325124721.941182-2-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210325124721.941182-2-maz@kernel.org> 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-20210325_192808_672510_B0431352 X-CRM114-Status: GOOD ( 17.20 ) 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 On Thu, Mar 25, 2021 at 12:47:20PM +0000, Marc Zyngier wrote: > Some CPUs are broken enough that some overrides need to be rejected > at the earliest opportunity. In some cases, that's right at cpu > feature override time. > > Provide the necessary infrastructure to filter out overrides, > and to report such filtered out overrides to the core cpufeature code. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kernel/cpufeature.c | 6 ++++++ > arch/arm64/kernel/idreg-override.c | 13 +++++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 066030717a4c..6de15deaa912 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -809,6 +809,12 @@ static void __init init_cpu_ftr_reg(u32 sys_reg, u64 new) > reg->name, > ftrp->shift + ftrp->width - 1, > ftrp->shift, str, tmp); > + } else if ((ftr_mask & reg->override->val) == ftr_mask) { This seems to rely on 'val == mask' being invalid, but I'm not sure why that's generally true. Can we just invoke the filter function again here to figure out if the field has been ignored? Then in match_options, we can just clear the override val/mask to zero. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel