From: Brian Gerst <bgerst@didntduck.org>
To: root@chaos.analogic.com
Cc: richardj_moore@uk.ibm.com, Andi Kleen <ak@suse.de>,
"Maciej W. Rozycki" <macro@ds2.pg.gda.pl>,
linux-kernel@vger.kernel.org
Subject: Re: Why is double_fault serviced by a trap gate?
Date: Thu, 07 Dec 2000 17:36:54 -0500 [thread overview]
Message-ID: <3A301106.D58DCB2E@didntduck.org> (raw)
In-Reply-To: <Pine.LNX.3.95.1001207163133.3136A-100000@chaos.analogic.com>
"Richard B. Johnson" wrote:
>
> On Thu, 7 Dec 2000 richardj_moore@uk.ibm.com wrote:
>
> >
> >
> > Which surely we can on today's x86 systems. Even back in the days of OS/2
> > 2.0 running on a 386 with 4Mb RAM we used a taskgate for both NMI and
> > Double Fault. You need only a minimal stack - 1K, sufficient to save state
> > and restore ESP to a known point before switching back to the main TSS to
> > allow normal exception handling to occur.
> >
> > There no architectural restriction that some folks have hinted at - as long
> > as the DPL for the task gates is 3.
> >
> [SNIPPED...]
>
> Please refer to page 6-16, Inter486 Microprocessor Family Programmer's
> Reference Manual.
>
> The specifc text is: "The TSS does not have a stack pointer for a
> privilege level 3 stack, because the procedure cannot be called by a less
> privileged procedure. The stack for privilege level 3 is preserved by the
> contents of SS and EIP registers which have been saved on the stack
> of the privilege level called from level 3".
>
> What this means is that a stack-fault in level 3 will kill you no
> matter how cute you try to be. And, putting a task gate as call
> procedure entry from a trap or fault is just trying to be cute.
> It's extra code that will result in the same processor reset.
No, because the CPL of the task gate would be 0, which means the stack
will be set to tss->esp0. The DPL of 3 means that the descriptor can be
accessed from CPL3. The text you mention generally means that the only
way to get back to CPL3 is with iret (via the saved %cs:%eip and
%ss:%esp pushed on the CPL0/1/2 stack).
--
Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-12-07 23:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-12-07 21:09 Why is double_fault serviced by a trap gate? richardj_moore
2000-12-07 21:44 ` Richard B. Johnson
2000-12-07 22:36 ` Brian Gerst [this message]
2000-12-08 1:36 ` Richard B. Johnson
2000-12-08 11:44 ` Maciej W. Rozycki
2000-12-07 22:47 ` Keith Owens
2000-12-08 11:30 ` Maciej W. Rozycki
-- strict thread matches above, loose matches on Subject: below --
2000-12-09 23:46 richardj_moore
2000-12-08 20:48 richardj_moore
2000-12-08 16:34 richardj_moore
2000-12-08 16:52 ` Richard B. Johnson
2000-12-08 13:18 richardj_moore
2000-12-08 8:37 richardj_moore
2000-12-08 12:58 ` Richard B. Johnson
2000-12-08 22:34 ` Keith Owens
2000-12-08 20:31 ` Mikulas Patocka
2000-12-07 23:08 richardj_moore
2000-12-07 23:03 richardj_moore
2000-12-07 23:01 Petr Vandrovec
2000-12-07 20:20 Petr Vandrovec
2000-12-07 19:38 ` Maciej W. Rozycki
2000-12-07 18:13 Petr Vandrovec
2000-12-07 18:04 ` Maciej W. Rozycki
2000-12-07 16:04 richardj_moore
2000-12-07 16:13 ` Andi Kleen
2000-12-07 16:31 ` Richard B. Johnson
2000-12-07 16:55 ` Maciej W. Rozycki
2000-12-07 18:05 ` Andi Kleen
2000-12-07 18:11 ` Maciej W. Rozycki
2000-12-07 18:29 ` Andi Kleen
2000-12-07 18:47 ` Maciej W. Rozycki
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=3A301106.D58DCB2E@didntduck.org \
--to=bgerst@didntduck.org \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@ds2.pg.gda.pl \
--cc=richardj_moore@uk.ibm.com \
--cc=root@chaos.analogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.