From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from minute.unseen.parts (minute.unseen.parts [139.162.151.61]) (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 9CD7226A0D2 for ; Tue, 18 Feb 2025 14:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=139.162.151.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739890220; cv=none; b=eG4ZkQhMygJVgsAqNGmWF7xFukYrNsPeN0qo04XjAHLQCxxXyfKanE2alg10XS9omXRrXIhlxOyhOD3JNaCq0LUjOOX6KvRF/SSNx3Zf8ZXkRQFOKfkFeiaXYm43U0pdfsbHIUjA8OnFZhhdN4xMq+A9JRUvs7jpVcYU9y/I/ds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739890220; c=relaxed/simple; bh=+PAmDWSI9ufCPRdH7T68uFQIOv2VA6XTS2FhcAYGa6Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XfCLkxgO/uH/e4F4LGqH64M6LHBci3jZmbN8ZVOx+wOiuqUE618q5dEkhfxO9sgFllWKHUycZSUBfuK6SlFJIPrcQKeAMnxdB3nut6w/mHRZ0Hhr1JkLgwCNaPK8iA7bq9ZbKbr2Q6+GGoA65vnp0xeqefE+gvGKL8GJsZBM+xg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unseen.parts; spf=pass smtp.mailfrom=unseen.parts; dkim=pass (2048-bit key) header.d=unseen.parts header.i=@unseen.parts header.b=JY78NWfB; arc=none smtp.client-ip=139.162.151.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unseen.parts Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unseen.parts Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=unseen.parts header.i=@unseen.parts header.b="JY78NWfB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=unseen.parts; s=sig; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=oslRDW8z/9DaCSedAoMo+mhZULEdq2vfnqERramfXSk=; b=JY78NWfBRA1+0MvBDZEs73yDuD exshaUY5ZcZtXv44xBt3I2UQTHR3codgQZpMuZcrqE6v1C7LeMDm46QtN4phocDElVR9f47tacer4 5rPHZDK/VDmjFyyh/9xS/jnw2w/cGTfC20BkHcEw+r+Np0cdcq8xMG3qXggcqFujQpOy6KNuNa8DV EzJq1z7DSBDY1AxGKFeg04Vw+k8ext+oW17bui0BKbNtw1iJBheefRS3ox7tVik2+1DMML7MN0uSA KK+OgPiPFEtokY+sZt13BTZKuy9ZmDI5Cxh4u8CE3h50cZ6JIrG+s1CS3RpPqxrCICbWET7l+79wA d07tkLQA==; Received: from minute.unseen.parts ([139.162.151.61]:41386 helo=minute) by minute.unseen.parts with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1tkOvK-0005Cb-1v; Tue, 18 Feb 2025 15:50:10 +0100 Date: Tue, 18 Feb 2025 15:50:08 +0100 From: Ivan Kokshaysky To: Greg KH Cc: linmag7@gmail.com, macro@orcam.me.uk, mattst88@gmail.com, stable@vger.kernel.org Subject: [PATCH][v4.19-v6.1] alpha: replace hardcoded stack offsets with autogenerated Message-ID: References: <2025021844-cruelness-freedom-e051@gregkh> <2025021849-zoning-bath-bc43@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2025021849-zoning-bath-bc43@gregkh> [backported commit 77b823fa619f97d16409] 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 # v4.19.x-v6.1.x Signed-off-by: Ivan Kokshaysky --- arch/alpha/kernel/asm-offsets.c | 4 ++++ arch/alpha/kernel/entry.S | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c index 4cfeae42c79a..e9dad60b147f 100644 --- 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); diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index dd26062d75b3..6fb38365539d 100644 --- 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 -- 2.47.2