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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

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

  




 

 

Xen 3.0 Virtualization Interface Guide
Prev Home Next

A.6 Context Switching

When a guest OS wishes to context switch between two processes, it can use the page table and segmentation hypercalls described above to perform the the bulk of the privileged work. In addition, however, it will need to invoke Xen to switch the kernel (ring 1) stack pointer:


stack_switch(unsigned long ss, unsigned long esp)

Request kernel stack switch from hypervisor; ss is the new stack segment, which esp is the new stack pointer.

A useful hypercall for context switching allows ``lazy'' save and restore of floating point state:


fpu_taskswitch(int set)

This call instructs Xen to set the TS bit in the cr0 control register; this means that the next attempt to use floating point will cause a trap which the guest OS can trap. Typically it will then save/restore the FP state, and clear the TS bit, using the same call.

This is provided as an optimization only; guest OSes can also choose to save and restore FP state on all context switches for simplicity.

Finally, a hypercall is provided for entering vm86 mode:


switch_vm86

This allows the guest to run code in vm86 mode, which is needed for some legacy software.

Xen 3.0 Virtualization Interface Guide
Prev Home Next

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