From patchwork Thu Oct 17 13:39:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13840083 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 9204CD37495 for ; Thu, 17 Oct 2024 13:57:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6hj6vva+nQtvr/VwvrNRG4vMooV625tTpgPD9qLQqAM=; b=ySKYpfIqEBFXfDkvH1bNdHFeWj ES+5OwFV9UUvaxkV4+ZpRlld9dAufClyW9O+shgi8qW4PBw5e2lYV5gDpN6Uym97BHDAb0A0fZaG3 +xrzCGnURK94wNurAolyw8sMcqE7lAG/fNCKfryERer1eUotZlKFy21Sf3zrLY61zuUp6bj+JCq0h YW1durjp51Ah5JLLH6iqeSqMyT1+VAVsY+Wcy0uFQLJuVnKjeDj/i0F4yc/X8P6YyCejCHFMXS8kF Qj/VzWf3CCBVRsU3A3mFZyoMAfKxD2OSnfktPkBHk/YDTNQoiWJmiTDlWik16qe5woY1YsotkBG7V 7DE2l/8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1R0G-0000000F1Zb-0oBT; Thu, 17 Oct 2024 13:57:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t1Qjh-0000000EycL-0xGU for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2024 13:40:18 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8DB0A150C; Thu, 17 Oct 2024 06:40:46 -0700 (PDT) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 702923F71E; Thu, 17 Oct 2024 06:40:14 -0700 (PDT) From: Kevin Brodsky To: linux-arm-kernel@lists.infradead.org Cc: Kevin Brodsky , akpm@linux-foundation.org, anshuman.khandual@arm.com, aruna.ramakrishna@oracle.com, broonie@kernel.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, dave.martin@arm.com, jeffxu@chromium.org, joey.gouly@arm.com, shuah@kernel.org, will@kernel.org, linux-kselftest@vger.kernel.org, x86@kernel.org Subject: [PATCH 2/5] arm64: signal: Remove unnecessary check when saving POE state Date: Thu, 17 Oct 2024 14:39:06 +0100 Message-ID: <20241017133909.3837547-3-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241017133909.3837547-1-kevin.brodsky@arm.com> References: <20241017133909.3837547-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241017_064017_362829_CB6C068F X-CRM114-Status: GOOD ( 11.64 ) 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 The POE frame record is allocated unconditionally if POE is supported. If the allocation fails, a SIGSEGV is delivered before setup_sigframe() can be reached. As a result there is no need to check that poe_offset has been checked before saving POR_EL0; this is in line with other frame records (FPMR, TPIDR2). Signed-off-by: Kevin Brodsky Reviewed-by: Mark Brown Reviewed-by: Dave Martin Acked-by: Catalin Marinas --- arch/arm64/kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index dc998326e24d..f5fb48dabebe 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -1092,7 +1092,7 @@ static int setup_sigframe(struct rt_sigframe_user_layout *user, err |= preserve_fpmr_context(fpmr_ctx); } - if (system_supports_poe() && err == 0 && user->poe_offset) { + if (system_supports_poe() && err == 0) { struct poe_context __user *poe_ctx = apply_user_offset(user, user->poe_offset);