All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Aravindh Puthiyaparambil <aravindh@virtuata.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] xen: Add GS base to HVM VCPU context
Date: Mon, 23 Apr 2012 22:04:31 +0100	[thread overview]
Message-ID: <CBBB826F.31605%keir.xen@gmail.com> (raw)
In-Reply-To: <CAB10MZBUPC2AyZ5CCzEOCezq+pefiqZ_SyWCb7JWVDWhJnA=TA@mail.gmail.com>

On 23/04/2012 20:11, "Aravindh Puthiyaparambil" <aravindh@virtuata.com>
wrote:

>>>>> +#ifdef __x86_64__
>>>>> +        if ( ring_0(&c.nat->user_regs) )
>>>>> +            c.nat->gs_base_kernel = sreg.base;
>>>>> +        else
>>>>> +            c.nat->gs_base_user = sreg.base;
>>>>> +#endif
>>>> 
>>>> If you do anything like this, do it completely please (i.e. fill all three
>>>> base address fields instead of just one).
>>>> 
>>> 
>>> Sure. I was not sure if it was ok to add fields to the vcpu context
>>> structure which is why I didn't do it across the board. I will do so and
>>> resubmit.
>> 
>> I don't see what fields you would need to add.
> 
> Don't I need to add ss_base, cs_base, es_base, ds_base to
> vcpu_guest_context? I am assuming both 32-bit and 64-bit cases.

Only the existing (x86_64-only) fs_base, gs_base_kernel, gs_base_user fields
need be filled in. All other base addresses are zero in 64-bit mode, and in
32-bit mode the base addresses are obtained from the GDT/LDT when the
segment register is loaded, and so do not need to be stored in the
vcpu_context.

 -- Keir

> Aravindh
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2012-04-23 21:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21  0:58 [PATCH] xen: Add GS base to HVM VCPU context Aravindh Puthiyaparambil
2012-04-23  7:41 ` Jan Beulich
2012-04-23  7:47   ` Aravindh Puthiyaparambil
2012-04-23  7:53     ` Jan Beulich
2012-04-23 19:11       ` Aravindh Puthiyaparambil
2012-04-23 21:04         ` Keir Fraser [this message]
2012-04-23 22:11           ` Aravindh Puthiyaparambil

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=CBBB826F.31605%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=aravindh@virtuata.com \
    --cc=xen-devel@lists.xen.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 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.