From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEE6B33EC for ; Mon, 16 Jan 2023 15:56:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63BC4C433D2; Mon, 16 Jan 2023 15:56:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673884581; bh=25mIPByvC0F11M+OqIPwMmaMS3HV65Ilw4mgKFVl9UI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q5bgCCqOnaB/4aUAFyYcYQpe8iJUo7tAk1/gqMKjQlV2C/HzSs/ZnPAEdG2Ak06EJ WPGVYjpus5HMqAQArXnMSfVUNY9Xj9x9ZW9frm7fd1lKnubZKRNTkpECp3nSexBf7Q qJ7qsgdY0Fwzzw7rtK8xlK8p7TWI7arShKIifmos= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mark Brown , Will Deacon Subject: [PATCH 6.1 060/183] arm64/signal: Always accept SVE signal frames on SME only systems Date: Mon, 16 Jan 2023 16:49:43 +0100 Message-Id: <20230116154805.876815145@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154803.321528435@linuxfoundation.org> References: <20230116154803.321528435@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Mark Brown commit 7dde62f0687c8856b6c0660066c7ee83a6a6f033 upstream. Currently we reject an attempt to restore a SVE signal frame on a system with SME but not SVE supported. This means that it is not possible to disable streaming mode via signal return as this is configured via the flags in the SVE signal context. Instead accept the signal frame, we will require it to have a vector length of 0 specified and no payload since the task will have no SVE vector length configured. Fixes: 85ed24dad290 ("arm64/sme: Implement streaming SVE signal handling") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20221223-arm64-fix-sme-only-v1-2-938d663f69e5@kernel.org Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/signal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -280,7 +280,12 @@ static int restore_sve_fpsimd_context(st vl = task_get_sme_vl(current); } else { - if (!system_supports_sve()) + /* + * A SME only system use SVE for streaming mode so can + * have a SVE formatted context with a zero VL and no + * payload data. + */ + if (!system_supports_sve() && !system_supports_sme()) return -EINVAL; vl = task_get_sve_vl(current);