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 25F1BC43334 for ; Thu, 2 Jun 2022 12:18:54 +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=/ISNqiIJciJaWpUcPrXzmRGPxjgLAmT8ws9XoI5nWUc=; b=Yg7nGfNminIdNo v0LVNJpfgC/A8T2xOrq7V1IrKiMUOfVNC1M2Fq/6/oVQ0kSfmrtb1b7QAHy59KH+PblESagHQnWq2 dNB52H7Z60mDBO2S45UpABpYSxdnTzqiqnxnT+h+TzmeJ7aY44heGoAhJBYqN0Nbj3vFs9EyO4fv/ 7LXMUxCx9PX1rZSdCkGfYgCJqVKzcMWqOl2ERPgB2w2BPjgNXu7vMPA8VyubI/6zlRrX12zKT7uFz 4ukhPOsrmSSS6Db9bjZ0Uyi7oL6oIhNsR4O0lnnIeWLBHwTVDksc5zpzWm1fxPjNZGC0w5DJLx/9j q+EBfeKsGMff/smeooFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwjlu-003Atr-3B; Thu, 02 Jun 2022 12:17:50 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwjlp-003AtK-RP for linux-arm-kernel@lists.infradead.org; Thu, 02 Jun 2022 12:17:47 +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 ams.source.kernel.org (Postfix) with ESMTPS id 552EAB81F18; Thu, 2 Jun 2022 12:17:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AE53C385A5; Thu, 2 Jun 2022 12:17:41 +0000 (UTC) Date: Thu, 2 Jun 2022 13:17:38 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, kernel test robot Subject: Re: [PATCH] arm64/sme: Fix EFI save/restore Message-ID: References: <20220602094544.3303367-1-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220602094544.3303367-1-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220602_051746_063338_CE925E68 X-CRM114-Status: GOOD ( 15.92 ) 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, Jun 02, 2022 at 11:45:44AM +0200, Mark Brown wrote: > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c > index 819979398127..3c66a061ff6f 100644 > --- a/arch/arm64/kernel/fpsimd.c > +++ b/arch/arm64/kernel/fpsimd.c > @@ -1916,10 +1916,11 @@ void __efi_fpsimd_begin(void) > if (system_supports_sme()) { > svcr = read_sysreg_s(SYS_SVCR); > > - if (!system_supports_fa64()) > - ffr = svcr & SVCR_SM_MASK; > + __this_cpu_write(efi_sm_state, > + svcr & SVCR_SM_MASK); > > - __this_cpu_write(efi_sm_state, ffr); > + if (!system_supports_fa64()) > + ffr = !(svcr & SVCR_SM_MASK); > } > > sve_save_state(sve_state + sve_ffr_offset(sve_max_vl()), > @@ -1965,7 +1966,7 @@ void __efi_fpsimd_end(void) > 0, > SVCR_SM_MASK); > if (!system_supports_fa64()) > - ffr = efi_sm_state; > + ffr = false; > } > } This looks fine to me: Reviewed-by: Catalin Marinas Please add some comments to the code for when we need to save/restore the FFR state and let me know when you got a chance to test it so that I can send it upstream. Thanks. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel