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 B3CB225BABF; Tue, 11 Mar 2025 15:32:37 +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=1741707157; cv=none; b=u76D5LBgtifLAbSnMxpY0vKBXNc6//UEYzC/X7iBlSkLEloT4rWs25B+J6TTF54ZddB6/pkUtmFPotTFJ3ZlLiJPXf2A+Q6rQi1iW5MpT8CHabfA1wpalE8tX7FL1eT0rEINqAx9IrJXxJ8LgSoqZ6u3cbiDjlN8tZc8K215SXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741707157; c=relaxed/simple; bh=VFEkH87GY0VxyxTlHjk3roPsVBjCwjI09oJq88hsX3U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IcgKgns35bmDtJLBsuviXCVsgjyNmDkNy3HZDrPQZ+/EQw+c8yfR5OprSlKlQ8Fm+0qg32hXuhcBNvL37CRUGbOStzqyy6+7SzMx8AJU9cHqi/3AOtSGfKgAujWgh4gE+mkv9Te+BSRXhnsZhAD6ciiISnOPLcvjlg3tw7D8izg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=j/Ownm4h; 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="j/Ownm4h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B7E4C4CEE9; Tue, 11 Mar 2025 15:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741707157; bh=VFEkH87GY0VxyxTlHjk3roPsVBjCwjI09oJq88hsX3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/Ownm4h0umRH5VKBsKZEKGaPYeKyNbdvPomvfPeTjTwaWxCILDrImqHKuL6crVAN NSJGtx8nGSeTA5LAgzg0fU483UCpncWPdEgoJOO4ly3vNAP4nQX2rA44XiqzqiIGaB 4TKg9ggdwd5R2wWHUAb0oxNJinflgeWVuz3JkeOU= 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.10 294/462] alpha: replace hardcoded stack offsets with autogenerated ones Date: Tue, 11 Mar 2025 15:59:20 +0100 Message-ID: <20250311145809.980832323@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145758.343076290@linuxfoundation.org> References: <20250311145758.343076290@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.10-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