All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: "Petersson, Mats" <Mats.Petersson@amd.com>
Cc: Al Boldi <a1426z@gawab.com>, xen-devel@lists.xensource.com
Subject: Re: Questioning the Xen Design of the VMM
Date: Tue, 08 Aug 2006 12:39:29 -0400	[thread overview]
Message-ID: <44D8BE41.9010709@redhat.com> (raw)
In-Reply-To: <907625E08839C4409CE5768403633E0BA7FE0E@sefsexmb1.amd.com>

Mats, thanks for the examples of where the hypervisor needs to know 
otherwise x86 guest doesn't do what it expects to be done.

I've just recently started working with Xen, but my background has been 
more with other architectures than x86.  I understand all that you 
explained, but one: see below. (I'm posting to the list so that others 
can learn too ;)

Petersson, Mats wrote:
>  

[ snipped a lot of good info ]

> 
> Another problem is "hidden bits" in registers. 
> 
> Let's say this:
> 
> 	mov	cr0, eax
> 	mov	eax, ecx
> 	or	$1, eax
> 	mov	eax, cr0
> 	mov	$0x10, eax
> 	mov	eax, fs
> 	mov	ecx, cr0
> 	
> 	mov	$0xF000000, eax
> 	mov	$10000, ecx
> $1:
> 	mov	$0, fs:eax
> 	add	$4, eax
> 	dec	ecx
> 	jnz	$1
> 
> Let's now say that we have an interrupt that the hypervisor would handle
> in the loop in the above code. The hypervisor itself uses FS for some
> special purpose, and thus needs to save/restore the FS register. When it
> returns, the system will crash (GP fault) because the FS register limit
> is 0xFFFF (64KB) and eax is greater than the limit - but the limit of FS
> was set to 0xFFFFFFFF before we took the interrupt... Incorrect
> behaviour like this is terribly difficult to deal with, and there really
> isn't any good way to solve these issues [other than not allowing the
> code to run when it does "funny" things like this - or to perform the
> necessary code in "translation mode" - i.e. emulate each instruction ->
> slow(ish)]. 
> 

The above I'm confused on.  In x86, the hypervisor can't store the fs 
register fully before returning from the interrupt??  You stated that 
the fs register limit was 0xffffffff before the interrupt, but ends up 
being 0xffff afterwards.  As I mentioned, I'm just learning the 
internals of x86, so my full comprehension on segment registers of x86 
is still a little fuzzy.

Could you explain further here?

Thanks,

-- Steve

  reply	other threads:[~2006-08-08 16:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 15:01 Questioning the Xen Design of the VMM Al Boldi
2006-08-08  9:10 ` Keir Fraser
2006-08-08  9:17 ` Harry Butterworth
2006-08-08  9:20 ` Petersson, Mats
2006-08-08 14:10   ` Al Boldi
2006-08-08 15:07     ` Petersson, Mats
2006-08-08 16:39       ` Steven Rostedt [this message]
2006-08-08 17:14         ` Petersson, Mats
2006-08-08 18:22           ` Steven Rostedt
2006-08-09 12:53       ` Al Boldi
2006-08-09 13:28         ` Petersson, Mats
2006-08-10 14:55           ` Al Boldi
2006-08-10 15:42             ` Petersson, Mats
2006-08-10 11:20         ` Daniel Stodden
2006-08-09 12:49     ` Daniel Stodden
2006-08-10 14:57       ` Al Boldi
2006-08-10 15:53         ` Daniel Stodden
2006-08-10 16:34           ` Petersson, Mats
2006-08-10 18:07             ` Daniel Stodden
2006-08-11  8:41               ` Petersson, Mats

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=44D8BE41.9010709@redhat.com \
    --to=srostedt@redhat.com \
    --cc=Mats.Petersson@amd.com \
    --cc=a1426z@gawab.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 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.