All of lore.kernel.org
 help / color / mirror / Atom feed
* Updating built-in GDT
@ 2006-01-23 18:02 Ivan Kelly
  2006-01-24 11:35 ` Keir Fraser
  0 siblings, 1 reply; 9+ messages in thread
From: Ivan Kelly @ 2006-01-23 18:02 UTC (permalink / raw)
  To: xen-devel

When porting a new OS to xen (using 2.0.7) is it possible to use the builtin
GDT for all your purposes, or do you have to create a new one if you want to
work with anything but the descriptors that are already in the xen provided
one. 
If you can use the builtin one, how do you access the GDT? Is it in the 64M
reserved address space?
Regards
Ivan Kelly

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-23 18:02 Updating built-in GDT Ivan Kelly
@ 2006-01-24 11:35 ` Keir Fraser
  2006-01-24 11:47   ` Ivan Kelly
  2006-01-24 14:48   ` Ivan Kelly
  0 siblings, 2 replies; 9+ messages in thread
From: Keir Fraser @ 2006-01-24 11:35 UTC (permalink / raw)
  To: Ivan Kelly; +Cc: xen-devel


On 23 Jan 2006, at 18:02, Ivan Kelly wrote:

> When porting a new OS to xen (using 2.0.7) is it possible to use the 
> builtin
> GDT for all your purposes, or do you have to create a new one if you 
> want to
> work with anything but the descriptors that are already in the xen 
> provided
> one.
> If you can use the builtin one, how do you access the GDT? Is it in 
> the 64M
> reserved address space?

You can't update the built-in GDT. Instead, create your own and pass 
the list of MFNs that comprise your GDT to the set_gdt() hypercall. You 
must ensure you have only read-only mappings of those MFNs before 
passing them to that hypercall! If you wish to update your GDT, use the 
update_descriptor() hypercall.

We could emulate write accesses to the guest GDT, but that hasn't so 
far been implemented.

  -- Keir

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-24 11:35 ` Keir Fraser
@ 2006-01-24 11:47   ` Ivan Kelly
  2006-01-24 12:04     ` Keir Fraser
  2006-01-24 14:48   ` Ivan Kelly
  1 sibling, 1 reply; 9+ messages in thread
From: Ivan Kelly @ 2006-01-24 11:47 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On Tue, Jan 24, 2006 at 11:35:05AM +0000, Keir Fraser wrote:
> You can't update the built-in GDT. Instead, create your own and pass 
> the list of MFNs that comprise your GDT to the set_gdt() hypercall. You 
> must ensure you have only read-only mappings of those MFNs before 
> passing them to that hypercall! If you wish to update your GDT, use the 
> update_descriptor() hypercall.
I ended up taking this approach, though i've yet to get it to work. With
update_descriptor the first argument is a machine address. Should this be the
machine frame number + offset of entry?
Regards
Ivan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-24 12:04     ` Keir Fraser
@ 2006-01-24 12:02       ` Ivan Kelly
  2006-01-24 12:15         ` Keir Fraser
  0 siblings, 1 reply; 9+ messages in thread
From: Ivan Kelly @ 2006-01-24 12:02 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On Tue, Jan 24, 2006 at 12:04:00PM +0000, Keir Fraser wrote:
> Nope, it's a u64 machine address.
32bit machine here, so i guess that should be u32
> 
> Precisely, it's (MFN << 12) + offset
ya, thats what i meant :)
Thanks
Ivan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-24 11:47   ` Ivan Kelly
@ 2006-01-24 12:04     ` Keir Fraser
  2006-01-24 12:02       ` Ivan Kelly
  0 siblings, 1 reply; 9+ messages in thread
From: Keir Fraser @ 2006-01-24 12:04 UTC (permalink / raw)
  To: Ivan Kelly; +Cc: xen-devel


On 24 Jan 2006, at 11:47, Ivan Kelly wrote:

> I ended up taking this approach, though i've yet to get it to work. 
> With
> update_descriptor the first argument is a machine address. Should this 
> be the
> machine frame number + offset of entry?

