Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Xen 3.0 Virtualization Interface Guide
Prev Home Next

A.5 Segmentation Support

Xen allows guest OSes to install a custom GDT if they require it; this is context switched transparently whenever a domain is [de]scheduled. The following hypercall is effectively a `safe' version of lgdt:

set_gdt(unsigned long *frame_list, int entries)

Install a global descriptor table for a domain; frame_list is an array of up to 16 machine page frames within which the GDT resides, with entries being the actual number of descriptor-entry slots. All page frames must be mapped read-only within the guest's address space, and the table must be large enough to contain Xen's reserved entries (see xen/include/public/arch-x86_32.h).

Many guest OSes will also wish to install LDTs; this is achieved by using mmu_update() with an extended command, passing the linear address of the LDT base along with the number of entries. No special safety checks are required; Xen needs to perform this task simply since lldt requires CPL 0.

Xen also allows guest operating systems to update just an individual segment descriptor in the GDT or LDT:

update_descriptor(uint64_t ma, uint64_t desc)

Update the GDT/LDT entry at machine address ma; the new 8-byte descriptor is stored in desc. Xen performs a number of checks to ensure the descriptor is valid.

Guest OSes can use the above in place of context switching entire LDTs (or the GDT) when the number of changing descriptors is small.

Xen 3.0 Virtualization Interface Guide
Prev Home Next

  Published under the terms of the GNU General Public License Design by Interspire