virtualization hooks patch for ia64 2.6.15

From: Magenheimer, Dan (HP Labs Fort Collins) <>
Date: 2005-10-29 06:51:24
Attached is a patch which provides a set of virtualization
hooks for Linux/ia64.  Although these will be applicable
for Xen, they are generalized to be useful for some other
virtualization solutions.  In fact, all mentions of Xen
(except for one comment) have been deleted; this is purely
a foundation patch which adds a layer of indirection to
certain C and assembly routines so that they can be easily
replaced.  Until the hooks are used, this patch has no functional
effect -- e.g. calls to foo() are changed to __foo() and then
re-defined to foo().  Virtualization solutions need only
add an ifdef'd include in one (new) header file to utilize
the hooks and enable solution-specific paravirtualization.

To explain briefly, there are a set of instructions in the
current ia64 (and x86) architecture that are "privilege-sensitive".
If any of these instructions are executed by a "deprivileged"
guest running on top of a virtualization solution, the
results of the instruction will be different than expected
which in most cases can crash the guest kernel.  Thus,
these instructions must be avoided.  In a "paravirtualized"
guest these instructions are replaced in the source.  In
most paravirtualization solutions, some other privileged
instructions (e.g. turning on/off interrupts) are also replaced
with solution-specific mechanisms that perform better
in a virtualized environment.

Future processor revisions (code-named VT for Intel and
Pacifica for AMD) will change the instruction set to
minimize virtualization problems but with other tradeoffs;
suffice it to say that paravirtualized solutions and
hardware-virtualized solutions -- as well as other
solutions such as UML and "pre-virtualization" -- will
need to co-exist for the forseeable future.  Just like
Linux supports a number of filesystems to meet the
requirements of different users, the same will be
true for virtualization.  And, just like filesystems,
providing a good generalized foundation which meets many
of the needs of many of the solutions should not wait
until all solutions are completely evolved.

With help and advice from Tony Luck, David Mosberger,
Christoph Hellwig and others, this patch has evolved
from replacing the instructions at the point of use
(which was ugly and difficult to maintain)
to replacing them at the gcc-intrinsic level, plus a
few remaining assembly routines.  As a result, nearly
all changes to Linux and Linux/ia64 can be applied
completely oblivious to the needs of a paravirtualization
solution.  Plus, this foundation will support "transparent
paravirtualization" which allows distros to build a single
binary that will run both on raw iron and on one or more
virtualization platforms.

These hooks are not a magic salve for all virtualization
solutions.  Indeed they are not applicable to "higher level"
virtualization solution, e.g. UML, but should be useful
for several paravirtualization solutions that replace
privilege-sensitive instructions, including Xen, vBlades,
vNUMA, Itanium VM, and if they were to enter the ia64
market, VMware.

For those specifically interested in Xen, Chris Wright is
working with Andrew and Linus to integrate the Xen patch
from a separate tree... the patch I am proposing here will
greatly reduce the impact for this effort for Xen/ia64
and Linux/ia64 so I would like to see it in 2.6.15 even
if the Xen patch doesn't make it in time.

Comments appreciated.  Tony, if this explanation and
more generalized patch doesn't resolve your previously
stated philosophical concerns (e.g. don't want to lead
x86 Xen changes; and don't know if all virtualization
solutions will be instruction-based), please let me know.

Dan Magenheimer
HP Labs

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at

Received on Sat Oct 29 06:55:21 2005

This archive was generated by hypermail 2.1.8 : 2005-10-29 06:55:30 EST