Nope, it's a u64 machine address.

Precisely, it's (MFN << 12) + offset

  -- Keir

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Updating built-in GDT
@ 2006-01-24 12:08 Petersson, Mats
  0 siblings, 0 replies; 9+ messages in thread
From: Petersson, Mats @ 2006-01-24 12:08 UTC (permalink / raw)
  To: Ivan Kelly, Keir Fraser; +Cc: xen-devel

 

> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com 
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ivan Kelly
> Sent: 24 January 2006 12:02
> To: Keir Fraser
> Cc: xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] Updating built-in GDT
> 
> On Tue, Jan 24, 2006 at 12:04:00PM +0000, Keir Fraser wrote:
> > Nope, it's a u64 machine address.
> 32bit machine here, so i guess that should be u32

It would still need to be > 32 bits, as 32-bit machines may have PAE
enabled -> 36 bits of addressable memory. You wouldn't want your code to
break just because your GDT is above the 4G boundary, would you?

--
Mats
> > 
> > Precisely, it's (MFN << 12) + offset
> ya, thats what i meant :)
> Thanks
> Ivan
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-24 12:02       ` Ivan Kelly
@ 2006-01-24 12:15         ` Keir Fraser
  0 siblings, 0 replies; 9+ messages in thread
From: Keir Fraser @ 2006-01-24 12:15 UTC (permalink / raw)
  To: Ivan Kelly; +Cc: xen-devel


On 24 Jan 2006, at 12:02, Ivan Kelly wrote:

>> Nope, it's a u64 machine address.
> 32bit machine here, so i guess that should be u32

Always u64 (think PAE: it can support >4GB on a 32b system).

  -- Keir

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-24 11:35 ` Keir Fraser
  2006-01-24 11:47   ` Ivan Kelly
@ 2006-01-24 14:48   ` Ivan Kelly
  2006-01-24 16:15     ` Keir Fraser
  1 sibling, 1 reply; 9+ messages in thread
From: Ivan Kelly @ 2006-01-24 14:48 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

> You can't update the built-in GDT. Instead, create your own and pass 
> the list of MFNs that comprise your GDT to the set_gdt() hypercall. You 
> must ensure you have only read-only mappings of those MFNs before 
> passing them to that hypercall! If you wish to update your GDT, use the 
> update_descriptor() hypercall.
does set_gdt add the default descriptors(at 819, 820, 821 etc) or will i have
to insert these into my new gdt manually?
Regards
Ivan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Updating built-in GDT
  2006-01-24 14:48   ` Ivan Kelly
@ 2006-01-24 16:15     ` Keir Fraser
  0 siblings, 0 replies; 9+ messages in thread
From: Keir Fraser @ 2006-01-24 16:15 UTC (permalink / raw)
  To: Ivan Kelly; +Cc: xen-devel


On 24 Jan 2006, at 14:48, Ivan Kelly wrote:

>> You can't update the built-in GDT. Instead, create your own and pass
>> the list of MFNs that comprise your GDT to the set_gdt() hypercall. 
>> You
>> must ensure you have only read-only mappings of those MFNs before
>> passing them to that hypercall! If you wish to update your GDT, use 
>> the
>> update_descriptor() hypercall.
> does set_gdt add the default descriptors(at 819, 820, 821 etc) or will 
> i have
> to insert these into my new gdt manually?

The default selectors are 0xe000 and above. They are always available, 
even if you install your own GDT. To achieve this trick, guest GDTs are 
limited to 14 pages (7168 entries) rather than 16 pages (8192 entries).

  -- Keir

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-01-24 16:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-23 18:02 Updating built-in GDT Ivan Kelly
2006-01-24 11:35 ` Keir Fraser
2006-01-24 11:47   ` Ivan Kelly
2006-01-24 12:04     ` Keir Fraser
2006-01-24 12:02       ` Ivan Kelly
2006-01-24 12:15         ` Keir Fraser
2006-01-24 14:48   ` Ivan Kelly
2006-01-24 16:15     ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2006-01-24 12:08 Petersson, Mats

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.