mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "Andrew Lutomirski" <luto@mit.edu>
Cc: <jj@chaosbits.net>, <mingo@elte.hu>,
	"Ian Campbell" <Ian.Campbell@eu.citrix.com>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	<andi@firstfloor.org>, <pageexec@freemail.hu>,
	<brgerst@gmail.com>, <richard.weinberger@gmail.com>,
	"Jeremy Fitzhardinge" <jeremy@goop.org>, <arjan@infradead.org>,
	<mikpe@it.uu.se>, <Louis.Rilling@kerlabs.com>,
	<xen-devel@lists.xensource.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	<linux-kernel@vger.kernel.org>, <Valdis.Kletnieks@vt.edu>
Subject: Re: git commit 9fd67b4ed0714ab718f1f9bd14c344af336a6df7 (x86-64: Give vvars their own page) breaks Xen PV guests (64-bit).
Date: Tue, 26 Jul 2011 08:18:27 +0100	[thread overview]
Message-ID: <4E2E8663020000780004FAA4@nat28.tlf.novell.com> (raw)
In-Reply-To: <CAObL_7F9+Wn1DBf5te7BHoAe3CbEzR=pxTqy_S_vpkwcG57NKQ@mail.gmail.com>

>>> On 25.07.11 at 20:10, Andrew Lutomirski <luto@mit.edu> wrote:
> On Mon, Jul 25, 2011 at 12:10 PM, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
>> However, this is what I get later on, any ideas?
> 
>> [    0.585880] init[1] illegal int 0xcc from 32-bit mode ip:ffffffffff600400 
> cs:e033 sp:7fff230ca088 ax:ffffffffff600400 si:7faee3e822bf di:7fff230ca158
> 
> That will, indeed, crash your system.
> 
> 0xe033 is FLAT_RING3_CS64
> 
> Jeremy / other Xen people:  I'm trying to implement a lightweight
> check to distinguish a trap from a sane (i.e. allowable for syscalls)
> 64-bit user context from anything else.  There seems to be precedent
> for using ->cs == __USER_CS to detect 64-bitness; for example, step.c
> contains:
> 
> #ifdef CONFIG_X86_64
>                 case 0x40 ... 0x4f:
>                         if (regs->cs != __USER_CS)
>                                 /* 32-bit mode: register increment */
>                                 return 0;
>                         /* 64-bit mode: REX prefix */
>                         continue;
> #endif
> 
> The prefetch opcode checker in mm/fault.c does something similar.

That (namely the latter) has been in place basically forever (also in
the original http://xenbits.xen.org/hg/linux-2.6.18-xen.hg/ tree),
but indeed would seem to need addition of a check against Xen's
ring-3 64-bit CS. It's just that in the pre-existing cases the
consequences are at worst moderate...

Jan


  reply	other threads:[~2011-07-26  7:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-25 15:54 Konrad Rzeszutek Wilk
2011-07-25 16:10 ` Konrad Rzeszutek Wilk
2011-07-25 18:10   ` Andrew Lutomirski
2011-07-26  7:18     ` Jan Beulich [this message]
2011-07-26 16:18     ` Konrad Rzeszutek Wilk
2011-07-26 16:46       ` Ian Campbell
2011-07-26 19:01       ` Andrew Lutomirski
2011-07-26 20:51         ` Konrad Rzeszutek Wilk
2011-07-26 20:55           ` Andrew Lutomirski
2011-07-26 21:06             ` Konrad Rzeszutek Wilk

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=4E2E8663020000780004FAA4@nat28.tlf.novell.com \
    --to=jbeulich@novell.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Louis.Rilling@kerlabs.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=brgerst@gmail.com \
    --cc=jeremy@goop.org \
    --cc=jj@chaosbits.net \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@mit.edu \
    --cc=mikpe@it.uu.se \
    --cc=mingo@elte.hu \
    --cc=pageexec@freemail.hu \
    --cc=richard.weinberger@gmail.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --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®