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 594AEC25B08 for ; Wed, 17 Aug 2022 14:28:29 +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=qQGJZh8wgpCroSqzpxY6/RHhg65u9XC5dQZ6cV7luV4=; b=OiakNZYShvOgqd 0iU4CXwQEmX5VJSC9nPGpR7R85hMh7eYsPgXgBr4XQqRPMlLNTI9o/eDeuowGh9DE4n7JjReBy0bi 6g/6VQuu48CduWVmwFF0CPt09JTC0+f55qxtlsEgPxhHfSlWI/xxQz4b1fm7kH7T5dRH1JUwb050u ijKUFFqjkJzIk/VL9ZLVnkGKgZSF6Sb1KoYA8E/AqLol9p5mg4i4/ev4py/CU30pkw1hhl59O+I6Z 35qjFvcuXyO2gdtlcHDe8rK5X2grEADwxdWuCOjDiUFCJrYBtKYCEVOipuAc/kUjYrPr+T0Q0DN+F 0Ely2zNxaOnMcOZsLbkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oOK0t-002pJr-1j; Wed, 17 Aug 2022 14:27:19 +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 1oOK0q-002pIj-GC for linux-arm-kernel@lists.infradead.org; Wed, 17 Aug 2022 14:27:17 +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 D86056142A for ; Wed, 17 Aug 2022 14:27:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 881C9C433C1; Wed, 17 Aug 2022 14:27:14 +0000 (UTC) Date: Wed, 17 Aug 2022 15:27:10 +0100 From: Catalin Marinas To: Mark Brown Cc: Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 3/4] arm64/sme: Don't flush SVE register state when allocating SME storage Message-ID: References: <20220815132834.229769-1-broonie@kernel.org> <20220815132834.229769-4-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815132834.229769-4-broonie@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220817_072716_595412_B1C03B60 X-CRM114-Status: GOOD ( 15.32 ) 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, Aug 15, 2022 at 02:28:33PM +0100, Mark Brown wrote: > Currently when taking a SME access trap we allocate storage for the SVE > register state in order to be able to handle storage of streaming mode SVE. > Due to the original usage in a purely SVE context the SVE register state > allocation this also flushes the register state for SVE if storage was > already allocated but in the SME context this is not desirable. For a SME > access trap to be taken the task must not be in streaming mode so either > there already is SVE register state present for regular SVE mode which would > be corrupted or the task does not have TIF_SVE and the flush is redundant. > > Fix this by adding a flag to sve_alloc() indicating if we are in a SVE > context and need to flush the state. Freshly allocated storage is always > zeroed either way. > > Fixes: 8bd7f91c03d88 ("arm64/sme: Implement traps and syscall handling for SME") > Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel