aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.rootkeys32
-rw-r--r--BitKeeper/etc/ignore65
-rw-r--r--COPYING11
-rw-r--r--README204
-rw-r--r--docs/figs/xenserver.obj312
-rw-r--r--docs/misc/blkif-drivers-explained.txt4
-rw-r--r--docs/src/interface.tex896
-rw-r--r--docs/src/user.tex280
-rw-r--r--extras/mini-os/Makefile8
-rw-r--r--extras/mini-os/h/events.h2
-rw-r--r--extras/mini-os/h/hypervisor.h5
-rw-r--r--extras/mini-os/h/os.h4
-rw-r--r--linux-2.4.27-xen-sparse/arch/xen/Makefile2
-rw-r--r--linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h4
-rw-r--r--linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c4
-rw-r--r--linux-2.4.27-xen-sparse/arch/xen/kernel/process.c2
-rw-r--r--linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c4
-rw-r--r--linux-2.4.27-xen-sparse/arch/xen/kernel/time.c2
-rw-r--r--linux-2.4.27-xen-sparse/include/asm-xen/page.h2
-rw-r--r--linux-2.4.27-xen-sparse/include/asm-xen/segment.h2
-rwxr-xr-xlinux-2.4.27-xen-sparse/mkbuildtree10
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/Makefile8
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S2
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S2
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c2
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c2
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c29
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c5
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c4
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c4
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c4
-rw-r--r--linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c2
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/balloon/balloon.c93
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h2
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h4
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/console/console.c2
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/netback/common.h2
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c2
-rw-r--r--linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c2
-rw-r--r--linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h2
-rw-r--r--linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h2
-rw-r--r--linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h2
-rw-r--r--linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h6
-rwxr-xr-xlinux-2.6.9-xen-sparse/mkbuildtree10
-rwxr-xr-xnetbsd-2.0-xen-sparse/mkbuildtree10
-rw-r--r--netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h12
-rw-r--r--netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h2
-rw-r--r--netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c2
-rw-r--r--tools/Make.defs2
-rw-r--r--tools/libxc/Makefile12
-rw-r--r--tools/libxc/xc.h56
-rw-r--r--tools/libxc/xc_domain.c19
-rw-r--r--tools/libxc/xc_evtchn.c16
-rw-r--r--tools/libxc/xc_linux_save.c43
-rw-r--r--tools/libxc/xc_misc.c10
-rw-r--r--tools/libxc/xc_private.h14
-rw-r--r--tools/misc/Makefile3
-rw-r--r--tools/misc/p4perf.h559
-rw-r--r--tools/misc/setdomainmaxmem34
-rw-r--r--tools/misc/xen_cpuperf.c271
-rwxr-xr-xtools/misc/xensymoops (renamed from tools/misc/xensymoops.py)0
-rw-r--r--tools/python/setup.py3
-rw-r--r--tools/python/xen/lowlevel/xu/xu.c4
-rw-r--r--tools/xentrace/Makefile1
-rw-r--r--tools/xentrace/xentrace.c4
-rw-r--r--tools/xfrd/Makefile3
-rw-r--r--xen/COPYING4
-rw-r--r--xen/Makefile4
-rw-r--r--xen/Rules.mk2
-rw-r--r--xen/arch/x86/boot/x86_32.S2
-rw-r--r--xen/arch/x86/boot/x86_64.S2
-rw-r--r--xen/arch/x86/dom0_ops.c4
-rw-r--r--xen/arch/x86/pci-pc.c9
-rw-r--r--xen/arch/x86/pdb-stub.c3
-rw-r--r--xen/arch/x86/trampoline.S2
-rw-r--r--xen/arch/x86/traps.c2
-rw-r--r--xen/arch/x86/x86_32/entry.S2
-rw-r--r--xen/common/debug-linux.c2
-rw-r--r--xen/common/debug.c2
-rw-r--r--xen/common/dom0_ops.c4
-rw-r--r--xen/common/domain.c2
-rw-r--r--xen/common/event_channel.c4
-rw-r--r--xen/common/kernel.c2
-rw-r--r--xen/common/physdev.c4
-rw-r--r--xen/common/sched_atropos.c2
-rw-r--r--xen/common/sched_rrobin.c2
-rw-r--r--xen/common/schedule.c2
-rw-r--r--xen/common/trace.c4
-rw-r--r--xen/include/asm-x86/mm.h2
-rw-r--r--xen/include/asm-x86/pdb.h4
-rw-r--r--xen/include/asm-x86/processor.h2
-rw-r--r--xen/include/public/COPYING (renamed from xen/include/hypervisor-ifs/COPYING)0
-rw-r--r--xen/include/public/arch-x86_32.h (renamed from xen/include/hypervisor-ifs/arch-x86_32.h)6
-rw-r--r--xen/include/public/arch-x86_64.h (renamed from xen/include/hypervisor-ifs/arch-x86_64.h)10
-rw-r--r--xen/include/public/dom0_ops.h (renamed from xen/include/hypervisor-ifs/dom0_ops.h)8
-rw-r--r--xen/include/public/event_channel.h (renamed from xen/include/hypervisor-ifs/event_channel.h)6
-rw-r--r--xen/include/public/grant_table.h (renamed from xen/include/hypervisor-ifs/grant_table.h)6
-rw-r--r--xen/include/public/io/blkif.h (renamed from xen/include/hypervisor-ifs/io/blkif.h)6
-rw-r--r--xen/include/public/io/domain_controller.h (renamed from xen/include/hypervisor-ifs/io/domain_controller.h)6
-rw-r--r--xen/include/public/io/netif.h (renamed from xen/include/hypervisor-ifs/io/netif.h)4
-rw-r--r--xen/include/public/physdev.h (renamed from xen/include/hypervisor-ifs/physdev.h)6
-rw-r--r--xen/include/public/sched_ctl.h (renamed from xen/include/hypervisor-ifs/sched_ctl.h)6
-rw-r--r--xen/include/public/trace.h (renamed from xen/include/hypervisor-ifs/trace.h)8
-rw-r--r--xen/include/public/xen.h (renamed from xen/include/hypervisor-ifs/hypervisor-if.h)12
-rw-r--r--xen/include/xen/grant_table.h4
-rw-r--r--xen/include/xen/sched.h4
-rw-r--r--xen/include/xen/time.h2
-rw-r--r--xen/include/xen/trace.h6
108 files changed, 1458 insertions, 1844 deletions
diff --git a/.rootkeys b/.rootkeys
index ee88c673bb..93831dd4fe 100644
--- a/.rootkeys
+++ b/.rootkeys
@@ -7,6 +7,7 @@
3f5ef5a24IaQasQE2tyMxrfxskMmvw README
3f9e7d53iC47UnlfORp9iC1vai6kWw docs/Makefile
3f9e7d60PWZJeVh5xdnk0nLUdxlqEA docs/figs/xenlogo.eps
+418273f3YZUyGIrNbERVAPFeOd9gww docs/figs/xenserver.obj
4022a73cgxX1ryj1HgS-IwwB6NUi2A docs/misc/XenDebugger-HOWTO
412f4bd9sm5mCQ8BkrgKcAKZGadq7Q docs/misc/blkif-drivers-explained.txt
40d6ccbfKKBq8jE0ula4eHEzBiQuDA docs/misc/xen_config.html
@@ -350,15 +351,12 @@
40c9c469kT0H9COWzA4XzPBjWK0WsA tools/misc/netfix
4022a73cEKvrYe_DVZW2JlAxobg9wg tools/misc/nsplitd/Makefile
4022a73cKms4Oq030x2JBzUB426lAQ tools/misc/nsplitd/nsplitd.c
-3f870808_8aFBAcZbWiWGdgrGQyIEw tools/misc/p4perf.h
-4113d1afyPjO8m8-9E1pVBDHzGe1jQ tools/misc/setdomainmaxmem
3f5ef5a2ir1kVAthS14Dc5QIRCEFWg tools/misc/xen-clone
3f5ef5a2dTZP0nnsFoeq2jRf3mWDDg tools/misc/xen-clone.README
-3f870808zS6T6iFhqYPGelroZlVfGQ tools/misc/xen_cpuperf.c
405eedf6_nnNhFQ1I85lhCkLK6jFGA tools/misc/xencons
40c9c4697z76HDfkCLdMhmaEwzFoNQ tools/misc/xend
4107986eMWVdBoz4tXYoOscpN_BCYg tools/misc/xensv
-4056f5155QYZdsk-1fLdjsZPFTnlhg tools/misc/xensymoops.py
+4056f5155QYZdsk-1fLdjsZPFTnlhg tools/misc/xensymoops
40cf2937dqM1jWW87O5OoOYND8leuA tools/misc/xm
40c9c468icGyC5RAF1bRKsCXPDCvsA tools/python/Makefile
40ffc44dOwe1CcYXGCkYHdG_NxcccA tools/python/logging/logging-0.4.9.2/PKG-INFO
@@ -733,19 +731,19 @@
404f1bb86rAXB3aLS1vYdcqpJiEcyg xen/include/asm-x86/x86_64/ptrace.h
40e1966azOJZfNI6Ilthe6Q-T3Hewg xen/include/asm-x86/x86_64/string.h
404f1bc4tWkB9Qr8RkKtZGW5eMQzhw xen/include/asm-x86/x86_64/uaccess.h
-400304fcmRQmDdFYEzDh0wcBba9alg xen/include/hypervisor-ifs/COPYING
-404f1bc68SXxmv0zQpXBWGrCzSyp8w xen/include/hypervisor-ifs/arch-x86_32.h
-404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/hypervisor-ifs/arch-x86_64.h
-3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h
-403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/hypervisor-ifs/event_channel.h
-4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/hypervisor-ifs/grant_table.h
-3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h
-40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/hypervisor-ifs/io/blkif.h
-40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/hypervisor-ifs/io/domain_controller.h
-40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/hypervisor-ifs/io/netif.h
-4051db79512nOCGweabrFWO2M2h5ng xen/include/hypervisor-ifs/physdev.h
-40589968wmhPmV5-ENbBYmMjnedgKw xen/include/hypervisor-ifs/sched_ctl.h
-404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/hypervisor-ifs/trace.h
+400304fcmRQmDdFYEzDh0wcBba9alg xen/include/public/COPYING
+404f1bc68SXxmv0zQpXBWGrCzSyp8w xen/include/public/arch-x86_32.h
+404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/include/public/arch-x86_64.h
+3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/public/dom0_ops.h
+403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/public/event_channel.h
+4121d149udGfSUGhn3k1ECz0bM31nQ xen/include/public/grant_table.h
+40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/public/io/blkif.h
+40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/public/io/domain_controller.h
+40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/public/io/netif.h
+4051db79512nOCGweabrFWO2M2h5ng xen/include/public/physdev.h
+40589968wmhPmV5-ENbBYmMjnedgKw xen/include/public/sched_ctl.h
+404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/public/trace.h
+3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/public/xen.h
3e397e66m2tO3s-J8Jnr7Ws_tGoPTg xen/include/xen/ac_timer.h
40715b2epYl2jBbxzz9CI2rgIca7Zg xen/include/xen/acpi.h
3ddb79c0c0cX_DZE209-Bb-Rx1v-Aw xen/include/xen/cache.h
diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore
index ad49516b63..d8bc1ae2f2 100644
--- a/BitKeeper/etc/ignore
+++ b/BitKeeper/etc/ignore
@@ -13,25 +13,56 @@ TAGS
Twisted-1.3.0
Twisted-1.3.0.tar.gz
docs/*.aux
+docs/*.dvi
docs/*.log
docs/*.pdf
docs/*.ps
-docs/*.dvi
docs/*.toc
+docs/figs/xenserver.eps
docs/html/*
+docs/interface/WARNINGS
+docs/interface/images.pl
+docs/interface/images.tex
+docs/interface/img1.png
+docs/interface/index.html
+docs/interface/interface.css
+docs/interface/interface.html
+docs/interface/labels.pl
+docs/user/WARNINGS
+docs/user/images.pl
+docs/user/images.tex
+docs/user/img1.png
+docs/user/img2.png
+docs/user/img3.png
+docs/user/index.html
+docs/user/internals.pl
+docs/user/labels.pl
+docs/user/user.css
+docs/user/user.html
+docs/xend/WARNINGS
+docs/xend/images.pl
+docs/xend/images.tex
+docs/xend/img1.png
+docs/xend/index.html
+docs/xend/internals.pl
+docs/xend/labels.pl
+docs/xend/xend.css
+docs/xend/xend.html
extras/mini-os/h/hypervisor-ifs
install
install/*
linux-*-xen0/*
linux-*-xenU/*
-pristine-*
+linux-xen-sparse
+netbsd-*-tools
netbsd-*-xen0
netbsd-*-xenU
-netbsd-*-tools
patches/*
+pristine-*
tools/*/build/lib*/*.py
tools/balloon/balloon
tools/check/.*
+tools/libxc/xen
tools/misc/miniterm/miniterm
tools/misc/xen_cpuperf
tools/web-shutdown.tap
@@ -50,31 +81,3 @@ xen/tools/figlet/figlet
xen/xen
xen/xen-syms
xen/xen.*
-docs/interface/WARNINGS
-docs/interface/images.pl
-docs/interface/images.tex
-docs/interface/img1.png
-docs/interface/index.html
-docs/interface/interface.css
-docs/interface/interface.html
-docs/interface/labels.pl
-docs/user/WARNINGS
-docs/user/images.pl
-docs/user/images.tex
-docs/user/img1.png
-docs/user/img2.png
-docs/user/img3.png
-docs/user/index.html
-docs/user/internals.pl
-docs/user/labels.pl
-docs/user/user.css
-docs/user/user.html
-docs/xend/WARNINGS
-docs/xend/images.pl
-docs/xend/images.tex
-docs/xend/img1.png
-docs/xend/index.html
-docs/xend/internals.pl
-docs/xend/labels.pl
-docs/xend/xend.css
-docs/xend/xend.html
diff --git a/COPYING b/COPYING
index 9e4ba6a151..32f39ab5f8 100644
--- a/COPYING
+++ b/COPYING
@@ -17,12 +17,11 @@ Xen guests, certain files in this repository are not subject to the
GPL when distributed separately or included in software packages
outside this repository. Instead we specify a much more relaxed
BSD-style license. Affected files include the Xen interface headers
-(xen/include/hypervisor-ifs/COPYING), and various drivers, support
-functions and header files within the Linux sparse source trees. In
-all such cases, license terms are stated at the top of the file or in
-a COPYING file in the same directory. Note that _any_ file that is
-modified and then distributed within a Linux kernel is still subject
-to the GNU GPL!
+(xen/include/public/COPYING), and various drivers, support functions
+and header files within the Linux sparse source trees. In all such
+cases, license terms are stated at the top of the file or in a COPYING
+file in the same directory. Note that _any_ file that is modified and
+then distributed within a Linux kernel is still subject to the GNU GPL.
-- Keir Fraser (on behalf of the Xen team)
diff --git a/README b/README
index b56495a69c..a45e7f3213 100644
--- a/README
+++ b/README
@@ -8,203 +8,25 @@ __ __ ____ ___
###############################
University of Cambridge Computer Laboratory
-28 October 2004
+29 October 2004
-http://www.cl.cam.ac.uk/netos/xen
+http://www.cl.cam.ac.uk/netos/xen/
About the Xen Virtual Machine Monitor
=====================================
-"Xen" is a Virtual Machine Monitor (VMM) originally developed by the
+Xen is a Virtual Machine Monitor (VMM) originally developed by the
Systems Research Group of the University of Cambridge Computer
-Laboratory as part of the UK-EPSRC funded XenoServers project.
+Laboratory, as part of the UK-EPSRC funded XenoServers project.
-The XenoServers project aims to provide a "public infrastructure for
-global distributed computing", and Xen plays a key part in that,
-allowing us to efficiently partition a single machine to enable
-multiple independent clients to run their operating systems and
-applications in an environment providing protection, resource
-isolation and accounting. The project web page contains further
-information along with pointers to papers and technical reports:
-http://www.cl.cam.ac.uk/xeno
+The 2.0 release offers excellent performance, hardware support and
+enterprise-grade features such as live migration. Linux 2.6, 2.4 and
+NetBSD 2.0 are already available for Xen, with more operating system
+ports on the way.
-Xen has since grown into a project in its own right, enabling us to
-investigate interesting research issues regarding the best techniques
-for virtualizing resources such as the CPU, memory, disk and network.
-The project has been bolstered by support from Intel Research
-Cambridge, and HP Labs, who are now working closely with us.
-
-Xen enables multiple operating system images to execute concurrently
-on the same hardware with very low performance overhead --- much lower
-than commercial offerings for the same x86 platform.
-
-This is achieved by requiring OSs to be specifically ported to run on
-Xen, rather than allowing unmodified OS images to be used. Crucially,
-only the OS needs to be changed -- all of the user-level application
-binaries, libraries etc can run unmodified. Hence the modified OS
-kernel can typically just be dropped into any existing OS distribution
-or installation.
-
-Xen currently runs on the x86 architecture, but could in principle be
-ported to others. In fact, it would have been rather easier to write
-Xen for pretty much any other architecture as x86 is particularly
-tricky to handle. A good description of Xen's design, implementation
-and performance is contained in our October 2003 SOSP paper, available
-at http://www.cl.cam.ac.uk/netos/papers/2003-xensosp.pdf
-[update: work to port Xen to x86_64 and IA64 is underway]
-
-To date five different operating systems have been ported to run on
-Xen 2.0: Linux 2.4/2.6, NetBSD, FreeBSD and Plan 9.
-
-The Linux 2.4 and 2.6 ports works very well -- we regularly use them
-to host complex applications such as PostgreSQL, Apache, BK servers
-etc. It runs every user-space applications we've tried. We refer to
-our version of Linux ported to run on Xen as "XenLinux", although
-really it's just standard Linux ported to a new virtual CPU
-architecture that we call xen-x86.
-
-NetBSD has been ported to Xen by Christian Limpach, and will hopefully
-soon become part of the standard release. Work on a FreeBSD port has
-been started by Kip Macy, and we hope to see this complete for the 2.0
-release. Ron Minnich has been working on Plan 9.
-
-A version of Windows XP was ported to an earlier version of Xen, but
-can not be released due to licensing restrictions. We are
-investigating alternative approaches to getting Windows XP/2003
-running on Xen, but have no firm timetable as yet.
-
-So, for the moment, you only get to run Linux 2.4/2.6 and NetBSD on
-Xen, but we hope this will change before long. Even running multiple
-copies of the same OS can be very useful, as it provides a means of
-containing faults to one OS image, and also for providing performance
-isolation between the various OS, enabling you to either restrict, or
-reserve resources for, particular VM instances.
-
-It's also useful for development -- each version of Linux can have
-different patches applied, enabling different kernels to be tried
-out. For example, the "vservers" patch used by PlanetLab applies
-easily to our ported version of Linux.
-
-We've successfully booted over 128 copies of Linux on the same machine
-(a dual CPU hyperthreaded Xeon box) but we imagine that it would be
-more normal to use some smaller number, perhaps 10-20.
-
-A common question is "how many virtual machines can I run on hardware
-xyz?". The answer is very application dependent, but the rule of thumb
-is that you should expect to be able to run the same workload under
-multiple guest OSs that you could run under a single Linux instance,
-with an additional overhead of a few MB per OS instance.
-
-One key feature in this new release of Xen is `live migration'. This
-enables virtual machines instances to be dynamically moved between
-physical Xen machines, with typical downtimes of just a few tens of
-milliseconds. This is really useful for admins that want to take a
-node down for maintenance, or to load balance a large number of
-virtual machines across a cluster.
-
-
-Hardware support
-================
-
-Xen is intended to be run on server-class machines, and the current
-list of supported hardware very much reflects this, avoiding the need
-for us to write drivers for "legacy" hardware. It is likely that some
-desktop chipsets will fail to work properly with the default Xen
-configuration: specifying 'noacpi' or 'ignorebiostables' when booting
-Xen may help in these cases.
-
-Xen requires a "P6" or newer processor (e.g. Pentium Pro, Celeron,
-Pentium II, Pentium III, Pentium IV, Xeon, AMD Athlon, AMD Duron).
-Multiprocessor machines are supported, and we also have basic support
-for HyperThreading (SMT), although this remains a topic for ongoing
-research. We're also working on an AMD x86_64 port (though Xen should
-run on Opterons in 32-bit mode just fine).
-
-Xen can currently use up to 4GB of memory. It's possible for x86
-machines to address more than that (64GB), but it requires using a
-different page table format (3-level rather than 2-level). We
-currently don't support the 3-level format, as we are concentrating
-our efforts on an x86_64 port that will provide a better solution to
-large memory configurations.
-
-In contrast to previous Xen versions, in Xen 2.0 device drivers run
-within a privileged guest OS rather than within Xen itself. This means
-that we should be compatible with almost the full set of device
-hardware supported by Linux. The default XenLinux build contains
-support for relatively modern server-class network and disk hardware,
-but you can add suppport for other hardware by configuring your
-XenLinux kernel in the normal way (e.g. "make xconfig").
-
-
-Building Xen and XenLinux
-=========================
-
-The public master BK repository for the 2.0 release lives at:
-bk://xen.bkbits.net/xen-2.0.bk
-
-To fetch a local copy, install the BitKeeper tools, then run:
-'bk clone bk://xen.bkbits.net/xen-2.0.bk'
-
-You can do a complete build of Xen, the control tools, and the
-XenLinux kernel images with "make world". This can take 10 minutes
-even on a fast machine. If you're on an SMP machine you may wish to
-give the '-j4' argument to make to get a parallel build. All of the
-files that are built are placed under the ./install directory. You
-can then install everything to the standard system directories
-(e.g. /boot, /usr/bin, /usr/lib/python/ etc) by typing "make install".
-
-Take a look in install/boot/:
- install/boot/xen.gz The Xen 'kernel' (formerly image.gz)
- install/boot/vmlinuz-2.4.27-xen0 Domain 0 XenLinux kernel (xenolinux.gz)
- install/boot/vmlinuz-2.4.27-xenU Unprivileged XenLinux kernel
-
-The difference between the two Linux kernels that are built is
-due to the configuration file used for each. The "U" suffixed
-unprivileged version doesn't contain any of the physical hardware
-device drivers, so is 30% smaller and hence may be preferred for
-your non-privileged domains.
-
-The install/boot directory will also contain the config files
-used for building the XenLinux kernels, and also versions of Xen
-and XenLinux kernels that contain debug symbols (xen-syms and
-vmlinux-syms-2.4.27-xen0) which are essential for interpreting crash
-dumps.
-
-Inspect the Makefile if you want to see what goes on during a
-build. Building Xen and the tools is straightforward, but XenLinux is
-more complicated. The makefile needs a 'pristine' linux kernel tree
-which it will then add the Xen architecture files to. You can tell the
-makefile the location of the appropriate linux compressed tar file by
-setting the LINUX_SRC environment variable
-(e.g. "LINUX_SRC=/tmp/linux-2.4.27.tar.gz make world") or by placing
-the tar file somewhere in the search path of LINUX_SRC_PATH which
-defaults to ".:..". If the makefile can't find a suitable kernel tar
-file it attempts to download it from kernel.org, but this won't work
-if you're behind a firewall.
-
-After untaring the pristine kernel tree, the makefile uses the
-'mkbuildtree' script to add the Xen patches the kernel. "make world"
-then build two different XenLinux images, one with a "-xen0" extension
-which contains hardware device drivers and is intended to be used in
-the first virtual machine ("domain 0"), and one with a "-xenU"
-extension that just contains virtual-device drivers. The latter can be
-used for all non hardware privileged domains, and is substantially
-smaller than the other kernel with its selection of hardware drivers.
-
-If you don't want to use bitkeeper to download the source, you can
-download prebuilt binaries and src tar balls from the project
-downloads page: http://www.cl.cam.ac.uk/netos/xen/downloads/
-
-
-Using the domain control tools
-==============================
-
-Before starting domains you'll need to start the node management
-daemon: "xend start".
-The primary tool for starting and controlling domains is "xm".
-"xm help <cmd>" will tell you how to use it.
-
-Further documentation is in the docs/ directory. Postscript, PDF and
-HTML versions of the user manual can be found in the ps/, pdf/ and
-html/ subdirectories.
+Xen is freely-distributable Open Source software, released under the
+GNU GPL.
+For full documentation, see the Xen User Manual in docs/pdf/user.pdf
+(after running make -C docs) or the Documentation page on the Xen
+website.
diff --git a/docs/figs/xenserver.obj b/docs/figs/xenserver.obj
new file mode 100644
index 0000000000..4d2da1183f
--- /dev/null
+++ b/docs/figs/xenserver.obj
@@ -0,0 +1,312 @@
+%TGIF 4.1.8
+state(0,37,100.000,0,108,0,4,1,16,2,2,2,0,1,2,1,1,'Helvetica-Oblique',2,80640,0,8,1,5,-4,0,1,1,0,16,1,0,1,1,1,1,1088,1408,0,0,2880,0).
+%
+% @(#)$Header$
+% %W%
+%
+unit("1 pixel/pixel").
+color_info(28,65535,0,[
+ "black", 0, 0, 0, 0, 0, 0, 1,
+ "gray10", 6682, 6682, 6682, 6682, 6682, 6682, 1,
+ "gray20", 13107, 13107, 13107, 13107, 13107, 13107, 1,
+ "gray30", 19789, 19789, 19789, 19789, 19789, 19789, 1,
+ "gray40", 26214, 26214, 26214, 26214, 26214, 26214, 1,
+ "gray50", 32639, 32639, 32639, 32639, 32639, 32639, 1,
+ "gray60", 39321, 39321, 39321, 39321, 39321, 39321, 1,
+ "gray70", 46003, 46003, 46003, 46003, 46003, 46003, 1,
+ "gray80", 52428, 52428, 52428, 52428, 52428, 52428, 1,
+ "gray90", 58853, 58853, 58853, 58853, 58853, 58853, 1,
+ "white", 65535, 65535, 65535, 65535, 65535, 65535, 1,
+ "red", 65535, 0, 0, 65535, 0, 0, 1,
+ "orange", 65535, 42405, 0, 65535, 42405, 0, 1,
+ "yellow", 65535, 65535, 0, 65535, 65535, 0, 1,
+ "green", 0, 65535, 0, 0, 65535, 0, 1,
+ "blue", 0, 0, 65535, 0, 0, 65535, 1,
+ "blue4", 0, 0, 35723, 0, 0, 35723, 1,
+ "violet", 61166, 33410, 61166, 61166, 33410, 61166, 1,
+ "magenta", 65535, 0, 65535, 65535, 0, 65535, 1,
+ "cyan", 0, 65535, 65535, 0, 65535, 65535, 1,
+ "wheat", 62965, 57054, 46003, 62965, 57054, 46003, 1,
+ "wheat3", 52685, 47802, 38550, 52685, 47802, 38550, 1,
+ "wheat4", 35723, 32382, 26214, 35723, 32382, 26214, 1,
+ "pink", 65535, 49344, 52171, 65535, 49344, 52171, 1,
+ "palegreen", 39064, 64507, 39064, 39064, 64507, 39064, 1,
+ "skyblue", 34695, 52942, 60395, 34695, 52942, 60395, 1,
+ "CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1,
+ "DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1
+]).
+script_frac("0.6").
+fg_bg_colors('blue4','gray90').
+page(1,"",1,'').
+group([
+rcbox('gray90','',375,225,440,435,1,2,1,8,16,69683,0,0,0,0,'2',0,[
+]),
+rcbox('gray20','',375,225,440,435,0,2,1,8,16,69684,0,0,0,0,'2',0,[
+])
+],
+69682,0,0,[
+]).
+group([
+rcbox('gray90','',450,225,515,435,1,2,1,8,16,69623,0,0,0,0,'2',0,[
+]),
+rcbox('gray20','',450,225,515,435,0,2,1,8,16,69624,0,0,0,0,'2',0,[
+])
+],
+69622,0,0,[
+]).
+group([
+rcbox('gray90','',525,225,590,435,1,2,1,8,16,69119,0,0,0,0,'2',0,[
+]),
+rcbox('gray20','',525,225,590,435,0,2,1,8,16,69120,0,0,0,0,'2',0,[
+])
+],
+69366,0,0,[
+]).
+box('gray40','',227,457,607,502,1,2,1,69020,0,0,0,0,0,'2',0,[
+]).
+box('gray40','',235,335,340,435,1,2,1,69017,0,0,0,0,0,'2',0,[
+]).
+box('gray40','',235,230,340,330,1,2,1,69001,0,0,0,0,0,'2',0,[
+]).
+box('gray80','',230,330,335,430,1,2,1,68660,0,0,0,0,0,'2',0,[
+]).
+box('gray80','',230,225,335,325,1,2,1,68663,0,0,0,0,0,'2',0,[
+]).
+box('gray70','',222,452,602,497,1,2,1,68416,0,0,0,0,0,'2',0,[
+]).
+text('black',621,451,3,1,1,14,55,68422,18,5,0,-7,0,0,2,14,55,-1,2,"",0,0,0,0,469,'',[
+minilines(14,55,-1,2,1,-7,0,[
+mini_line(12,18,5,-1,2,0,[
+str_block(0,12,18,5,-1,2,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,115200,12,18,5,-1,2,0,0,0,0,0,
+ "X")])
+]),
+mini_line(12,18,5,0,1,0,[
+str_block(0,12,18,5,0,1,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,115200,12,18,5,0,1,0,0,0,0,0,
+ "E")])
+]),
+mini_line(14,18,5,0,1,0,[
+str_block(0,14,18,5,0,1,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,115200,14,18,5,0,1,0,0,0,0,0,
+ "N")])
+])
+])]).
+text('black',282,244,3,1,1,99,60,68643,16,4,0,0,0,0,2,99,60,-1,0,"",0,0,0,0,260,'',[
+minilines(99,60,-1,0,1,0,0,[
+mini_line(98,16,4,0,0,0,[
+str_block(0,98,16,4,0,-4,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,97920,98,16,4,0,-4,0,0,0,0,0,
+ "Control and ")])
+]),
+mini_line(99,16,4,-1,0,0,[
+str_block(0,99,16,4,-1,0,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,97920,99,16,4,-1,0,0,0,0,0,0,
+ "Management")])
+]),
+mini_line(69,16,4,0,0,0,[
+str_block(0,69,16,4,0,-1,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,97920,69,16,4,0,-1,0,0,0,0,0,
+ "Software")])
+])
+])]).
+text('black',280,349,2,1,1,85,42,68748,18,5,0,-4,0,0,2,85,42,0,1,"",0,0,0,0,367,'',[
+minilines(85,42,0,1,1,-4,0,[
+mini_line(85,18,5,0,1,0,[
+str_block(0,85,18,5,0,1,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,115200,85,18,5,0,1,0,0,0,0,0,
+ "Privileged")])
+]),
+mini_line(79,18,5,0,0,0,[
+str_block(0,79,18,5,0,0,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,115200,79,18,5,0,0,0,0,0,0,0,
+ "GuestOS")])
+])
+])]).
+text('black',280,393,1,1,1,74,17,68749,14,3,0,-4,0,0,2,74,17,0,0,"",0,0,0,0,407,'',[
+minilines(74,17,0,0,1,-4,0,[
+mini_line(74,14,3,0,0,0,[
+str_block(0,74,14,3,0,0,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,80640,74,14,3,0,0,0,0,0,0,0,
+ "(XenLinux)")])
+])
+])]).
+box('gray80','',236,459,351,489,1,2,1,68474,0,0,0,0,0,'2',0,[
+]).
+text('black',291,465,1,1,1,92,17,68470,14,3,0,-4,0,0,2,92,17,0,3,"",0,0,0,0,479,'',[
+minilines(92,17,0,3,1,-4,0,[
+mini_line(92,14,3,0,3,0,[
+str_block(0,92,14,3,0,3,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,80640,92,14,3,0,3,0,0,0,0,0,
+ "VM control i/f")])
+])
+])]).
+box('gray80','',396,459,586,489,1,2,1,68895,0,0,0,0,0,'2',0,[
+]).
+text('black',496,465,1,1,1,143,17,68896,14,3,0,-4,0,0,2,143,17,0,1,"",0,0,0,0,479,'',[
+minilines(143,17,0,1,1,-4,0,[
+mini_line(143,14,3,0,1,0,[
+str_block(0,143,14,3,0,1,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,80640,143,14,3,0,1,0,0,0,0,0,
+ "Virtualized Hardware")])
+])
+])]).
+poly('black','',2,[
+ 355,473,395,473],1,4,1,68913,0,2,0,0,0,0,0,'4',0,0,
+ "0","",[
+ 0,14,6,0,'14','6','0'],[0,14,6,0,'14','6','0'],[
+]).
+poly('black','',2,[
+ 280,423,280,453],1,4,1,68941,0,2,0,0,0,0,0,'4',0,0,
+ "0","",[
+ 0,14,6,0,'14','6','0'],[0,14,6,0,'14','6','0'],[
+]).
+poly('black','',2,[
+ 255,313,255,343],1,2,1,68983,0,2,0,0,0,0,0,'2',0,0,
+ "0","",[
+ 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
+]).
+poly('black','',2,[
+ 305,313,305,343],1,2,1,68984,0,2,0,0,0,0,0,'2',0,0,
+ "0","",[
+ 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
+]).
+poly('black','',2,[
+ 280,313,280,343],1,2,1,68989,0,2,0,0,0,0,0,'2',0,0,
+ "0","",[
+ 0,10,4,0,'10','4','0'],[0,10,4,0,'10','4','0'],[
+]).
+box('gray70','',284,520,609,555,1,2,1,68490,0,0,0,0,0,'2',0,[
+]).
+text('black',444,527,1,1,1,276,23,68493,18,5,0,-8,0,0,2,276,23,0,0,"",0,0,0,0,545,'',[
+minilines(276,23,0,0,1,-8,0,[
+mini_line(276,18,5,0,0,0,[
+str_block(0,276,18,5,0,-1,0,0,0,[
+str_seg('black','Helvetica-BoldOblique',3,115200,276,18,5,0,-1,0,0,0,0,0,
+ "H/W (SMP x86, mem, net, block)")])
+])
+])]).
+poly('black','',2,[
+ 445,483,445,518],3,3,1,68528,0,2,0,0,0,0,0,'3',0,0,
+ "0","",[
+ 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[
+]).
+poly('black','',2,[
+ 500,483,500,518],3,3,1,68529,0,2,0,0,0,0,0,'3',0,0,
+ "0","",[
+ 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[
+]).
+poly('black','',2,[
+ 555,483,555,518],3,3,1,68530,0,2,0,0,0,0,0,'3',0,0,
+ "0","",[
+ 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[
+]).
+text('black',405,254,2,1,1,34,36,68698,16,4,0,-4,0,0,2,34,36,0,1,"",0,0,0,0,270,'',[
+minilines(34,36,0,1,1,-4,0,[
+mini_line(34,16,4,0,1,0,[
+str_block(0,34,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,34,16,4,0,1,0,0,0,0,0,
+ "User")])
+]),
+mini_line(32,16,4,0,1,0,[
+str_block(0,32,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,32,16,4,0,1,0,0,0,0,0,
+ "S/W")])
+])
+])]).
+text('black',405,354,3,1,1,44,52,69100,16,4,0,-4,0,0,2,44,52,0,1,"",0,0,0,0,370,'',[
+minilines(44,52,0,1,1,-4,0,[
+mini_line(34,16,4,0,1,0,[
+str_block(0,34,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,34,16,4,0,1,0,0,0,0,0,
+ "User")])
+]),
+mini_line(44,16,4,0,0,0,[
+str_block(0,44,16,4,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,44,16,4,0,0,0,0,0,0,0,
+ "Guest")])
+]),
+mini_line(24,16,4,0,0,0,[
+str_block(0,24,16,4,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,24,16,4,0,0,0,0,0,0,0,
+ "OS")])
+])
+])]).
+text('black',480,254,2,1,1,34,36,69114,16,4,0,-4,0,0,2,34,36,0,1,"",0,0,0,0,270,'',[
+minilines(34,36,0,1,1,-4,0,[
+mini_line(34,16,4,0,1,0,[
+str_block(0,34,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,34,16,4,0,1,0,0,0,0,0,
+ "User")])
+]),
+mini_line(32,16,4,0,1,0,[
+str_block(0,32,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,32,16,4,0,1,0,0,0,0,0,
+ "S/W")])
+])
+])]).
+text('black',480,354,3,1,1,44,52,69115,16,4,0,-4,0,0,2,44,52,0,1,"",0,0,0,0,370,'',[
+minilines(44,52,0,1,1,-4,0,[
+mini_line(34,16,4,0,1,0,[
+str_block(0,34,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,34,16,4,0,1,0,0,0,0,0,
+ "User")])
+]),
+mini_line(44,16,4,0,0,0,[
+str_block(0,44,16,4,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,44,16,4,0,0,0,0,0,0,0,
+ "Guest")])
+]),
+mini_line(24,16,4,0,0,0,[
+str_block(0,24,16,4,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,24,16,4,0,0,0,0,0,0,0,
+ "OS")])
+])
+])]).
+text('black',555,254,2,1,1,34,36,69116,16,4,0,-4,0,0,2,34,36,0,1,"",0,0,0,0,270,'',[
+minilines(34,36,0,1,1,-4,0,[
+mini_line(34,16,4,0,1,0,[
+str_block(0,34,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,34,16,4,0,1,0,0,0,0,0,
+ "User")])
+]),
+mini_line(32,16,4,0,1,0,[
+str_block(0,32,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,32,16,4,0,1,0,0,0,0,0,
+ "S/W")])
+])
+])]).
+text('black',555,354,3,1,1,44,52,69117,16,4,0,-4,0,0,2,44,52,0,1,"",0,0,0,0,370,'',[
+minilines(44,52,0,1,1,-4,0,[
+mini_line(34,16,4,0,1,0,[
+str_block(0,34,16,4,0,1,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,34,16,4,0,1,0,0,0,0,0,
+ "User")])
+]),
+mini_line(44,16,4,0,0,0,[
+str_block(0,44,16,4,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,44,16,4,0,0,0,0,0,0,0,
+ "Guest")])
+]),
+mini_line(24,16,4,0,0,0,[
+str_block(0,24,16,4,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,97920,24,16,4,0,0,0,0,0,0,0,
+ "OS")])
+])
+])]).
+text('black',282,201,1,1,1,116,17,69753,14,3,2,-4,0,0,2,116,17,0,2,"",0,0,0,0,215,'',[
+minilines(116,17,0,2,1,-4,0,[
+mini_line(116,14,3,0,2,0,[
+str_block(0,116,14,3,0,2,0,0,0,[
+str_seg('blue4','Helvetica-BoldOblique',3,80640,116,14,3,0,2,0,0,0,0,0,
+ "Management VM")])
+])
+])]).
+text('black',480,201,1,1,1,146,17,69770,14,3,2,-4,0,0,2,146,17,0,0,"",0,0,0,0,215,'',[
+minilines(146,17,0,0,1,-4,0,[
+mini_line(146,14,3,0,0,0,[
+str_block(0,146,14,3,0,0,0,0,0,[
+str_seg('blue4','Helvetica-Oblique',2,80640,146,14,3,0,0,0,0,0,0,0,
+ "User Virtual Machines")])
+])
+])]).
diff --git a/docs/misc/blkif-drivers-explained.txt b/docs/misc/blkif-drivers-explained.txt
index 8f6f7a498a..adf1d3738a 100644
--- a/docs/misc/blkif-drivers-explained.txt
+++ b/docs/misc/blkif-drivers-explained.txt
@@ -244,8 +244,8 @@ records. Pointers may only advance, and may not pass one another.
By adopting the convention that every request will receive a response,
not all four pointers need be shared and flow control on the ring
becomes very easy to manage. Each domain manages its own
-consumer pointer, and the two producer pointers are visible to both (Xen/include/hypervisor-ifs/io/blkif.h):
-
+consumer pointer, and the two producer pointers are visible to both
+(xen/include/public/io/blkif.h):
/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <=PAGE_SIZE.*/
diff --git a/docs/src/interface.tex b/docs/src/interface.tex
index 6dc6879df4..752ab1d157 100644
--- a/docs/src/interface.tex
+++ b/docs/src/interface.tex
@@ -1,5 +1,6 @@
\documentclass[11pt,twoside,final,openright]{xenstyle}
\usepackage{a4,graphicx,setspace,times}
+\usepackage{comment,parskip}
\setstretch{1.15}
\begin{document}
@@ -16,12 +17,19 @@
{\Huge \bf Interface manual} \\[4mm]
{\huge Xen v2.0 for x86} \\[80mm]
-{\Large Xen is Copyright (c) 2004, The Xen Team} \\[3mm]
+{\Large Xen is Copyright (c) 2002-2004, The Xen Team} \\[3mm]
{\Large University of Cambridge, UK} \\[20mm]
-{\large Last updated on 11th March, 2004}
\end{tabular}
-\vfill
\end{center}
+
+{\bf
+DISCLAIMER: This documentation is currently under active development
+and as such there may be mistakes and omissions --- watch out for
+these and please report any you find to the developer's mailing list.
+Contributions of material, suggestions and corrections are welcome.
+}
+
+\vfill
\cleardoublepage
% TABLE OF CONTENTS
@@ -45,205 +53,270 @@
\setstretch{1.15}
\chapter{Introduction}
-Xen allows the hardware resouces of a machine to be virtualized and
-dynamically partitioned such as to allow multiple different 'guest'
-operating system images to be run simultaneously.
-
-Virtualizing the machine in this manner provides flexibility allowing
-different users to choose their preferred operating system (Windows,
-Linux, NetBSD, or a custom operating system). Furthermore, Xen provides
-secure partitioning between these 'domains', and enables better resource
+
+Xen allows the hardware resources of a machine to be virtualized and
+dynamically partitioned, allowing multiple different {\em guest}
+operating system images to be run simultaneously. Virtualizing the
+machine in this manner provides considerable flexibility, for example
+allowing different users to choose their preferred operating system
+(e.g., Linux, NetBSD, or a custom operating system). Furthermore, Xen
+provides secure partitioning between virtual machines (known as
+{\em domains} in Xen terminology), and enables better resource
accounting and QoS isolation than can be achieved with a conventional
-operating system.
-
-The hypervisor runs directly on server hardware and dynamically partitions
-it between a number of {\it domains}, each of which hosts an instance
-of a {\it guest operating system}. The hypervisor provides just enough
-abstraction of the machine to allow effective isolation and resource
-management between these domains.
-
-Xen essentially takes a virtual machine approach as pioneered by IBM
-VM/370. However, unlike VM/370 or more recent efforts such as VMWare
-and Virtual PC, Xen doesn not attempt to completely virtualize the
-underlying hardware. Instead parts of the hosted guest operating
-systems are modified to work with the hypervisor; the operating system
-is effectively ported to a new target architecture, typically
-requiring changes in just the machine-dependent code. The user-level
-API is unchanged, thus existing binaries and operating system
-distributions can work unmodified.
-
-In addition to exporting virtualized instances of CPU, memory, network and
-block devicees, Xen exposes a control interface to set how these resources
-are shared between the running domains. The control interface is privileged
-and may only be accessed by one particular virtual machine: {\it domain0}.
-This domain is a required part of any Xen-base server and runs the application
-software that manages the control-plane aspects of the platform. Running the
-control software in {\it domain0}, distinct from the hypervisor itself, allows
-the Xen framework to separate the notions of {\it mechanism} and {\it policy}
-within the system.
-
-
-\chapter{CPU state}
+operating system.
+
+Xen essentially takes a `whole machine' virtualization approach as
+pioneered by IBM VM/370. However, unlike VM/370 or more recent
+efforts such as VMWare and Virtual PC, Xen does not attempt to
+completely virtualize the underlying hardware. Instead parts of the
+hosted guest operating systems are modified to work with the VMM; the
+operating system is effectively ported to a new target architecture,
+typically requiring changes in just the machine-dependent code. The
+user-level API is unchanged, and so existing binaries and operating
+system distributions work without modification.
+
+In addition to exporting virtualized instances of CPU, memory, network
+and block devices, Xen exposes a control interface to manage how these
+resources are shared between the running domains. Access to the
+control interface is restricted: it may only be used by one
+specially-privileged VM, known as {\em domain-0}. This domain is a
+required part of any Xen-based server and runs the application software
+that manages the control-plane aspects of the platform. Running the
+control software in {\it domain-0}, distinct from the hypervisor
+itself, allows the Xen framework to separate the notions of
+mechanism and policy within the system.
+
+
+
+\chapter{Virtual Architecture}
+
+On a Xen-based system, the hypervisor itself runs in {\it ring 0}. It
+has full access to the physical memory available in the system and is
+responsible for allocating portions of it to the domains. Guest
+operating systems run in and use {\it rings 1}, {\it 2} and {\it 3} as
+they see fit. Segmentation is used to prevent the guest OS from
+accessing the portion of the address space that is reserved for
+Xen. We expect most guest operating systems will use ring 1 for their
+own operation and place applications in ring 3.
+
+In this chapter we consider the basic virtual architecture provided
+by Xen: the basic CPU state, exception and interrupt handling, and
+time. Other aspects such as memory and device access are discussed
+in later chapters.
+
+\section{CPU state}
All privileged state must be handled by Xen. The guest OS has no
direct access to CR3 and is not permitted to update privileged bits in
-EFLAGS.
-
-\chapter{Exceptions}
-The IDT is virtualised by submitting a virtual 'trap
-table' to Xen. Most trap handlers are identical to native x86
-handlers. The page-fault handler is a noteable exception.
-
-\chapter{Interrupts and events}
-Interrupts are virtualized by mapping them to events, which are delivered
-asynchronously to the target domain. A guest OS can map these events onto
-its standard interrupt dispatch mechanisms, such as a simple vectoring
-scheme. Each physical interrupt source controlled by the hypervisor, including
-network devices, disks, or the timer subsystem, is responsible for identifying
-the target for an incoming interrupt and sending an event to that domain.
-
-This demultiplexing mechanism also provides a device-specific mechanism for
-event coalescing or hold-off. For example, a guest OS may request to only
-actually receive an event after {\it n} packets are queued ready for delivery
-to it, {\it t} nanoseconds after the first packet arrived (which ever is true
-first). This allows latency and throughput requirements to be addressed on a
-domain-specific basis.
-
-\chapter{Time}
-Guest operating systems need to be aware of the passage of real time and their
-own ``virtual time'', i.e. the time they have been executing. Furthermore, a
-notion of time is required in the hypervisor itself for scheduling and the
-activities that relate to it. To this end the hypervisor provides for notions
-of time: cycle counter time, system time, wall clock time, domain virtual
-time.
-
-
-\section{Cycle counter time}
-This provides the finest-grained, free-running time reference, with the
-approximate frequency being publicly accessible. The cycle counter time is
+EFLAGS. Guest OSes use \emph{hypercalls} to invoke operations in Xen;
+these are analagous to system calls but occur from ring 1 to ring 0.
+
+A list of all hypercalls is given in Appendix~\ref{a:hypercalls}.
+
+
+
+\section{Exceptions}
+
+A virtual IDT is provided --- a domain can submit a table of trap
+handlers to Xen via the {\tt set\_trap\_table()} hypercall. Most trap
+handlers are identical to native x86 handlers, although the page-fault
+handler is somewhat different.
+
+
+\section{Interrupts and events}
+
+Interrupts are virtualized by mapping them to events, which are
+delivered asynchronously to the target domain. A guest OS can map
+these events onto its standard interrupt dispatch mechanisms. Xen
+is responsible for determining the target domain that will handle
+each physical interrupt source.
+
+
+\section{Time}
+
+Guest operating systems need to be aware of the passage of both real
+(or wallclock) time and their own `virtual time' (the time for
+which they have been executing). Furthermore, Xen has a notion of
+time which is used for scheduling. The following notions of
+time are provided:
+
+\begin{description}
+\item[Cycle counter time.]
+
+This provides a fine-grained time reference. The cycle counter time is
used to accurately extrapolate the other time references. On SMP machines
it is currently assumed that the cycle counter time is synchronised between
CPUs. The current x86-based implementation achieves this within inter-CPU
communication latencies.
-\section{System time}
-This is a 64-bit value containing the nanoseconds elapsed since boot
-time. Unlike cycle counter time, system time accurately reflects the
-passage of real time, i.e. it is adjusted several times a second for timer
-drift. This is done by running an NTP client in {\it domain0} on behalf of
-the machine, feeding updates to the hypervisor. Intermediate values can be
-extrapolated using the cycle counter.
-
-\section{Wall clock time}
-This is the actual ``time of day'' Unix style struct timeval (i.e. seconds and
-microseconds since 1 January 1970, adjusted by leap seconds etc.). Again, an
-NTP client hosted by {\it domain0} can help maintain this value. To guest
-operating systems this value will be reported instead of the hardware RTC
-clock value and they can use the system time and cycle counter times to start
-and remain perfectly in time.
-
-
-\section{Domain virtual time}
-This progresses at the same pace as cycle counter time, but only while a
-domain is executing. It stops while a domain is de-scheduled. Therefore the
-share of the CPU that a domain receives is indicated by the rate at which
-its domain virtual time increases, relative to the rate at which cycle
-counter time does so.
-
-\section{Time interface}
-Xen exports some timestamps to guest operating systems through their shared
-info page. Timestamps are provided for system time and wall-clock time. Xen
-also provides the cycle counter values at the time of the last update
-allowing guests to calculate the current values. The cpu frequency and a
-scaling factor are provided for guests to convert cycle counter values to
-real time. Since all time stamps need to be updated and read
-\emph{atomically} two version numbers are also stored in the shared info
-page.
-
-Xen will ensure that the time stamps are updated frequently enough to avoid
-an overflow of the cycle counter values. A guest can check if its notion of
-time is up-to-date by comparing the version numbers.
-
-\section{Timer events}
-
-Xen maintains a periodic timer (currently with a 10ms period) which sends a
-timer event to the currently executing domain. This allows Guest OSes to
-keep track of the passing of time when executing. The scheduler also
-arranges for a newly activated domain to receive a timer event when
-scheduled so that the Guest OS can adjust to the passage of time while it
-has been inactive.
-
-In addition, Xen exports a hypercall interface to each domain which allows
-them to request a timer event sent to them at the specified system
-time. Guest OSes may use this timer to implement timeout values when they
-block.
+\item[System time.]
+
+This is a 64-bit counter which holds the number of nanoseconds that
+have elapsed since system boot.
+
+
+\item[Wall clock time.]
+
+This is the time of day in a Unix-style {\tt struct timeval} (seconds
+and microseconds since 1 January 1970, adjusted by leap seconds). An
+NTP client hosted by {\it domain-0} can keep this value accurate.
+
+
+\item[Domain virtual time.]
+
+This progresses at the same pace as system time, but only while a
+domain is executing --- it stops while a domain is de-scheduled.
+Therefore the share of the CPU that a domain receives is indicated by
+the rate at which its virtual time increases.
+
+\end{description}
+
+
+Xen exports timestamps for system time and wall-clock time to guest
+operating systems through a shared page of memory. Xen also provides
+the cycle counter time at the instant the timestamps were calculated,
+and the CPU frequency in Hertz. This allows the guest to extrapolate
+system and wall-clock times accurately based on the current cycle
+counter time.
+
+Since all time stamps need to be updated and read \emph{atomically}
+two version numbers are also stored in the shared info page. The
+first is incremented prior to an update, while the second is only
+incremented afterwards. Thus a guest can be sure that it read a consistent
+state by checking the two version numbers are equal.
+
+Xen includes a periodic ticker which sends a timer event to the
+currently executing domain every 10ms. The Xen scheduler also sends a
+timer event whenever a domain is scheduled; this allows the guest OS
+to adjust for the time that has passed while it has been inactive. In
+addition, Xen allows each domain to request that they receive a timer
+event sent at a specified system time by using the {\tt
+set\_timer\_op()} hypercall. Guest OSes may use this timer to
+implement timeout values when they block.
+
\chapter{Memory}
-The hypervisor is responsible for providing memory to each of the
-domains running over it. However, the Xen hypervisor's duty is
-restricted to managing physical memory and to policying page table
-updates. All other memory management functions are handled
-externally. Start-of-day issues such as building initial page tables
-for a domain, loading its kernel image and so on are done by the {\it
-domain builder} running in user-space in {\it domain0}. Paging to
-disk and swapping is handled by the guest operating systems
-themselves, if they need it.
+Xen is responsible for managing the allocation of physical memory to
+domains, and for ensuring safe use of the paging and segmentation
+hardware.
+
+
+\section{Memory Allocation}
+
+
+Xen resides within a small fixed portion of physical memory; it also
+reserves the top 64MB of every virtual address space. The remaining
+physical memory is available for allocation to domains at a page
+granularity. Xen tracks the ownership and use of each page, which
+allows it to enforce secure partitioning between domains.
+
+Each domain has a maximum and current physical memory allocation.
+A guest OS may run a `balloon driver' to dynamically adjust its
+current memory allocation up to its limit.
+
+
+%% XXX SMH: I use machine and physical in the next section (which
+%% is kinda required for consistency with code); wonder if this
+%% section should use same terms?
+%%
+%% Probably.
+%%
+%% Merging this and below section at some point prob makes sense.
+
+\section{Pseudo-Physical Memory}
+
+Since physical memory is allocated and freed on a page granularity,
+there is no gaurantee that a domain will receive a contiguous stretch
+of physical memory. However most operating systems do not have good
+support for operating in a fragmented physical address space. To aid
+porting such operating systems to run on top of Xen, we make a
+distinction between \emph{machine memory} and \emph{pseduo-physical
+memory}.
+
+Put simply, machine memory refers to the entire amount of memory
+installed in the machine, including that reserved by Xen, in use by
+various domains, or currently unallocated. We consider machine memory
+to comprise a set of 4K \emph{machine page frames} numbered
+consecutively starting from 0. Machine frame numbers mean the same
+within Xen or any domain.
+
+Pseudo-physical memory, on the other hand, is a per-domain
+abstraction. It allows a guest operating system to consider its memory
+allocation to consist of a contiguous range of physical page frames
+starting at physical frame 0, despite the fact that the underlying
+machine page frames may be sparsely allocated and in any order.
+
+To achieve this, Xen maintains a globally readable {\it
+machine-to-physical} table which records the mapping from machine page
+frames to pseudo-physical ones. In addition, each domain is supplied
+with a {\it physical-to-machine} table which performs the inverse
+mapping. Clearly the machine-to-physical table has size proportional
+to the amount of RAM installed in the machine, while each
+physical-to-machine table has size proportional to the memory
+allocation of the given domain.
+
+Architecture dependent code in guest operating systems can then use
+the two tables to provide the abstraction of pseudo-physical
+memory. In general, only certain specialized parts of the operating
+system (such as page table management) needs to understand the
+difference between machine and pseudo-physical addresses.
-On a Xen-based system, the hypervisor itself runs in {\it ring 0}. It
-has full access to the physical memory available in the system and is
-responsible for allocating portions of it to the domains. Guest
-operating systems run in and use {\it rings 1}, {\it 2} and {\it 3} as
-they see fit, aside from the fact that segmentation is used to prevent
-the guest OS from accessing a portion of the linear address space that
-is reserved for use by the hypervisor. This approach allows
-transitions between the guest OS and hypervisor without flushing the
-TLB. We expect most guest operating systems will use ring 1 for their
-own operation and place applications (if they support such a notion)
-in ring 3.
-
-\section{Physical Memory Allocation}
-The hypervisor reserves a small fixed portion of physical memory at
-system boot time. This special memory region is located at the
-beginning of physical memory and is mapped at the very top of every
-virtual address space.
-
-Any physical memory that is not used directly by the hypervisor is divided into
-pages and is available for allocation to domains. The hypervisor tracks which
-pages are free and which pages have been allocated to each domain. When a new
-domain is initialized, the hypervisor allocates it pages drawn from the free
-list. The amount of memory required by the domain is passed to the hypervisor
-as one of the parameters for new domain initialization by the domain builder.
-
-Domains can never be allocated further memory beyond that which was
-requested for them on initialization. However, a domain can return
-pages to the hypervisor if it discovers that its memory requirements
-have diminished.
-
-% put reasons for why pages might be returned here.
\section{Page Table Updates}
-In addition to managing physical memory allocation, the hypervisor is also in
-charge of performing page table updates on behalf of the domains. This is
-neccessary to prevent domains from adding arbitrary mappings to their page
-tables or introducing mappings to other's page tables.
-
-\section{Writabel Page Tables}
-A domain can also request write access to its page tables. In this
-mode, Xen notes write attempts to page table pages and makes the page
-temporarily writable. In-use page table pages are also disconnect
-from the page directory. The domain can now update entries in these
-page table pages without the assistance of Xen. As soon as the
-writabel page table pages get used as page table pages, Xen makes the
-pages read-only again and revalidates the entries in the pages.
+
+In the default mode of operation, Xen enforces read-only access to
+page tables and requires guest operating systems to explicitly request
+any modifications. Xen validates all such requests and only applies
+updates that it deems safe. This is necessary to prevent domains from
+adding arbitrary mappings to their page tables.
+
+To aid validation, Xen associates a type and reference count with each
+memory page. A page has one of the following
+mutually-exclusive types at any point in time: page directory ({\sf
+PD}), page table ({\sf PT}), local descriptor table ({\sf LDT}),
+global descriptor table ({\sf GDT}), or writable ({\sf RW}). Note that
+a guest OS may always create readable mappings of its own memory
+regardless of its current type.
+%%% XXX: possibly explain more about ref count 'lifecyle' here?
+This mechanism is used to
+maintain the invariants required for safety; for example, a domain
+cannot have a writable mapping to any part of a page table as this
+would require the page concerned to simultaneously be of types {\sf
+ PT} and {\sf RW}.
+
+
+%\section{Writable Page Tables}
+
+Xen also provides an alternative mode of operation in which guests be
+have the illusion that their page tables are directly writable. Of
+course this is not really the case, since Xen must still validate
+modifications to ensure secure partitioning. To this end, Xen traps
+any write attempt to a memory page of type {\sf PT} (i.e., that is
+currently part of a page table). If such an access occurs, Xen
+temporarily allows write access to that page while at the same time
+{\em disconnecting} it from the page table that is currently in
+use. This allows the guest to safely make updates to the page because
+the newly-updated entries cannot be used by the MMU until Xen
+revalidates and reconnects the page.
+Reconnection occurs automatically in a number of situations: for
+example, when the guest modifies a different page-table page, when the
+domain is preempted, or whenever the guest uses Xen's explicit
+page-table update interfaces.
+
\section{Segment Descriptor Tables}
-On boot a guest is supplied with a default GDT, which is {\em not}
-taken from its own memory allocation. If the guest wishes to use other
-than the default `flat' ring-1 and ring-3 segments that this default
-table provides, it must register a custom GDT and/or LDT with Xen,
-allocated from its own memory.
+On boot a guest is supplied with a default GDT, which does not reside
+within its own memory allocation. If the guest wishes to use other
+than the default `flat' ring-1 and ring-3 segments that this GDT
+provides, it must register a custom GDT and/or LDT with Xen,
+allocated from its own memory. Note that a number of GDT
+entries are reserved by Xen -- any custom GDT must also include
+sufficent space for these entries.
+
+For example, the following hypercall is used to specify a new GDT:
+\begin{quote}
int {\bf set\_gdt}(unsigned long *{\em frame\_list}, int {\em entries})
{\em frame\_list}: An array of up to 16 page frames within which the
@@ -253,28 +326,27 @@ mappings, no use as a page-table page, and so on).
{\em 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 '{\em entries $>$ LAST\_RESERVED\_GDT\_ENTRY}'.
+thus we must have `{\em entries $>$ LAST\_RESERVED\_GDT\_ENTRY}\ '.
Note also that, after registering the GDT, slots {\em FIRST\_} through
{\em LAST\_RESERVED\_GDT\_ENTRY} are no longer usable by the guest and
may be overwritten by Xen.
+\end{quote}
-\section{Pseudo-Physical Memory}
-The usual problem of external fragmentation means that a domain is
-unlikely to receive a contiguous stretch of physical memory. However,
-most guest operating systems do not have built-in support for
-operating in a fragmented physical address space e.g. Linux has to
-have a one-to-one mapping for its physical memory. There a notion of
-{\it pseudo physical memory} is introdouced. Xen maintains a {\it
-real physical} to {\it pseudo physical} mapping which can be consulted
-by every domain. Additionally, at its start of day, a domain is
-supplied a {\it pseudo physical} to {\it real physical} mapping which
-it needs to keep updated itself. From that moment onwards {\it pseudo
-physical} addresses are used instead of discontiguous {\it real
-physical} addresses. Thus, the rest of the guest OS code has an
-impression of operating in a contiguous address space. Guest OS page
-tables contain real physical addresses. Mapping {\it pseudo physical}
-to {\it real physical} addresses is needed on page table updates and
-also on remapping memory regions with the guest OS.
+The LDT is updated via the generic MMU update mechanism (i.e., via
+the {\tt mmu\_update()} hypercall.
+
+\section{Start of Day}
+
+The start-of-day environment for guest operating systems is rather
+different to that provided by the underlying hardware. In particular,
+the processor is already executing in protected mode with paging
+enabled.
+
+{\it Domain-0} is created and booted by Xen itself. For all subsequent
+donains, the analogue of the boot-loader is the {\it domain builder},
+user-space software running in {\it domain-0}. The domain builder
+is responsible for building the initial page tables for a domain
+and loading its kernel image at the appropriate virtual address.
@@ -416,9 +488,265 @@ of the CPU for each domain. Round-robin is provided as an example of
Xen's internal scheduler API.
More information on the characteristics and use of these schedulers is
-available in { \tt Sched-HOWTO.txt }.
+available in {\tt Sched-HOWTO.txt}.
+
+
+
+
+\appendix
+
+%\newcommand{\hypercall}[1]{\vspace{5mm}{\large\sf #1}}
+
+
+
+
+
+\newcommand{\hypercall}[1]{\vspace{2mm}{\sf #1}}
+
+
+
+\hypercall{physdev\_op(void *physdev\_op)}
+
+
+\hypercall{vm\_assist(unsigned int cmd, unsigned int type)}
+
+
+
+
+\chapter{Xen Hypercalls}
+\label{a:hypercalls}
+
+Hypercalls represent the procedural interface to Xen; this appendix
+categorizes and describes the current set of hypercalls.
+
+\section{Invoking Hypercalls}
+
+\hypercall{multicall(void *call\_list, int nr\_calls)}
+
+Execute a series of hypervisor calls
+
+
+
+
+\section{Virtual CPU Setup}
+
+\hypercall{set\_callbacks(unsigned long event\_selector, unsigned long
+ event\_address, unsigned long failsafe\_selector, unsigned long
+ failsafe\_address) }
+
+Register OS event processing routine. In
+Linux both the event\_selector and failsafe\_selector are the
+kernel's CS. The value event\_address specifies the address for an
+interrupt handler dispatch routine and failsafe\_address specifies a
+handler for application faults.
+
+\hypercall{set\_trap\_table(trap\_info\_t *table)}
+
+Install trap handler table.
+
+
+\hypercall{set\_fast\_trap(int idx)}
+
+ install traps to allow guest OS to bypass hypervisor
+
+
+
+
+\section{Scheduling}
+
+
+\hypercall{stack\_switch(unsigned long ss, unsigned long esp)}
+
+Request context switch from hypervisor.
+
+
+\hypercall{fpu\_taskswitch(void)}
+
+Notify hypervisor that fpu registers needed to be save on context switch.
+
+
+\hypercall{sched\_op(unsigned long op)}
+
+Request scheduling operation from hypervisor. The options are: {\it
+yield}, {\it block}, and {\it shutdown}. {\it yield} keeps the
+calling domain run-able but may cause a reschedule if other domains
+are run-able. {\it block} removes the calling domain from the run
+queue and the domains sleeps until an event is delivered to it. {\it
+shutdown} is used to end the domain's execution and allows to specify
+whether the domain should reboot, halt or suspend..
+
+\hypercall{set\_timer\_op(uint64\_t timeout)}
+
+Request a timer event to be sent at the specified system time.
+
+
+\section{Page Table Management}
+
+\hypercall{mmu\_update(mmu\_update\_t *req, int count, int *success\_count)}
+
+Update the page table for the domain. Updates can be batched.
+success\_count will be updated to report the number of successfull
+updates. The update types are:
+
+{\it MMU\_NORMAL\_PT\_UPDATE}:
+
+{\it MMU\_MACHPHYS\_UPDATE}:
+
+{\it MMU\_EXTENDED\_COMMAND}:
+
+
+\hypercall{update\_va\_mapping(unsigned long page\_nr, unsigned long val, unsigned long flags)}
+
+
+\hypercall{update\_va\_mapping\_otherdomain(unsigned long page\_nr,
+unsigned long val, unsigned long flags, uint16\_t domid)}
+
+
+\section{Segmentation Support}
+
+
+\hypercall{set\_gdt(unsigned long *frame\_list, int entries)}
+
+Set the global descriptor table - virtualization for lgdt.
+
+
+
+\hypercall{update\_descriptor(unsigned long ma, unsigned long word1, unsigned long word2)}
+
+
+
+
+\section{Inter-Domain Communication}
+
+
+\hypercall{event\_channel\_op(void *op)}
+
+Inter-domain event-channel management.
+
+
+\hypercall{grant\_table\_op(unsigned int cmd, void *uop, unsigned int count)}
+
+
+
+\section{Physical Memory Management}
+
+\hypercall{dom\_mem\_op(unsigned int op, unsigned long *extent\_list,
+unsigned long nr\_extents, unsigned int extent\_order)}
+
+Increase or decrease memory reservations for guest OS
+
+
+
+
+
+
+\section{Administrative Operations}
+
+
+\hypercall{dom0\_op(dom0\_op\_t *op)}
+
+Administrative domain operations for domain management. The options are:
+
+{\it DOM0\_CREATEDOMAIN}: create new domain, specifying the name and memory usage
+in kilobytes.
+
+{\it DOM0\_CREATEDOMAIN}: create domain
+
+{\it DOM0\_PAUSEDOMAIN}: mark domain as unschedulable
+
+{\it DOM0\_UNPAUSEDOMAIN}: mark domain as schedulable
+
+{\it DOM0\_DESTROYDOMAIN}: deallocate resources associated with the domain
+
+{\it DOM0\_GETMEMLIST}: get list of pages used by the domain
+
+{\it DOM0\_SCHEDCTL}:
+
+{\it DOM0\_ADJUSTDOM}: adjust scheduling priorities for domain
+
+{\it DOM0\_BUILDDOMAIN}: do final guest OS setup for domain
+
+{\it DOM0\_GETDOMAINFO}: get statistics about the domain
+
+{\it DOM0\_GETPAGEFRAMEINFO}:
+
+{\it DOM0\_IOPL}: set IO privilege level
+
+{\it DOM0\_MSR}:
+
+{\it DOM0\_DEBUG}: interactively call pervasive debugger
+
+{\it DOM0\_SETTIME}: set system time
+
+{\it DOM0\_READCONSOLE}: read console content from hypervisor buffer ring
+
+{\it DOM0\_PINCPUDOMAIN}: pin domain to a particular CPU
+
+{\it DOM0\_GETTBUFS}: get information about the size and location of
+ the trace buffers (only on trace-buffer enabled builds)
+
+{\it DOM0\_PHYSINFO}: get information about the host machine
+
+{\it DOM0\_PCIDEV\_ACCESS}: modify PCI device access permissions
+
+{\it DOM0\_SCHED\_ID}: get the ID of the current Xen scheduler
+
+{\it DOM0\_SHADOW\_CONTROL}:
+
+{\it DOM0\_SETDOMAINNAME}: set the name of a domain
+
+{\it DOM0\_SETDOMAININITIALMEM}: set initial memory allocation of a domain
+
+{\it DOM0\_SETDOMAINMAXMEM}: set maximum memory allocation of a domain
+
+{\it DOM0\_GETPAGEFRAMEINFO2}:
+
+{\it DOM0\_SETDOMAINVMASSIST}: set domain VM assist options
+
+
+
+
+\section{Miscellaneous Hypercalls}
+
+
+\hypercall{console\_io(int cmd, int count, char *str)}
-\section{Scheduling API}
+Interact with the console, operations are:
+
+{\it CONSOLEIO\_write}: Output count characters from buffer str.
+
+{\it CONSOLEIO\_read}: Input at most count characters into buffer str.
+
+
+
+\hypercall{set\_debugreg(int reg, unsigned long value)}
+
+set debug register reg to value
+
+
+\hypercall{get\_debugreg(int reg)}
+
+ get the debug register reg
+
+
+\hypercall{xen\_version(int cmd)}
+
+Request Xen version number.
+
+
+
+
+
+
+%%
+%% XXX SMH: not really sure how useful below is -- if it's still
+%% actually true, might be useful for someone wanting to write a
+%% new scheduler... not clear how many of them there are...
+%%
+
+\begin{comment}
+
+\chapter{Scheduling API}
The scheduling API is used by both the schedulers described above and should
also be used by any new schedulers. It provides a generic interface and also
@@ -470,7 +798,7 @@ this scheduler.
\subsubsection{sched\_id}
This is an integer that uniquely identifies this scheduler. There should be a
-macro corrsponding to this scheduler ID in {\tt <hypervisor-ifs/sched-if.h>}.
+macro corrsponding to this scheduler ID in {\tt <xen/sched-if.h>}.
\subsubsection{init\_scheduler}
@@ -687,6 +1015,20 @@ This method should dump any private settings for the specified task.
This function is called with interrupts disabled and the {\tt schedule\_lock}
for the task's CPU held.
+\end{comment}
+
+
+
+
+%%
+%% XXX SMH: we probably should have something in here on debugging
+%% etc; this is a kinda developers manual and many devs seem to
+%% like debugging support :^)
+%% Possibly sanitize below, else wait until new xendbg stuff is in
+%% (and/or kip's stuff?) and write about that instead?
+%%
+
+\begin{comment}
\chapter{Debugging}
@@ -751,151 +1093,9 @@ trace points, there is an example format file in {\tt tools/xentrace/formats }.
For more information, see the manual pages for {\tt xentrace}, {\tt
xentrace\_format} and {\tt xentrace\_cpusplit}.
+\end{comment}
-\chapter{Hypervisor calls}
-
-\section{ set\_trap\_table(trap\_info\_t *table)}
-
-Install trap handler table.
-
-\section{ mmu\_update(mmu\_update\_t *req, int count, int *success\_count)}
-Update the page table for the domain. Updates can be batched.
-success\_count will be updated to report the number of successfull
-updates. The update types are:
-
-{\it MMU\_NORMAL\_PT\_UPDATE}:
-
-{\it MMU\_MACHPHYS\_UPDATE}:
-
-{\it MMU\_EXTENDED\_COMMAND}:
-
-\section{ set\_gdt(unsigned long *frame\_list, int entries)}
-Set the global descriptor table - virtualization for lgdt.
-
-\section{ stack\_switch(unsigned long ss, unsigned long esp)}
-Request context switch from hypervisor.
-
-\section{ set\_callbacks(unsigned long event\_selector, unsigned long event\_address,
- unsigned long failsafe\_selector, unsigned
- long failsafe\_address) } Register OS event processing routine. In
- Linux both the event\_selector and failsafe\_selector are the
- kernel's CS. The value event\_address specifies the address for an
- interrupt handler dispatch routine and failsafe\_address specifies a
- handler for application faults.
-
-\section{ fpu\_taskswitch(void)}
-Notify hypervisor that fpu registers needed to be save on context switch.
-
-\section{ sched\_op(unsigned long op)}
-Request scheduling operation from hypervisor. The options are: {\it
-yield}, {\it block}, and {\it shutdown}. {\it yield} keeps the
-calling domain run-able but may cause a reschedule if other domains
-are run-able. {\it block} removes the calling domain from the run
-queue and the domains sleeps until an event is delivered to it. {\it
-shutdown} is used to end the domain's execution and allows to specify
-whether the domain should reboot, halt or suspend..
-
-\section{ dom0\_op(dom0\_op\_t *op)}
-Administrative domain operations for domain management. The options are:
-
-{\it DOM0\_CREATEDOMAIN}: create new domain, specifying the name and memory usage
-in kilobytes.
-
-{\it DOM0\_CREATEDOMAIN}: create domain
-
-{\it DOM0\_PAUSEDOMAIN}: mark domain as unschedulable
-
-{\it DOM0\_UNPAUSEDOMAIN}: mark domain as schedulable
-
-{\it DOM0\_DESTROYDOMAIN}: deallocate resources associated with the domain
-
-{\it DOM0\_GETMEMLIST}: get list of pages used by the domain
-
-{\it DOM0\_SCHEDCTL}:
-
-{\it DOM0\_ADJUSTDOM}: adjust scheduling priorities for domain
-
-{\it DOM0\_BUILDDOMAIN}: do final guest OS setup for domain
-
-{\it DOM0\_GETDOMAINFO}: get statistics about the domain
-
-{\it DOM0\_GETPAGEFRAMEINFO}:
-
-{\it DOM0\_IOPL}: set IO privilege level
-
-{\it DOM0\_MSR}:
-
-{\it DOM0\_DEBUG}: interactively call pervasive debugger
-
-{\it DOM0\_SETTIME}: set system time
-
-{\it DOM0\_READCONSOLE}: read console content from hypervisor buffer ring
-
-{\it DOM0\_PINCPUDOMAIN}: pin domain to a particular CPU
-
-{\it DOM0\_GETTBUFS}: get information about the size and location of
- the trace buffers (only on trace-buffer enabled builds)
-
-{\it DOM0\_PHYSINFO}: get information about the host machine
-
-{\it DOM0\_PCIDEV\_ACCESS}: modify PCI device access permissions
-
-{\it DOM0\_SCHED\_ID}: get the ID of the current Xen scheduler
-
-{\it DOM0\_SHADOW\_CONTROL}:
-
-{\it DOM0\_SETDOMAINNAME}: set the name of a domain
-
-{\it DOM0\_SETDOMAININITIALMEM}: set initial memory allocation of a domain
-
-{\it DOM0\_SETDOMAINMAXMEM}: set maximum memory allocation of a domain
-
-{\it DOM0\_GETPAGEFRAMEINFO2}:
-
-{\it DOM0\_SETDOMAINVMASSIST}: set domain VM assist options
-
-
-\section{ set\_debugreg(int reg, unsigned long value)}
-set debug register reg to value
-
-\section{ get\_debugreg(int reg)}
- get the debug register reg
-
-\section{ update\_descriptor(unsigned long ma, unsigned long word1, unsigned long word2)}
-
-\section{ set\_fast\_trap(int idx)}
- install traps to allow guest OS to bypass hypervisor
-
-\section{ dom\_mem\_op(unsigned int op, unsigned long *extent\_list, unsigned long nr\_extents, unsigned int extent\_order)}
-Increase or decrease memory reservations for guest OS
-
-\section{ multicall(void *call\_list, int nr\_calls)}
-Execute a series of hypervisor calls
-
-\section{ update\_va\_mapping(unsigned long page\_nr, unsigned long val, unsigned long flags)}
-
-\section{ set\_timer\_op(uint64\_t timeout)}
-Request a timer event to be sent at the specified system time.
-
-\section{ event\_channel\_op(void *op)}
-Iinter-domain event-channel management.
-
-\section{ xen\_version(int cmd)}
-Request Xen version number.
-
-\section{ console\_io(int cmd, int count, char *str)}
-Interact with the console, operations are:
-
-{\it CONSOLEIO\_write}: Output count characters from buffer str.
-
-{\it CONSOLEIO\_read}: Input at most count characters into buffer str.
-
-\section{ physdev\_op(void *physdev\_op)}
-
-\section{ grant\_table\_op(unsigned int cmd, void *uop, unsigned int count)}
-\section{ vm\_assist(unsigned int cmd, unsigned int type)}
-\section{ update\_va\_mapping\_otherdomain(unsigned long page\_nr, unsigned long val, unsigned long flags, uint16\_t domid)}
\end{document}
diff --git a/docs/src/user.tex b/docs/src/user.tex
index 5b3d256984..ff7978bba0 100644
--- a/docs/src/user.tex
+++ b/docs/src/user.tex
@@ -1,6 +1,6 @@
\documentclass[11pt,twoside,final,openright]{xenstyle}
-\usepackage{a4,graphicx,setspace,times}
-\setstretch{1.15}
+\usepackage{a4,graphicx,parskip,setspace,times}
+\setstretch{1.1}
\begin{document}
@@ -16,12 +16,19 @@
{\Huge \bf Users' manual} \\[4mm]
{\huge Xen v2.0 for x86} \\[80mm]
-{\Large Xen is Copyright (c) 2004, The Xen Team} \\[3mm]
+{\Large Xen is Copyright (c) 2002-2004, The Xen Team} \\[3mm]
{\Large University of Cambridge, UK} \\[20mm]
-{\large Last updated on 26th October, 2004}
\end{tabular}
-\vfill
\end{center}
+
+{\bf
+DISCLAIMER: This documentation is currently under active development
+and as such there may be mistakes and omissions --- watch out for
+these and please report any you find to the developer's mailing list.
+Contributions of material, suggestions and corrections are welcome.
+}
+
+\vfill
\cleardoublepage
% TABLE OF CONTENTS
@@ -42,22 +49,13 @@
\renewcommand{\bottomfraction}{.8}
\renewcommand{\textfraction}{.2}
\renewcommand{\floatpagefraction}{.8}
-\setstretch{1.15}
+\setstretch{1.1}
\newcommand{\path}[1]{{\tt #1}}
\part{Introduction and Tutorial}
\chapter{Introduction}
-{\bf
-DISCLAIMER: This documentation is currently under active development
-and as such there may be mistakes and omissions --- watch out for
-these and please report any you find to the developer's mailing list.
-Contributions of material, suggestions and corrections are welcome.
-}
-
-\vspace{5mm}
-
Xen is a { \em paravirtualising } virtual machine monitor (VMM), or
`hypervisor', for the x86 processor architecture. Xen can securely
execute multiple virtual machines on a single physical system with
@@ -81,7 +79,7 @@ The drawback of this approach is that it requires operating systems to
be {\em ported} to run on Xen. This process is similar to a port of
an operating system to a new hardware platform, although the process
is simplified because the paravirtual machine architecture is very
-similar to the underlying native hardware. Although operating system
+similar to the underlying native hardware. Even though operating system
kernels must explicitly support Xen, a key feature is that user space
applications and libraries {\em do not} require modification.
@@ -91,11 +89,6 @@ We expect that Xen support will ultimately be integrated into the
official releases of Linux, NetBSD, FreeBSD and Dragonfly BSD.
Other OS ports, including Plan 9, are in progress.
-%Even running multiple copies of Linux can be very useful, providing a
-%means of containing faults to one OS image, providing performance
-%isolation between the various OS instances and trying out multiple
-%distros.
-
Possible usage scenarios for Xen include:
\begin{description}
\item [Kernel development.] Test and debug kernel modifications in a
@@ -103,18 +96,18 @@ Possible usage scenarios for Xen include:
machine.
\item [Multiple OS configurations.] Run multiple operating systems
simultaneously, for instance for compatibility or QA purposes.
-\item [Server consolidation.] Move multiple servers onto one box,
- provided performance and fault isolation at virtual machine
- boundaries.
+\item [Server consolidation.] Move multiple servers onto one box
+ with performance and fault isolation provided at virtual machine
+ boundaries.
\item [Cluster computing.] Improve manageability and efficiency by
running services in virtual machines, isolated from
- machine-specifics and load balance using live migration.
+ machine-specifics; load balance using live migration.
\item [High availability computing.] Run device drivers in sandboxed
domains for increased robustness.
\item [Hardware support for custom OSes.] Export drivers from a
- mainstream OS (e.g. Linux) with good hardware support
+ mainstream OS (e.g. Linux) with wide-ranging hardware support
to your custom OS, avoiding the need for you to port existing
- drivers to achieve good hardware support.
+ drivers.
\end{description}
\section{Structure of a Xen-Based System}
@@ -133,15 +126,15 @@ other domains and manages their virtual devices. It also performs
suspend, resume and migration of virtual machines. Where one is
required, the X server is also run in domain 0.
-Within Domain 0, a process called `Xend' runs to manage the system.
+Within Domain 0, a process called `xend' runs to manage the system.
Xend is responsible for managing virtual machines and providing access
to their consoles. Commands are issued to Xend over an HTTP
interface, either from a command-line tool or from a web browser.
\section{Hardware Support}
-Xen currently runs only on the x86 architecture (however, ports to other
-architectures, including x86/64 and IA64, are in progress).
+Xen currently runs only on the x86 architecture, although ports to other
+architectures, including x86/64 and IA64, are in progress.
Xen requires a `P6' or newer processor (e.g. Pentium Pro, Celeron,
Pentium II, Pentium III, Pentium IV, Xeon, AMD Athlon, AMD Duron).
Multiprocessor machines are supported, and we also have basic support
@@ -153,7 +146,7 @@ mode.
Xen can currently use up to 4GB of memory. It is possible for x86
machines to address up to 64GB of physical memory but there are no
plans to support these systems. The x86\_64 port is the planned route
-to supporting more than 4GB of memory.
+to supporting larger memory sizes.
Xen offloads most of the hardware support issues to the guest OS
running in Domain 0. Xen itself only contains code to detect and
@@ -183,7 +176,7 @@ information along with pointers to papers and technical reports:
Xen has since grown into a project in its own right, enabling us to
investigate interesting research issues regarding the best techniques
-for virtualizing resources such as the CPU, memory, disk and network.
+for virtualising resources such as the CPU, memory, disk and network.
The project has been bolstered by support from Intel Research
Cambridge, and HP Labs, who are now working closely with us.
@@ -193,16 +186,15 @@ first public release (1.0) was made in October 2003. Since
then, Xen has been extensively developed and is now used in production
scenarios on multiple sites.
-Xen 2.0 feature greatly enhanced hardware support, configuration
+Xen 2.0 features greatly enhanced hardware support, configuration
flexibility, usability and a larger complement of supported operating
-systems. We think that Xen has the potential to become {\em the}
-definitive open source virtualisation solution and will work to
-conclusively achieve that position.
+systems. This latest release takes Xen a step closer to becoming the
+definitive open source solution for virtualisation.
\chapter{Installation}
The Xen distribution includes three main components: Xen itself,
-utilities to convert a standard Linux tree to run on Xen and the
+utilities to convert a standard Linux tree to run on Xen, and the
userspace tools required to operate a Xen-based system.
This manual describes how to install the Xen 2.0 distribution from
@@ -217,7 +209,7 @@ operating system distribution.
\item A working installation of the GRUB bootloader.
\item An installation of Twisted v1.3 or above (see {\tt
http://www.twistedmatrix.com}). There may be a package available for
-your distribution; alternatively it can be installed by running {\tt \#
+your distribution; alternatively it can be installed by running {\tt
make install-twisted} in the root of the Xen source tree.
\item Python logging package (see {\tt http://www.red-dove.com/})
\item The Linux bridge control tools (see {\tt
@@ -236,9 +228,11 @@ available for your distribution.
\section{Install Bitkeeper (Optional)}
To fetch a local copy, first download the BitKeeper tools.
-Download instructions must be obtained by filling out the provided
-form at: \\ {\tt
-http://www.bitmover.com/cgi-bin/download.cgi }
+Download instructions can be obtained by filling out the provided
+form at:
+\begin{quote}
+{\tt http://www.bitmover.com/cgi-bin/download.cgi}
+\end{quote}
The BitKeeper install program is designed to be run with X. If X is
not available, you can specify the install directory on the command
@@ -248,8 +242,11 @@ line.
\subsection{Using Bitkeeper}
-The public master BK repository for the 2.0 release lives at: \\
-{\tt bk://xen.bkbits.net/xen-2.0.bk}. You can use Bitkeeper to
+The public master BK repository for the 2.0 release lives at:
+\begin{quote}
+{\tt bk://xen.bkbits.net/xen-2.0.bk}
+\end{quote}
+You can use Bitkeeper to
download it and keep it updated with the latest features and fixes.
Change to the directory in which you want to put the source code, then
@@ -258,6 +255,7 @@ run:
# bk clone bk://xen.bkbits.net/xen-2.0.bk
\end{verbatim}
+
Under your current directory, a new directory named `xen-2.0.bk' has
been created, which contains all the source code for the Xen
hypervisor and the Xen tools. The directory also contains `sparse' OS
@@ -276,7 +274,8 @@ changes to the repository by running:
The Xen source tree is also available in gzipped tarball form from the
Xen downloads page:\\
{\tt http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads.html}.
-Prebuilt tarballs are also available from this page but are very large.
+Prebuilt tarballs are also available from this page but are relatively
+ large.
\section{The distribution}
@@ -311,9 +310,9 @@ following:
Inspect the Makefile if you want to see what goes on during a build.
Building Xen and the tools is straightforward, but XenLinux is more
-complicated. The makefile needs a `pristine' linux kernel tree which
-it will then add the Xen architecture files to. You can tell the
-makefile the location of the appropriate linux compressed tar file by
+complicated. The makefile needs a `pristine' Linux kernel tree to which
+it will then add the Xen architecture files. You can tell the
+makefile the location of the appropriate Linux compressed tar file by
setting the LINUX\_SRC environment variable, e.g. \\
\verb!# LINUX_SRC=/tmp/linux-2.6.8.1.tar.bz2 make world! \\ or by
placing the tar file somewhere in the search path of {\tt
@@ -476,30 +475,36 @@ The first step in creating a new domain is to prepare a root
filesystem for it to boot off. Typically, this might be stored in a
normal partition, an LVM or other volume manager partition, a disk
file or on an NFS server.
-
A simple way to do this is simply to boot from your standard OS
install CD and install the distribution into another partition on your
hard drive.
-{\em N.b } you can boot with Xen and XenLinux without installing any
-special userspace tools but will need to have the prerequisites
-described in Section~\ref{sec:prerequisites} and the Xen control tools
-installed before you proceed.
-
-\section{From the web interface}
-
-Boot the Xen machine and start Xensv (see Chapter~\ref{cha:xensv} for
-more details) using the command: \\
-\verb_# xensv start_ \\
-This will also start Xend (see Chapter~\ref{cha:xend} for more information).
-
-The domain management interface will then be available at {\tt
-http://your\_machine:8080/}. This provides a user friendly wizard for
-starting domains and functions for managing running domains.
-
-\section{From the command line}
-
-Full details of the {\tt xm} tool are found in Chapter~\ref{cha:xm}.
+You can boot Xen and a single XenLinux instance without installing any
+special user-space tools. To proceed further than this you will need
+to install the prerequisites described in Section~\ref{sec:prerequisites}
+and the Xen control tools. The control tools are installed by entering
+the tools subdirectory of the repository and typing \\
+\verb!# LINUX_SRC=/path/to/linux2.4/source make linux24! \\
+
+To start the control daemon, type \\ \verb!# xend start! \\ If you
+wish to start the daemon automatically, see the instructions in
+Chapter~\ref{cha:xend}. Once the daemon is running, you can use the
+{\tt xm} tool to monitor and maintain the domains running on your
+system. This chapter provides only a brief tutorial: we provide full
+details of the {\tt xm} tool in Chapter~\ref{cha:xm}.
+
+%\section{From the web interface}
+%
+%Boot the Xen machine and start Xensv (see Chapter~\ref{cha:xensv} for
+%more details) using the command: \\
+%\verb_# xensv start_ \\
+%This will also start Xend (see Chapter~\ref{cha:xend} for more information).
+%
+%The domain management interface will then be available at {\tt
+%http://your\_machine:8080/}. This provides a user friendly wizard for
+%starting domains and functions for managing running domains.
+%
+%\section{From the command line}
This example explains how to use the \path{xmdefconfig} file. If you
require a more complex setup, you will want to write a custom
@@ -531,7 +536,7 @@ second to the location of \path{/usr} (if you are sharing it between
domains). [i.e. {\tt disk = ['phy:your\_hard\_drive\%d,sda1,w' \%
(base\_partition\_number + vmid), 'phy:your\_usr\_partition,sda6,r' ]}
\item[dhcp] Uncomment the dhcp variable, so that the domain will
-receive its IP address from a DHCP server. [i.e. {\tt dhcp=''dhcp''}]
+receive its IP address from a DHCP server. [i.e. {\tt dhcp='dhcp'}]
\end{description}
You may also want to edit the {\bf vif} variable in order to choose
@@ -597,8 +602,8 @@ configuration file (or a link to it) under \path{/etc/xen/auto/}.
A Sys-V style init script for RedHat and LSB-compliant systems is
provided and will be automatically copied to \path{/etc/init.d/}
-during install. You can then enable it in the appriate way for your
-distribution.
+during install. You can then enable it in the appropriate way for
+your distribution.
For instance, on RedHat:
@@ -689,13 +694,22 @@ or:
# xm console 5
\end{verbatim}
-\chapter{Other kinds of storage}
+\chapter{Domain filesystem storage}
It is possible to directly export any Linux block device to a virtual,
or to export filesystems / devices to virtual machines using standard
-network protocals (e.g. NBD, iSCSI, NFS, etc). This chapter covers
+network protocols (e.g. NBD, iSCSI, NFS, etc). This chapter covers
some of the possibilities.
+\section{Warning: Block device sharing}
+
+Block devices should only be shared between domains in a read-only
+fashion otherwise the Linux kernels will obviously get very confused
+as the file system structure may change underneath them (having the
+same partition mounted rw twice is a sure fire way to cause
+irreparable damage)! If you want read-write sharing, export the
+directory to other domains via NFS from domain0.
+
\section{File-backed virtual block devices}
It is possible to use a file in Domain 0 as the primary storage for a
@@ -1227,6 +1241,25 @@ parameters, etc.
% Support for other administrative domains is not yet available...
+\chapter{Debugging}
+
+Xen has a set of debugging features that can be useful to try and
+figure out what's going on. Hit 'h' on the serial line (if you
+specified a baud rate on the Xen command line) or ScrollLock-h on the
+keyboard to get a list of supported commands.
+
+If you have a crash you'll likely get a crash dump containing an EIP
+(PC) which, along with an 'objdump -d image', can be useful in
+figuring out what's happened. Debug a Xenlinux image just as you
+would any other Linux kernel.
+
+We supply a handy debug terminal program which you can find in
+/usr/local/src/xen-2.0.bk/tools/misc/miniterm/
+This should be built and executed on another machine that is connected
+via a null modem cable. Documentation is included.
+Alternatively, if the Xen machine is connected to a serial-port server
+then we supply a dumb TCP terminal client, {\tt xencons}.
+
\chapter{Xen build options}
For most users, the default build of Xen will be adequate. For some
@@ -1582,6 +1615,61 @@ template and the new image, and using {\tt cp -a} or {\tt tar} or by
simply copying the image file. Once this is done, modify the
image-specific settings (hostname, network settings, etc).
+\chapter{Installing Xen / XenLinux on Redhat / Fedora}
+
+When using Xen / Xenlinux on a standard Linux distribution there are
+a couple of things to watch out for:
+
+Note that, because domains>0 don't have any privileged access at all,
+certain commands in the default boot sequence will fail e.g. attempts
+to update the hwclock, change the console font, update the keytable
+map, start apmd (power management), or gpm (mouse cursor). Either
+ignore the errors (they should be harmless), or remove them from the
+startup scripts. Deleting the following links are a good start:
+S24pcmcia S09isdn S17keytable S26apmd S85gpm.
+
+If you want to use a single root file system that works cleanly for
+domain0 and domains>0, a useful trick is to use different 'init' run
+levels. For example, on the Xen Demo CD we use run level 3 for domain
+0, and run level 4 for domains>0. This enables different startup
+scripts to be run in depending on the run level number passed on the
+kernel command line.
+
+If you're going to use NFS root files systems mounted either from an
+external server or from domain0 there are a couple of other gotchas.
+The default /etc/sysconfig/iptables rules block NFS, so part way
+through the boot sequence things will suddenly go dead.
+
+If you're planning on having a separate NFS /usr partition, the RH9
+boot scripts don't make life easy - they attempt to mount NFS file
+systems way to late in the boot process. The easiest way I found to do
+this was to have a '/linuxrc' script run ahead of /sbin/init that
+mounts /usr:
+
+\begin{verbatim}
+ #!/bin/bash
+ /sbin/ipconfig lo 127.0.0.1
+ /sbin/portmap
+ /bin/mount /usr
+ exec /sbin/init "$@" <>/dev/console 2>&1
+\end{verbatim}
+
+The one slight complication with the above is that /sbib/portmap is
+dynamically linked against /usr/lib/libwrap.so.0 Since this is in
+/usr, it won't work. This can be solved by copying the file (and link)
+below the /usr mount point, and just let the file be 'covered' when
+the mount happens.
+
+In some installations, where a shared read-only /usr is being used, it
+may be desirable to move other large directories over into the
+read-only /usr. For example, you might replace /bin /lib and /sbin
+with links into /usr/root/bin /usr/root/lib and /usr/root/sbin
+respectively. This creates other problems for running the /linuxrc
+script, requiring bash, portmap, mount, ifconfig, and a handful of
+other shared libraries to be copied below the mount point - little
+statically linked C program would solve this problem.
+
+
\end{document}
@@ -1612,4 +1700,52 @@ image-specific settings (hostname, network settings, etc).
%% You can use these modules to write your own custom scripts or you can
%% customise the scripts supplied in the Xen distribution.
+
+
% Explain about AGP GART
+
+
+%% If you're not intending to configure the new domain with an IP address
+%% on your LAN, then you'll probably want to use NAT. The
+%% 'xen_nat_enable' installs a few useful iptables rules into domain0 to
+%% enable NAT. [NB: We plan to support RSIP in future]
+
+
+
+
+%% Installing the file systems from the CD
+%% =======================================
+
+%% If you haven't got an existing Linux installation onto which you can
+%% just drop down the Xen and Xenlinux images, then the file systems on
+%% the CD provide a quick way of doing an install. However, you would be
+%% better off in the long run doing a proper install of your preferred
+%% distro and installing Xen onto that, rather than just doing the hack
+%% described below:
+
+%% Choose one or two partitions, depending on whether you want a separate
+%% /usr or not. Make file systems on it/them e.g.:
+%% mkfs -t ext3 /dev/hda3
+%% [or mkfs -t ext2 /dev/hda3 && tune2fs -j /dev/hda3 if using an old
+%% version of mkfs]
+
+%% Next, mount the file system(s) e.g.:
+%% mkdir /mnt/root && mount /dev/hda3 /mnt/root
+%% [mkdir /mnt/usr && mount /dev/hda4 /mnt/usr]
+
+%% To install the root file system, simply untar /usr/XenDemoCD/root.tar.gz:
+%% cd /mnt/root && tar -zxpf /usr/XenDemoCD/root.tar.gz
+
+%% You'll need to edit /mnt/root/etc/fstab to reflect your file system
+%% configuration. Changing the password file (etc/shadow) is probably a
+%% good idea too.
+
+%% To install the usr file system, copy the file system from CD on /usr,
+%% though leaving out the "XenDemoCD" and "boot" directories:
+%% cd /usr && cp -a X11R6 etc java libexec root src bin dict kerberos local sbin tmp doc include lib man share /mnt/usr
+
+%% If you intend to boot off these file systems (i.e. use them for
+%% domain 0), then you probably want to copy the /usr/boot directory on
+%% the cd over the top of the current symlink to /boot on your root
+%% filesystem (after deleting the current symlink) i.e.:
+%% cd /mnt/root ; rm boot ; cp -a /usr/boot .
diff --git a/extras/mini-os/Makefile b/extras/mini-os/Makefile
index d2d478ac40..606454b6bb 100644
--- a/extras/mini-os/Makefile
+++ b/extras/mini-os/Makefile
@@ -14,16 +14,16 @@ TARGET := mini-os
LOBJS := lib/malloc.o lib/math.o lib/printf.o lib/string.o
OBJS := entry.o kernel.o traps.o hypervisor.o mm.o events.o time.o ${LOBJS}
-HINTF := h/hypervisor-ifs/hypervisor-if.h
+HINTF := h/xen-public/xen.h
HDRS := h/os.h h/types.h h/hypervisor.h h/mm.h h/events.h h/time.h h/lib.h
HDRS += $(HINTF)
default: $(TARGET)
-hypervisor-ifs:
- ln -sf ../../../xen/include/hypervisor-ifs h/hypervisor-ifs
+xen-public:
+ [ -e h/xen-public] || ln -sf ../../../xen/include/public h/xen-public
-$(TARGET): hypervisor-ifs head.o $(OBJS)
+$(TARGET): xen-public head.o $(OBJS)
$(LD) -N -T minios.lds head.o $(OBJS) -o $@.elf
objcopy -R .note -R .comment $@.elf $@
gzip -f -9 -c $@ >$@.gz
diff --git a/extras/mini-os/h/events.h b/extras/mini-os/h/events.h
index 5166876b76..c8f696ae90 100644
--- a/extras/mini-os/h/events.h
+++ b/extras/mini-os/h/events.h
@@ -20,7 +20,7 @@
#ifndef _EVENTS_H_
#define _EVENTS_H_
-/* _EVENT_* are defined in hypervisor-if.h */
+/* _EVENT_* are defined in xen-public/xen.h */
#define EV_BLKDEV _EVENT_BLKDEV
#define EV_TIMER _EVENT_TIMER
#define EV_DIE _EVENT_DIE
diff --git a/extras/mini-os/h/hypervisor.h b/extras/mini-os/h/hypervisor.h
index c29bd1723e..3a127e1290 100644
--- a/extras/mini-os/h/hypervisor.h
+++ b/extras/mini-os/h/hypervisor.h
@@ -11,9 +11,8 @@
#include <types.h>
-/* include the hypervisor interface */
-#include <hypervisor-ifs/hypervisor-if.h>
-#include "../../../tools/xu/lib/domain_controller.h"
+#include <xen-public/xen.h>
+#include <xen-public/io/domain_controller.h>
/*
* a placeholder for the start of day information passed up from the hypervisor
diff --git a/extras/mini-os/h/os.h b/extras/mini-os/h/os.h
index c717b66961..cf15d92126 100644
--- a/extras/mini-os/h/os.h
+++ b/extras/mini-os/h/os.h
@@ -29,7 +29,7 @@
/*
- * these are also defined in hypervisor-if.h but can't be pulled in as
+ * these are also defined in xen-public/xen.h but can't be pulled in as
* they are used in start of day assembly. Need to clean up the .h files
* a bit more...
*/
@@ -48,7 +48,7 @@
#ifndef __ASSEMBLY__
#include <types.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <xen-public/xen.h>
/* this struct defines the way the registers are stored on the
diff --git a/linux-2.4.27-xen-sparse/arch/xen/Makefile b/linux-2.4.27-xen-sparse/arch/xen/Makefile
index f8f1e96214..1db1b7f1b6 100644
--- a/linux-2.4.27-xen-sparse/arch/xen/Makefile
+++ b/linux-2.4.27-xen-sparse/arch/xen/Makefile
@@ -127,7 +127,7 @@ archclean:
@$(MAKEBOOT) clean
archmrproper:
- rm -f include/asm-xen/hypervisor-ifs/arch
+ rm -f include/asm-xen/xen-public/arch
archdep:
@$(MAKEBOOT) dep
diff --git a/linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h b/linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h
index 03937e0e4c..d16895d2c2 100644
--- a/linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h
+++ b/linux-2.4.27-xen-sparse/arch/xen/drivers/blkif/frontend/common.h
@@ -18,11 +18,11 @@
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#include <linux/major.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
-#include <asm-xen/hypervisor-ifs/io/blkif.h>
+#include <asm/xen-public/io/blkif.h>
#if 0
#define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
diff --git a/linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c b/linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c
index 48dcecd6ec..b77703ac89 100644
--- a/linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c
+++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/pci-pc.c
@@ -18,8 +18,8 @@
#include <asm/segment.h>
#include <asm/io.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/physdev.h>
#include "pci-i386.h"
diff --git a/linux-2.4.27-xen-sparse/arch/xen/kernel/process.c b/linux-2.4.27-xen-sparse/arch/xen/kernel/process.c
index 9c1123b740..806e9a73f6 100644
--- a/linux-2.4.27-xen-sparse/arch/xen/kernel/process.c
+++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/process.c
@@ -44,7 +44,7 @@
#include <asm/desc.h>
#include <asm/mmu_context.h>
#include <asm/multicall.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
#include <linux/irq.h>
diff --git a/linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c b/linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c
index 61c2f73a07..92312734b8 100644
--- a/linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c
+++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/setup.c
@@ -48,7 +48,7 @@ static int errno;
#include <asm/mmu_context.h>
#include <asm/ctrl_if.h>
#include <asm/hypervisor.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/tqueue.h>
@@ -335,7 +335,7 @@ void __init setup_arch(char **cmdline_p)
* and the bootmem bitmap.
* NB. There is definitely enough room for the bootmem bitmap in the
* bootstrap page table. We are guaranteed to get >=512kB unused 'padding'
- * for our own use after all bootstrap elements (see hypervisor-if.h).
+ * for our own use after all bootstrap elements (see asm/xen-public/xen.h).
*/
boot_pfn = min((int)xen_start_info.nr_pages,lmax_low_pfn);
bootmap_size = init_bootmem(start_pfn,boot_pfn);
diff --git a/linux-2.4.27-xen-sparse/arch/xen/kernel/time.c b/linux-2.4.27-xen-sparse/arch/xen/kernel/time.c
index 3a4f8bf2c5..d4b6f5edac 100644
--- a/linux-2.4.27-xen-sparse/arch/xen/kernel/time.c
+++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/time.c
@@ -52,7 +52,7 @@
#include <asm/div64.h>
#include <asm/hypervisor.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
#include <linux/mc146818rtc.h>
#include <linux/kernel.h>
diff --git a/linux-2.4.27-xen-sparse/include/asm-xen/page.h b/linux-2.4.27-xen-sparse/include/asm-xen/page.h
index 26e504485b..239daa6ede 100644
--- a/linux-2.4.27-xen-sparse/include/asm-xen/page.h
+++ b/linux-2.4.27-xen-sparse/include/asm-xen/page.h
@@ -12,7 +12,7 @@
#include <linux/config.h>
#include <linux/string.h>
#include <asm/types.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
#ifdef CONFIG_XEN_SCRUB_PAGES
#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
diff --git a/linux-2.4.27-xen-sparse/include/asm-xen/segment.h b/linux-2.4.27-xen-sparse/include/asm-xen/segment.h
index ca13028ce0..276765d1de 100644
--- a/linux-2.4.27-xen-sparse/include/asm-xen/segment.h
+++ b/linux-2.4.27-xen-sparse/include/asm-xen/segment.h
@@ -4,7 +4,7 @@
#ifndef __ASSEMBLY__
#include <linux/types.h>
#endif
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
#define __KERNEL_CS FLAT_RING1_CS
#define __KERNEL_DS FLAT_RING1_DS
diff --git a/linux-2.4.27-xen-sparse/mkbuildtree b/linux-2.4.27-xen-sparse/mkbuildtree
index 3180d21675..ff5e789ccf 100755
--- a/linux-2.4.27-xen-sparse/mkbuildtree
+++ b/linux-2.4.27-xen-sparse/mkbuildtree
@@ -107,11 +107,11 @@ set ${RS}/../linux-2.6.*-xen-sparse
LINUX_26="$1"
-# Create links to the shared definitions of the hypervisor interface
-rm -rf ${AD}/include/asm-xen/hypervisor-ifs
-mkdir ${AD}/include/asm-xen/hypervisor-ifs
-cd ${AD}/include/asm-xen/hypervisor-ifs
-relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
+# Create links to the shared definitions of the Xen interfaces.
+rm -rf ${AD}/include/asm-xen/xen-public
+mkdir ${AD}/include/asm-xen/xen-public
+cd ${AD}/include/asm-xen/xen-public
+relative_lndir ../../../${RS}/../xen/include/public
# Create a link to the shared definitions for the control interface
cd ${AD}/include/asm-xen
diff --git a/linux-2.6.9-xen-sparse/arch/xen/Makefile b/linux-2.6.9-xen-sparse/arch/xen/Makefile
index 728d0aa5e1..1185a454fc 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/Makefile
+++ b/linux-2.6.9-xen-sparse/arch/xen/Makefile
@@ -33,16 +33,16 @@ include/asm-xen/asm:
@echo ' SYMLINK $@ -> include/asm-xen/asm-$(XENARCH)'
@ln -fsn asm-$(XENARCH) $@
-include/asm-xen/asm-$(XENARCH)/hypervisor-ifs:
- @echo ' SYMLINK $@ -> include/asm-xen/hypervisor-ifs'
- @ln -fsn ../hypervisor-ifs $@
+include/asm-xen/asm-$(XENARCH)/xen-public:
+ @echo ' SYMLINK $@ -> include/asm-xen/xen-public'
+ @ln -fsn ../xen-public $@
arch/xen/arch:
@rm -f $@
@ln -fsn $(XENARCH) $@
prepare: include/.asm-ignore include/asm-xen/asm \
- include/asm-xen/asm-$(XENARCH)/hypervisor-ifs \
+ include/asm-xen/asm-$(XENARCH)/xen-public \
arch/xen/arch ;
all: vmlinuz
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S
index f1e60cc06c..e6978360e8 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S
@@ -48,7 +48,7 @@
#include <asm/smp.h>
#include <asm/page.h>
#include "irq_vectors.h"
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
#define nr_syscalls ((syscall_table_size)/4)
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S
index b41a96db42..b773a18e5e 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/head.S
@@ -15,7 +15,7 @@
#include <asm/segment.h>
#include <asm/thread_info.h>
#include <asm/asm_offsets.h>
-#include <asm/hypervisor-ifs/arch-x86_32.h>
+#include <asm/xen-public/arch-x86_32.h>
/*
* References to members of the new_cpu_data structure.
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c
index bb3b0f3090..3c85bee294 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/ioport.c
@@ -8,7 +8,7 @@
#include <linux/smp_lock.h>
#include <linux/stddef.h>
#include <linux/slab.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
asmlinkage long sys_iopl(unsigned int new_io_pl)
{
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c
index 930e9151a3..66d9d6e4d0 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/process.c
@@ -47,7 +47,7 @@
#include <asm/irq.h>
#include <asm/desc.h>
#include <asm-xen/multicall.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
#ifdef CONFIG_MATH_EMULATION
#include <asm/math_emu.h>
#endif
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c
index 5ed85495cc..1edc1cbf83 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c
@@ -627,6 +627,8 @@ void __init time_init(void)
wall_to_monotonic.tv_nsec = -xtime.tv_nsec;
processed_system_time = shadow_system_time;
+ if (cur_timer->init(NULL) != 0)
+ BUG();
printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);
time_irq = bind_virq_to_irq(VIRQ_TIMER);
@@ -673,21 +675,26 @@ int set_timeout_timer(void)
void time_suspend(void)
{
+ /* nothing */
}
+/* No locking required. We are only CPU running, and interrupts are off. */
void time_resume(void)
{
- unsigned long flags;
- write_seqlock_irqsave(&xtime_lock, flags);
- /* Get timebases for new environment. */
- __get_time_values_from_xen();
- /* Reset our own concept of passage of system time. */
- processed_system_time = shadow_system_time;
- /* Accept a warp in UTC (wall-clock) time. */
- last_seen_tv.tv_sec = 0;
- /* Make sure we resync UTC time with Xen on next timer interrupt. */
- last_update_from_xen = 0;
- write_sequnlock_irqrestore(&xtime_lock, flags);
+ if (cur_timer->init(NULL) != 0)
+ BUG();
+
+ /* Get timebases for new environment. */
+ __get_time_values_from_xen();
+
+ /* Reset our own concept of passage of system time. */
+ processed_system_time = shadow_system_time;
+
+ /* Accept a warp in UTC (wall-clock) time. */
+ last_seen_tv.tv_sec = 0;
+
+ /* Make sure we resync UTC time with Xen on next timer interrupt. */
+ last_update_from_xen = 0;
}
/*
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c
index 683ad982ca..d4d64de094 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/timer_tsc.c
@@ -332,7 +332,6 @@ static inline void cpufreq_delayed_get(void) { return; }
static int __init init_tsc(char* override)
{
- unsigned long long alarm;
u64 __cpu_khz;
__cpu_khz = HYPERVISOR_shared_info->cpu_freq;
@@ -353,9 +352,7 @@ static int __init init_tsc(char* override)
set_cyc2ns_scale(cpu_khz/1000);
- rdtscll(alarm);
-
- use_tsc=1;
+ use_tsc = 1;
return 0;
}
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c b/linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c
index 661221379b..e964ae00f1 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/pci/direct.c
@@ -6,8 +6,8 @@
#include <linux/init.h>
#include "pci.h"
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/physdev.h>
/*
* Functions for accessing PCI configuration space with type xen accesses
diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c b/linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c
index 7dc8dfb0ba..b7761350a9 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/i386/pci/irq.c
@@ -19,8 +19,8 @@
#include "pci.h"
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/physdev.h>
/*
* Never use: 0, 1, 2 (timer, keyboard, and cascade)
diff --git a/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c b/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
index b779ac114c..37ba61846a 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
@@ -38,8 +38,8 @@
#include <asm/system.h>
#include <asm/ptrace.h>
#include <asm/synch_bitops.h>
-#include <asm/hypervisor-ifs/event_channel.h>
-#include <asm/hypervisor-ifs/physdev.h>
+#include <asm/xen-public/event_channel.h>
+#include <asm/xen-public/physdev.h>
#include <asm-xen/ctrl_if.h>
#include <asm-xen/hypervisor.h>
diff --git a/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c
index 9b9761e841..2e81929624 100644
--- a/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c
+++ b/linux-2.6.9-xen-sparse/arch/xen/kernel/reboot.c
@@ -12,7 +12,7 @@ static int errno;
#include <asm/mmu_context.h>
#include <asm-xen/ctrl_if.h>
#include <asm-xen/hypervisor.h>
-#include <asm-xen/hypervisor-ifs/dom0_ops.h>
+#include <asm-xen/xen-public/dom0_ops.h>
#include <asm-xen/suspend.h>
#include <asm-xen/queues.h>
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6.9-xen-sparse/drivers/xen/balloon/balloon.c
index b9ebda1785..d7ecf3f8ec 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/balloon/balloon.c
+++ b/linux-2.6.9-xen-sparse/drivers/xen/balloon/balloon.c
@@ -60,6 +60,8 @@
#include <asm/uaccess.h>
#include <asm/tlb.h>
+#include <linux/list.h>
+
/* USER DEFINES -- THESE SHOULD BE COPIED TO USER-SPACE TOOLS */
#define USER_INFLATE_BALLOON 1 /* return mem to hypervisor */
#define USER_DEFLATE_BALLOON 2 /* claim mem from hypervisor */
@@ -74,11 +76,47 @@ static struct proc_dir_entry *balloon_pde;
unsigned long credit;
static unsigned long current_pages, most_seen_pages;
-/*
- * Dead entry written into balloon-owned entries in the PMT.
- * It is deliberately different to INVALID_P2M_ENTRY.
- */
-#define DEAD 0xdead1234
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+/* Use the private and mapping fields of struct page as a list. */
+#define PAGE_TO_LIST(p) ( (struct list_head *)&p->private )
+#define LIST_TO_PAGE(l) ( list_entry( ((unsigned long *)l), \
+ struct page, private ) )
+#define UNLIST_PAGE(p) do { list_del(PAGE_TO_LIST(p)); \
+ p->mapping = NULL; \
+ p->private = 0; } while(0)
+#else
+/* There's a dedicated list field in struct page we can use. */
+#define PAGE_TO_LIST(p) ( &p->list )
+#define LIST_TO_PAGE(l) ( list_entry(l, struct page, list) )
+#define UNLIST_PAGE(p) ( list_del(&p->list) )
+#endif
+
+/* List of ballooned pages, threaded through the mem_map array. */
+LIST_HEAD(ballooned_pages);
+
+/** add_ballooned_page - remember we've ballooned a pfn */
+void add_ballooned_page(unsigned long pfn)
+{
+ struct page *p = mem_map + pfn;
+
+ list_add(PAGE_TO_LIST(p), &ballooned_pages);
+}
+
+/* rem_ballooned_page - recall a ballooned page and remove from list. */
+struct page *rem_ballooned_page(void)
+{
+ if(!list_empty(&ballooned_pages))
+ {
+ struct page *ret;
+
+ ret = LIST_TO_PAGE(ballooned_pages.next);
+ UNLIST_PAGE(ret);
+
+ return ret;
+ }
+ else
+ return NULL;
+}
static inline pte_t *get_ptep(unsigned long addr)
{
@@ -101,6 +139,7 @@ static inline pte_t *get_ptep(unsigned long addr)
/* Main function for relinquishing memory. */
static unsigned long inflate_balloon(unsigned long num_pages)
+
{
unsigned long *parray;
unsigned long *currp;
@@ -130,6 +169,7 @@ static unsigned long inflate_balloon(unsigned long num_pages)
currp = parray;
for ( j = 0; j < i; j++, currp++ )
__free_page((struct page *) (mem_map + *currp));
+
ret = -EFAULT;
goto cleanup;
}
@@ -156,7 +196,10 @@ static unsigned long inflate_balloon(unsigned long num_pages)
kunmap(&mem_map[*currp]);
}
#endif
- phys_to_machine_mapping[*currp] = DEAD;
+
+ add_ballooned_page(*currp);
+
+ phys_to_machine_mapping[*currp] = INVALID_P2M_ENTRY;
*currp = mfn;
}
@@ -195,28 +238,38 @@ static unsigned long process_returned_pages(unsigned long * parray,
* incorporated here.
*/
- unsigned long tot_pages = most_seen_pages;
unsigned long * curr = parray;
unsigned long num_installed;
- unsigned long i;
+
+ struct page *page;
num_installed = 0;
- for ( i = 0; (i < tot_pages) && (num_installed < num); i++ )
+ while ( (page = rem_ballooned_page()) != NULL )
{
- if ( phys_to_machine_mapping[i] == DEAD )
- {
- phys_to_machine_mapping[i] = *curr;
- queue_machphys_update(*curr, i);
- if (i<max_low_pfn)
- queue_l1_entry_update(
- get_ptep((unsigned long)__va(i << PAGE_SHIFT)),
- ((*curr) << PAGE_SHIFT) | pgprot_val(PAGE_KERNEL));
+ unsigned long pfn;
+
+ if ( num_installed == num )
+ break;
- __free_page(mem_map + i);
+ pfn = page - mem_map;
- curr++;
- num_installed++;
+ if(phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY)
+ {
+ printk("BUG: Tried to unballoon existing page!");
+ BUG();
}
+
+ phys_to_machine_mapping[pfn] = *curr;
+ queue_machphys_update(*curr, pfn);
+ if (pfn<max_low_pfn)
+ queue_l1_entry_update(
+ get_ptep((unsigned long)__va(pfn << PAGE_SHIFT)),
+ ((*curr) << PAGE_SHIFT) | pgprot_val(PAGE_KERNEL));
+
+ __free_page(mem_map + pfn);
+
+ curr++;
+ num_installed++;
}
return num_installed;
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h b/linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h
index 0fa60cdceb..4a12ca8fe9 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h
+++ b/linux-2.6.9-xen-sparse/drivers/xen/blkback/common.h
@@ -14,7 +14,7 @@
#include <asm/pgalloc.h>
#include <asm-xen/ctrl_if.h>
#include <asm-xen/hypervisor.h>
-#include <asm-xen/hypervisor-ifs/io/blkif.h>
+#include <asm-xen/xen-public/io/blkif.h>
#if 0
#define ASSERT(_p) \
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h
index 76255e8637..8503cfedcc 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h
+++ b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h
@@ -44,8 +44,8 @@
#include <linux/blkdev.h>
#include <linux/major.h>
#include <linux/devfs_fs_kernel.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm-xen/hypervisor-ifs/io/blkif.h>
+#include <asm/xen-public/xen.h>
+#include <asm-xen/xen-public/io/blkif.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/console/console.c b/linux-2.6.9-xen-sparse/drivers/xen/console/console.c
index 8309c253d0..f2da97e1f4 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/console/console.c
+++ b/linux-2.6.9-xen-sparse/drivers/xen/console/console.c
@@ -47,7 +47,7 @@
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>
-#include <asm/hypervisor-ifs/event_channel.h>
+#include <asm/xen-public/event_channel.h>
#include <asm-xen/hypervisor.h>
#include <asm-xen/evtchn.h>
#include <asm-xen/ctrl_if.h>
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/netback/common.h b/linux-2.6.9-xen-sparse/drivers/xen/netback/common.h
index 6646f5339f..a8eeac8aac 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/netback/common.h
+++ b/linux-2.6.9-xen-sparse/drivers/xen/netback/common.h
@@ -15,7 +15,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <asm-xen/ctrl_if.h>
-#include <asm-xen/hypervisor-ifs/io/netif.h>
+#include <asm-xen/xen-public/io/netif.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c
index 831572b4b2..6f702fa8f8 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c
+++ b/linux-2.6.9-xen-sparse/drivers/xen/netfront/netfront.c
@@ -44,7 +44,7 @@
#include <asm/io.h>
#include <asm-xen/evtchn.h>
#include <asm-xen/ctrl_if.h>
-#include <asm-xen/hypervisor-ifs/io/netif.h>
+#include <asm-xen/xen-public/io/netif.h>
#include <asm/page.h>
#include <net/arp.h>
diff --git a/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c
index 42c5b1309c..62994ba302 100644
--- a/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c
+++ b/linux-2.6.9-xen-sparse/drivers/xen/privcmd/privcmd.c
@@ -26,7 +26,7 @@
#include <asm/uaccess.h>
#include <asm/tlb.h>
#include <asm-xen/proc_cmd.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
+#include <asm/xen-public/dom0_ops.h>
#include <asm-xen/xen_proc.h>
static struct proc_dir_entry *privcmd_intf;
diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h
index 34e8f7f9eb..e2604817b6 100644
--- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h
+++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/page.h
@@ -15,7 +15,7 @@
#include <linux/config.h>
#include <linux/string.h>
#include <linux/types.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
+#include <asm/xen-public/xen.h>
#ifdef CONFIG_XEN_SCRUB_PAGES
#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h b/linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h
index 2ad902ed6b..ace8984b08 100644
--- a/linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h
+++ b/linux-2.6.9-xen-sparse/include/asm-xen/evtchn.h
@@ -35,7 +35,7 @@
#include <asm-xen/hypervisor.h>
#include <asm/ptrace.h>
#include <asm/synch_bitops.h>
-#include <asm/hypervisor-ifs/event_channel.h>
+#include <asm/xen-public/event_channel.h>
/*
* LOW-LEVEL DEFINITIONS
diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h b/linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h
index 6e52923b17..fa166ec6b1 100644
--- a/linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h
+++ b/linux-2.6.9-xen-sparse/include/asm-xen/gnttab.h
@@ -14,7 +14,7 @@
#include <linux/config.h>
#include <asm-xen/hypervisor.h>
-#include <asm-xen/hypervisor-ifs/grant_table.h>
+#include <asm-xen/xen-public/grant_table.h>
int
gnttab_grant_foreign_access(
diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
index 3054b30779..f3536bf38d 100644
--- a/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
+++ b/linux-2.6.9-xen-sparse/include/asm-xen/hypervisor.h
@@ -33,9 +33,9 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/version.h>
-#include <asm/hypervisor-ifs/hypervisor-if.h>
-#include <asm/hypervisor-ifs/dom0_ops.h>
-#include <asm/hypervisor-ifs/io/domain_controller.h>
+#include <asm/xen-public/xen.h>
+#include <asm/xen-public/dom0_ops.h>
+#include <asm/xen-public/io/domain_controller.h>
#include <asm/ptrace.h>
#include <asm/page.h>
diff --git a/linux-2.6.9-xen-sparse/mkbuildtree b/linux-2.6.9-xen-sparse/mkbuildtree
index 20513e6ead..d353015ff2 100755
--- a/linux-2.6.9-xen-sparse/mkbuildtree
+++ b/linux-2.6.9-xen-sparse/mkbuildtree
@@ -103,9 +103,9 @@ relative_lndir ${RS}
rm -f mkbuildtree
-# Create links to the shared definitions of the hypervisor interface
-rm -rf ${AD}/include/asm-xen/hypervisor-ifs
-mkdir ${AD}/include/asm-xen/hypervisor-ifs
-cd ${AD}/include/asm-xen/hypervisor-ifs
-relative_lndir ../../../${RS}/../xen/include/hypervisor-ifs
+# Create links to the shared definitions of the Xen interfaces.
+rm -rf ${AD}/include/asm-xen/xen-public
+mkdir ${AD}/include/asm-xen/xen-public
+cd ${AD}/include/asm-xen/xen-public
+relative_lndir ../../../${RS}/../xen/include/public
diff --git a/netbsd-2.0-xen-sparse/mkbuildtree b/netbsd-2.0-xen-sparse/mkbuildtree
index 2db906080a..1877db8a5e 100755
--- a/netbsd-2.0-xen-sparse/mkbuildtree
+++ b/netbsd-2.0-xen-sparse/mkbuildtree
@@ -103,11 +103,11 @@ relative_lndir ${RS}
rm -f mkbuildtree
-# Create links to the shared definitions of the hypervisor interface
-rm -rf ${AD}/sys/arch/xen/include/hypervisor-ifs
-mkdir ${AD}/sys/arch/xen/include/hypervisor-ifs
-cd ${AD}/sys/arch/xen/include/hypervisor-ifs
-relative_lndir ../../../../../${RS}/../xen/include/hypervisor-ifs
+# Create links to the shared definitions of the Xen interface
+rm -rf ${AD}/sys/arch/xen/include/xen-public
+mkdir ${AD}/sys/arch/xen/include/xen-public
+cd ${AD}/sys/arch/xen/include/xen-public
+relative_lndir ../../../../../${RS}/../xen/include/public
# Remove files which don't exist anymore
rm -rf ${AD}/sys/arch/xen/xen/events.c
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h b/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h
index 3d3f1d38c7..035495d4be 100644
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/hypervisor.h
@@ -54,12 +54,12 @@ struct xen_npx_attach_args {
/* include the hypervisor interface */
#include <sys/systm.h>
-#include <machine/hypervisor-ifs/hypervisor-if.h>
-#include <machine/hypervisor-ifs/dom0_ops.h>
-#include <machine/hypervisor-ifs/event_channel.h>
-#include <machine/hypervisor-ifs/io/domain_controller.h>
-#include <machine/hypervisor-ifs/io/netif.h>
-#include <machine/hypervisor-ifs/io/blkif.h>
+#include <machine/xen-public/xen.h>
+#include <machine/xen-public/dom0_ops.h>
+#include <machine/xen-public/event_channel.h>
+#include <machine/xen-public/io/domain_controller.h>
+#include <machine/xen-public/io/netif.h>
+#include <machine/xen-public/io/blkif.h>
#undef u8
#undef u16
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h b/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h
index 274dad8410..e590db5ae6 100644
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h
@@ -85,7 +85,7 @@ void vprintk(const char *, va_list);
/*
- * these are also defined in hypervisor-if.h but can't be pulled in as
+ * these are also defined in xen-public/xen.h but can't be pulled in as
* they are used in start of day assembly. Need to clean up the .h files
* a bit more...
*/
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c
index e54615567b..ede2207965 100644
--- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c
+++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/xenkbc.c
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: xenkbc.c,v 1.3.2.1 2004/05/22 15:57:43 he Exp $");
#include <machine/xenkbcvar.h>
#include <machine/xen.h>
#include <machine/hypervisor.h>
-#include <machine/hypervisor-ifs/kbd.h>
+#include <machine/xen-public/kbd.h>
#include <machine/evtchn.h>
#define KBC_DELAY DELAY(1000)
diff --git a/tools/Make.defs b/tools/Make.defs
index 1b4d4fec7f..7f40cfef6a 100644
--- a/tools/Make.defs
+++ b/tools/Make.defs
@@ -1,5 +1,5 @@
# -*- mode: Makefile; -*-
-XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/hypervisor-ifs
+XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/public
XEN_LINUX_INCLUDE = $(XEN_ROOT)/linux-xen-sparse/include
XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
XEN_LIBXC = $(XEN_ROOT)/tools/libxc
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 1678a1a448..761e43c632 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -8,9 +8,6 @@ CC = gcc
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Make.defs
-vpath %.h $(XEN_HYPERVISOR_IFS)
-INCLUDES += -I $(XEN_HYPERVISOR_IFS)
-
vpath %h $(XEN_LINUX_INCLUDE)
INCLUDES += -I $(XEN_LINUX_INCLUDE)
@@ -44,7 +41,7 @@ OBJS = $(patsubst %.c,%.o,$(SRCS))
LIB = libxc.so libxc.so.$(MAJOR) libxc.so.$(MAJOR).$(MINOR)
-all: check-for-zlib $(LIB)
+all: check-for-zlib mk-symlinks $(LIB)
check-for-zlib:
@if [ ! -e /usr/include/zlib.h ]; then \
@@ -54,6 +51,9 @@ check-for-zlib:
false; \
fi
+mk-symlinks:
+ [ -e xen ] || ln -sf $(XEN_HYPERVISOR_IFS) xen
+
install: all
mkdir -p $(prefix)/usr/lib
mkdir -p $(prefix)/usr/include
@@ -61,9 +61,7 @@ install: all
install -m0644 xc.h $(prefix)/usr/include
clean:
- $(RM) *.a *.so *.o *.rpm $(LIB)
- $(RM) *~
- $(RM) $(DEPS)
+ $(RM) *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen
rpm: all
rm -rf staging
diff --git a/tools/libxc/xc.h b/tools/libxc/xc.h
index 027d76711f..ab3ace4ff1 100644
--- a/tools/libxc/xc.h
+++ b/tools/libxc/xc.h
@@ -3,7 +3,7 @@
*
* A library for low-level access to the Xen control interfaces.
*
- * Copyright (c) 2003, K A Fraser.
+ * Copyright (c) 2003-2004, K A Fraser.
*/
#ifndef __XC_H__
@@ -18,6 +18,12 @@ typedef signed short s16;
typedef signed long s32;
typedef signed long long s64;
+#include "xen/xen.h"
+#include "xen/dom0_ops.h"
+#include "xen/event_channel.h"
+#include "xen/sched_ctl.h"
+#include "xen/io/domain_controller.h"
+
/* Obtain or relinquish a handle on the 'xc' library. */
int xc_interface_open(void);
int xc_interface_close(int xc_handle);
@@ -34,14 +40,7 @@ typedef struct {
unsigned long max_memkb;
} xc_dominfo_t;
-typedef struct xc_shadow_control_stats_st
-{
- unsigned long fault_count;
- unsigned long dirty_count;
- unsigned long dirty_net_count;
- unsigned long dirty_block_count;
-} xc_shadow_control_stats_t;
-
+typedef dom0_getdomaininfo_t xc_domaininfo_t;
int xc_domain_create(int xc_handle,
unsigned int mem_kb,
int cpu,
@@ -60,10 +59,18 @@ int xc_domain_getinfo(int xc_handle,
u32 first_domid,
unsigned int max_doms,
xc_dominfo_t *info);
+int xc_domain_getfullinfo(int xc_handle,
+ u32 domid,
+ xc_domaininfo_t *info,
+ full_execution_context_t *ctxt);
int xc_domain_setcpuweight(int xc_handle,
u32 domid,
float weight);
+long long xc_domain_get_cpu_usage(int xc_handle,
+ domid_t domid);
+
+typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
int xc_shadow_control(int xc_handle,
u32 domid,
unsigned int sop,
@@ -125,27 +132,7 @@ int xc_rrobin_global_set(int xc_handle, u64 slice);
int xc_rrobin_global_get(int xc_handle, u64 *slice);
-#define DOMID_SELF (0x7FF0U)
-#define DOMID_IO (0x7FF1U)
-#define DOMID_XEN (0x7FF2U)
-
-typedef struct {
-#define EVTCHNSTAT_closed 0 /* Chennel is not in use. */
-#define EVTCHNSTAT_unbound 1 /* Channel is not bound to a source. */
-#define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
-#define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
-#define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
- int status;
- union {
- struct {
- u32 dom;
- int port;
- } interdomain;
- int pirq;
- int virq;
- } u;
-} xc_evtchn_status_t;
-
+typedef evtchn_status_t xc_evtchn_status_t;
int xc_evtchn_alloc_unbound(int xc_handle,
u32 dom,
int *port);
@@ -179,14 +166,7 @@ int xc_readconsolering(int xc_handle,
unsigned int max_chars,
int clear);
-typedef struct {
- int ht_per_core;
- int cores;
- unsigned long total_pages;
- unsigned long free_pages;
- unsigned long cpu_khz;
-} xc_physinfo_t;
-
+typedef dom0_physinfo_t xc_physinfo_t;
int xc_physinfo(int xc_handle,
xc_physinfo_t *info);
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 958d85a69e..67168910e9 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -120,16 +120,21 @@ int xc_domain_getinfo(int xc_handle,
int xc_domain_getfullinfo(int xc_handle,
u32 domid,
- dom0_op_t *op,
- full_execution_context_t *ctxt )
+ xc_domaininfo_t *info,
+ full_execution_context_t *ctxt)
{
int rc;
- op->cmd = DOM0_GETDOMAININFO;
- op->u.getdomaininfo.domain = (domid_t)domid;
- op->u.getdomaininfo.ctxt = ctxt;
+ dom0_op_t op;
+
+ op.cmd = DOM0_GETDOMAININFO;
+ op.u.getdomaininfo.domain = (domid_t)domid;
+ op.u.getdomaininfo.ctxt = ctxt;
+
+ rc = do_dom0_op(xc_handle, &op);
+
+ memcpy(info, &op.u.getdomaininfo, sizeof(*info));
- rc = do_dom0_op(xc_handle, op);
- if ( ((u16)op->u.getdomaininfo.domain != domid) && rc > 0 )
+ if ( ((u16)op.u.getdomaininfo.domain != domid) && rc > 0 )
return -ESRCH;
else
return rc;
diff --git a/tools/libxc/xc_evtchn.c b/tools/libxc/xc_evtchn.c
index 2f78ef7936..9371e61261 100644
--- a/tools/libxc/xc_evtchn.c
+++ b/tools/libxc/xc_evtchn.c
@@ -134,21 +134,7 @@ int xc_evtchn_status(int xc_handle,
op.u.status.port = port;
if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
- {
- switch ( status->status = op.u.status.status )
- {
- case EVTCHNSTAT_interdomain:
- status->u.interdomain.dom = (u16)op.u.status.u.interdomain.dom;
- status->u.interdomain.port = op.u.status.u.interdomain.port;
- break;
- case EVTCHNSTAT_pirq:
- status->u.pirq = op.u.status.u.pirq;
- break;
- case EVTCHNSTAT_virq:
- status->u.virq = op.u.status.u.virq;
- break;
- }
- }
+ memcpy(status, &op.u.status, sizeof(*status));
return rc;
}
diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c
index 7e0ab5c502..e9f4259494 100644
--- a/tools/libxc/xc_linux_save.c
+++ b/tools/libxc/xc_linux_save.c
@@ -319,9 +319,9 @@ static int analysis_phase( int xc_handle, u32 domid,
}
-int suspend_and_state( int xc_handle, XcIOContext *ioctxt,
- dom0_op_t *op,
- full_execution_context_t *ctxt )
+int suspend_and_state(int xc_handle, XcIOContext *ioctxt,
+ xc_domaininfo_t *info,
+ full_execution_context_t *ctxt)
{
int i=0;
@@ -329,26 +329,26 @@ int suspend_and_state( int xc_handle, XcIOContext *ioctxt,
retry:
- if ( xc_domain_getfullinfo( xc_handle, ioctxt->domain, op, ctxt) )
+ if ( xc_domain_getfullinfo(xc_handle, ioctxt->domain, info, ctxt) )
{
xcio_error(ioctxt, "Could not get full domain info");
return -1;
}
- if ( (op->u.getdomaininfo.flags &
- ( DOMFLAGS_SHUTDOWN | (SHUTDOWN_suspend<<DOMFLAGS_SHUTDOWNSHIFT) ))
- == ( DOMFLAGS_SHUTDOWN | (SHUTDOWN_suspend<<DOMFLAGS_SHUTDOWNSHIFT) ))
+ if ( (info->flags &
+ (DOMFLAGS_SHUTDOWN | (SHUTDOWN_suspend<<DOMFLAGS_SHUTDOWNSHIFT))) ==
+ (DOMFLAGS_SHUTDOWN | (SHUTDOWN_suspend<<DOMFLAGS_SHUTDOWNSHIFT)) )
{
return 0; // success
}
- if ( op->u.getdomaininfo.flags & DOMFLAGS_PAUSED )
+ if ( info->flags & DOMFLAGS_PAUSED )
{
// try unpausing domain, wait, and retest
xc_domain_unpause( xc_handle, ioctxt->domain );
xcio_error(ioctxt, "Domain was paused. Wait and re-test. (%lx)",
- op->u.getdomaininfo.flags);
+ info->flags);
usleep(10000); // 10ms
goto retry;
@@ -358,20 +358,21 @@ retry:
if( ++i < 100 )
{
xcio_error(ioctxt, "Retry suspend domain (%lx)",
- op->u.getdomaininfo.flags);
+ info->flags);
usleep(10000); // 10ms
goto retry;
}
xcio_error(ioctxt, "Unable to suspend domain. (%lx)",
- op->u.getdomaininfo.flags);
+ info->flags);
return -1;
}
int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
{
- dom0_op_t op;
+ xc_domaininfo_t info;
+
int rc = 1, i, j, k, last_iter, iter = 0;
unsigned long mfn;
u32 domid = ioctxt->domain;
@@ -441,12 +442,12 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
return 1;
}
- if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) )
+ if ( xc_domain_getfullinfo( xc_handle, domid, &info, &ctxt) )
{
xcio_error(ioctxt, "Could not get full domain info");
goto out;
}
- shared_info_frame = op.u.getdomaininfo.shared_info_frame;
+ shared_info_frame = info.shared_info_frame;
/* A cheesy test to see whether the domain contains valid state. */
if ( ctxt.pt_base == 0 ){
@@ -454,7 +455,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
goto out;
}
- nr_pfns = op.u.getdomaininfo.max_pages;
+ nr_pfns = info.max_pages;
/* cheesy sanity check */
if ( nr_pfns > 1024*1024 ){
@@ -536,10 +537,10 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
last_iter = 1;
- if ( suspend_and_state( xc_handle, ioctxt, &op, &ctxt) )
+ if ( suspend_and_state( xc_handle, ioctxt, &info, &ctxt) )
{
xcio_error(ioctxt, "Domain appears not to have suspended: %lx",
- op.u.getdomaininfo.flags);
+ info.flags);
goto out;
}
@@ -900,17 +901,17 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
DPRINTF("Start last iteration\n");
last_iter = 1;
- if ( suspend_and_state( xc_handle, ioctxt, &op, &ctxt) )
+ if ( suspend_and_state( xc_handle, ioctxt, &info, &ctxt) )
{
xcio_error(ioctxt, "Domain appears not to have suspended: %lx",
- op.u.getdomaininfo.flags);
+ info.flags);
goto out;
}
xcio_info(ioctxt,
"SUSPEND flags %08lx shinfo %08lx eip %08lx "
- "esi %08lx\n", op.u.getdomaininfo.flags,
- op.u.getdomaininfo.shared_info_frame,
+ "esi %08lx\n",info.flags,
+ info.shared_info_frame,
ctxt.cpu_ctxt.eip, ctxt.cpu_ctxt.esi );
}
diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index 0019ffe96b..e8ea18c5ff 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -52,18 +52,14 @@ int xc_physinfo(int xc_handle,
{
int ret;
dom0_op_t op;
- dom0_physinfo_t *got_info = &op.u.physinfo;
op.cmd = DOM0_PHYSINFO;
op.interface_version = DOM0_INTERFACE_VERSION;
- if((ret = do_dom0_op(xc_handle, &op))) return ret;
+ if ( (ret = do_dom0_op(xc_handle, &op)) != 0 )
+ return ret;
- put_info->ht_per_core = got_info->ht_per_core;
- put_info->cores = got_info->cores;
- put_info->total_pages = got_info->total_pages;
- put_info->free_pages = got_info->free_pages;
- put_info->cpu_khz = got_info->cpu_khz;
+ memcpy(put_info, &op.u.physinfo, sizeof(*put_info));
return 0;
}
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 3da14a16a8..8fd4559886 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -16,13 +16,6 @@
#include "xc.h"
-/* from xen/include/hypervisor-ifs */
-#include <hypervisor-if.h>
-#include <dom0_ops.h>
-#include <event_channel.h>
-#include <sched_ctl.h>
-#include <io/domain_controller.h>
-
#include <asm-xen/proc_cmd.h>
@@ -193,15 +186,8 @@ typedef struct mfn_mapper {
} mfn_mapper_t;
-long long xc_domain_get_cpu_usage( int xc_handle, domid_t domid );
-
#include "xc_io.h"
-int xc_domain_getfullinfo(int xc_handle,
- u32 domid,
- dom0_op_t *op,
- full_execution_context_t *ctxt );
-
unsigned long xc_get_m2p_start_mfn ( int xc_handle );
#endif /* __XC_PRIVATE_H__ */
diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index e3eaad9b2c..0dc13c4b50 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -5,7 +5,6 @@ include $(XEN_ROOT)/tools/Make.defs
CC = gcc
CFLAGS = -Wall -O3
-INCLUDES += -I $(XEN_HYPERVISOR_IFS)
INCLUDES += -I $(XEN_LINUX_INCLUDE)
INCLUDES += -I $(XEN_XC)
INCLUDES += -I $(XEN_LIBXC)
@@ -17,7 +16,7 @@ HDRS = $(wildcard *.h)
SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
-TARGETS = xen_cpuperf
+TARGETS =
INSTALL_BIN = $(TARGETS) xencons
INSTALL_SBIN = netfix xm xend xensv
diff --git a/tools/misc/p4perf.h b/tools/misc/p4perf.h
deleted file mode 100644
index 4f681b636d..0000000000
--- a/tools/misc/p4perf.h
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
- * For P6 use PERFCTR1 (0 used for APIC NMI watchdog). Must setup after
- * APIC NMI watchdog setup. Note that if this previous setup doesn't happen
- * we still must enable both counters.
- *
- * P4 Xeon with Hyperthreading has counters per physical package which can
- * count events from either logical CPU. However, in many cases more than
- * ECSR and CCCR/counter can be used to count the same event. For instr or
- * uops retired, use either ESCR0/IQ_CCCR0 ESCR1/IQ_CCCR2.
- *
- * USE CONFIG_MPENTIUM4_HT for a P4 Xeon with hyperthreading.
- *
- * Note that the counters may be initialised on each logical processor
- * which will cause each physical processor to be initialised twice. This
- * should not cause a problem.
- */
-
-#ifndef P4PERF_H
-#define P4PERF_H
-
-#ifdef __KERNEL__
-#include <asm/msr.h>
-#endif
-
-/*****************************************************************************
- * Performance counter configuration. *
- *****************************************************************************/
-
-#ifndef P6_EVNTSEL_OS
-# define P6_EVNTSEL_OS (1 << 17)
-# define P6_EVNTSEL_USR (1 << 16)
-# define P6_EVNTSEL_E (1 << 18)
-# define P6_EVNTSEL_EN (1 << 22)
-#endif
-#define P6_PERF_INST_RETIRED 0xc0
-#define P6_PERF_UOPS_RETIRED 0xc2
-
-#define P4_ESCR_USR (1 << 2)
-#define P4_ESCR_OS (1 << 3)
-#define P4_ESCR_T0_USR (1 << 2) /* First logical CPU */
-#define P4_ESCR_T0_OS (1 << 3)
-#define P4_ESCR_T1_USR (1 << 0) /* Second logical CPU */
-#define P4_ESCR_T1_OS (1 << 1)
-#define P4_ESCR_TE (1 << 4)
-#define P4_ESCR_THREADS(t) (t)
-#define P4_ESCR_TV(tag) (tag << 5)
-#define P4_ESCR_EVNTSEL(e) (e << 25)
-#define P4_ESCR_EVNTMASK(e) (e << 9)
-
-#define P4_ESCR_EVNTSEL_FRONT_END 0x08
-#define P4_ESCR_EVNTSEL_EXECUTION 0x0c
-#define P4_ESCR_EVNTSEL_REPLAY 0x09
-#define P4_ESCR_EVNTSEL_INSTR_RETIRED 0x02
-#define P4_ESCR_EVNTSEL_UOPS_RETIRED 0x01
-#define P4_ESCR_EVNTSEL_UOP_TYPE 0x02
-#define P4_ESCR_EVNTSEL_RET_MBR_TYPE 0x05
-//#define P4_ESCR_EVNTSEL_RET_MBR_TYPE 0x04
-
-#define P4_ESCR_EVNTMASK_FE_NBOGUS 0x01
-#define P4_ESCR_EVNTMASK_FE_BOGUS 0x02
-
-#define P4_ESCR_EVNTMASK_EXEC_NBOGUS0 0x01
-#define P4_ESCR_EVNTMASK_EXEC_NBOGUS1 0x02
-#define P4_ESCR_EVNTMASK_EXEC_NBOGUS2 0x04
-#define P4_ESCR_EVNTMASK_EXEC_NBOGUS3 0x08
-#define P4_ESCR_EVNTMASK_EXEC_BOGUS0 0x10
-#define P4_ESCR_EVNTMASK_EXEC_BOGUS1 0x20
-#define P4_ESCR_EVNTMASK_EXEC_BOGUS2 0x40
-#define P4_ESCR_EVNTMASK_EXEC_BOGUS3 0x80
-
-#define P4_ESCR_EVNTMASK_REPLAY_NBOGUS 0x01
-#define P4_ESCR_EVNTMASK_REPLAY_BOGUS 0x02
-
-#define P4_ESCR_EVNTMASK_IRET_NB_NTAG 0x01
-#define P4_ESCR_EVNTMASK_IRET_NB_TAG 0x02
-#define P4_ESCR_EVNTMASK_IRET_B_NTAG 0x04
-#define P4_ESCR_EVNTMASK_IRET_B_TAG 0x08
-
-#define P4_ESCR_EVNTMASK_URET_NBOGUS 0x01
-#define P4_ESCR_EVNTMASK_URET_BOGUS 0x02
-
-#define P4_ESCR_EVNTMASK_UOP_LOADS 0x02
-#define P4_ESCR_EVNTMASK_UOP_STORES 0x04
-
-#define P4_ESCR_EVNTMASK_RMBRT_COND 0x02
-#define P4_ESCR_EVNTMASK_RMBRT_CALL 0x04
-#define P4_ESCR_EVNTMASK_RMBRT_RETURN 0x08
-#define P4_ESCR_EVNTMASK_RMBRT_INDIR 0x10
-
-#define P4_ESCR_EVNTMASK_RBRT_COND 0x02
-#define P4_ESCR_EVNTMASK_RBRT_CALL 0x04
-#define P4_ESCR_EVNTMASK_RBRT_RETURN 0x08
-#define P4_ESCR_EVNTMASK_RBRT_INDIR 0x10
-
-//#define P4_ESCR_EVNTMASK_INSTR_RETIRED 0x01 /* Non bogus, not tagged */
-//#define P4_ESCR_EVNTMASK_UOPS_RETIRED 0x01 /* Non bogus */
-
-#define P4_CCCR_OVF (1 << 31)
-#define P4_CCCR_CASCADE (1 << 30)
-#define P4_CCCR_FORCE_OVF (1 << 25)
-#define P4_CCCR_EDGE (1 << 24)
-#define P4_CCCR_COMPLEMENT (1 << 19)
-#define P4_CCCR_COMPARE (1 << 18)
-#define P4_CCCR_THRESHOLD(t) (t << 20)
-#define P4_CCCR_ENABLE (1 << 12)
-#define P4_CCCR_ESCR(escr) (escr << 13)
-#define P4_CCCR_ACTIVE_THREAD(t) (t << 16) /* Set to 11 */
-#define P4_CCCR_OVF_PMI_T0 (1 << 26)
-#define P4_CCCR_OVF_PMI_T1 (1 << 27)
-#define P4_CCCR_RESERVED (3 << 16)
-#define P4_CCCR_OVF_PMI (1 << 26)
-
-// BPU
-#define MSR_P4_BPU_COUNTER0 0x300
-#define MSR_P4_BPU_COUNTER1 0x301
-#define MSR_P4_BPU_CCCR0 0x360
-#define MSR_P4_BPU_CCCR1 0x361
-
-#define MSR_P4_BPU_COUNTER2 0x302
-#define MSR_P4_BPU_COUNTER3 0x303
-#define MSR_P4_BPU_CCCR2 0x362
-#define MSR_P4_BPU_CCCR3 0x363
-
-#define MSR_P4_BSU_ESCR0 0x3a0
-#define MSR_P4_FSB_ESCR0 0x3a2
-#define MSR_P4_MOB_ESCR0 0x3aa
-#define MSR_P4_PMH_ESCR0 0x3ac
-#define MSR_P4_BPU_ESCR0 0x3b2
-#define MSR_P4_IS_ESCR0 0x3b4
-#define MSR_P4_ITLB_ESCR0 0x3b6
-#define MSR_P4_IX_ESCR0 0x3c8
-
-#define P4_BSU_ESCR0_NUMBER 7
-#define P4_FSB_ESCR0_NUMBER 6
-#define P4_MOB_ESCR0_NUMBER 2
-#define P4_PMH_ESCR0_NUMBER 4
-#define P4_BPU_ESCR0_NUMBER 0
-#define P4_IS_ESCR0_NUMBER 1
-#define P4_ITLB_ESCR0_NUMBER 3
-#define P4_IX_ESCR0_NUMBER 5
-
-#define MSR_P4_BSU_ESCR1 0x3a1
-#define MSR_P4_FSB_ESCR1 0x3a3
-#define MSR_P4_MOB_ESCR1 0x3ab
-#define MSR_P4_PMH_ESCR1 0x3ad
-#define MSR_P4_BPU_ESCR1 0x3b3
-#define MSR_P4_IS_ESCR1 0x3b5
-#define MSR_P4_ITLB_ESCR1 0x3b7
-#define MSR_P4_IX_ESCR1 0x3c9
-
-#define P4_BSU_ESCR1_NUMBER 7
-#define P4_FSB_ESCR1_NUMBER 6
-#define P4_MOB_ESCR1_NUMBER 2
-#define P4_PMH_ESCR1_NUMBER 4
-#define P4_BPU_ESCR1_NUMBER 0
-#define P4_IS_ESCR1_NUMBER 1
-#define P4_ITLB_ESCR1_NUMBER 3
-#define P4_IX_ESCR1_NUMBER 5
-
-// MS
-#define MSR_P4_MS_COUNTER0 0x304
-#define MSR_P4_MS_COUNTER1 0x305
-#define MSR_P4_MS_CCCR0 0x364
-#define MSR_P4_MS_CCCR1 0x365
-
-#define MSR_P4_MS_COUNTER2 0x306
-#define MSR_P4_MS_COUNTER3 0x307
-#define MSR_P4_MS_CCCR2 0x366
-#define MSR_P4_MS_CCCR3 0x367
-
-#define MSR_P4_MS_ESCR0 0x3c0
-#define MSR_P4_TBPU_ESCR0 0x3c2
-#define MSR_P4_TC_ESCR0 0x3c4
-
-#define P4_MS_ESCR0_NUMBER 0
-#define P4_TBPU_ESCR0_NUMBER 2
-#define P4_TC_ESCR0_NUMBER 1
-
-#define MSR_P4_MS_ESCR1 0x3c1
-#define MSR_P4_TBPU_ESCR1 0x3c3
-#define MSR_P4_TC_ESCR1 0x3c5
-
-#define P4_MS_ESCR1_NUMBER 0
-#define P4_TBPU_ESCR1_NUMBER 2
-#define P4_TC_ESCR1_NUMBER 1
-
-// FLAME
-#define MSR_P4_FLAME_COUNTER0 0x308
-#define MSR_P4_FLAME_COUNTER1 0x309
-#define MSR_P4_FLAME_CCCR0 0x368
-#define MSR_P4_FLAME_CCCR1 0x369
-
-#define MSR_P4_FLAME_COUNTER2 0x30a
-#define MSR_P4_FLAME_COUNTER3 0x30b
-#define MSR_P4_FLAME_CCCR2 0x36a
-#define MSR_P4_FLAME_CCCR3 0x36b
-
-#define MSR_P4_FIRM_ESCR0 0x3a4
-#define MSR_P4_FLAME_ESCR0 0x3a6
-#define MSR_P4_DAC_ESCR0 0x3a8
-#define MSR_P4_SAAT_ESCR0 0x3ae
-#define MSR_P4_U2L_ESCR0 0x3b0
-
-#define P4_FIRM_ESCR0_NUMBER 1
-#define P4_FLAME_ESCR0_NUMBER 0
-#define P4_DAC_ESCR0_NUMBER 5
-#define P4_SAAT_ESCR0_NUMBER 2
-#define P4_U2L_ESCR0_NUMBER 3
-
-#define MSR_P4_FIRM_ESCR1 0x3a5
-#define MSR_P4_FLAME_ESCR1 0x3a7
-#define MSR_P4_DAC_ESCR1 0x3a9
-#define MSR_P4_SAAT_ESCR1 0x3af
-#define MSR_P4_U2L_ESCR1 0x3b1
-
-#define P4_FIRM_ESCR1_NUMBER 1
-#define P4_FLAME_ESCR1_NUMBER 0
-#define P4_DAC_ESCR1_NUMBER 5
-#define P4_SAAT_ESCR1_NUMBER 2
-#define P4_U2L_ESCR1_NUMBER 3
-
-// IQ
-#define MSR_P4_IQ_COUNTER0 0x30c
-#define MSR_P4_IQ_COUNTER1 0x30d
-#define MSR_P4_IQ_CCCR0 0x36c
-#define MSR_P4_IQ_CCCR1 0x36d
-
-#define MSR_P4_IQ_COUNTER2 0x30e
-#define MSR_P4_IQ_COUNTER3 0x30f
-#define MSR_P4_IQ_CCCR2 0x36e
-#define MSR_P4_IQ_CCCR3 0x36f
-
-#define MSR_P4_IQ_COUNTER4 0x310
-#define MSR_P4_IQ_COUNTER5 0x311
-#define MSR_P4_IQ_CCCR4 0x370
-#define MSR_P4_IQ_CCCR5 0x371
-
-#define MSR_P4_CRU_ESCR0 0x3b8
-#define MSR_P4_CRU_ESCR2 0x3cc
-#define MSR_P4_CRU_ESCR4 0x3e0
-#define MSR_P4_IQ_ESCR0 0x3ba
-#define MSR_P4_RAT_ESCR0 0x3bc
-#define MSR_P4_SSU_ESCR0 0x3be
-#define MSR_P4_ALF_ESCR0 0x3ca
-
-#define P4_CRU_ESCR0_NUMBER 4
-#define P4_CRU_ESCR2_NUMBER 5
-#define P4_CRU_ESCR4_NUMBER 6
-#define P4_IQ_ESCR0_NUMBER 0
-#define P4_RAT_ESCR0_NUMBER 2
-#define P4_SSU_ESCR0_NUMBER 3
-#define P4_ALF_ESCR0_NUMBER 1
-
-#define MSR_P4_CRU_ESCR1 0x3b9
-#define MSR_P4_CRU_ESCR3 0x3cd
-#define MSR_P4_CRU_ESCR5 0x3e1
-#define MSR_P4_IQ_ESCR1 0x3bb
-#define MSR_P4_RAT_ESCR1 0x3bd
-#define MSR_P4_ALF_ESCR1 0x3cb
-
-#define P4_CRU_ESCR1_NUMBER 4
-#define P4_CRU_ESCR3_NUMBER 5
-#define P4_CRU_ESCR5_NUMBER 6
-#define P4_IQ_ESCR1_NUMBER 0
-#define P4_RAT_ESCR1_NUMBER 2
-#define P4_ALF_ESCR1_NUMBER 1
-
-#define P4_BPU_COUNTER0_NUMBER 0
-#define P4_BPU_COUNTER1_NUMBER 1
-#define P4_BPU_COUNTER2_NUMBER 2
-#define P4_BPU_COUNTER3_NUMBER 3
-
-#define P4_MS_COUNTER0_NUMBER 4
-#define P4_MS_COUNTER1_NUMBER 5
-#define P4_MS_COUNTER2_NUMBER 6
-#define P4_MS_COUNTER3_NUMBER 7
-
-#define P4_FLAME_COUNTER0_NUMBER 8
-#define P4_FLAME_COUNTER1_NUMBER 9
-#define P4_FLAME_COUNTER2_NUMBER 10
-#define P4_FLAME_COUNTER3_NUMBER 11
-
-#define P4_IQ_COUNTER0_NUMBER 12
-#define P4_IQ_COUNTER1_NUMBER 13
-#define P4_IQ_COUNTER2_NUMBER 14
-#define P4_IQ_COUNTER3_NUMBER 15
-#define P4_IQ_COUNTER4_NUMBER 16
-#define P4_IQ_COUNTER5_NUMBER 17
-
-/* PEBS
- */
-#define MSR_P4_PEBS_ENABLE 0x3F1
-#define MSR_P4_PEBS_MATRIX_VERT 0x3F2
-
-#define P4_PEBS_ENABLE_MY_THR (1 << 25)
-#define P4_PEBS_ENABLE_OTH_THR (1 << 26)
-#define P4_PEBS_ENABLE (1 << 24)
-#define P4_PEBS_BIT0 (1 << 0)
-#define P4_PEBS_BIT1 (1 << 1)
-#define P4_PEBS_BIT2 (1 << 2)
-
-#define P4_PEBS_MATRIX_VERT_BIT0 (1 << 0)
-#define P4_PEBS_MATRIX_VERT_BIT1 (1 << 1)
-#define P4_PEBS_MATRIX_VERT_BIT2 (1 << 2)
-
-/* Replay tagging.
- */
-#define P4_REPLAY_TAGGING_PEBS_L1LMR P4_PEBS_BIT0
-#define P4_REPLAY_TAGGING_PEBS_L2LMR P4_PEBS_BIT1
-#define P4_REPLAY_TAGGING_PEBS_DTLMR P4_PEBS_BIT2
-#define P4_REPLAY_TAGGING_PEBS_DTSMR P4_PEBS_BIT2
-#define P4_REPLAY_TAGGING_PEBS_DTAMR P4_PEBS_BIT2
-
-#define P4_REPLAY_TAGGING_VERT_L1LMR P4_PEBS_MATRIX_VERT_BIT0
-#define P4_REPLAY_TAGGING_VERT_L2LMR P4_PEBS_MATRIX_VERT_BIT0
-#define P4_REPLAY_TAGGING_VERT_DTLMR P4_PEBS_MATRIX_VERT_BIT0
-#define P4_REPLAY_TAGGING_VERT_DTSMR P4_PEBS_MATRIX_VERT_BIT1
-#define P4_REPLAY_TAGGING_VERT_DTAMR P4_PEBS_MATRIX_VERT_BIT0 | P4_PEBS_MATRIX_VERT_BIT1
-
-
-
-
-/*****************************************************************************
- * *
- *****************************************************************************/
-
-// x87_FP_uop
-#define EVENT_SEL_x87_FP_uop 0x04
-#define EVENT_MASK_x87_FP_uop_ALL (1 << 15)
-
-// execution event (at retirement)
-#define EVENT_SEL_execution_event 0x0C
-
-// scalar_SP_uop
-#define EVENT_SEL_scalar_SP_uop 0x0a
-#define EVENT_MASK_scalar_SP_uop_ALL (1 << 15)
-
-// scalar_DP_uop
-#define EVENT_SEL_scalar_DP_uop 0x0e
-#define EVENT_MASK_scalar_DP_uop_ALL (1 << 15)
-
-// Instruction retired
-#define EVENT_SEL_instr_retired 0x02
-#define EVENT_MASK_instr_retired_ALL 0x0f
-
-// uOps retired
-#define EVENT_SEL_uops_retired 0x01
-#define EVENT_MASK_uops_retired_ALL 0x03
-
-// L1 misses retired
-#define EVENT_SEL_replay_event 0x09
-#define EVENT_MASK_replay_event_ALL 0x03
-
-// Trace cache
-#define EVENT_SEL_BPU_fetch_request 0x03
-#define EVENT_MASK_BPU_fetch_request_TCMISS 0x01
-
-// Bus activity
-#define EVENT_SEL_FSB_data_activity 0x17
-#define EVENT_MASK_FSB_data_activity_DRDY_DRV 0x01
-#define EVENT_MASK_FSB_data_activity_DRDY_OWN 0x02
-#define EVENT_MASK_FSB_data_activity_DRDY_OOTHER 0x04
-#define EVENT_MASK_FSB_data_activity_DBSY_DRV 0x08
-#define EVENT_MASK_FSB_data_activity_DBSY_OWN 0x10
-#define EVENT_MASK_FSB_data_activity_DBSY_OOTHER 0x20
-
-// Cache L2
-#define EVENT_SEL_BSQ_cache_reference 0x0c
-#define EVENT_MASK_BSQ_cache_reference_RD_L2_HITS 0x001
-#define EVENT_MASK_BSQ_cache_reference_RD_L2_HITE 0x002
-#define EVENT_MASK_BSQ_cache_reference_RD_L2_HITM 0x004
-
-#define EVENT_MASK_BSQ_cache_reference_RD_L3_HITS 0x008
-#define EVENT_MASK_BSQ_cache_reference_RD_L3_HITE 0x010
-#define EVENT_MASK_BSQ_cache_reference_RD_L3_HITM 0x020
-
-#define EVENT_MASK_BSQ_cache_reference_RD_L2_MISS 0x100
-#define EVENT_MASK_BSQ_cache_reference_RD_L3_MISS 0x200
-#define EVENT_MASK_BSQ_cache_reference_WR_L2_MISS 0x400
-
-/*****************************************************************************
- * *
- *****************************************************************************/
-
-
-/* The following turn configuration macros into 1/0 to allow code to be
- * selected using if(MPENTIUM4_HT) rather then #ifdef (to avoid stale code).
- * We rely on the compiler to optimise out unreachable code,
- */
-#ifdef CONFIG_MPENTIUM4_HT
-# define MPENTIUM4_HT 1
-#else
-# define MPENTIUM4_HT 0
-#endif
-
-#ifdef CONFIG_MPENTIUMIII
-# define MPENTIUMIII 1
-#else
-# define MPENTIUMIII 0
-#endif
-
-#ifdef CONFIG_MPENTIUM4
-# define MPENTIUM4 1
-#else
-# define MPENTIUM4 0
-#endif
-
-/*****************************************************************************
- * MSR access macros *
- *****************************************************************************/
-
-/* rpcc: get full 64-bit Pentium TSC value
- */
-static __inline__ unsigned long long int rpcc(void)
-{
- unsigned int __h, __l;
- __asm__ __volatile__ ("rdtsc" :"=a" (__l), "=d" (__h));
- return (((unsigned long long)__h) << 32) + __l;
-}
-
-/*****************************************************************************
- * Functions. *
- *****************************************************************************/
-
-#ifdef __KERNEL__
-static inline void smt_sched_setup(void)
-{
- if (MPENTIUMIII) {
- unsigned int evntsel, x;
-
- /* Make sure counters enabled. */
- rdmsr(MSR_P6_EVNTSEL0, evntsel, x);
- evntsel |= P6_EVNTSEL_EN;
- wrmsr(MSR_P6_EVNTSEL0, evntsel, 0);
-
- evntsel =
- P6_PERF_INST_RETIRED |
- P6_EVNTSEL_OS |
- P6_EVNTSEL_USR |
- P6_EVNTSEL_E;
- wrmsr(MSR_P6_EVNTSEL1, evntsel, 0);
- }
-
- if(MPENTIUM4) {
- unsigned int x;
-
- /* Program the ESCR */
- x = P4_ESCR_USR |
- P4_ESCR_OS |
- P4_ESCR_EVNTSEL(P4_ESCR_EVNTSEL_INSTR_RETIRED) |
- P4_ESCR_EVNTMASK(P4_ESCR_EVNTMASK_IRET_NB_NTAG);
- wrmsr(MSR_P4_CRU_ESCR0, x, 0);
-
- /* Program the CCCR */
- if (MPENTIUM4_HT) {
- x = P4_CCCR_ENABLE |
- P4_CCCR_ESCR(P4_CRU_ESCR0_NUMBER) |
- P4_CCCR_ACTIVE_THREAD(3);
- }
- else {
- x = P4_CCCR_ENABLE |
- P4_CCCR_ESCR(P4_CRU_ESCR0_NUMBER) |
- P4_CCCR_RESERVED;
- }
- wrmsr(MSR_P4_IQ_CCCR0, x, 0);
-
- if (MPENTIUM4_HT) {
-
- /* Program the second ESCR */
- x = P4_ESCR_T1_USR |
- P4_ESCR_T1_OS |
- P4_ESCR_EVNTSEL(P4_ESCR_EVNTSEL_INSTR_RETIRED) |
- P4_ESCR_EVNTMASK(P4_ESCR_EVNTMASK_IRET_NB_NTAG);
- wrmsr(MSR_P4_CRU_ESCR1, x, 0);
-
- /* Program the second CCCR */
- x = P4_CCCR_ENABLE |
- P4_CCCR_ESCR(P4_CRU_ESCR1_NUMBER) |
- P4_CCCR_ACTIVE_THREAD(3);
- wrmsr(MSR_P4_IQ_CCCR2, x, 0);
- }
- }
-
- if (!MPENTIUMIII && !MPENTIUM4) {
- printk("WARNING: Not setting up IPC performance counters.\n");
- } else {
- printk("Setting up IPC performance counters.\n");
- }
-}
-
-#ifdef CONFIG_MPENTIUMIII
-# define MY_MSR_COUNTER MSR_P6_PERFCTR1
-#endif
-#ifdef CONFIG_MPENTIUM4
-# define MY_MSR_COUNTER MSR_P4_IQ_COUNTER0
-#endif
-#ifndef MY_MSR_COUNTER
-# define MY_MSR_COUNTER 0 /* Never used but ensures compilation */
-#endif
-#define MY_MSR_COUNTER0 MSR_P4_IQ_COUNTER0
-#define MY_MSR_COUNTER1 MSR_P4_IQ_COUNTER2
-
-# define smt_sched_start_sample(task) \
-{ \
- unsigned int l, h; \
- \
- if (MPENTIUM4_HT) { \
- unsigned int msr = \
- (task->processor & 1)?MY_MSR_COUNTER1:MY_MSR_COUNTER0; \
- rdmsr(msr, l, h); \
- } \
- else { \
- rdmsr(MY_MSR_COUNTER, l, h); \
- } \
- task->ipc_sample_start_count_lo = l; \
- task->ipc_sample_start_count_hi = h; \
- rdtsc(l, h); \
- task->ipc_sample_start_cycle_lo = l; \
- task->ipc_sample_start_cycle_hi = h; \
-}
-
-# define smt_sched_stop_sample(task) \
-{ \
- if (task->ipc_sample_start_cycle_hi != 0) \
- { \
- unsigned int cl, ch, tl, th; \
- unsigned int c, t; \
- \
- if (MPENTIUM4_HT) { \
- unsigned int msr = \
- (task->processor & 1)?MY_MSR_COUNTER1:MY_MSR_COUNTER0; \
- rdmsr(msr, cl, ch); \
- } \
- else { \
- rdmsr(MY_MSR_COUNTER, cl, ch); \
- } \
- \
- rdtsc(tl, th); \
- \
- c = cl - task->ipc_sample_start_count_lo; \
- t = tl - task->ipc_sample_start_cycle_lo; \
- task->ipc_average = IPC_AVERAGE(task->ipc_average, \
- ((double)c)/((double)t)); \
- task->ipc_sample_start_cycle_hi = 0; \
- \
- } \
- else \
- task->ipc_average = 0.0; \
- \
-}
-
-// task->ipc_sample_latest =
-// (unsigned int)(1000.0*((double)c)/((double)t));
-#endif /* __KERNEL__ */
-
-
-#endif /* P4PERF_H */
-
-/* End of $RCSfile$ */
diff --git a/tools/misc/setdomainmaxmem b/tools/misc/setdomainmaxmem
deleted file mode 100644
index 4800cff2f3..0000000000
--- a/tools/misc/setdomainmaxmem
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-require "sys/ioctl.ph";
-
-sub SIZEOF_HYPERCALL () { 24; }
-sub STRUCT_PRIVCMD_HYPERCALL () {"L P";}
-sub IOCTL_PRIVCMD_HYPERCALL ()
- { &_IOC( &_IOC_NONE, ord('P'), 0, SIZEOF_HYPERCALL );}
-sub __HYPERVISOR_dom0_op () {7;}
-sub DOM0_INTERFACE_VERSION () {0xaaaa0010;}
-sub DOM0_SETDOMAINMAXMEM () {28;}
-sub STRUCT_DOM0_OP_PREFIX () {"L L";}
-sub STRUCT_SETDOMAINMAXMEM () {STRUCT_DOM0_OP_PREFIX."L x4 L";}
-sub XEN_PRIVCMD () {"/proc/xen/privcmd";}
-
-sub setdomainmaxmem($$) {
- my ($domain,$bytes) = @_;
- my $msg = pack(STRUCT_SETDOMAINMAXMEM,DOM0_SETDOMAINMAXMEM,
- DOM0_INTERFACE_VERSION, $domain, $bytes);
- my $cmd = pack(STRUCT_PRIVCMD_HYPERCALL,__HYPERVISOR_dom0_op,$msg);
- open(XEN,XEN_PRIVCMD) or die "$!\n";
- ioctl(XEN, IOCTL_PRIVCMD_HYPERCALL, $cmd) or die "ioctl: $!";
- close XEN;
-}
-
-my ($bytes,$suffix) = $ARGV[1] =~ m/(^\d+)([mMkKgG])/;
-$bytes<<=10 if $suffix =~ m/[kK]/;
-$bytes<<=20 if $suffix =~ m/[mM]/;
-$bytes<<=30 if $suffix =~ m/[gG]/;
-
-printf "set domain $ARGV[0] to $bytes\n";
-setdomainmaxmem($ARGV[0],$bytes);
-
diff --git a/tools/misc/xen_cpuperf.c b/tools/misc/xen_cpuperf.c
deleted file mode 100644
index 235ca58a39..0000000000
--- a/tools/misc/xen_cpuperf.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * User mode program to prod MSR values through /proc/perfcntr
- */
-
-#include <sys/types.h>
-#include <sched.h>
-#include <error.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "p4perf.h"
-#include "xc_private.h"
-
-void dom0_wrmsr( int privfd,
- int cpu_mask,
- int msr,
- unsigned int low,
- unsigned int high )
-{
- dom0_op_t op;
- op.cmd = DOM0_MSR;
- op.u.msr.write = 1;
- op.u.msr.msr = msr;
- op.u.msr.cpu_mask = cpu_mask;
- op.u.msr.in1 = low;
- op.u.msr.in2 = high;
- do_dom0_op(privfd, &op);
-}
-
-unsigned long long dom0_rdmsr( int privfd,
- int cpu_mask,
- int msr )
-{
- dom0_op_t op;
- op.cmd = DOM0_MSR;
- op.u.msr.write = 0;
- op.u.msr.msr = msr;
- op.u.msr.cpu_mask = cpu_mask;
- do_dom0_op(privfd, &op);
- return (((unsigned long long)op.u.msr.out2)<<32) | op.u.msr.out1 ;
-}
-
-struct macros {
- char *name;
- unsigned long msr_addr;
- int number;
-};
-
-struct macros msr[] = {
- {"BPU_COUNTER0", 0x300, 0},
- {"BPU_COUNTER1", 0x301, 1},
- {"BPU_COUNTER2", 0x302, 2},
- {"BPU_COUNTER3", 0x303, 3},
- {"MS_COUNTER0", 0x304, 4},
- {"MS_COUNTER1", 0x305, 5},
- {"MS_COUNTER2", 0x306, 6},
- {"MS_COUNTER3", 0x307, 7},
- {"FLAME_COUNTER0", 0x308, 8},
- {"FLAME_COUNTER1", 0x309, 9},
- {"FLAME_COUNTER2", 0x30a, 10},
- {"FLAME_COUNTER3", 0x30b, 11},
- {"IQ_COUNTER0", 0x30c, 12},
- {"IQ_COUNTER1", 0x30d, 13},
- {"IQ_COUNTER2", 0x30e, 14},
- {"IQ_COUNTER3", 0x30f, 15},
- {"IQ_COUNTER4", 0x310, 16},
- {"IQ_COUNTER5", 0x311, 17},
- {"BPU_CCCR0", 0x360, 0},
- {"BPU_CCCR1", 0x361, 1},
- {"BPU_CCCR2", 0x362, 2},
- {"BPU_CCCR3", 0x363, 3},
- {"MS_CCCR0", 0x364, 4},
- {"MS_CCCR1", 0x365, 5},
- {"MS_CCCR2", 0x366, 6},
- {"MS_CCCR3", 0x367, 7},
- {"FLAME_CCCR0", 0x368, 8},
- {"FLAME_CCCR1", 0x369, 9},
- {"FLAME_CCCR2", 0x36a, 10},
- {"FLAME_CCCR3", 0x36b, 11},
- {"IQ_CCCR0", 0x36c, 12},
- {"IQ_CCCR1", 0x36d, 13},
- {"IQ_CCCR2", 0x36e, 14},
- {"IQ_CCCR3", 0x36f, 15},
- {"IQ_CCCR4", 0x370, 16},
- {"IQ_CCCR5", 0x371, 17},
- {"BSU_ESCR0", 0x3a0, 7},
- {"BSU_ESCR1", 0x3a1, 7},
- {"FSB_ESCR0", 0x3a2, 6},
- {"FSB_ESCR1", 0x3a3, 6},
- {"MOB_ESCR0", 0x3aa, 2},
- {"MOB_ESCR1", 0x3ab, 2},
- {"PMH_ESCR0", 0x3ac, 4},
- {"PMH_ESCR1", 0x3ad, 4},
- {"BPU_ESCR0", 0x3b2, 0},
- {"BPU_ESCR1", 0x3b3, 0},
- {"IS_ESCR0", 0x3b4, 1},
- {"IS_ESCR1", 0x3b5, 1},
- {"ITLB_ESCR0", 0x3b6, 3},
- {"ITLB_ESCR1", 0x3b7, 3},
- {"IX_ESCR0", 0x3c8, 5},
- {"IX_ESCR1", 0x3c9, 5},
- {"MS_ESCR0", 0x3c0, 0},
- {"MS_ESCR1", 0x3c1, 0},
- {"TBPU_ESCR0", 0x3c2, 2},
- {"TBPU_ESCR1", 0x3c3, 2},
- {"TC_ESCR0", 0x3c4, 1},
- {"TC_ESCR1", 0x3c5, 1},
- {"FIRM_ESCR0", 0x3a4, 1},
- {"FIRM_ESCR1", 0x3a5, 1},
- {"FLAME_ESCR0", 0x3a6, 0},
- {"FLAME_ESCR1", 0x3a7, 0},
- {"DAC_ESCR0", 0x3a8, 5},
- {"DAC_ESCR1", 0x3a9, 5},
- {"SAAT_ESCR0", 0x3ae, 2},
- {"SAAT_ESCR1", 0x3af, 2},
- {"U2L_ESCR0", 0x3b0, 3},
- {"U2L_ESCR1", 0x3b1, 3},
- {"CRU_ESCR0", 0x3b8, 4},
- {"CRU_ESCR1", 0x3b9, 4},
- {"CRU_ESCR2", 0x3cc, 5},
- {"CRU_ESCR3", 0x3cd, 5},
- {"CRU_ESCR4", 0x3e0, 6},
- {"CRU_ESCR5", 0x3e1, 6},
- {"IQ_ESCR0", 0x3ba, 0},
- {"IQ_ESCR1", 0x3bb, 0},
- {"RAT_ESCR0", 0x3bc, 2},
- {"RAT_ESCR1", 0x3bd, 2},
- {"SSU_ESCR0", 0x3be, 3},
- {"SSU_ESCR1", 0x3bf, 3},
- {"ALF_ESCR0", 0x3ca, 1},
- {"ALF_ESCR1", 0x3cb, 1},
- {"PEBS_ENABLE", 0x3f1, 0},
- {"PEBS_MATRIX_VERT", 0x3f2, 0},
- {NULL, 0, 0}
-};
-
-struct macros *lookup_macro(char *str)
-{
- struct macros *m;
-
- m = msr;
- while (m->name) {
- if (strcmp(m->name, str) == 0)
- return m;
- m++;
- }
- return NULL;
-}
-
-int main(int argc, char **argv)
-{
- int c, t = 0xc, es = 0, em = 0, tv = 0, te = 0;
- unsigned int cpu_mask = 1;
- struct macros *escr = NULL, *cccr = NULL;
- unsigned long escr_val, cccr_val;
- int debug = 0;
- unsigned long pebs = 0, pebs_vert = 0;
- int pebs_x = 0, pebs_vert_x = 0;
- int read = 0, privfd;
-
- while ((c = getopt(argc, argv, "dc:t:e:m:T:E:C:P:V:r")) != -1) {
- switch((char)c) {
- case 'P':
- pebs |= 1 << atoi(optarg);
- pebs_x = 1;
- break;
- case 'V':
- pebs_vert |= 1 << atoi(optarg);
- pebs_vert_x = 1;
- break;
- case 'd':
- debug = 1;
- break;
- case 'c':
- {
- int cpu = atoi(optarg);
- cpu_mask = (cpu == -1)?(~0):(1<<cpu);
- break;
- }
- case 't': // ESCR thread bits
- t = atoi(optarg);
- break;
- case 'e': // eventsel
- es = atoi(optarg);
- break;
- case 'm': // eventmask
- em = atoi(optarg);
- break;
- case 'T': // tag value
- tv = atoi(optarg);
- te = 1;
- break;
- case 'E':
- escr = lookup_macro(optarg);
- if (!escr) {
- fprintf(stderr, "Macro '%s' not found.\n", optarg);
- exit(1);
- }
- break;
- case 'C':
- cccr = lookup_macro(optarg);
- if (!cccr) {
- fprintf(stderr, "Macro '%s' not found.\n", optarg);
- exit(1);
- }
- break;
- case 'r':
- read = 1;
- break;
- }
- }
-
- if ( (privfd = open("/proc/xen/privcmd", O_RDWR)) == -1 )
- {
- fprintf(stderr, "Could not open privileged Xen control interface.\n");
- exit(1);
- }
-
- if (read) {
- while((cpu_mask&1)) {
- int i;
- for (i=0x300;i<0x312;i++)
- {
- printf("%010llx ",dom0_rdmsr( privfd, cpu_mask, i ) );
- }
- printf("\n");
- cpu_mask>>=1;
- }
- exit(1);
- }
-
- if (!escr) {
- fprintf(stderr, "Need an ESCR.\n");
- exit(1);
- }
- if (!cccr) {
- fprintf(stderr, "Need a counter number.\n");
- exit(1);
- }
-
- escr_val = P4_ESCR_THREADS(t) | P4_ESCR_EVNTSEL(es) |
- P4_ESCR_EVNTMASK(em) | P4_ESCR_TV(tv) | ((te)?P4_ESCR_TE:0);
- cccr_val = P4_CCCR_ENABLE | P4_CCCR_ESCR(escr->number) |
- P4_CCCR_ACTIVE_THREAD(3)/*reserved*/;
-
- if (debug) {
- fprintf(stderr, "ESCR 0x%lx <= 0x%08lx\n", escr->msr_addr, escr_val);
- fprintf(stderr, "CCCR 0x%lx <= 0x%08lx (%u)\n",
- cccr->msr_addr, cccr_val, cccr->number);
- if (pebs_x)
- fprintf(stderr, "PEBS 0x%x <= 0x%08lx\n",
- MSR_P4_PEBS_ENABLE, pebs);
- if (pebs_vert_x)
- fprintf(stderr, "PMV 0x%x <= 0x%08lx\n",
- MSR_P4_PEBS_MATRIX_VERT, pebs_vert);
- }
-
- dom0_wrmsr( privfd, cpu_mask, escr->msr_addr, escr_val, 0 );
- dom0_wrmsr( privfd, cpu_mask, cccr->msr_addr, cccr_val, 0 );
-
- if (pebs_x)
- dom0_wrmsr( privfd, cpu_mask, MSR_P4_PEBS_ENABLE, pebs, 0 );
-
- if (pebs_vert_x)
- dom0_wrmsr( privfd, cpu_mask, MSR_P4_PEBS_MATRIX_VERT, pebs_vert, 0 );
-
- return 0;
-}
-
diff --git a/tools/misc/xensymoops.py b/tools/misc/xensymoops
index 835d187e90..835d187e90 100755
--- a/tools/misc/xensymoops.py
+++ b/tools/misc/xensymoops
diff --git a/tools/python/setup.py b/tools/python/setup.py
index 7adae6cc94..ec7efc0b63 100644
--- a/tools/python/setup.py
+++ b/tools/python/setup.py
@@ -7,8 +7,7 @@ XEN_ROOT = "../.."
extra_compile_args = [ "-fno-strict-aliasing", "-Wall", "-Werror" ]
-include_dirs = [ XEN_ROOT + "/xen/include/hypervisor-ifs",
- XEN_ROOT + "/linux-xen-sparse/include",
+include_dirs = [ XEN_ROOT + "/linux-xen-sparse/include",
XEN_ROOT + "/tools/python/xen/lowlevel/xu",
XEN_ROOT + "/tools/libxc",
XEN_ROOT + "/tools/libxutil",
diff --git a/tools/python/xen/lowlevel/xu/xu.c b/tools/python/xen/lowlevel/xu/xu.c
index d08a17aa11..5143700538 100644
--- a/tools/python/xen/lowlevel/xu/xu.c
+++ b/tools/python/xen/lowlevel/xu/xu.c
@@ -23,8 +23,8 @@
#include <signal.h>
#include <xc.h>
-#include <hypervisor-if.h>
-#include <io/domain_controller.h>
+#include <xen/xen.h>
+#include <xen/io/domain_controller.h>
#include <asm-xen/proc_cmd.h>
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index de5350e3c2..7759b90f86 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -5,7 +5,6 @@ include $(XEN_ROOT)/tools/Make.defs
CC = gcc
CFLAGS = -Wall -Werror -O3
-CFLAGS += -I $(XEN_HYPERVISOR_IFS)
CFLAGS += -I $(XEN_LINUX_INCLUDE)
CFLAGS += -I $(XEN_XC)
CFLAGS += -I $(XEN_LIBXC)
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c
index 2df1ed9462..351ecd71a8 100644
--- a/tools/xentrace/xentrace.c
+++ b/tools/xentrace/xentrace.c
@@ -22,9 +22,7 @@
#include <signal.h>
#include "xc_private.h"
-
-/* from xen/include/hypervisor-ifs */
-#include <trace.h>
+#include <xen/trace.h>
extern FILE *stderr;
diff --git a/tools/xfrd/Makefile b/tools/xfrd/Makefile
index 5824960ac9..9b8d9bc108 100644
--- a/tools/xfrd/Makefile
+++ b/tools/xfrd/Makefile
@@ -9,9 +9,6 @@ include $(XEN_ROOT)/tools/Make.defs
XFRD_INSTALL_DIR = /usr/sbin
-vpath %.h $(XEN_HYPERVISOR_IFS)
-INCLUDES += -I $(XEN_HYPERVISOR_IFS)
-
vpath %h $(XEN_LINUX_INCLUDE)
INCLUDES += -I $(XEN_LINUX_INCLUDE)
diff --git a/xen/COPYING b/xen/COPYING
index 8da935f55e..fb8fcc90fc 100644
--- a/xen/COPYING
+++ b/xen/COPYING
@@ -10,9 +10,9 @@ virtual machine monitor) is copyrighted by me and others who actually
wrote it.
Further note that the guest-OS interfacing header files, which
-includes all files within the subdirectory include/hypervisor-ifs, are
+includes all files within the subdirectory include/public, are
*not* covered by the GPL but by a much weaker license:
- include/hypervisor-ifs/COPYING
+ include/public/COPYING
Also note that the only valid version of the GPL as far as Xen is
concerned is _this_ particular version of the license (i.e., *only*
diff --git a/xen/Makefile b/xen/Makefile
index deda917692..e47e2ea8a6 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -22,6 +22,10 @@ install: $(TARGET)
mkdir -p $(prefix)/boot
install -m0644 $(TARGET).gz $(prefix)/boot
install -m0644 $(TARGET)-syms $(prefix)/boot
+ mkdir -p $(prefix)/usr/include/xen/io
+ install -m0644 include/public/*.h $(prefix)/usr/include/xen
+ install -m0644 include/public/io/*.h $(prefix)/usr/include/xen/io
+ install -m0644 include/public/COPYING $(prefix)/usr/include/xen
dist: $(TARGET)
$(MAKE) prefix=`pwd`/../install dist=yes install
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 12fde1e8e4..ecb20cb35a 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -18,7 +18,7 @@ TARGET_SUBARCH ?= $(COMPILE_SUBARCH)
TARGET := $(BASEDIR)/xen
HDRS := $(wildcard $(BASEDIR)/include/xen/*.h)
HDRS += $(wildcard $(BASEDIR)/include/scsi/*.h)
-HDRS += $(wildcard $(BASEDIR)/include/hypervisor-ifs/*.h)
+HDRS += $(wildcard $(BASEDIR)/include/public/*.h)
HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/*.h)
HDRS += $(wildcard $(BASEDIR)/include/asm-$(TARGET_ARCH)/$(TARGET_SUBARCH)/*.h)
# compile.h is always regenerated, but other files shouldn't be rebuilt
diff --git a/xen/arch/x86/boot/x86_32.S b/xen/arch/x86/boot/x86_32.S
index ce09feb6e8..305c279c5e 100644
--- a/xen/arch/x86/boot/x86_32.S
+++ b/xen/arch/x86/boot/x86_32.S
@@ -1,5 +1,5 @@
#include <xen/config.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
#include <asm/page.h>
#define SECONDARY_CPU_FLAG 0xA5A5A5A5
diff --git a/xen/arch/x86/boot/x86_64.S b/xen/arch/x86/boot/x86_64.S
index 73a23023e2..98289c7ab6 100644
--- a/xen/arch/x86/boot/x86_64.S
+++ b/xen/arch/x86/boot/x86_64.S
@@ -1,5 +1,5 @@
#include <xen/config.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
#include <asm/page.h>
#include <asm/msr.h>
diff --git a/xen/arch/x86/dom0_ops.c b/xen/arch/x86/dom0_ops.c
index ce677b1165..62b2739d18 100644
--- a/xen/arch/x86/dom0_ops.c
+++ b/xen/arch/x86/dom0_ops.c
@@ -10,7 +10,7 @@
#include <xen/types.h>
#include <xen/lib.h>
#include <xen/mm.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
#include <xen/sched.h>
#include <xen/event.h>
#include <asm/domain_page.h>
@@ -19,7 +19,7 @@
#include <xen/trace.h>
#include <xen/console.h>
#include <asm/shadow.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
#define TRC_DOM0OP_ENTER_BASE 0x00020000
#define TRC_DOM0OP_LEAVE_BASE 0x00030000
diff --git a/xen/arch/x86/pci-pc.c b/xen/arch/x86/pci-pc.c
index 261606bf91..363b635141 100644
--- a/xen/arch/x86/pci-pc.c
+++ b/xen/arch/x86/pci-pc.c
@@ -682,7 +682,9 @@ static int __devinit pci_bios_find_device (unsigned short vendor, unsigned short
{
unsigned short bx;
unsigned short ret;
+ unsigned long flags;
+ __save_flags(flags); __cli();
__asm__("lcall *(%%edi); cld\n\t"
"jc 1f\n\t"
"xor %%ah, %%ah\n"
@@ -694,6 +696,7 @@ static int __devinit pci_bios_find_device (unsigned short vendor, unsigned short
"d" (vendor),
"S" ((int) index),
"D" (&pci_indirect));
+ __restore_flags(flags);
*bus = (bx >> 8) & 0xff;
*device_fn = bx & 0xff;
return (int) (ret & 0xff00) >> 8;
@@ -1000,6 +1003,7 @@ struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void)
struct irq_routing_table *rt = NULL;
int ret, map;
unsigned long page;
+ unsigned long flags;
if (!pci_bios_present)
return NULL;
@@ -1011,6 +1015,7 @@ struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void)
opt.segment = __KERNEL_DS;
DBG("PCI: Fetching IRQ routing table... ");
+ __save_flags(flags); __cli();
__asm__("push %%es\n\t"
"push %%ds\n\t"
"pop %%es\n\t"
@@ -1026,6 +1031,7 @@ struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void)
"D" (&opt),
"S" (&pci_indirect)
: "memory");
+ __restore_flags(flags);
DBG("OK ret=%d, size=%d, map=%x\n", ret, opt.size, map);
if (ret & 0xff00)
printk(KERN_ERR "PCI: Error %02x when fetching IRQ routing table.\n", (ret >> 8) & 0xff);
@@ -1047,7 +1053,9 @@ struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void)
int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
{
int ret;
+ unsigned long flags;
+ __save_flags(flags); __cli();
__asm__("lcall *(%%esi); cld\n\t"
"jc 1f\n\t"
"xor %%ah, %%ah\n"
@@ -1057,6 +1065,7 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq)
"b" ((dev->bus->number << 8) | dev->devfn),
"c" ((irq << 8) | (pin + 10)),
"S" (&pci_indirect));
+ __restore_flags(flags);
return !(ret & 0xff00);
}
diff --git a/xen/arch/x86/pdb-stub.c b/xen/arch/x86/pdb-stub.c
index c8d5421feb..774167c88b 100644
--- a/xen/arch/x86/pdb-stub.c
+++ b/xen/arch/x86/pdb-stub.c
@@ -44,9 +44,6 @@ static int remote_debug;
static char pdb_in_buffer[PDB_BUFMAX];
static char pdb_out_buffer[PDB_BUFMAX];
static char pdb_buffer[PDB_BUFMAX];
-static int pdb_in_buffer_ptr;
-static unsigned char pdb_in_checksum;
-static unsigned char pdb_xmit_checksum;
struct pdb_context pdb_ctx;
int pdb_continue_thread = 0;
diff --git a/xen/arch/x86/trampoline.S b/xen/arch/x86/trampoline.S
index d625a47558..9c89ecf059 100644
--- a/xen/arch/x86/trampoline.S
+++ b/xen/arch/x86/trampoline.S
@@ -16,7 +16,7 @@
*/
#include <xen/config.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
#include <asm/page.h>
#ifdef CONFIG_SMP
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e46bc94106..3763694399 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -63,8 +63,6 @@ static struct tss_struct doublefault_tss;
static unsigned char doublefault_stack[DOUBLEFAULT_STACK_SIZE];
asmlinkage int hypercall(void);
-asmlinkage void lcall7(void);
-asmlinkage void lcall27(void);
/* Master table, and the one used by CPU0. */
struct desc_struct idt_table[256] = { {0, 0}, };
diff --git a/xen/arch/x86/x86_32/entry.S b/xen/arch/x86/x86_32/entry.S
index 460104244c..5dad5b0b26 100644
--- a/xen/arch/x86/x86_32/entry.S
+++ b/xen/arch/x86/x86_32/entry.S
@@ -59,7 +59,7 @@
#include <xen/config.h>
#include <xen/errno.h>
#include <xen/softirq.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
EBX = 0x00
ECX = 0x04
diff --git a/xen/common/debug-linux.c b/xen/common/debug-linux.c
index 557997be3f..03c4995eb1 100644
--- a/xen/common/debug-linux.c
+++ b/xen/common/debug-linux.c
@@ -13,7 +13,7 @@
#include <xen/config.h>
#include <xen/types.h>
#include <xen/lib.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
#include <asm/pdb.h>
/* from linux/sched.h */
diff --git a/xen/common/debug.c b/xen/common/debug.c
index b17748a864..fa99d6bd8f 100644
--- a/xen/common/debug.c
+++ b/xen/common/debug.c
@@ -7,7 +7,7 @@
#include <xen/config.h>
#include <xen/types.h>
#include <xen/lib.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
#include <xen/sched.h>
#include <xen/event.h>
#include <asm/page.h>
diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c
index f949c7d7af..aa979f1dc0 100644
--- a/xen/common/dom0_ops.c
+++ b/xen/common/dom0_ops.c
@@ -10,7 +10,7 @@
#include <xen/types.h>
#include <xen/lib.h>
#include <xen/mm.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
#include <xen/sched.h>
#include <xen/event.h>
#include <asm/domain_page.h>
@@ -18,7 +18,7 @@
#include <xen/trace.h>
#include <xen/console.h>
#include <asm/shadow.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
#define TRC_DOM0OP_ENTER_BASE 0x00020000
#define TRC_DOM0OP_LEAVE_BASE 0x00030000
diff --git a/xen/common/domain.c b/xen/common/domain.c
index cbbd29c0cb..dff88d1fc0 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -14,7 +14,7 @@
#include <xen/time.h>
#include <xen/console.h>
#include <asm/shadow.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
#include <asm/domain_page.h>
/* Both these structures are protected by the tasklist_lock. */
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index ca2eb46f12..40e218c731 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -23,8 +23,8 @@
#include <xen/event.h>
#include <xen/irq.h>
-#include <hypervisor-ifs/hypervisor-if.h>
-#include <hypervisor-ifs/event_channel.h>
+#include <public/xen.h>
+#include <public/event_channel.h>
#define INIT_EVENT_CHANNELS 16
#define MAX_EVENT_CHANNELS 1024
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 79bb14324a..481b05de17 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -24,7 +24,7 @@
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/domain_page.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
unsigned long xenheap_phys_end;
diff --git a/xen/common/physdev.c b/xen/common/physdev.c
index ff486ba29b..b1c16d00b3 100644
--- a/xen/common/physdev.c
+++ b/xen/common/physdev.c
@@ -26,8 +26,8 @@
#include <xen/irq.h>
#include <xen/event.h>
#include <asm/pci.h>
-#include <hypervisor-ifs/hypervisor-if.h>
-#include <hypervisor-ifs/physdev.h>
+#include <public/xen.h>
+#include <public/physdev.h>
/* Called by PHYSDEV_PCI_INITIALISE_DEVICE to finalise IRQ routing. */
extern void pcibios_enable_irq(struct pci_dev *dev);
diff --git a/xen/common/sched_atropos.c b/xen/common/sched_atropos.c
index b83d853d5d..1565b86ac9 100644
--- a/xen/common/sched_atropos.c
+++ b/xen/common/sched_atropos.c
@@ -20,7 +20,7 @@
#include <xen/time.h>
#include <xen/sched.h>
#include <xen/sched-if.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
#include <xen/trace.h>
#define ATROPOS_TASK_UNBLOCKED 16
diff --git a/xen/common/sched_rrobin.c b/xen/common/sched_rrobin.c
index 1915b37632..fbf17ab84c 100644
--- a/xen/common/sched_rrobin.c
+++ b/xen/common/sched_rrobin.c
@@ -6,7 +6,7 @@
#include <xen/sched.h>
#include <xen/sched-if.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
#include <xen/ac_timer.h>
#include <xen/softirq.h>
#include <xen/time.h>
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 7b7530616c..138234104d 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -26,7 +26,7 @@
#include <xen/sched-if.h>
#include <xen/softirq.h>
#include <xen/trace.h>
-#include <hypervisor-ifs/sched_ctl.h>
+#include <public/sched_ctl.h>
/*#define WAKE_HISTO*/
/*#define BLOCKTIME_HISTO*/
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 1e4e634627..4b8d5b6f37 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -13,7 +13,7 @@
* it's possible to reconstruct a chronological record of trace events.
*
* See also include/xen/trace.h and the dom0 op in
- * include/hypervisor-ifs/dom0_ops.h
+ * include/public/dom0_ops.h
*/
#include <xen/config.h>
@@ -26,7 +26,7 @@
#include <xen/trace.h>
#include <xen/errno.h>
#include <asm/atomic.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
/* Pointers to the meta-data objects for all system trace buffers */
struct t_buf *t_bufs[NR_CPUS];
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 5068294ded..31a669c08d 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -14,7 +14,7 @@
#include <asm/flushtlb.h>
#include <asm/io.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
/*
* Per-page-frame information.
diff --git a/xen/include/asm-x86/pdb.h b/xen/include/asm-x86/pdb.h
index db98294b7d..d718505089 100644
--- a/xen/include/asm-x86/pdb.h
+++ b/xen/include/asm-x86/pdb.h
@@ -14,8 +14,8 @@
#include <asm/ptrace.h>
#include <xen/list.h>
-#include <hypervisor-ifs/dom0_ops.h>
-#include <hypervisor-ifs/hypervisor-if.h> /* for domain id */
+#include <public/dom0_ops.h>
+#include <public/xen.h> /* for domain id */
extern int pdb_initialized;
extern int pdb_com_port;
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index f6951c0bc1..e87c0986a1 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -15,7 +15,7 @@
#include <asm/pdb.h>
#include <xen/config.h>
#include <xen/spinlock.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
struct domain;
diff --git a/xen/include/hypervisor-ifs/COPYING b/xen/include/public/COPYING
index 3377710a5c..3377710a5c 100644
--- a/xen/include/hypervisor-ifs/COPYING
+++ b/xen/include/public/COPYING
diff --git a/xen/include/hypervisor-ifs/arch-x86_32.h b/xen/include/public/arch-x86_32.h
index 91a111bd92..1287cdbe04 100644
--- a/xen/include/hypervisor-ifs/arch-x86_32.h
+++ b/xen/include/public/arch-x86_32.h
@@ -1,11 +1,11 @@
/******************************************************************************
- * arch-i386/hypervisor-if.h
+ * arch-x86_32.h
*
* Guest OS interface to x86 32-bit Xen.
*/
-#ifndef __HYPERVISOR_IF_I386_H__
-#define __HYPERVISOR_IF_I386_H__
+#ifndef __XEN_PUBLIC_ARCH_X86_32_H__
+#define __XEN_PUBLIC_ARCH_X86_32_H__
/*
* Pointers and other address fields inside interface structures are padded to
diff --git a/xen/include/hypervisor-ifs/arch-x86_64.h b/xen/include/public/arch-x86_64.h
index 8eab08f669..856b5070a8 100644
--- a/xen/include/hypervisor-ifs/arch-x86_64.h
+++ b/xen/include/public/arch-x86_64.h
@@ -1,11 +1,11 @@
/******************************************************************************
- * arch-x86_64/hypervisor-if.h
+ * arch-x86_64.h
*
- * Guest OS interface to AMD x86-64 bit Xen.
+ * Guest OS interface to x86 64-bit Xen.
*/
-#ifndef __HYPERVISOR_IF_X86_64_H__
-#define __HYPERVISOR_IF_X86_64_H__
+#ifndef __XEN_PUBLIC_ARCH_X86_64_H__
+#define __XEN_PUBLIC_ARCH_X86_64_H__
/* Pointers are naturally 64 bits in this architecture; no padding needed. */
#define _MEMORY_PADDING(_X)
@@ -131,4 +131,4 @@ typedef struct {
#endif /* !__ASSEMBLY__ */
-#endif /* __HYPERVISOR_IF_H__ */
+#endif
diff --git a/xen/include/hypervisor-ifs/dom0_ops.h b/xen/include/public/dom0_ops.h
index 05eaa4ad20..e19141ca02 100644
--- a/xen/include/hypervisor-ifs/dom0_ops.h
+++ b/xen/include/public/dom0_ops.h
@@ -8,10 +8,10 @@
*/
-#ifndef __DOM0_OPS_H__
-#define __DOM0_OPS_H__
+#ifndef __XEN_PUBLIC_DOM0_OPS_H__
+#define __XEN_PUBLIC_DOM0_OPS_H__
-#include "hypervisor-if.h"
+#include "xen.h"
#include "sched_ctl.h"
/*
@@ -369,4 +369,4 @@ typedef struct {
} PACKED u;
} PACKED dom0_op_t; /* 80 bytes */
-#endif /* __DOM0_OPS_H__ */
+#endif /* __XEN_PUBLIC_DOM0_OPS_H__ */
diff --git a/xen/include/hypervisor-ifs/event_channel.h b/xen/include/public/event_channel.h
index 2da4f06d24..284326d9b6 100644
--- a/xen/include/hypervisor-ifs/event_channel.h
+++ b/xen/include/public/event_channel.h
@@ -6,8 +6,8 @@
* Copyright (c) 2003-2004, K A Fraser.
*/
-#ifndef __HYPERVISOR_IFS__EVENT_CHANNEL_H__
-#define __HYPERVISOR_IFS__EVENT_CHANNEL_H__
+#ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
+#define __XEN_PUBLIC_EVENT_CHANNEL_H__
/*
* EVTCHNOP_alloc_unbound: Allocate a fresh local port and prepare
@@ -158,4 +158,4 @@ typedef struct {
} PACKED u;
} PACKED evtchn_op_t; /* 32 bytes */
-#endif /* __HYPERVISOR_IFS__EVENT_CHANNEL_H__ */
+#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
diff --git a/xen/include/hypervisor-ifs/grant_table.h b/xen/include/public/grant_table.h
index cb48c1f3b9..389e082646 100644
--- a/xen/include/hypervisor-ifs/grant_table.h
+++ b/xen/include/public/grant_table.h
@@ -7,8 +7,8 @@
* Copyright (c) 2004, K A Fraser
*/
-#ifndef __HYPERVISOR_IFS_GRANT_TABLE_H__
-#define __HYPERVISOR_IFS_GRANT_TABLE_H__
+#ifndef __XEN_PUBLIC_GRANT_TABLE_H__
+#define __XEN_PUBLIC_GRANT_TABLE_H__
/***********************************
@@ -248,4 +248,4 @@ typedef struct {
}
-#endif /* __HYPERVISOR_IFS_GRANT_TABLE_H__ */
+#endif /* __XEN_PUBLIC_GRANT_TABLE_H__ */
diff --git a/xen/include/hypervisor-ifs/io/blkif.h b/xen/include/public/io/blkif.h
index 1024629ea7..8cd3696eb6 100644
--- a/xen/include/hypervisor-ifs/io/blkif.h
+++ b/xen/include/public/io/blkif.h
@@ -6,8 +6,8 @@
* Copyright (c) 2003-2004, Keir Fraser
*/
-#ifndef __SHARED_BLKIF_H__
-#define __SHARED_BLKIF_H__
+#ifndef __XEN_PUBLIC_IO_BLKIF_H__
+#define __XEN_PUBLIC_IO_BLKIF_H__
#define blkif_vdev_t u16
#define blkif_sector_t u64
@@ -112,4 +112,4 @@ typedef struct {
u16 info; /* 10: Device type and flags (VDISK_*). */
} PACKED vdisk_t; /* 12 bytes */
-#endif /* __SHARED_BLKIF_H__ */
+#endif /* __XEN_PUBLIC_IO_BLKIF_H__ */
diff --git a/xen/include/hypervisor-ifs/io/domain_controller.h b/xen/include/public/io/domain_controller.h
index ab04072fe8..5a4056cd4d 100644
--- a/xen/include/hypervisor-ifs/io/domain_controller.h
+++ b/xen/include/public/io/domain_controller.h
@@ -7,8 +7,8 @@
* Copyright (c) 2004, K A Fraser
*/
-#ifndef __DOMAIN_CONTROLLER_H__
-#define __DOMAIN_CONTROLLER_H__
+#ifndef __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
+#define __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__
/*
@@ -575,4 +575,4 @@ typedef struct {
} PACKED mem_request_t; /* 8 bytes */
-#endif /* __DOMAIN_CONTROLLER_H__ */
+#endif /* __XEN_PUBLIC_IO_DOMAIN_CONTROLLER_H__ */
diff --git a/xen/include/hypervisor-ifs/io/netif.h b/xen/include/public/io/netif.h
index abb87bafaa..839cc8dade 100644
--- a/xen/include/hypervisor-ifs/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -6,8 +6,8 @@
* Copyright (c) 2003-2004, Keir Fraser
*/
-#ifndef __SHARED_NETIF_H__
-#define __SHARED_NETIF_H__
+#ifndef __XEN_PUBLIC_IO_NETIF_H__
+#define __XEN_PUBLIC_IO_NETIF_H__
typedef struct {
memory_t addr; /* 0: Machine address of packet. */
diff --git a/xen/include/hypervisor-ifs/physdev.h b/xen/include/public/physdev.h
index 4e1aa135d3..ab1af9998a 100644
--- a/xen/include/hypervisor-ifs/physdev.h
+++ b/xen/include/public/physdev.h
@@ -6,8 +6,8 @@
* Description: Interface for domains to access physical devices on the PCI bus
*/
-#ifndef __HYPERVISOR_IFS_PHYSDEV_H__
-#define __HYPERVISOR_IFS_PHYSDEV_H__
+#ifndef __XEN_PUBLIC_PHYSDEV_H__
+#define __XEN_PUBLIC_PHYSDEV_H__
/* Commands to HYPERVISOR_physdev_op() */
#define PHYSDEVOP_PCI_CFGREG_READ 0
@@ -77,4 +77,4 @@ typedef struct _physdev_op_st
} PACKED u;
} PACKED physdev_op_t; /* 40 bytes */
-#endif /* __HYPERVISOR_IFS_PHYSDEV_H__ */
+#endif /* __XEN_PUBLIC_PHYSDEV_H__ */
diff --git a/xen/include/hypervisor-ifs/sched_ctl.h b/xen/include/public/sched_ctl.h
index 0c298f76d6..bd6a717521 100644
--- a/xen/include/hypervisor-ifs/sched_ctl.h
+++ b/xen/include/public/sched_ctl.h
@@ -4,8 +4,8 @@
* Mark Williamson, (C) 2004 Intel Research Cambridge
*/
-#ifndef __SCHED_CTL_H__
-#define __SCHED_CTL_H__
+#ifndef __XEN_PUBLIC_SCHED_CTL_H__
+#define __XEN_PUBLIC_SCHED_CTL_H__
/* Scheduler types */
#define SCHED_BVT 0
@@ -67,4 +67,4 @@ struct sched_adjdom_cmd
} PACKED u;
} PACKED; /* 40 bytes */
-#endif /* __SCHED_CTL_H__ */
+#endif /* __XEN_PUBLIC_SCHED_CTL_H__ */
diff --git a/xen/include/hypervisor-ifs/trace.h b/xen/include/public/trace.h
index 52d53842ca..5e7904d52a 100644
--- a/xen/include/hypervisor-ifs/trace.h
+++ b/xen/include/public/trace.h
@@ -1,9 +1,9 @@
/******************************************************************************
- * include/hypervisor-ifs/trace.h
+ * trace.h
*/
-#ifndef __HYPERVISOR_IFS_TRACE_H__
-#define __HYPERVISOR_IFS_TRACE_H__
+#ifndef __XEN_PUBLIC_TRACE_H__
+#define __XEN_PUBLIC_TRACE_H__
/* This structure represents a single trace buffer record. */
struct t_rec {
@@ -28,4 +28,4 @@ struct t_buf {
struct t_rec *vdata; /* virtual address pointer to data */
};
-#endif /* __HYPERVISOR_IFS_TRACE_H__ */
+#endif /* __XEN_PUBLIC_TRACE_H__ */
diff --git a/xen/include/hypervisor-ifs/hypervisor-if.h b/xen/include/public/xen.h
index 1038d3c88d..f103509b04 100644
--- a/xen/include/hypervisor-ifs/hypervisor-if.h
+++ b/xen/include/public/xen.h
@@ -1,13 +1,13 @@
/******************************************************************************
- * hypervisor-if.h
+ * xen.h
*
* Guest OS interface to Xen.
*
* Copyright (c) 2004, K A Fraser
*/
-#ifndef __HYPERVISOR_IF_H__
-#define __HYPERVISOR_IF_H__
+#ifndef __XEN_PUBLIC_XEN_H__
+#define __XEN_PUBLIC_XEN_H__
/* GCC-specific way to pack structure definitions (no implicit padding). */
#define PACKED __attribute__ ((packed))
@@ -21,7 +21,7 @@
#endif
/*
- * HYPERVISOR "SYSTEM CALLS"
+ * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
*/
/* EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5. */
@@ -62,7 +62,7 @@
/*
* VIRTUAL INTERRUPTS
*
- * Virtual interrupts that a guest OS may receive from the hypervisor.
+ * Virtual interrupts that a guest OS may receive from Xen.
*/
#define VIRQ_MISDIRECT 0 /* Catch-all interrupt for unbound VIRQs. */
#define VIRQ_TIMER 1 /* Timebase update, and/or requested timeout. */
@@ -422,4 +422,4 @@ extern shared_info_t *HYPERVISOR_shared_info;
#endif /* !__ASSEMBLY__ */
-#endif /* __HYPERVISOR_IF_H__ */
+#endif /* __XEN_PUBLIC_XEN_H__ */
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index bbacae6e4c..eb9d8c15af 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -26,7 +26,7 @@
#include <xen/config.h>
#include <xen/mm.h>
-#include <hypervisor-ifs/grant_table.h>
+#include <public/grant_table.h>
/* Active grant entry - used for shadowing GTF_permit_access grants. */
typedef struct {
@@ -68,7 +68,7 @@ typedef struct {
/* Per-domain grant information. */
typedef struct {
- /* Shared grant table (see include/hypervisor-ifs/grant_table.h). */
+ /* Shared grant table (see include/public/grant_table.h). */
grant_entry_t *shared;
/* Active grant table. */
active_grant_entry_t *active;
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 7c1e7bc909..6eba6ab425 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -10,8 +10,8 @@
#include <xen/smp.h>
#include <asm/page.h>
#include <asm/processor.h>
-#include <hypervisor-ifs/hypervisor-if.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/xen.h>
+#include <public/dom0_ops.h>
#include <xen/list.h>
#include <xen/time.h>
#include <xen/ac_timer.h>
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 79ddb92309..dd476f9298 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -28,7 +28,7 @@
#define __XEN_TIME_H__
#include <xen/types.h>
-#include <hypervisor-ifs/hypervisor-if.h>
+#include <public/xen.h>
extern int init_xen_time();
diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
index 3064c47a0b..88c0b23d39 100644
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -15,13 +15,13 @@
* Access to the trace buffers is via a dom0 hypervisor op and analysis of
* trace buffer contents can then be performed using a userland tool.
*
- * See also common/trace.c and the dom0 op in include/hypervisor-ifs/dom0_ops.h
+ * See also common/trace.c and the dom0 op in include/public/dom0_ops.h
*/
#ifndef __XEN_TRACE_H__
#define __XEN_TRACE_H__
-#include <hypervisor-ifs/trace.h>
+#include <public/trace.h>
#ifdef TRACE_BUFFER
@@ -32,7 +32,7 @@
#include <asm/atomic.h>
#include <asm/current.h>
#include <asm/msr.h>
-#include <hypervisor-ifs/dom0_ops.h>
+#include <public/dom0_ops.h>
/* Used to initialise trace buffer functionality */
void init_trace_bufs(void);