public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] sigaltstack and RBS
Date: Sun, 09 Feb 2003 18:22:33 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590709805830@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709805824@msgid-missing>

>>>>> On Sun, 9 Feb 2003 21:55:50 +1100, Matt Chapman <matthewc@cse.unsw.edu.au> said:

  Matt> I'll explain the context.  I've written a virtual machine
  Matt> monitor which currently (for ease of prototyping) runs
  Matt> completely in userspace.  e.g. itc does an mmap, ptc does an
  Matt> munmap, changing RID unmaps a whole region, SIGSEGV delivers a
  Matt> TLB miss to the "guest" kernel.

  Matt> Now after a flush or RID change the guest kernel returns to
  Matt> its userspace with ar.bspstore pointing off to somewhere that
  Matt> isn't mapped, expecting to get a fault eventually.  This is
  Matt> where the problem occurs.  A mandatory RSE load faults as
  Matt> expected and the kernel tries to deliver SIGSEGV.  But then
  Matt> the RFI to the signal trampoline repeats the same RSE load
  Matt> that caused the fault in the first place, before the signal
  Matt> handler can deal with it.

Ah, that does sound interesting.

Actually, my explanation from yesterday can't be right: the current
register frame as of the time of the mandatory RSE fault by definition
is NOT on the user backing store, so the "rfi" shouldn't trigger any
mandatory loads (the user's current frame is restored by the "loadrs"
in the kernel's exit path).

  Matt> Is there any reason that the signal trampoline needs to see
  Matt> the original frame, or would it suffice to give it an empty
  Matt> frame?  (Hmm, presumably this would mean filling out sc_cfm in
  Matt> the kernel...  how to do that if we're in a syscall and
  Matt> haven't done the cover?)

Someone needs to take care of backing the user's dirty partition.
Since the user's original stack may not be valid, it needs to be
backed by the alternate signal stack.  That's most easily done by the
signal trampoline after switching to the new backing store.

I'm not sure off-hand what's wrong.  I'll take a look Monday.  For
what it's worth, the test program does seem to work fine on 2.5.52.

	--david


  parent reply	other threads:[~2003-02-09 18:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-09  5:19 [Linux-ia64] sigaltstack and RBS Matt Chapman
2003-02-09  5:27 ` David Mosberger
2003-02-09  5:47 ` Matt Chapman
2003-02-09  7:58 ` Matt Chapman
2003-02-09  8:48 ` David Mosberger
2003-02-09 10:55 ` Matt Chapman
2003-02-09 18:22 ` David Mosberger [this message]
2003-02-11  3:06 ` David Mosberger
2003-02-11  7:26 ` Matt Chapman
2003-02-11 19:11 ` David Mosberger
2003-03-07 23:35 ` Bjorn Helgaas

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=marc-linux-ia64-105590709805830@msgid-missing \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /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