From: Bastian Blank <waldi@debian.org>
To: Jeremy Fitzhardinge <jeremy@goop.org>,
linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
544145@bugs.debian.org, Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: 32bit binaries on x86_64/Xen segfaults in syscall-vdso
Date: Fri, 4 Sep 2009 20:19:39 +0200 [thread overview]
Message-ID: <20090904181939.GA9077@wavehammer.waldi.eu.org> (raw)
In-Reply-To: <20090904174605.GA8396@wavehammer.waldi.eu.org>
On Fri, Sep 04, 2009 at 07:46:05PM +0200, Bastian Blank wrote:
> On Fri, Sep 04, 2009 at 09:07:39AM -0700, Jeremy Fitzhardinge wrote:
> > On 09/03/09 15:36, Bastian Blank wrote:
> > > This function looks weird. It tries to restores the user code segment.
> > > But the documentation from AMD explicitely stat that the CS and SS are
> > > restored from the STAR register.
> | #define FLAT_RING3_CS32 0xe023
> | wrmsr(MSR_STAR, 0, (FLAT_RING3_CS32<<16) | __HYPERVISOR_CS);
> But this does not match my observation either.
Well, it does. The values for a long-mode program within Xen:
| cs 0xe033 57395
| ss 0xe02b 57387
Values on the bare hardware:
| cs 0x33 51
| ss 0x2b 43
Values for a compatibility-mode program on the bare hardware:
| cs 0x23 35
| ss 0x2b 43
So Xen adds 0xe000 (no idea what that means), but the Linux kernel
expects the value without. Long mode is not affected.
Okay, I tried the test program again and yes, it jumps back into
long-mode. (See the 0x10 in the restored CS[1].)
| cs 0xe033 57395
| ss 0xe02b 57387
Bastian
[1]: http://amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24593.pdf,
page 151
--
Where there's no emotion, there's no motive for violence.
-- Spock, "Dagger of the Mind", stardate 2715.1
prev parent reply other threads:[~2009-09-04 18:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-30 18:16 Bastian Blank
2009-09-03 20:51 ` Jeremy Fitzhardinge
2009-09-03 22:02 ` Bastian Blank
2009-09-03 22:06 ` Jeremy Fitzhardinge
2009-09-03 22:36 ` Bastian Blank
2009-09-04 16:07 ` Jeremy Fitzhardinge
2009-09-04 16:20 ` Bastian Blank
2009-09-04 16:56 ` Jeremy Fitzhardinge
2009-09-04 17:46 ` Bastian Blank
2009-09-04 18:19 ` Bastian Blank [this message]
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=20090904181939.GA9077@wavehammer.waldi.eu.org \
--to=waldi@debian.org \
--cc=544145@bugs.debian.org \
--cc=jeremy@goop.org \
--cc=keir.fraser@eu.citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xensource.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
all inboxes | Powered by JetHome®