[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen: Add GS base to HVM VCPU context


  • To: Aravindh Puthiyaparambil <aravindh@xxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>
  • From: Keir Fraser <keir.xen@xxxxxxxxx>
  • Date: Mon, 23 Apr 2012 22:04:31 +0100
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxx>
  • Delivery-date: Mon, 23 Apr 2012 21:05:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: Ac0hlK1NDD+Dz62NyUiqAFzygkOYtg==
  • Thread-topic: [Xen-devel] [PATCH] xen: Add GS base to HVM VCPU context

On 23/04/2012 20:11, "Aravindh Puthiyaparambil" <aravindh@xxxxxxxxxxxx>
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@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.