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 4F0D4188CCA; Wed, 19 Feb 2025 09:04:45 +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=1739955885; cv=none; b=WnwxehjDgVufbiBAdy7K3mJ3HMIDif0HqmeL2LL6mJyO4kF27EPH2P0Bi9Jd6+IJiQN0qsfBblRjcLozU9Y4VcDQVg3RSkNSHTCZVjAGrRnsk/C7PLPFmHMUR2JHLFvyiHsdkg9EE6UUJehg2mSr+2tpfaO5euY0dA/+zx4E9mU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739955885; c=relaxed/simple; bh=XHlpdjbMeIe/6HTslFIXYGUGc5C84psUtqbtEzFgH6Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lc+01ZZnT3tPMHIKSG0mtQh04Y3yQ+iOcVjJ2VhtoImL7zJlNzJVJgBrTPaYiwpz3fPD715cZ4dv6wWAlrBb3zRZx/0/maHMBCj6DjkL7E+pxqqsBuKo9J10ot0lo7HbfNapnPAHSEahlt/ee0K1UpLhGyV7m0pdtOS3iTdNdVA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SDyYSccI; 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="SDyYSccI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9952C4CEE9; Wed, 19 Feb 2025 09:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739955885; bh=XHlpdjbMeIe/6HTslFIXYGUGc5C84psUtqbtEzFgH6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SDyYSccIO5marjeP7tKynuXaPh1zI6CjCGfiRx+zIcNkhtgY5zP5K1pIxF0zsrLMt 32BN7cHKZ7lNw6uXCaMZ6DUaMikmVd+X+UHASjaZWGhdNDv1ZAptmTX32DfewNRMQ7 i5WA14ryHEwNrWs8baINMEMKy4Uu4M5dmw250kZ0= 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 6.6 146/152] alpha: replace hardcoded stack offsets with autogenerated ones Date: Wed, 19 Feb 2025 09:29:19 +0100 Message-ID: <20250219082555.823561691@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250219082550.014812078@linuxfoundation.org> References: <20250219082550.014812078@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 6.6-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 @@ -34,7 +34,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 64 - .macro CFI_START_OSF_FRAME func .align 4 .globl \func