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

Re: [Xen-devel] do_set_gdt



> HYPERVISOR_set_gdt(unsigned long *frame_list, unsigned int entries)
> 
> frame_list: an array of up to 16 page frames on which the gdt resides
> 
> entries: NOT the number of entries used in the gdt, but rather the
> number of gdt sized elements on the page that the hypervisor can use,
> this number must be greater than the maximum number of reserved entries
> regardless of the actual number of gdt entries you use or the call will
> fail with EINVAL, do not use FIRST_RESERVED_GDT_ENTRY -
> LAST_RESERVED_GDT_ENTRY as they are blindly overwritten by the
> hypervisor. You are, however, free to use any entry prior to
> FIRST_RESERVED_GDT_ENTRY and after LAST_RESERVED_GDT_ENTRY.

frame_list: An array of up to 16 page frames within which the GDT
resides. Any frame registered as a GDT frame may only be mapped
read-only within the guest's address space (e.g., no writeable
mappings, no use as a page-table page, and so on).

entries: The number of descriptor-entry slots in the GDT. Note that
the table must be large enough to contain Xen's reserved entries; thus
we must have 'entries > LAST_RESERVED_GDT_ENTRY'. Note also that,
after registering the GDT, slots FIRST_RESERVED_GDT_ENTRY to
LAST_RESERVED_GDT_ENTRY are no longer usable by the guest and may be
overwritten by Xen. 

> =========================================================================
> 
> 
> I think segments are intrinsically crufty, so a crufty interface is
> unavoidable. I'm merely pointing out that this particular interface
> requires the guest to know more about the internals of Xen than
> standard system/hyper call. To claim otherwise would be misleading.

It's the same with the linear address space: the guest is aware that
the top 64MB of the address space is unavailable to it. Similarly
here, the guest will be aware that a number of GDT entries are
inaccessible outside Xen.

This inelegance is part of the price we pay for performance on x86.

 -- Keir


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

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