mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andi Kleen <ak@suse.de>, Andrew Morton <akpm@osdl.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86_64: handle iret faults better
Date: Mon, 25 Apr 2005 15:31:25 -0700	[thread overview]
Message-ID: <200504252231.j3PMVPTb010573@magilla.sf.frob.com> (raw)
In-Reply-To: Linus Torvalds's message of  Monday, 25 April 2005 08:55:22 -0700 <Pine.LNX.4.58.0504250849370.18901@ppc970.osdl.org>

> Why don't you just do
> 
> 	pushl $0
> 	pushl $do_iret_error
> 	jmp error_code

I quote from the comment in the code:

								   We want
 * to turn it into a signal.  To make that signal's info exactly match what
 * this same kind of fault in a user instruction would show, the fixup
 * needs to know the trapno and error code.  But those are lost when we get
 * back to the fixup entrypoint.  

The error code is not always 0, it might be a bad segment value.  I think
the kernel ought to give accurate information about the fault consistently
no matter where it occurs, so I did not want to pretend the error code is 0.

I certainly think it would be cleaner if the fixup code could access the
fault information directly.  However, it's arguably not so clean to have a
do_iret_error function that replicates the work of do_trap and
do_general_protection.  The iret case is really not so much a special case
for what to do, but a special case for how you determine whether the
vanilla user-mode thing is done or the vanilla kernel-mode thing is done.


Thanks,
Roland

  reply	other threads:[~2005-04-25 22:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-24  0:50 Roland McGrath
2005-04-25 15:33 ` Andi Kleen
2005-04-25 15:55   ` Linus Torvalds
2005-04-25 22:31     ` Roland McGrath [this message]
2005-04-25 22:51       ` Linus Torvalds
2005-04-26  1:57         ` Roland McGrath
2005-04-26  4:06           ` Linus Torvalds
2005-04-29  3:40             ` [PATCH] i386: " Roland McGrath
2005-04-29 15:01               ` Andi Kleen
2005-04-29 16:44               ` Linus Torvalds
2005-05-02 19:56                 ` Andi Kleen
2005-04-29  3:45             ` [PATCH] x86_64: " Roland McGrath
2005-04-29 15:02               ` Andi Kleen

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=200504252231.j3PMVPTb010573@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

all inboxes | Powered by JetHome®