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 9ED402343C9; Mon, 10 Mar 2025 18:14:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741630464; cv=none; b=VVk9ymussN/Gx9DqOasXTCFvRw4KC12j6k990yTBPbySHHPHRruQZsQj2nhymVaFuufWzcMgdDMKbC8DGcOQ4QuINo+1874MsieNsc0iYpz/BYYzPpE6FCfkZa7R5CjMbLrdIagmzMfbYBBmHBinpP08QpAmtjJtzWYP/TpLtHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741630464; c=relaxed/simple; bh=NBO5IEtLp/cfeo2/W3WGUps65FhG/ojETMW9plyonBc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pQw5zq08WYBek5DMkK/6HMayB6eS9zWFU5XqyMdN7qbxr9WysnENpljqsI1/IgH7uKT5xw2CnkTT+VoKv+8sgG6OvGTK5Eey8exK7cxsX01z6vXhoRM1U70WCmAkmthNmb/iU0QOv2l8mzateFM8rW9L1mzDt+mrcJlBLxTgvOk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xr9dokYa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Xr9dokYa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25DEBC4CEEC; Mon, 10 Mar 2025 18:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741630464; bh=NBO5IEtLp/cfeo2/W3WGUps65FhG/ojETMW9plyonBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xr9dokYaxJ2bE8oA46bFV4ItpRCcFuHP2ZCJMwlpmQE2Cex8M73A6wUbg21ctzueU VEoBhRhuEJMvgUxMYY1eSh6vWgGvDpbg+3MOIL+MrbpYYFhGt43OF4/Ok24YW7vmmi nKoe2va/rKsYqLVkNHx6tKKZMXI0z6QV9Ux3qafo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Maciej W. Rozycki" , Matt Turner , Ivan Kokshaysky Subject: [PATCH 5.15 415/620] alpha: replace hardcoded stack offsets with autogenerated ones Date: Mon, 10 Mar 2025 18:04:21 +0100 Message-ID: <20250310170601.970158578@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ivan Kokshaysky commit 77b823fa619f97d16409ca37ad4f7936e28c5f83 upstream. This allows the assembly in entry.S to automatically keep in sync with changes in the stack layout (struct pt_regs and struct switch_stack). Cc: stable@vger.kernel.org Tested-by: Maciej W. Rozycki Tested-by: Matt Turner Reviewed-by: Maciej W. Rozycki Signed-off-by: Ivan Kokshaysky Signed-off-by: Matt Turner Signed-off-by: Greg Kroah-Hartman --- arch/alpha/kernel/asm-offsets.c | 2 ++ arch/alpha/kernel/entry.S | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/arch/alpha/kernel/asm-offsets.c +++ b/arch/alpha/kernel/asm-offsets.c @@ -32,7 +32,9 @@ void foo(void) DEFINE(CRED_EGID, offsetof(struct cred, egid)); BLANK(); + DEFINE(SP_OFF, offsetof(struct pt_regs, ps)); DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs)); + DEFINE(SWITCH_STACK_SIZE, sizeof(struct switch_stack)); DEFINE(PT_PTRACED, PT_PTRACED); DEFINE(CLONE_VM, CLONE_VM); DEFINE(CLONE_UNTRACED, CLONE_UNTRACED); --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S @@ -15,10 +15,6 @@ .set noat .cfi_sections .debug_frame -/* Stack offsets. */ -#define SP_OFF 184 -#define SWITCH_STACK_SIZE 320 - .macro CFI_START_OSF_FRAME func .align 4 .globl \func