Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1527304rdb; Mon, 8 Jan 2024 01:57:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5nN4WxA37uFTargJA3vu/tygq0U0jx1BsRUNEvmR2TvGa2eoeZ9X+Q+yGbN+3dwweceeH X-Received: by 2002:a50:d61d:0:b0:554:4bb2:9a6e with SMTP id x29-20020a50d61d000000b005544bb29a6emr3637507edi.11.1704707821030; Mon, 08 Jan 2024 01:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704707821; cv=none; d=google.com; s=arc-20160816; b=nmbyISQAaaJuosoXhQJJ/hHJC5jkpELS/2dzfAAvehEQH8e7eENuL5dZnyra/gSKk3 iWXdJKXGJKbRGxwzCP4kMvYL0Jp3PKN5zkUtmBsNVPxFAYeBBjX8WV8JyMX99wiULKpY S7qF+YgtlMN9iXCSOpKXUlR7HQXM+8zdndQxd6zlgFCGFm7aB9EhMNOmrLtTk9137U7w RowXTbesB87usDglsZBU0EhcGpyfE7/g0Gl7C3i+ezCVCOf/TMqgfSAVcnwgJZ9h5whu WAf0outOH8JRyv0zmFs0xQEtG6jx0Egf4LsIlpX9AmUHmpEhDLRmTxd3mJMGDKtzIhJm wcEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=J6zcoW9ZBE4FkJfB/Sgrd9ilZjNAT7x2Y69neKzMmhA=; fh=m7x+bE4wxU8Jqo7VbteSGsqYU+FTUdXTMwn1Ts81+p8=; b=T8KN6IXvS7auUedroAxoAiqV93d3B+7s6R/pPHDk95K7de3pdy3s9i15gkxXYy1Kjh 87V4c6jfMeLgHNIhBL4bJ/Lu5abzG25xcmNkE4VQaY/Weo91Y2W9JUBf9fbTDuzZjiIY N3AAhZfgRaFDnuqu+6/ERDNwYq+/UDecIJnHvEdPv46v3T7+gTvPGRA8SSXW1YcS8rCc USIHknBavYkSU0vA2QfEHv2dHL/RnPPArxCZ0lOM0SnFIOzXjQ2U/FV2SYt3tFKNTyrF 0zbqVpR6THH+Yr+FioPH3Y6VfDdSifqGdOgb6kYARu3AoUAMWGtAW6/C/TNqZXMwN/n9 lg/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19304-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cz6-20020a0564021ca600b005561131ca4asi2881150edb.81.2024.01.08.01.57.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:57:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19304-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19304-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C57B51F22106 for ; Mon, 8 Jan 2024 09:57:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F188A13AF0; Mon, 8 Jan 2024 09:56:53 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 912B013ADC for ; Mon, 8 Jan 2024 09:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-5e784ce9bb8so11527917b3.0 for ; Mon, 08 Jan 2024 01:56:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704707810; x=1705312610; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J6zcoW9ZBE4FkJfB/Sgrd9ilZjNAT7x2Y69neKzMmhA=; b=kdjgjS6+HSOTt9xRmE7TUF+tERvCJdqDwSjdW5pvTfw+IfRUiRMnrzifGRqF8rAwcb i8FJFXXwHPDq4mX7/TzAiYSne5Oy6Qv9MbykRnqUdabndbEdtnZsAeZL3cIPhRIlLL9a iYJQkPtJmxAIKCG1jhM0b6Y4rfiu/fGnZkJJpWQOWriIpVKGN+oiT1rr4IEkCl8lz/vB JFnpNc3gvCgfDRFDCE0bptr69UwaWFGpnqjW5q6h59tFJcK92kUAd+/mgwzcX3Gd2NXa 6OGYuM8cGsETC8B1t3rxjJFUuXn+bpFPGrC7LItdVZL9VeKazDE+GJ1BV5u2j5ezXnD0 hLiw== X-Gm-Message-State: AOJu0YyJQEKqf1qfzAGdSaecXv6vOTOFR25hHrdZ/dWubNQczfpl/kHk kkbV8Mn/1+HlqDAHLlF0KnFajzMfIdzawQ== X-Received: by 2002:a0d:d3c6:0:b0:5e7:7811:84e9 with SMTP id v189-20020a0dd3c6000000b005e7781184e9mr2028063ywd.35.1704707810430; Mon, 08 Jan 2024 01:56:50 -0800 (PST) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id j3-20020a816e03000000b005e8f5b53d6bsm3027021ywc.22.2024.01.08.01.56.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jan 2024 01:56:50 -0800 (PST) Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-dbdd61d80a3so1144904276.0 for ; Mon, 08 Jan 2024 01:56:49 -0800 (PST) X-Received: by 2002:a25:7ec7:0:b0:dbd:726a:21f0 with SMTP id z190-20020a257ec7000000b00dbd726a21f0mr1894139ybc.16.1704707809104; Mon, 08 Jan 2024 01:56:49 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240108093221.1477020-1-daniel@0x0f.com> <20240108093221.1477020-3-daniel@0x0f.com> In-Reply-To: <20240108093221.1477020-3-daniel@0x0f.com> From: Geert Uytterhoeven Date: Mon, 8 Jan 2024 10:56:37 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/2] m68k: Fix interrupt stack frames for 68000 To: Daniel Palmer Cc: gerg@linux-m68k.org, fthain@linux-m68k.org, linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Daniel, Thanks for your patch! On Mon, Jan 8, 2024 at 10:32=E2=80=AFAM Daniel Palmer wro= te: > The plain old 68000 does not push the frame type/vector on the > stack when an interrupt starts like the brand new 68010 does. ;-) > This means that currently everything in struct pt_regs is > a bit off because it expects the processor to push an extra > short before the kernel interrupt code adds the rest. > > In entry.S for the 68000 we already need to manually put > the vector number on the stack to work out what interrupt > is being handled because the cpu doesn't push that to the > stack. > > So we can jiggle this around a bit to fix the issue: > - For 68000 use the same struct pt_regs layout as coldfire > where frame/vector is after pc and sp. > - In entry.S push the vector number first, the stack pointer > now lines up with the sktadj field in pt_regs and when saving > the remaining registers the offsets match the fields in the > struct. > - Remove the vec argument from the DragonBall interrupt > decoding logic as it's not pushed on the stack anymore > and not used either way. > > Signed-off-by: Daniel Palmer > --- a/arch/m68k/include/uapi/asm/ptrace.h > +++ b/arch/m68k/include/uapi/asm/ptrace.h > @@ -39,7 +39,7 @@ struct pt_regs { > long d0; > long orig_d0; > long stkadj; > -#ifdef CONFIG_COLDFIRE > +#if defined(CONFIG_COLDFIRE) || defined(CONFIG_M68000) > unsigned format : 4; /* frame format specifier */ > unsigned vector : 12; /* vector offset */ > unsigned short sr; I think it would be better to use the classic m68k stack frame. That would pave the way for building a single nommu kernel for MC680[012346]0 that runs on e.g. any Amiga. MC68000 and Coldfire are incompatible anyway. Gr{oetje,eeting}s, Geert --=20 Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k= .org In personal conversations with technical people, I call myself a hacker. Bu= t when I'm talking to journalists I just say "programmer" or something like t= hat. -- Linus Torvalds