From patchwork Wed Jun 1 17:13:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Marinas X-Patchwork-Id: 12867090 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 ABC90C43334 for ; Wed, 1 Jun 2022 17:14:50 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Nf+oL9mSh6gEKSj4fwEojGhiLOXqJ+FPhJv6L2DjBdA=; b=UGgrPzQVAShS43 nic8J6fuTtfMFxivilWPb6ucfuXYcm1R3kKVaTzIGrd+FJymZ22EKzDYaLVz6cv/U2PXWnT7M3lOv jtzM2/dQCTXFPnWv9/2KkbY9NegCf5JS04fKPN6Rx0g/VcKxmQO+TI8LUtfCM1h+RAktljJ8DtmXR zBWCne7ksUZTTAZNkBYjA49AwkWoGJg51V1AdGtmoT9xnj7iN8EKFVq5GguF3BPICQueSy+nVRnOU mq+KTsJnzpQ7yTBs2ffjlfcngk7BkQFbs3x/VZ4ZWG7mODXbFBJfkYJPH7+mZhcGtkZL7Gi1RI5nE 7+OHQPtql0pnwuEaT5PQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwRuv-00HFoh-86; Wed, 01 Jun 2022 17:13:57 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwRup-00HFnX-Tm for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 17:13:53 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 45787615F9; Wed, 1 Jun 2022 17:13:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C1A0C385A5; Wed, 1 Jun 2022 17:13:49 +0000 (UTC) From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon , kernel test robot , Mark Brown Subject: [PATCH] arm64/sme: Fix the ffr variable assignment Date: Wed, 1 Jun 2022 18:13:46 +0100 Message-Id: <20220601171346.2143699-1-catalin.marinas@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_101352_035920_DAE6A474 X-CRM114-Status: GOOD ( 13.14 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This variable is a bool and expected to be set to true if the FFR state needs saving/restoring, false otherwise. In __efi_fpsimd_end() this variable should be restored to the value of efi_sm_state but this is a per-CPU variable, not to be read directly. Make ffr false if !__this_cpu_read(efi_sm_state), leave it true otherwise. Signed-off-by: Catalin Marinas Fixes: e0838f6373e5 ("arm64/sme: Save and restore streaming mode over EFI runtime calls") Reported-by: kernel test robot Cc: Mark Brown --- arch/arm64/kernel/fpsimd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) base-commit: 0616ea3f1b93a99264d84f3d002ae117f6526b62 diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 819979398127..8bc9080adab2 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1960,13 +1960,12 @@ void __efi_fpsimd_end(void) * streaming mode. */ if (system_supports_sme()) { - if (__this_cpu_read(efi_sm_state)) { + if (__this_cpu_read(efi_sm_state)) sysreg_clear_set_s(SYS_SVCR, 0, SVCR_SM_MASK); - if (!system_supports_fa64()) - ffr = efi_sm_state; - } + else + ffr = false; } sve_load_state(sve_state + sve_ffr_offset(sve_max_vl()),