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 A1968EB64DD for ; Thu, 3 Aug 2023 16:40:10 +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=O5q3m/jLhxhHwp27LqVpuEuVTry4k4+0UC5pHF3BVMQ=; b=piwcWLaZPun2xD 7A6cXKbWxuaZ9KCj0vk29OUOV0i3FZOeLLOnJl9UX1nbuh++wtbl+6KP4asDbwWf0pMb4+YlDlRM/ Z5QhEO4X1X2XN9BOhGGVGX8PeX5+AQq+i/o0NpQm7yG7kqfuT5EqHT0LM/QAV3lLibkRDbFaJVOjR 9NMMcOUNK2W0+S5nfxX2/DNDxQ5KWYQYCKqMRaAeeydbyalf5E8cVjbf2gIJrJK98a6/JaUfeEZ8L 4lUfgY/iLC56VZqmoQRiqGFWBqeI3XDKKXdyM2x+cFJwsqw3ZtzsTTn6UBy5SeaKGYvrVJ2tnvGGZ Vq6nrHm0iMdYUSLpKalA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qRbMZ-00AM7j-1I; Thu, 03 Aug 2023 16:39:47 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qRbMW-00AM79-1N for linux-arm-kernel@lists.infradead.org; Thu, 03 Aug 2023 16:39:45 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1AAC361E41; Thu, 3 Aug 2023 16:39:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C345C433C7; Thu, 3 Aug 2023 16:39:41 +0000 (UTC) Date: Thu, 3 Aug 2023 17:39:38 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] arm64/fpsimd: Only provide the length to cpufeature for xCR registers Message-ID: References: <20230731-arm64-sme-fa64-hotplug-v2-1-7714c00dd902@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230731-arm64-sme-fa64-hotplug-v2-1-7714c00dd902@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230803_093944_529918_F967A6FB X-CRM114-Status: GOOD ( 19.60 ) 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 Mon, Jul 31, 2023 at 02:58:48PM +0100, Mark Brown wrote: > For both SVE and SME we abuse the generic register field comparison > support in the cpufeature code as part of our detection of unsupported > variations in the vector lengths available to PEs, reporting the maximum > vector lengths via ZCR_EL1.LEN and SMCR_EL1.LEN. Since these are > configuration registers rather than identification registers the > assumptions the cpufeature code makes about how unknown bitfields behave > are invalid, leading to warnings when SME features like FA64 are enabled > and we hotplug a CPU: > > CPU features: SANITY CHECK: Unexpected variation in SYS_SMCR_EL1. Boot CPU: 0x0000000000000f, CPU3: 0x0000008000000f > CPU features: Unsupported CPU feature variation detected. > > SVE has no controls other than the vector length so is not yet impacted > but the same issue will apply there if any are defined. > > Since the only field we are interested in having the cpufeature code > handle is the length field and we use a custom read function to obtain > the value we can avoid these warnings by filtering out all other bits > when we return the register value, if we're doing that we don't need to > bother reading the register at all and can simply use the RDVL/RDSVL > value we were filling in instead. Maybe that's the simplest fix, especially if you want it in stable, but I wonder why we even bother with with treating ZCR_EL1 and SMCR_EL1 as feature registers. We already have verify_sme_features() to check for the mismatch. BTW, is vec_verify_vq_map() sufficient so that we can skip the maximum vector length check? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DD6FEB64DD for ; Thu, 3 Aug 2023 16:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234152AbjHCQjp (ORCPT ); Thu, 3 Aug 2023 12:39:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbjHCQjo (ORCPT ); Thu, 3 Aug 2023 12:39:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80969E4D for ; Thu, 3 Aug 2023 09:39:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F4EA61E43 for ; Thu, 3 Aug 2023 16:39:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C345C433C7; Thu, 3 Aug 2023 16:39:41 +0000 (UTC) Date: Thu, 3 Aug 2023 17:39:38 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] arm64/fpsimd: Only provide the length to cpufeature for xCR registers Message-ID: References: <20230731-arm64-sme-fa64-hotplug-v2-1-7714c00dd902@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230731-arm64-sme-fa64-hotplug-v2-1-7714c00dd902@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 02:58:48PM +0100, Mark Brown wrote: > For both SVE and SME we abuse the generic register field comparison > support in the cpufeature code as part of our detection of unsupported > variations in the vector lengths available to PEs, reporting the maximum > vector lengths via ZCR_EL1.LEN and SMCR_EL1.LEN. Since these are > configuration registers rather than identification registers the > assumptions the cpufeature code makes about how unknown bitfields behave > are invalid, leading to warnings when SME features like FA64 are enabled > and we hotplug a CPU: > > CPU features: SANITY CHECK: Unexpected variation in SYS_SMCR_EL1. Boot CPU: 0x0000000000000f, CPU3: 0x0000008000000f > CPU features: Unsupported CPU feature variation detected. > > SVE has no controls other than the vector length so is not yet impacted > but the same issue will apply there if any are defined. > > Since the only field we are interested in having the cpufeature code > handle is the length field and we use a custom read function to obtain > the value we can avoid these warnings by filtering out all other bits > when we return the register value, if we're doing that we don't need to > bother reading the register at all and can simply use the RDVL/RDSVL > value we were filling in instead. Maybe that's the simplest fix, especially if you want it in stable, but I wonder why we even bother with with treating ZCR_EL1 and SMCR_EL1 as feature registers. We already have verify_sme_features() to check for the mismatch. BTW, is vec_verify_vq_map() sufficient so that we can skip the maximum vector length check? -- Catalin