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 DE8E5C433FE for ; Thu, 24 Nov 2022 14:05:22 +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:References:In-Reply-To: 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: List-Owner; bh=yp40mbhTr0ddJ/nNusPzFxQor4p04dNYsFLmTbF00Og=; b=bUoXzZ6jDOLdKV 6ToB3LVOy/DsJhJgQX1XDX1Nfhr9O2yL38tgwEzVTqHjHorZM8l6LF8RzYY2YQ9IICz9rmn2NSWcV wLX3YsKEXGVm/zrRusmFgVcGes6ooX6lDHHxhwQ1udN7WzvciVkh5Jw26A4N3AGlBt0fYFG71fBEU 9hE0EIbsCWjso5bq849UXQY7J+XOTbthN2rF1wJS5Z7cMiOFvq7khILUDvYW5+wS4Stw4z7MV2BES SD5jRcy1EmDs9r4A1rLCtqmDKUh8+mBT1g0Lu2kXq5DvGZ1Rk1lkHnvzcSYWVSIEk5Iqtl/q9gNMr mT8W8R16IRcN8WkBpUiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCpj-0095Nn-Av; Thu, 24 Nov 2022 14:04:07 +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 1oyCnq-0094i1-0X for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2022 14:02:12 +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 B029DB82803; Thu, 24 Nov 2022 14:02:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D703FC433C1; Thu, 24 Nov 2022 14:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669298527; bh=1PvN4Yqp5r7aZn94eP0nnCVDEToBhdZY2NLf3CPU5wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMmCKgyTJ5yNVdp31xNk9mnctoVKtVOgmoH0UAy0vISShxADYcW3LEK5YxGMzv+lx Vp50ubR3yq4xRvbJGayTtNW/6WEtG7epLSiBU+V/QiN8yEP9rTppLvrS95v/+pMUKd gQOlWa79U3CD230N/OlyW9OV8uDwQBqc/mZ12+0KHCvCM/ciCkc1kfioBEI/3ekfX6 y+zmWVVdMMBXjFYlxR4N+XxXpVPb5v7+UadEH3/LK3a3v/DtcbcbK3qlo0aE3W9e95 rQNzf7YN88kt7q0uDGocF6KD/dWkIlgsKIGUaHUDVppnJIYT8n6YVzautYqt5V3wXe 88HHrD3e+7WDw== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v1 3/6] arm64/signal: Make interface for restore_fpsimd_context() consistent Date: Thu, 24 Nov 2022 13:58:15 +0000 Message-Id: <20221124135818.282955-4-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221124135818.282955-1-broonie@kernel.org> References: <20221124135818.282955-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2785; i=broonie@kernel.org; h=from:subject; bh=1PvN4Yqp5r7aZn94eP0nnCVDEToBhdZY2NLf3CPU5wU=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjf3h3L/NGN937+gf8b42Khx4wlWMK8lANrpQO1dgn 9kKrY9iJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY394dwAKCRAk1otyXVSH0BjzB/ 4uWFxfQDtclleISHxsFanyeTWb4SFrqQk++mnNBYWrWKcq5wkCk0KzXwgdBYobfuk+3bdCT3sPTDae wxkYvxfIiL9Wi54BFqU1M+EHZmeQqcmd75xz1GwJ4e0W/dEc6M/S9ryCBFv/mU5WCFLPj8Y7g50tq0 RqnMX0NSW14eLQ6MJ+2DfK+hCXwCornD1eY/BlDP/DFCitm4TriJDbopwRdYbtPDooKUYQ+ltv4aw6 MCUKXIUuS55aNjWTOJ3FSuVzV55G9VDgcHNwP42dUwQSld2qeGXyp46PXUsrMpvrMQQX6KuR7Mcr++ /jrlEgmrHG1ZCKLw3Ovt0YP5Bloep8 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221124_060210_438443_3BDD7F4E X-CRM114-Status: GOOD ( 16.03 ) 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 Instead of taking a pointer to struct user_ctxs like the other two restore_blah_context() functions the FPSIMD function takes a pointer to the user struct it should read. Change it to be consistent with the rest, both for consistency and to prepare for changes which avoid rereading data that has already been read by the core parsing code. There should be no functional change from this patch. Signed-off-by: Mark Brown --- arch/arm64/kernel/signal.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index 1840e26f3f54..9603a468b104 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -168,6 +168,12 @@ static void __user *apply_user_offset( return base + offset; } +struct user_ctxs { + struct fpsimd_context __user *fpsimd; + struct sve_context __user *sve; + struct za_context __user *za; +}; + static int preserve_fpsimd_context(struct fpsimd_context __user *ctx) { struct user_fpsimd_state const *fpsimd = @@ -186,24 +192,24 @@ static int preserve_fpsimd_context(struct fpsimd_context __user *ctx) return err ? -EFAULT : 0; } -static int restore_fpsimd_context(struct fpsimd_context __user *ctx) +static int restore_fpsimd_context(struct user_ctxs *user) { struct user_fpsimd_state fpsimd; __u32 size; int err = 0; /* check the size information */ - __get_user_error(size, &ctx->head.size, err); + __get_user_error(size, &user->fpsimd->head.size, err); if (err) return -EFAULT; if (size != sizeof(struct fpsimd_context)) return -EINVAL; /* copy the FP and status/control registers */ - err = __copy_from_user(fpsimd.vregs, ctx->vregs, + err = __copy_from_user(fpsimd.vregs, &(user->fpsimd->vregs), sizeof(fpsimd.vregs)); - __get_user_error(fpsimd.fpsr, &ctx->fpsr, err); - __get_user_error(fpsimd.fpcr, &ctx->fpcr, err); + __get_user_error(fpsimd.fpsr, &(user->fpsimd->fpsr), err); + __get_user_error(fpsimd.fpcr, &(user->fpsimd->fpcr), err); clear_thread_flag(TIF_SVE); @@ -215,12 +221,6 @@ static int restore_fpsimd_context(struct fpsimd_context __user *ctx) } -struct user_ctxs { - struct fpsimd_context __user *fpsimd; - struct sve_context __user *sve; - struct za_context __user *za; -}; - #ifdef CONFIG_ARM64_SVE static int preserve_sve_context(struct sve_context __user *ctx) @@ -656,7 +656,7 @@ static int restore_sigframe(struct pt_regs *regs, if (user.sve) err = restore_sve_fpsimd_context(&user); else - err = restore_fpsimd_context(user.fpsimd); + err = restore_fpsimd_context(&user); } if (err == 0 && system_supports_sme() && user.za) -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel