The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: dmr@plan9.bell-labs.com (Dennis Ritchie)
Subject: [TUHS] re: Raise of interrupt level necessary
Date: Fri, 13 Dec 2002 01:04:29 -0500	[thread overview]
Message-ID: <9c4e303326da457e4762dda8f843916a@plan9.bell-labs.com> (raw)

Wolfgang Helbig wondered,

 > While studying the V6 kernel, I search for some rules as when to raise
 > the interrupt priority level (IPL). I came up with something like this:
 > A kernel process needs to raise the IPL if a change of data must be atomic and might
 > be accessed (not necessarily changed) by an IRS.

 > In light of this rule, some raising of interrupts seem unnecessary:
 > - In m40.s changes of the user space segmentation registers are bracketed by raising
 > and lowering the IPL, although these registers are never accessed by an ISR.

 > - Likewise, in m40.s, just before the trap routine checks the runrun flag and
 > restores r0, r1 and the user stackpointer, it raises the IPL. I can't see what
 > possibly should go wrong, if being interrupted while restoring the values.
 
It's quite possible that the code is unnecessarily cautious.
In general one does not want an interrupt while something
sensitive is in a half-changed state (for example, some of
the addressing registers changed, or a stack half-switched).

For example, the clock interrupt routine can inspect user
space (for display(), for example, though this is inactive
on the 11/40), and even change it (for profiling).
It does appear that other things (checking for
a direct-from user-mode interrupt) in the clock routine
already guard against these particular problems.

It's been a long time since I've looked at this, however.

	Dennis




             reply	other threads:[~2002-12-13  6:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-13  6:04 Dennis Ritchie [this message]
2002-12-14  8:47 Wolfgang Helbig
2002-12-14 23:27 ` Michael Davidson
2002-12-15  9:52 Wolfgang Helbig
2002-12-16 21:43 Ian King

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=9c4e303326da457e4762dda8f843916a@plan9.bell-labs.com \
    --to=dmr@plan9.bell-labs.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;
as well as URLs for NNTP newsgroup(s).