public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Brad Boyer <flar@allandria.com>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k@lists.linux-m68k.org
Subject: Re: spinlock recursion when running q800 emulation in qemu
Date: Wed, 6 Mar 2024 00:30:54 -0800	[thread overview]
Message-ID: <20240306083054.GA20607@allandria.com> (raw)
In-Reply-To: <0ccf5e42-63ec-a63d-9ee9-7043947637c3@gmail.com>

On Wed, Mar 06, 2024 at 08:14:31PM +1300, Michael Schmitz wrote:
> Looking at the backtraces some more, I think what happens here is that the
> swapper kernel task is stalled for long enough here that on the next
> scheduler tick, it is still running. With no other tasks scheduled to run in
> the meantime, it may still be the current task.
> 
> The stalled swapper task still holds the run queue lock, hence the recursion
> message.
> 
> I do not think this is a bug, just a reflection of a slow system with
> nothing much to do.
> 
> There does not appear to be any interrupt nesting here. I cannot recall the
> interrupt level assignment on the Q800, in particular as regards disk
> interrupts and whether both VIAs are using the same interrupt level. I'd
> suppose they would, as these chips date back a long time and probably cannot
> place a vector number on the bus as part of the interrupt stack frame?

No, a Mac with 2 VIA chips should always have them on separate interrupt
levels. The exact mapping varies by model, but every model supported
by Linux uses at least three different hardware IRQ levels.

On most Mac models, VIA1 is IRQ1, VIA2 is IRQ2, and the SCC is IRQ4.
VIA1 would handle the timer and ADB while VIA2 handles NuBus and SCSI.
It looks like the Q800 supports switching VIA1 to IRQ6 through the
alternate IRQ mapping. Most models also are using various other chips
emulating a real VIA for VIA2 with varying levels of compatibility.

Apple always used autovectoring and the three IPL pins to determine
the interrupt vector. Older models just have three external IRQ
sources, one matching each pin (thus the 1, 2, 4 pattern). I presume
they had some external circuit to make sure only one line is being
pulled low at a time since we never get other IRQ levels by accident.

The AV macs and the IIfx are the only models with more complex
interrupt controllers as separate chips (PSC or OSS).

	Brad Boyer
	flar@allandria.com


  reply	other threads:[~2024-03-06  8:55 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 17:58 spinlock recursion when running q800 emulation in qemu Guenter Roeck
2024-03-05  0:33 ` Finn Thain
2024-03-05  0:48   ` Michael Schmitz
     [not found]   ` <fcb506f2-523d-4efc-ae3d-fe3c79c6f09e@gmail.com>
2024-03-05  0:58     ` Guenter Roeck
2024-03-05  1:06       ` Michael Schmitz
2024-03-06  7:14 ` Michael Schmitz
2024-03-06  8:30   ` Brad Boyer [this message]
2024-03-06 23:13     ` Finn Thain
2024-03-06 23:46       ` Guenter Roeck
2024-03-07 23:35         ` Finn Thain
2024-03-06 23:42     ` Michael Schmitz
2024-03-06 23:52   ` Finn Thain
2024-03-08  0:20     ` Michael Schmitz
2024-03-08  0:56       ` Finn Thain
2024-03-08  8:06         ` Michael Schmitz
2024-03-08  9:15           ` Finn Thain
2024-03-08  9:33             ` Finn Thain
2024-03-08 20:14               ` Michael Schmitz
2024-03-09  5:02                 ` Finn Thain
2024-03-09 20:56                   ` Michael Schmitz
2024-03-09 22:18                     ` Finn Thain
2024-03-11  7:06                       ` Michael Schmitz
2024-03-11  8:35                         ` Finn Thain
2024-03-12  0:51                           ` Michael Schmitz
2024-03-12  7:59                             ` Geert Uytterhoeven
2024-03-12 20:14                               ` Michael Schmitz
2024-03-13  0:16                               ` Michael Schmitz
2024-03-13  4:39                                 ` Preemption (was: Re: spinlock recursion when running q800 emulation in qemu) Michael Schmitz
2024-03-13  4:40                                 ` spinlock recursion when running q800 emulation in qemu Finn Thain
2024-03-13  5:34                                   ` Michael Schmitz
2024-03-14  0:59                                   ` Michael Schmitz
2024-03-15  4:32                                     ` Michael Schmitz
2024-03-15  7:24                                       ` Finn Thain
2024-03-18  6:24                                         ` Michael Schmitz
2024-03-18  9:31                                           ` Finn Thain
2024-03-20  1:00                                             ` Michael Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240306083054.GA20607@allandria.com \
    --to=flar@allandria.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux@roeck-us.net \
    --cc=schmitzmic@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox