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

[Xen-changelog] Merged.



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID e002282b79c8d5e188e2048d2422c9e0587b1c1d
# Parent  c927e3761a96b5eecfc8d8d864ce9c1a71b07caf
# Parent  cc5450d52e49f7af1e6f8b0a80f357268f39b5e9
Merged.

diff -r c927e3761a96 -r e002282b79c8 buildconfigs/Rules.mk
--- a/buildconfigs/Rules.mk     Fri Nov 11 14:36:07 2005
+++ b/buildconfigs/Rules.mk     Fri Nov 11 14:36:16 2005
@@ -84,7 +84,7 @@
        rm -rf $(@D)
        cp -al $(<D) $(@D)
        if [ -d patches/$* ] ; then \
-           for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || 
exit 1 ) ; done ; \
+           for i in patches/$*/*.patch ; do patch -d $(@D) -p1 <$$i || exit 1 
; done ; \
        fi
        touch $@ # update timestamp to avoid rebuild
 endif
diff -r c927e3761a96 -r e002282b79c8 docs/src/user.tex
--- a/docs/src/user.tex Fri Nov 11 14:36:07 2005
+++ b/docs/src/user.tex Fri Nov 11 14:36:16 2005
@@ -7,7 +7,6 @@
 \def\xend{{xend}\xspace}
 
 \latexhtml{\newcommand{\path}[1]{{\small {\tt 
#1}}}}{\newcommand{\path}[1]{{\tt #1}}}
-
 
 
 \begin{document}
@@ -21,23 +20,23 @@
 \vfill
 \vfill
 \begin{tabular}{l}
-{\Huge \bf Users' manual} \\[4mm]
-{\huge Xen v2.0 for x86} \\[80mm]
-
-{\Large Xen is Copyright (c) 2002-2004, The Xen Team} \\[3mm]
+{\Huge \bf Users' Manual} \\[4mm]
+{\huge Xen v3.0} \\[80mm]
+
+{\Large Xen is Copyright (c) 2002-2005, The Xen Team} \\[3mm]
 {\Large University of Cambridge, UK} \\[20mm]
 \end{tabular}
 \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.
-}
+{\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
+  developers' mailing list.  Contributions of material, suggestions
+  and corrections are welcome.}
 
 \vfill
 \cleardoublepage
+
 
 % TABLE OF CONTENTS
 \pagestyle{plain}
@@ -45,6 +44,7 @@
 { \parskip 0pt plus 1pt
   \tableofcontents }
 \cleardoublepage
+
 
 % PREPARE FOR MAIN TEXT
 \pagenumbering{arabic}
@@ -68,7 +68,7 @@
 %% Chapter Installation moved to installation.tex
 \include{src/user/installation}
 
-%% Chapter Starting Additional Domains  moved to start_addl_dom.tex
+%% Chapter Starting Additional Domains moved to start_addl_dom.tex
 \include{src/user/start_addl_dom}
 
 %% Chapter Domain Management Tools moved to domain_mgmt.tex
@@ -86,6 +86,9 @@
 
 %% Chapter Domain Configuration moved to domain_configuration.tex
 \include{src/user/domain_configuration}
+
+%% Chapter Securing Xen
+\include{src/user/securing_xen}
 
 %% Chapter Build, Boot and Debug Options moved to build.tex
 \include{src/user/build}
@@ -99,25 +102,25 @@
 software (or the documentation) should be sent to the Xen developers'
 mailing list (address below).
 
+
 \section{Other Documentation}
 
 For developers interested in porting operating systems to Xen, the
-{\em Xen Interface Manual} is distributed in the \path{docs/}
-directory of the Xen source distribution.  
-
-%Various HOWTOs are available in \path{docs/HOWTOS} but this content is
-%being integrated into this manual.
+\emph{Xen Interface Manual} is distributed in the \path{docs/}
+directory of the Xen source distribution.
+
+% Various HOWTOs are available in \path{docs/HOWTOS} but this content
+% is being integrated into this manual.
 
 
 \section{Online References}
 
 The official Xen web site is found at:
-\begin{quote}
-{\tt http://www.cl.cam.ac.uk/netos/xen/}
+\begin{quote} {\tt http://www.cl.cam.ac.uk/netos/xen/}
 \end{quote}
 
-This contains links to the latest versions of all on-line 
-documentation (including the lateset version of the FAQ). 
+This contains links to the latest versions of all online
+documentation, including the latest version of the FAQ.
 
 
 \section{Mailing Lists}
@@ -126,17 +129,17 @@
 
 \begin{description}
 \item[xen-devel@xxxxxxxxxxxxxxxxxxx] Used for development
-discussions and bug reports.  Subscribe at: \\
-{\small {\tt http://lists.xensource.com/xen-devel}}
+  discussions and bug reports.  Subscribe at: \\
+  {\small {\tt http://lists.xensource.com/xen-devel}}
 \item[xen-users@xxxxxxxxxxxxxxxxxxx] Used for installation and usage
-discussions and requests for help.  Subscribe at: \\
-{\small {\tt http://lists.xensource.com/xen-users}}
+  discussions and requests for help.  Subscribe at: \\
+  {\small {\tt http://lists.xensource.com/xen-users}}
 \item[xen-announce@xxxxxxxxxxxxxxxxxxx] Used for announcements only.
-Subscribe at: \\
-{\small {\tt http://lists.xensource.com/xen-announce}}
-\item[xen-changelog@xxxxxxxxxxxxxxxxxxx]  Changelog feed
-from the unstable and 2.0 trees - developer oriented.  Subscribe at: \\
-{\small {\tt http://lists.xensource.com/xen-changelog}}
+  Subscribe at: \\
+  {\small {\tt http://lists.xensource.com/xen-announce}}
+\item[xen-changelog@xxxxxxxxxxxxxxxxxxx] Changelog feed
+  from the unstable and 2.0 trees - developer oriented.  Subscribe at: \\
+  {\small {\tt http://lists.xensource.com/xen-changelog}}
 \end{description}
 
 
@@ -149,9 +152,9 @@
 %% Chapter Installing Xen on Red Hat moved to redhat.tex
 \include{src/user/redhat}
 
-
 %% Chapter Glossary of Terms moved to glossary.tex
 \include{src/user/glossary}
+
 
 
 \end{document}
@@ -181,36 +184,35 @@
 %% # import xenctl.utils
 %% # help(xenctl.utils)
 
-%% You can use these modules to write your own custom scripts or you can
-%% customise the scripts supplied in the Xen distribution.
+%% 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]
-
+%% 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
+%% 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.:
@@ -224,12 +226,14 @@
 %% 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
+%% 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.:
+%% 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 -r c927e3761a96 -r e002282b79c8 docs/src/user/installation.tex
--- a/docs/src/user/installation.tex    Fri Nov 11 14:36:07 2005
+++ b/docs/src/user/installation.tex    Fri Nov 11 14:36:16 2005
@@ -17,7 +17,7 @@
 required if you wish to build from source.
 \begin{itemize}
 \item A working Linux distribution using the GRUB bootloader and
-  running on a P6-class (or newer) CPU.
+  running on a P6-class or newer CPU\@.
 \item [$\dag$] The \path{iproute2} package.
 \item [$\dag$] The Linux bridge-utils\footnote{Available from {\tt
       http://bridge.sourceforge.net}} (e.g., \path{/sbin/brctl})
@@ -30,29 +30,29 @@
   alternatively it can be installed by running `{\sl make
     install-twisted}' in the root of the Xen source tree.
 \item [$*$] Build tools (gcc v3.2.x or v3.3.x, binutils, GNU make).
-\item [$*$] Development installation of libcurl (e.g., libcurl-devel)
-\item [$*$] Development installation of zlib (e.g., zlib-dev).
-\item [$*$] Development installation of Python v2.2 or later (e.g.,
+\item [$*$] Development installation of libcurl (e.g.,\ libcurl-devel).
+\item [$*$] Development installation of zlib (e.g.,\ zlib-dev).
+\item [$*$] Development installation of Python v2.2 or later (e.g.,\ 
   python-dev).
 \item [$*$] \LaTeX\ and transfig are required to build the
   documentation.
 \end{itemize}
 
-Once you have satisfied the relevant prerequisites, you can now
-install either a binary or source distribution of Xen.
+Once you have satisfied these prerequisites, you can now install
+either a binary or source distribution of Xen.
 
 
 \section{Installing from Binary Tarball}
 
 Pre-built tarballs are available for download from the Xen download
-page
-\begin{quote} {\tt http://xen.sf.net}
+page:
+\begin{quote} {\tt http://www.xensource.com/downloads/}
 \end{quote}
 
 Once you've downloaded the tarball, simply unpack and install:
 \begin{verbatim}
-# tar zxvf xen-2.0-install.tgz
-# cd xen-2.0-install
+# tar zxvf xen-3.0-install.tgz
+# cd xen-3.0-install
 # sh ./install.sh
 \end{verbatim}
 
@@ -62,48 +62,29 @@
 
 \section{Installing from Source}
 
-This section describes how to obtain, build, and install Xen from
+This section describes how to obtain, build and install Xen from
 source.
 
 \subsection{Obtaining the Source}
 
-The Xen source tree is available as either a compressed source tar
-ball or as a clone of our master BitKeeper repository.
+The Xen source tree is available as either a compressed source tarball
+or as a clone of our master Mercurial repository.
 
 \begin{description}
 \item[Obtaining the Source Tarball]\mbox{} \\
-  Stable versions (and daily snapshots) of the Xen source tree are
-  available as compressed tarballs from the Xen download page
-  \begin{quote} {\tt http://xen.sf.net}
+  Stable versions and daily snapshots of the Xen source tree are
+  available from the Xen download page:
+  \begin{quote} {\tt \tt http://www.xensource.com/downloads/}
   \end{quote}
-
-\item[Using BitKeeper]\mbox{} \\
-  If you wish to install Xen from a clone of our latest BitKeeper
-  repository then you will need to install the BitKeeper tools.
-  Download instructions for BitKeeper can be obtained by filling out
-  the form at:
-  \begin{quote} {\tt http://www.bitmover.com/cgi-bin/download.cgi}
-\end{quote}
-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
-run:
-\begin{verbatim}
-# bk clone bk://xen.bkbits.net/xen-2.0.bk
-\end{verbatim}
-
-Under your current directory, a new directory named \path{xen-2.0.bk}
-has been created, which contains all the source code for Xen, the OS
-ports, and the control tools. You can update your repository with the
-latest changes at any time by running:
-\begin{verbatim}
-# cd xen-2.0.bk # to change into the local repository
-# bk pull       # to update the repository
-\end{verbatim}
+\item[Obtaining the source via Mercurial]\mbox{} \\
+  The source tree may also be obtained via the public Mercurial
+  repository hosted at:
+  \begin{quote}{\tt http://xenbits.xensource.com}.
+  \end{quote} See the instructions and the Getting Started Guide
+  referenced at:
+  \begin{quote}
+    {\tt http://www.xensource.com/downloads/}.
+  \end{quote}
 \end{description}
 
 % \section{The distribution}
@@ -124,7 +105,7 @@
 
 \subsection{Building from Source}
 
-The top-level Xen Makefile includes a target `world' that will do the
+The top-level Xen Makefile includes a target ``world'' that will do the
 following:
 
 \begin{itemize}
@@ -132,17 +113,17 @@
 \item Build the control tools, including \xend.
 \item Download (if necessary) and unpack the Linux 2.6 source code,
   and patch it for use with Xen.
-\item Build a Linux kernel to use in domain 0 and a smaller
+\item Build a Linux kernel to use in domain~0 and a smaller
   unprivileged kernel, which can optionally be used for unprivileged
   virtual machines.
 \end{itemize}
 
 After the build has completed you should have a top-level directory
-called \path{dist/} in which all resulting targets will be placed; of
-particular interest are the two kernels XenLinux kernel images, one
-with a `-xen0' extension which contains hardware device drivers and
-drivers for Xen's virtual devices, and one with a `-xenU' extension
-that just contains the virtual ones. These are found in
+called \path{dist/} in which all resulting targets will be placed. Of
+particular interest are the two XenLinux kernel images, one with a
+``-xen0'' extension which contains hardware device drivers and drivers
+for Xen's virtual devices, and one with a ``-xenU'' extension that
+just contains the virtual ones. These are found in
 \path{dist/install/boot/} along with the image for Xen itself and the
 configuration files used during the build.
 
@@ -150,17 +131,15 @@
 \begin{quote}
 \begin{verbatim}
 # make netbsd20
-\end{verbatim}
-\end{quote}
+\end{verbatim}\end{quote}
 NetBSD port is built using a snapshot of the netbsd-2-0 cvs branch.
-The snapshot is downloaded as part of the build process, if it is not
+The snapshot is downloaded as part of the build process if it is not
 yet present in the \path{NETBSD\_SRC\_PATH} search path.  The build
-process also downloads a toolchain which includes all the tools
+process also downloads a toolchain which includes all of the tools
 necessary to build the NetBSD kernel under Linux.
 
-To customize further the set of kernels built you need to edit the
-top-level Makefile. Look for the line:
-
+To customize the set of kernels built you need to edit the top-level
+Makefile. Look for the line:
 \begin{quote}
 \begin{verbatim}
 KERNELS ?= mk.linux-2.6-xen0 mk.linux-2.6-xenU
@@ -189,7 +168,6 @@
 %% After untaring the pristine kernel tree, the makefile uses the {\tt
 %%   mkbuildtree} script to add the Xen patches to the kernel.
 
-
 %% \framebox{\parbox{5in}{
 %%     {\bf Distro specific:} \\
 %%     {\it Gentoo} --- if not using udev (most installations,
@@ -201,7 +179,7 @@
 % If you have an SMP machine you may wish to give the {\tt '-j4'}
 % argument to make to get a parallel build.
 
-If you wish to build a customized XenLinux kernel (e.g. to support
+If you wish to build a customized XenLinux kernel (e.g.\ to support
 additional devices or enable distribution-required features), you can
 use the standard Linux configuration mechanisms, specifying that the
 architecture being built for is \path{xen}, e.g:
@@ -215,21 +193,21 @@
 \end{quote}
 
 You can also copy an existing Linux configuration (\path{.config})
-into \path{linux-2.6.11-xen0} and execute:
+into e.g.\ \path{linux-2.6.11-xen0} and execute:
 \begin{quote}
 \begin{verbatim}
 # make ARCH=xen oldconfig
 \end{verbatim}
 \end{quote}
 
-You may be prompted with some Xen-specific options; we advise
+You may be prompted with some Xen-specific options. We advise
 accepting the defaults for these options.
 
-Note that the only difference between the two types of Linux kernel
-that are built is the configuration file used for each.  The `U'
+Note that the only difference between the two types of Linux kernels
+that are built is the configuration file used for each.  The ``U''
 suffixed (unprivileged) versions don't contain any of the physical
 hardware device drivers, leading to a 30\% reduction in size; hence
-you may prefer these for your non-privileged domains.  The `0'
+you may prefer these for your non-privileged domains.  The ``0''
 suffixed privileged versions can be used to boot the system, as well
 as in driver domains and unprivileged domains.
 
@@ -259,10 +237,10 @@
 
 The \path{dist/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 (\path{xen-syms-2.0.6}
-and \path{vmlinux-syms-2.6.11.11-xen0}) which are essential for
-interpreting crash dumps.  Retain these files as the developers may
-wish to see them if you post on the mailing list.
+and XenLinux kernels that contain debug symbols such as
+(\path{xen-syms-2.0.6} and \path{vmlinux-syms-2.6.11.11-xen0}) which
+are essential for interpreting crash dumps.  Retain these files as the
+developers may wish to see them if you post on the mailing list.
 
 
 \section{Configuration}
@@ -280,23 +258,23 @@
 
 {\small
 \begin{verbatim}
-title Xen 2.0 / XenLinux 2.6
-  kernel /boot/xen-2.0.gz dom0_mem=131072
+title Xen 3.0 / XenLinux 2.6
+  kernel /boot/xen-3.0.gz dom0_mem=131072
   module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro console=tty0
 \end{verbatim}
 }
 
 The kernel line tells GRUB where to find Xen itself and what boot
-parameters should be passed to it (in this case, setting domain 0's
+parameters should be passed to it (in this case, setting the domain~0
 memory allocation in kilobytes and the settings for the serial port).
 For more details on the various Xen boot parameters see
 Section~\ref{s:xboot}.
 
 The module line of the configuration describes the location of the
 XenLinux kernel that Xen should start and the parameters that should
-be passed to it (these are standard Linux parameters, identifying the
+be passed to it. Tthese are standard Linux parameters, identifying the
 root device and specifying it be initially mounted read only and
-instructing that console output be sent to the screen).  Some
+instructing that console output be sent to the screen. Some
 distributions such as SuSE do not require the \path{ro} parameter.
 
 %% \framebox{\parbox{5in}{
@@ -307,24 +285,21 @@
 
 
 If you want to use an initrd, just add another \path{module} line to
-the configuration, as usual:
-
+the configuration, like:
 {\small
 \begin{verbatim}
   module /boot/my_initrd.gz
 \end{verbatim}
 }
 
-As always when installing a new kernel, it is recommended that you do
-not delete existing menu options from \path{menu.lst} --- you may want
-to boot your old Linux kernel in future, particularly if you have
-problems.
+When installing a new kernel, it is recommended that you do not delete
+existing menu options from \path{menu.lst}, as you may wish to boot
+your old Linux kernel in future, particularly if you have problems.
 
 \subsection{Serial Console (optional)}
 
 %% kernel /boot/xen-2.0.gz dom0_mem=131072 com1=115200,8n1
 %% module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro
-
 
 In order to configure Xen serial console output, it is necessary to
 add an boot option to your GRUB config; e.g.\ replace the above kernel
@@ -343,24 +318,23 @@
 achieve this append ``\path{console=ttyS0}'' to your module line.
 
 If you wish to be able to log in over the XenLinux serial console it
-is necessary to add a line into \path{/etc/inittab}, just as per
-regular Linux. Simply add the line:
+is necessary to add a line into \path{/etc/inittab}. Add the line:
 \begin{quote} {\small {\tt c:2345:respawn:/sbin/mingetty ttyS0}}
 \end{quote}
 
-and you should be able to log in. Note that to successfully log in as
-root over the serial line will require adding \path{ttyS0} to
-\path{/etc/securetty} in most modern distributions.
+and you should be able to log in. To successfully log in as root over
+the serial line will require adding \path{ttyS0} to
+\path{/etc/securetty} if it is not already there.
 
 \subsection{TLS Libraries}
 
 Users of the XenLinux 2.6 kernel should disable Thread Local Storage
-(e.g.\ by doing a \path{mv /lib/tls /lib/tls.disabled}) before
-attempting to run with a XenLinux kernel\footnote{If you boot without
+(TLS) (e.g.\ by doing a \path{mv /lib/tls /lib/tls.disabled}) before
+attempting to boot a XenLinux kernel\footnote{If you boot without
   first disabling TLS, you will get a warning message during the boot
   process. In this case, simply perform the rename after the machine
   is up and then run \texttt{/sbin/ldconfig} to make it take effect.}.
-You can always reenable it by restoring the directory to its original
+You can always reenable TLS by restoring the directory to its original
 location (i.e.\ \path{mv /lib/tls.disabled /lib/tls}).
 
 The reason for this is that the current TLS implementation uses
@@ -369,19 +343,19 @@
 performance substantially.
 
 We hope that this issue can be resolved by working with Linux
-distribution vendors to implement a minor backward-compatible change
+distributions to implement a minor backward-compatible change
 to the TLS library.
 
 
 \section{Booting Xen}
 
 It should now be possible to restart the system and use Xen.  Reboot
-as usual but choose the new Xen option when the Grub screen appears.
+and choose the new Xen option when the Grub screen appears.
 
 What follows should look much like a conventional Linux boot.  The
 first portion of the output comes from Xen itself, supplying low level
-information about itself and the machine it is running on.  The
-following portion of the output comes from XenLinux.
+information about itself and the underlying hardware.  The last
+portion of the output comes from XenLinux.
 
 You may see some errors during the XenLinux boot.  These are not
 necessarily anything to worry about --- they may result from kernel
@@ -389,5 +363,5 @@
 usually use.
 
 When the boot completes, you should be able to log into your system as
-usual.  If you are unable to log in to your system running Xen, you
-should still be able to reboot with your normal Linux kernel.
+usual.  If you are unable to log in, you should still be able to
+reboot with your normal Linux kernel.
diff -r c927e3761a96 -r e002282b79c8 docs/src/user/introduction.tex
--- a/docs/src/user/introduction.tex    Fri Nov 11 14:36:07 2005
+++ b/docs/src/user/introduction.tex    Fri Nov 11 14:36:16 2005
@@ -2,7 +2,7 @@
 
 
 Xen is a \emph{paravirtualising} virtual machine monitor (VMM), or
-`hypervisor', for the x86 processor architecture.  Xen can securely
+``hypervisor'', for the x86 processor architecture.  Xen can securely
 execute multiple virtual machines on a single physical system with
 close-to-native performance.  The virtual machine technology
 facilitates enterprise-grade functionality, including:
@@ -11,7 +11,7 @@
 \item Virtual machines with performance close to native hardware.
 \item Live migration of running virtual machines between physical
   hosts.
-\item Excellent hardware support (supports most Linux device drivers).
+\item Excellent hardware support. Supports most Linux device drivers.
 \item Sandboxed, re-startable device drivers.
 \end{itemize}
 
@@ -28,7 +28,7 @@
 space applications and libraries \emph{do not} require modification.
 
 Xen support is available for increasingly many operating systems:
-right now, Linux and NetBSD are available for Xen 2.0.
+right now, Linux and NetBSD are available for Xen 3.0.
 A FreeBSD port is undergoing testing and will be incorporated into the
 release soon. Other OS ports, including Plan 9, are in progress.  We
 hope that that arch-xen patches will be incorporated into the
@@ -43,14 +43,14 @@
 \item [Multiple OS configurations.] Run multiple operating systems
   simultaneously, for instance for compatibility or QA purposes.
 \item [Server consolidation.] Move multiple servers onto a single
-  physical host with performance and fault isolation provided at
+  physical host with performance and fault isolation provided at the
   virtual machine boundaries.
 \item [Cluster computing.] Management at VM granularity provides more
   flexibility than separately managing each physical host, but better
   control and isolation than single-system image solutions,
   particularly by using live migration for load balancing.
 \item [Hardware support for custom OSes.] Allow development of new
-  OSes while benefiting from the wide-ranging hardware support of
+  OSes while benefitting from the wide-ranging hardware support of
   existing OSes such as Linux.
 \end{description}
 
@@ -58,44 +58,44 @@
 \section{Structure of a Xen-Based System}
 
 A Xen system has multiple layers, the lowest and most privileged of
-which is Xen itself. 
+which is Xen itself.
 
-Xen in turn may host multiple \emph{guest} operating systems, each of
-which is executed within a secure virtual machine (in Xen terminology,
-a \emph{domain}). Domains are scheduled by Xen to make effective use
-of the available physical CPUs.  Each guest OS manages its own
-applications, which includes responsibility for scheduling each
-application within the time allotted to the VM by Xen.
+Xen may host multiple \emph{guest} operating systems, each of which is
+executed within a secure virtual machine. In Xen terminology, a
+\emph{domain}. Domains are scheduled by Xen to make effective use of
+the available physical CPUs.  Each guest OS manages its own
+applications. This management includes the responsibility of
+scheduling each application within the time allotted to the VM by Xen.
 
-The first domain, \emph{domain 0}, is created automatically when the
-system boots and has special management privileges. Domain 0 builds
+The first domain, \emph{domain~0}, is created automatically when the
+system boots and has special management privileges. Domain~0 builds
 other domains and manages their virtual devices. It also performs
 administrative tasks such as suspending, resuming and migrating other
 virtual machines.
 
-Within domain 0, a process called \emph{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
+Within domain~0, a process called \emph{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, requiring 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),
+newer processor (e.g.\ Pentium Pro, Celeron, Pentium~II, Pentium~III,
+Pentium~IV, Xeon, AMD~Athlon, AMD~Duron).  Multiprocessor machines are
+supported, and there is basic support for HyperThreading (SMT),
 although this remains a topic for ongoing research. A port
-specifically for x86/64 is in progress, although Xen already runs on
-such systems in 32-bit legacy mode. In addition a port to the IA64
+specifically for x86/64 is in progress. Xen already runs on such
+systems in 32-bit legacy mode. In addition, a port to the IA64
 architecture is approaching completion. We hope to add other
 architectures such as PPC and ARM in due course.
 
 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
-current plans to support these systems: The x86/64 port is the planned
-route to supporting larger memory sizes.
+plans to support these systems: The x86/64 port is the planned route
+to supporting larger memory sizes.
 
 Xen offloads most of the hardware support issues to the guest OS
 running in Domain~0.  Xen itself contains only the code required to
@@ -112,23 +112,22 @@
 
 Xen was originally developed by the Systems Research Group at the
 University of Cambridge Computer Laboratory as part of the XenoServers
-project, funded by the UK-EPSRC.
+project, funded by the UK-EPSRC\@.
 
-XenoServers aim 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:
+XenoServers aim to provide a ``public infrastructure for global
+distributed computing''. Xen plays a key part in that, allowing one to
+efficiently partition a single machine to enable multiple independent
+clients to run their operating systems and applications in an
+environment. This environment provides protection, resource isolation
+and accounting.  The project web page contains further information
+along with pointers to papers and technical reports:
 \path{http://www.cl.cam.ac.uk/xeno}
 
-Xen has since grown into a fully-fledged project in its own right,
-enabling us to investigate interesting research issues regarding the
-best techniques 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.
+Xen has grown into a fully-fledged project in its own right, enabling
+us to investigate interesting research issues regarding the best
+techniques 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.
 
 Xen was first described in a paper presented at SOSP in
 2003\footnote{\tt
@@ -137,7 +136,7 @@
 significantly matured and is now used in production scenarios on many
 sites.
 
-Xen 2.0 features greatly enhanced hardware support, configuration
+Xen 3.0 features greatly enhanced hardware support, configuration
 flexibility, usability and a larger complement of supported operating
 systems. This latest release takes Xen a step closer to becoming the
 definitive open source solution for virtualisation.
diff -r c927e3761a96 -r e002282b79c8 docs/src/user/start_addl_dom.tex
--- a/docs/src/user/start_addl_dom.tex  Fri Nov 11 14:36:07 2005
+++ b/docs/src/user/start_addl_dom.tex  Fri Nov 11 14:36:16 2005
@@ -40,8 +40,7 @@
 a starting point:
 \begin{itemize}
 \item \path{/etc/xen/xmexample1} is a simple template configuration
-  file for describing a single VM.
-
+  file for describing a single VM\@.
 \item \path{/etc/xen/xmexample2} file is a template description that
   is intended to be reused for multiple virtual machines.  Setting the
   value of the \path{vmid} variable on the \path{xm} command line
@@ -54,17 +53,17 @@
 \begin{quote}
 \begin{description}
 \item[kernel] Set this to the path of the kernel you compiled for use
-  with Xen (e.g.\ \path{kernel = `/boot/vmlinuz-2.6-xenU'})
+  with Xen (e.g.\ \path{kernel = ``/boot/vmlinuz-2.6-xenU''})
 \item[memory] Set this to the size of the domain's memory in megabytes
   (e.g.\ \path{memory = 64})
 \item[disk] Set the first entry in this list to calculate the offset
-  of the domain's root partition, based on the domain ID.  Set the
+  of the domain's root partition, based on the domain ID\@.  Set the
   second to the location of \path{/usr} if you are sharing it between
-  domains (e.g.\ \path{disk = [`phy:your\_hard\_drive\%d,sda1,w' \%
+  domains (e.g.\ \path{disk = ['phy:your\_hard\_drive\%d,sda1,w' \%
     (base\_partition\_number + vmid),
-    `phy:your\_usr\_partition,sda6,r' ]}
+    '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 (e.g.\ \path{dhcp=`dhcp'})
+  receive its IP address from a DHCP server (e.g.\ \path{dhcp=``dhcp''})
 \end{description}
 \end{quote}
 
@@ -72,7 +71,7 @@
 the MAC address of the virtual ethernet interface yourself.  For
 example:
 \begin{quote}
-\verb_vif = [`mac=00:06:AA:F6:BB:B3']_
+\verb_vif = ['mac=00:06:AA:F6:BB:B3']_
 \end{quote}
 If you do not set this variable, \xend\ will automatically generate a
 random MAC address from an unused range.
@@ -116,6 +115,7 @@
   section of the project's SourceForge site (see
   \path{http://sf.net/projects/xen/}).
 \item Create a configuration file like the following:
+  \begin{quote}
 \begin{verbatim}
 kernel = "/boot/vmlinuz-2.6-xenU"
 memory = 64
@@ -124,11 +124,14 @@
 ip = "1.2.3.4"
 disk = ['file:/path/to/ttylinux/rootfs,sda1,w']
 root = "/dev/sda1 ro"
-\end{verbatim}
+\end{verbatim}    
+  \end{quote}
 \item Now start the domain and connect to its console:
+  \begin{quote}
 \begin{verbatim}
 xm create configfile -c
 \end{verbatim}
+  \end{quote}
 \item Login as root, password root.
 \end{enumerate}
 
diff -r c927e3761a96 -r e002282b79c8 linux-2.6-xen-sparse/arch/ia64/Kconfig
--- a/linux-2.6-xen-sparse/arch/ia64/Kconfig    Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig    Fri Nov 11 14:36:16 2005
@@ -71,6 +71,11 @@
        default y
 
 config XEN_BLKDEV_GRANT
+       depends on XEN
+       bool
+       default y
+
+config XEN_BLKDEV_FRONTEND
        depends on XEN
        bool
        default y
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c  Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c  Fri Nov 11 
14:36:16 2005
@@ -6,75 +6,146 @@
 #include <asm/hw_irq.h>
 #include <asm-xen/evtchn.h>
 
-#define MAX_EVTCHN 256
-
-#define VALID_EVTCHN(_chn) ((_chn) >= 0)
-
+#define MAX_EVTCHN 1024
+
+/* Xen will never allocate port zero for any purpose. */
+#define VALID_EVTCHN(_chn) (((_chn) != 0) && ((_chn) < MAX_EVTCHN))
+
+/* Binding types. Hey, only IRQT_VIRQ and IRQT_EVTCHN are supported now
+ * for XEN/IA64 - ktian1
+ */
+enum { IRQT_UNBOUND, IRQT_PIRQ, IRQT_VIRQ, IRQT_IPI, IRQT_EVTCHN };
+
+/* Constructor for packed IRQ information. */
+#define mk_irq_info(type, index, evtchn)                               \
+       (((u32)(type) << 24) | ((u32)(index) << 16) | (u32)(evtchn))
+/* Convenient shorthand for packed representation of an unbound IRQ. */
+#define IRQ_UNBOUND    mk_irq_info(IRQT_UNBOUND, 0, 0)
+/* Accessor macros for packed IRQ information. */
+#define evtchn_from_irq(irq) ((u16)(irq_info[irq]))
+#define index_from_irq(irq)  ((u8)(irq_info[irq] >> 16))
+#define type_from_irq(irq)   ((u8)(irq_info[irq] >> 24))
+
+/* Packed IRQ information: binding type, sub-type index, and event channel. */
+static u32 irq_info[NR_IRQS];
+
+/* One note for XEN/IA64 is that we have all event channels bound to one
+ * physical irq vector. So we always mean evtchn vector identical to 'irq'
+ * vector in this context. - ktian1
+ */
 static struct {
        irqreturn_t (*handler)(int, void *, struct pt_regs *);
        void *dev_id;
+       char opened;    /* Whether allocated */
 } evtchns[MAX_EVTCHN];
 
-int virq_to_evtchn[NR_VIRQS] = {-1};
-unsigned int bind_virq_to_evtchn(int virq)
+/*
+ * This lock protects updates to the following mapping and reference-count
+ * arrays. The lock does not need to be acquired to read the mapping tables.
+ */
+static spinlock_t irq_mapping_update_lock;
+
+#define unbound_irq(e) (VALID_EVTCHN(e) && (!evtchns[(e)].opened))
+int bind_virq_to_irqhandler(
+       unsigned int virq,
+       unsigned int cpu,
+       irqreturn_t (*handler)(int, void *, struct pt_regs *),
+       unsigned long irqflags,
+       const char *devname,
+       void *dev_id)
 {
     evtchn_op_t op;
+    int evtchn;
+
+    spin_lock(&irq_mapping_update_lock);
 
     op.cmd = EVTCHNOP_bind_virq;
     op.u.bind_virq.virq = virq;
-    op.u.bind_virq.vcpu = 0;
-    if ( HYPERVISOR_event_channel_op(&op) != 0 )
-        BUG();
-
-    virq_to_evtchn[virq] = op.u.bind_virq.port;
-    return op.u.bind_virq.port;
-}
-
-#if 0
-void notify_remote_via_irq(int virq)
-{
-       printk("notify_remote_via_irq called... FIXME??\n");
-       while(1);
-}
-#endif
+    op.u.bind_virq.vcpu = cpu;
+    BUG_ON(HYPERVISOR_event_channel_op(&op) != 0 );
+    evtchn = op.u.bind_virq.port;
+
+    if (!unbound_irq(evtchn))
+       return -EINVAL;
+
+    evtchns[evtchn].handler = handler;
+    evtchns[evtchn].dev_id = dev_id;
+    evtchns[evtchn].opened = 1;
+    irq_info[evtchn] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
+
+    unmask_evtchn(evtchn);
+    spin_unlock(&irq_mapping_update_lock);
+    return evtchn;
+}
 
 int bind_evtchn_to_irqhandler(unsigned int evtchn,
                    irqreturn_t (*handler)(int, void *, struct pt_regs *),
                    unsigned long irqflags, const char * devname, void *dev_id)
 {
-    if (evtchn >= MAX_EVTCHN)
-        return -EINVAL;
+    spin_lock(&irq_mapping_update_lock);
+
+    if (!unbound_irq(evtchn))
+       return -EINVAL;
 
     evtchns[evtchn].handler = handler;
     evtchns[evtchn].dev_id = dev_id;
+    evtchns[evtchn].opened = 1;
+    irq_info[evtchn] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
+
     unmask_evtchn(evtchn);
-    //return 0;
-    /* On ia64, there's only one irq vector allocated for all event channels,
-     * so let's just return evtchn as handle for later communication
-     */
+    spin_unlock(&irq_mapping_update_lock);
     return evtchn;
 }
 
-void unbind_evtchn_from_irqhandler(unsigned int evtchn, void *dev_id)
-{
-    if (evtchn >= MAX_EVTCHN)
+int bind_ipi_to_irqhandler(
+       unsigned int ipi,
+       unsigned int cpu,
+       irqreturn_t (*handler)(int, void *, struct pt_regs *),
+       unsigned long irqflags,
+       const char *devname,
+       void *dev_id)
+{
+    printk("%s is called which has not been supported now...?\n", 
__FUNCTION__);
+    while(1);
+}
+
+void unbind_from_irqhandler(unsigned int irq, void *dev_id)
+{
+    evtchn_op_t op;
+    int evtchn = evtchn_from_irq(irq);
+
+    spin_lock(&irq_mapping_update_lock);
+
+    if (unbound_irq(irq))
         return;
+
+    op.cmd = EVTCHNOP_close;
+    op.u.close.port = evtchn;
+    BUG_ON(HYPERVISOR_event_channel_op(&op) != 0);
+
+    switch (type_from_irq(irq)) {
+       case IRQT_VIRQ:
+           /* Add smp stuff later... */
+           break;
+       case IRQT_IPI:
+           /* Add smp stuff later... */
+           break;
+       default:
+           break;
+    }
 
     mask_evtchn(evtchn);
     evtchns[evtchn].handler = NULL;
-}
-
-void unbind_evtchn_from_irq(unsigned int evtchn)
-{
-       printk("unbind_evtchn_from_irq called... FIXME??\n");
-       while(1);
+    evtchns[evtchn].opened = 0;
+
+    spin_unlock(&irq_mapping_update_lock);
 }
 
 void notify_remote_via_irq(int irq)
 {
-       int evtchn = virq_to_evtchn[irq];       // FIXME... is this right??
-
-       if (VALID_EVTCHN(evtchn))
+       int evtchn = evtchn_from_irq(irq);
+
+       if (!unbound_irq(evtchn))
                notify_remote_via_evtchn(evtchn);
 }
 
@@ -148,9 +219,7 @@
 
     vcpu_info->arch.evtchn_vector = evtchn_irq;
     printk("xen-event-channel using irq %d\n", evtchn_irq);
-}
-
-/* Following are set of interfaces unused on IA64/XEN, just keep it here */
-
-void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu) {}
-int teardown_irq(unsigned int irq, struct irqaction * old) {return 0;}
+
+    spin_lock_init(&irq_mapping_update_lock);
+    memset(evtchns, 0, sizeof(evtchns));
+}
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c     Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c     Fri Nov 11 14:36:16 2005
@@ -208,6 +208,7 @@
 static void dump_fault_path(unsigned long address)
 {
        unsigned long *p, page;
+       unsigned long mfn; 
 
        preempt_disable();
        page = __pa(per_cpu(cur_pgd, smp_processor_id()));
@@ -217,20 +218,22 @@
        p += (address >> 30) * 2;
        printk(KERN_ALERT "%08lx -> *pde = %08lx:%08lx\n", page, p[1], p[0]);
        if (p[0] & 1) {
-               page = p[0] & PAGE_MASK;
+               mfn  = (p[0] >> PAGE_SHIFT) | ((p[1] & 0x7) << 20); 
+               page = mfn_to_pfn(mfn) << PAGE_SHIFT; 
+               p  = (unsigned long *)__va(page);
                address &= 0x3fffffff;
-               page = machine_to_phys(page);
-               p  = (unsigned long *)__va(page);
                p += (address >> 21) * 2;
-               printk(KERN_ALERT "%08lx -> *pme = %08lx:%08lx\n", page, p[1], 
p[0]);
+               printk(KERN_ALERT "%08lx -> *pme = %08lx:%08lx\n", 
+                      page, p[1], p[0]);
 #ifndef CONFIG_HIGHPTE
                if (p[0] & 1) {
-                       page = p[0] & PAGE_MASK;
+                       mfn  = (p[0] >> PAGE_SHIFT) | ((p[1] & 0x7) << 20); 
+                       page = mfn_to_pfn(mfn) << PAGE_SHIFT; 
+                       p  = (unsigned long *) __va(page);
                        address &= 0x001fffff;
-                       page = machine_to_phys(page);
-                       p  = (unsigned long *) __va(page);
                        p += (address >> 12) * 2;
-                       printk(KERN_ALERT "%08lx -> *pte = %08lx:%08lx\n", 
page, p[1], p[0]);
+                       printk(KERN_ALERT "%08lx -> *pte = %08lx:%08lx\n",
+                              page, p[1], p[0]);
                }
 #endif
        }
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c     Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c     Fri Nov 11 14:36:16 2005
@@ -17,7 +17,7 @@
 /* Referenced in netback.c. */
 /*static*/ kmem_cache_t *skbuff_cachep;
 
-#define MAX_SKBUFF_ORDER 2
+#define MAX_SKBUFF_ORDER 4
 static kmem_cache_t *skbuff_order_cachep[MAX_SKBUFF_ORDER + 1];
 
 static struct {
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c
--- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c   Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c   Fri Nov 11 14:36:16 2005
@@ -97,9 +97,7 @@
 transmission_set_buffer(struct transmission *t,
                         unsigned char *buffer, unsigned int len)
 {
-       if (NULL != t->request) {
-               kfree(t->request);
-       }
+       kfree(t->request);
        t->request = kmalloc(len, GFP_KERNEL);
        if (t->request) {
                memcpy(t->request,
@@ -113,12 +111,8 @@
 static inline void
 transmission_free(struct transmission *t)
 {
-       if (t->request) {
-               kfree(t->request);
-       }
-       if (t->rcv_buffer) {
-               kfree(t->rcv_buffer);
-       }
+       kfree(t->request);
+       kfree(t->rcv_buffer);
        kfree(t);
 }
 
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c      Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c      Fri Nov 11 
14:36:16 2005
@@ -50,6 +50,12 @@
 
        blkif->shmem_ref = shared_page;
        blkif->shmem_handle = op.handle;
+
+#ifdef __ia64__
+       /* on some arch's, map_grant_ref behaves like mmap, in that the
+        * passed address is a hint and a different address may be returned */
+       blkif->blk_ring_area->addr = gnttab_map_vaddr(op);
+#endif
 
        return 0;
 }
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Fri Nov 11 14:36:16 2005
@@ -48,8 +48,7 @@
        unregister_xenbus_watch(&be->backend_watch);
        if (be->blkif)
                blkif_put(be->blkif);
-       if (be->frontpath)
-               kfree(be->frontpath);
+       kfree(be->frontpath);
        kfree(be);
        return 0;
 }
@@ -274,8 +273,7 @@
  free_be:
        if (be->backend_watch.node)
                unregister_xenbus_watch(&be->backend_watch);
-       if (frontend)
-               kfree(frontend);
+       kfree(frontend);
        kfree(be);
        return err;
 }
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Fri Nov 11 
14:36:16 2005
@@ -607,8 +607,7 @@
  destroy_blkring:
        blkif_free(info);
  out:
-       if (backend)
-               kfree(backend);
+       kfree(backend);
        return err;
 }
 
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c  Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c  Fri Nov 11 14:36:16 2005
@@ -52,8 +52,7 @@
        unregister_xenbus_watch(&be->backend_watch);
        if (be->blkif)
                blkif_put(be->blkif);
-       if (be->frontpath)
-               kfree(be->frontpath);
+       kfree(be->frontpath);
        kfree(be);
        return 0;
 }
@@ -201,8 +200,7 @@
  free_be:
        if (be->backend_watch.node)
                unregister_xenbus_watch(&be->backend_watch);
-       if (frontend)
-               kfree(frontend);
+       kfree(frontend);
        kfree(be);
        return err;
 }
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c        Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c        Fri Nov 11 
14:36:16 2005
@@ -241,11 +241,7 @@
 #endif
 
 /*** Useful function for console debugging -- goes straight to Xen. ***/
-#ifdef CONFIG_XEN_PRIVILEGED_GUEST
 asmlinkage int xprintk(const char *fmt, ...)
-#else
-asmlinkage int xprintk(const char *fmt, ...)
-#endif
 {
        va_list args;
        int printk_len;
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/netback/loopback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c       Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c       Fri Nov 11 
14:36:16 2005
@@ -160,10 +160,8 @@
        return 0;
 
  fail:
-       if (dev1 != NULL)
-               kfree(dev1);
-       if (dev2 != NULL)
-               kfree(dev2);
+       kfree(dev1);
+       kfree(dev2);
        return err;
 }
 
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Fri Nov 11 14:36:16 2005
@@ -46,8 +46,7 @@
        unregister_xenbus_watch(&be->backend_watch);
        if (be->netif)
                netif_disconnect(be->netif);
-       if (be->frontpath)
-               kfree(be->frontpath);
+       kfree(be->frontpath);
        kfree(be);
        return 0;
 }
@@ -253,8 +252,7 @@
  free_be:
        if (be->backend_watch.node)
                unregister_xenbus_watch(&be->backend_watch);
-       if (frontend)
-               kfree(frontend);
+       kfree(frontend);
        kfree(be);
        return err;
 }
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri Nov 11 
14:36:16 2005
@@ -917,7 +917,7 @@
        np->netdev = netdev;
 
  exit:
-       if ((err != 0) && (netdev != NULL))
+       if (err != 0)
                kfree(netdev);
        else if (val != NULL)
                *val = netdev;
@@ -1173,8 +1173,7 @@
  destroy_ring:
        shutdown_device(info);
  out:
-       if (backend)
-               kfree(backend);
+       kfree(backend);
        return err;
 }
 
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c
--- a/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c        Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c        Fri Nov 11 
14:36:16 2005
@@ -167,9 +167,7 @@
 packet_free(struct packet *pak)
 {
        del_singleshot_timer_sync(&pak->processing_timer);
-       if (pak->data_buffer) {
-               kfree(pak->data_buffer);
-       }
+       kfree(pak->data_buffer);
        /*
         * cannot do tpmif_put(pak->tpmif); bad things happen
         * on the last tpmif_put()
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c Fri Nov 11 14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c Fri Nov 11 14:36:16 2005
@@ -41,19 +41,16 @@
 {
        struct backend_info *be = dev->data;
 
-       if (be->watch.node) {
+       if (be->watch.node)
                unregister_xenbus_watch(&be->watch);
-       }
        unregister_xenbus_watch(&be->backend_watch);
 
        tpmif_vtpm_close(be->instance);
 
-       if (be->tpmif) {
+       if (be->tpmif)
                tpmif_put(be->tpmif);
-       }
-
-       if (be->frontpath)
-               kfree(be->frontpath);
+
+       kfree(be->frontpath);
        kfree(be);
        return 0;
 }
@@ -258,8 +255,7 @@
 free_be:
        if (be->backend_watch.node)
                unregister_xenbus_watch(&be->backend_watch);
-       if (frontend)
-               kfree(frontend);
+       kfree(frontend);
        kfree(be);
        return err;
 }
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c      Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c      Fri Nov 11 
14:36:16 2005
@@ -387,8 +387,7 @@
 destroy_tpmring:
        destroy_tpmring(info, &my_private);
 out:
-       if (backend)
-               kfree(backend);
+       kfree(backend);
        return err;
 }
 
diff -r c927e3761a96 -r e002282b79c8 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Fri Nov 11 
14:36:07 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Fri Nov 11 
14:36:16 2005
@@ -570,10 +570,8 @@
        }
 
 fail:
-       if (printf_buffer)
-               kfree(printf_buffer);
-       if (path_buffer)
-               kfree(path_buffer);
+       kfree(printf_buffer);
+       kfree(path_buffer);
 }
 EXPORT_SYMBOL(xenbus_dev_error);
 
diff -r c927e3761a96 -r e002282b79c8 tools/blktap/blkif.c
--- a/tools/blktap/blkif.c      Fri Nov 11 14:36:07 2005
+++ b/tools/blktap/blkif.c      Fri Nov 11 14:36:16 2005
@@ -108,8 +108,7 @@
         }
         pblkif = &curs->hash_next;
     }
-    if (blkif != NULL)
-        free(blkif);
+    free(blkif);
 }
 
 void blkif_register_request_hook(blkif_t *blkif, char *name, 
diff -r c927e3761a96 -r e002282b79c8 tools/blktap/parallax/blockstore.c
--- a/tools/blktap/parallax/blockstore.c        Fri Nov 11 14:36:07 2005
+++ b/tools/blktap/parallax/blockstore.c        Fri Nov 11 14:36:16 2005
@@ -604,8 +604,7 @@
     return block;
 
     err:
-    if (qe->block)
-        free(qe->block);
+    free(qe->block);
     free((void *)qe);
     return NULL;
 }
@@ -1072,7 +1071,7 @@
  *
  *   @return: pointer to new block, NULL on error
  */
-void *newblock() {
+void *newblock(void) {
     void *block = malloc(BLOCK_SIZE);
     if (block == NULL) {
         perror("newblock");
@@ -1089,7 +1088,6 @@
  *   @block: block to be freed
  */
 void freeblock(void *block) {
-    if (block != NULL)
         free(block);
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/blktap/parallax/blockstored.c
--- a/tools/blktap/parallax/blockstored.c       Fri Nov 11 14:36:07 2005
+++ b/tools/blktap/parallax/blockstored.c       Fri Nov 11 14:36:16 2005
@@ -232,7 +232,7 @@
  *
  *   @return: pointer to new block, NULL on error
  */
-void *newblock() {
+void *newblock(void) {
     void *block = malloc(BLOCK_SIZE);
     if (block == NULL) {
         perror("newblock");
@@ -249,7 +249,6 @@
  *   @block: block to be freed
  */
 void freeblock(void *block) {
-    if (block != NULL)
         free(block);
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/blktap/parallax/requests-async.c
--- a/tools/blktap/parallax/requests-async.c    Fri Nov 11 14:36:07 2005
+++ b/tools/blktap/parallax/requests-async.c    Fri Nov 11 14:36:16 2005
@@ -715,7 +715,7 @@
         r.u.i  = -1;
         /* free any saved node vals. */
         for (i=0; i<3; i++)
-            if (req->radix[i] != 0) free(req->radix[i]);
+            free(req->radix[i]);
         free(req);
         cb(r, req_param);
     }
diff -r c927e3761a96 -r e002282b79c8 tools/blktap/xenbus.c
--- a/tools/blktap/xenbus.c     Fri Nov 11 14:36:07 2005
+++ b/tools/blktap/xenbus.c     Fri Nov 11 14:36:16 2005
@@ -339,10 +339,8 @@
     /* Free everything else. */
     if (be->blkif)
         free_blkif(be->blkif);
-    if (be->frontpath)
-        free(be->frontpath);
-    if (be->backpath)
-        free(be->backpath);
+    free(be->frontpath);
+    free(be->backpath);
     free(be);
     return 0;
 }
@@ -406,8 +404,7 @@
     return;
 
  fail:
-    if (fepath)
-        free(fepath);
+    free(fepath);
 }
 
 
@@ -460,9 +457,7 @@
     }
 
  fail:
-    if (path)
-        free(path);
-
+    free(path);
 }
 
 static void blkback_probe(struct xs_handle *h, struct xenbus_watch *w, 
@@ -537,12 +532,10 @@
        return;
 
  free_be:
-       if ((be) && (be->backend_watch.node))
+       if (be && (be->backend_watch.node))
             unregister_xenbus_watch(h, &be->backend_watch);
-       if (frontend)
-            free(frontend);
-        if (bepath)
-            free(bepath);
+        free(frontend);
+        free(bepath);
        free(be);
        return;
 }
diff -r c927e3761a96 -r e002282b79c8 tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Fri Nov 11 14:36:07 2005
+++ b/tools/console/daemon/io.c Fri Nov 11 14:36:16 2005
@@ -344,8 +344,7 @@
 
        return dom;
  out:
-       if (dom->conspath)
-               free(dom->conspath);
+       free(dom->conspath);
        free(dom);
        return NULL;
 }
@@ -380,20 +379,16 @@
        if (!buffer_empty(&d->buffer))
                return;
 
-       if (d->buffer.data) {
-               free(d->buffer.data);
-               d->buffer.data = NULL;
-       }
-
        if (d->tty_fd != -1) {
                close(d->tty_fd);
                d->tty_fd = -1;
        }
 
-       if (d->conspath) {
-               free(d->conspath);
-               d->conspath = NULL;
-       }
+       free(d->buffer.data);
+       d->buffer.data = NULL;
+
+       free(d->conspath);
+       d->conspath = NULL;
 
        remove_domain(d);
 }
diff -r c927e3761a96 -r e002282b79c8 tools/examples/network-bridge
--- a/tools/examples/network-bridge     Fri Nov 11 14:36:07 2005
+++ b/tools/examples/network-bridge     Fri Nov 11 14:36:16 2005
@@ -20,9 +20,9 @@
 #
 # Vars:
 #
-# vifnum     Virtual device number to use (default 0). Numbers >=1
+# vifnum     Virtual device number to use (default 0). Numbers >=8
 #            require the netback driver to have nloopbacks set to a
-#            higher value than its default of 1.
+#            higher value than its default of 8.
 # bridge     The bridge to use (default xenbr${vifnum}).
 # netdev     The interface to add to the bridge (default eth${vifnum}).
 # antispoof  Whether to use iptables to prevent spoofing (default no).
diff -r c927e3761a96 -r e002282b79c8 tools/ioemu/hw/magic-load.c
--- a/tools/ioemu/hw/magic-load.c       Fri Nov 11 14:36:07 2005
+++ b/tools/ioemu/hw/magic-load.c       Fri Nov 11 14:36:16 2005
@@ -196,10 +196,8 @@
        goto error_freesyms;
 
     /* Commit */
-    if (disas_symtab)
-       qemu_free(disas_symtab); /* XXX Merge with old symbols? */
-    if (disas_strtab)
-       qemu_free(disas_strtab);
+    qemu_free(disas_symtab); /* XXX Merge with old symbols? */
+    qemu_free(disas_strtab);
     disas_symtab = syms;
     disas_num_syms = nsyms;
     disas_strtab = str;
diff -r c927e3761a96 -r e002282b79c8 tools/ioemu/vnc.c
--- a/tools/ioemu/vnc.c Fri Nov 11 14:36:07 2005
+++ b/tools/ioemu/vnc.c Fri Nov 11 14:36:16 2005
@@ -187,8 +187,7 @@
 
 static void start_mouse_calibration() {
        int size = screen->height*screen->paddedWidthInBytes;
-       if(mouse_magic->calibration)
-               free(mouse_magic->calibration);
+       free(mouse_magic->calibration);
        mouse_magic->calibration = malloc(size);
        memcpy(mouse_magic->calibration, screen->frameBuffer, size);
        calibration_step=0;
@@ -198,8 +197,7 @@
 }
 
 static void stop_mouse_calibration() {
-       if(mouse_magic->calibration)
-               free(mouse_magic->calibration);
+       free(mouse_magic->calibration);
        mouse_magic->calibration = 0;
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/libxc/Makefile
--- a/tools/libxc/Makefile      Fri Nov 11 14:36:07 2005
+++ b/tools/libxc/Makefile      Fri Nov 11 14:36:16 2005
@@ -102,6 +102,7 @@
        $(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
        ln -sf libxenguest.so.$(MAJOR).$(MINOR) 
$(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
        ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
+       $(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
 
 .PHONY: TAGS clean rpm install all
 
diff -r c927e3761a96 -r e002282b79c8 tools/libxc/xc_ia64_stubs.c
--- a/tools/libxc/xc_ia64_stubs.c       Fri Nov 11 14:36:07 2005
+++ b/tools/libxc/xc_ia64_stubs.c       Fri Nov 11 14:36:16 2005
@@ -77,7 +77,7 @@
 {
     // N.B. gva should be page aligned
     
-    unsigned long *page_array=NULL;
+    unsigned long *page_array = NULL;
     int i;
 
     if ( (page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL ){
@@ -99,8 +99,7 @@
     return 0;
     
 error_out:
-    if (page_array)
-        free(page_array);
+    free(page_array);
     return -1;
 }
 
@@ -603,7 +602,7 @@
                  int memsize,
                  const char *image_name,
                  unsigned int control_evtchn,
-                unsigned int lapic,
+                 unsigned int lapic,
                  unsigned int vcpus,
                  unsigned int store_evtchn,
                  unsigned long *store_mfn)
@@ -657,8 +656,7 @@
         goto error_out;
     }
 
-    if ( image != NULL )
-        free(image);
+    free(image);
 
     ctxt->flags = VGCF_VMX_GUEST;
     ctxt->regs.cr_iip = 0x80000000ffffffb0UL;
@@ -675,9 +673,7 @@
     return rc;
 
  error_out:
-    if ( image != NULL )
-        free(image);
-
+    free(image);
     return -1;
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Fri Nov 11 14:36:07 2005
+++ b/tools/libxc/xc_linux_build.c      Fri Nov 11 14:36:16 2005
@@ -670,10 +670,8 @@
     return 0;
 
  error_out:
-    if ( mmu != NULL )
-        free(mmu);
-    if ( page_array != NULL )
-        free(page_array);
+    free(mmu);
+    free(page_array);
     return -1;
 }
 #endif
@@ -768,8 +766,7 @@
         close(initrd_fd);
     if ( initrd_gfd )
         gzclose(initrd_gfd);
-    if ( image != NULL )
-        free(image);
+    free(image);
 
 #ifdef __ia64__
     /* based on new_thread in xen/arch/ia64/domain.c */
@@ -858,9 +855,7 @@
         gzclose(initrd_gfd);
     else if ( initrd_fd >= 0 )
         close(initrd_fd);
-    if ( image != NULL )
-        free(image);
-
+    free(image);
     return -1;
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/libxc/xc_vmx_build.c
--- a/tools/libxc/xc_vmx_build.c        Fri Nov 11 14:36:07 2005
+++ b/tools/libxc/xc_vmx_build.c        Fri Nov 11 14:36:16 2005
@@ -565,10 +565,8 @@
     return 0;
 
  error_out:
-    if ( mmu != NULL )
-        free(mmu);
-    if ( page_array != NULL )
-        free(page_array);
+    free(mmu);
+    free(page_array);
     return -1;
 }
 
@@ -663,8 +661,7 @@
         goto error_out;
     }
 
-    if ( image != NULL )
-        free(image);
+    free(image);
 
     ctxt->flags = VGCF_VMX_GUEST;
     /* FPU is set up to default initial state. */
@@ -710,9 +707,7 @@
     return rc;
 
  error_out:
-    if ( image != NULL )
-        free(image);
-
+    free(image);
     return -1;
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/python/xen/lowlevel/xs/xs.c
--- a/tools/python/xen/lowlevel/xs/xs.c Fri Nov 11 14:36:07 2005
+++ b/tools/python/xen/lowlevel/xs/xs.c Fri Nov 11 14:36:16 2005
@@ -114,8 +114,7 @@
     }
     val = PyString_FromStringAndSize(xsval, xsval_n);
  exit:
-    if (xsval)
-        free(xsval);
+    free(xsval);
     return val;
 }
 
@@ -427,8 +426,7 @@
     val = Py_None;
  exit:
     Py_XDECREF(tuple0);
-    if (xsperms)
-        free(xsperms);
+    free(xsperms);
     return val;
 }
 
@@ -541,8 +539,7 @@
     /* Create tuple (path, token). */
     val = Py_BuildValue("(sO)", xsval[XS_WATCH_PATH], token);
  exit:
-    if (xsval)
-        free(xsval);
+    free(xsval);
     return val;
 }
 
diff -r c927e3761a96 -r e002282b79c8 tools/vtpm_manager/manager/securestorage.c
--- a/tools/vtpm_manager/manager/securestorage.c        Fri Nov 11 14:36:07 2005
+++ b/tools/vtpm_manager/manager/securestorage.c        Fri Nov 11 14:36:16 2005
@@ -393,8 +393,7 @@
   vtpmlogerror(VTPM_LOG_VTPM, "Failed to load service data with error = %s\n", 
tpm_get_error_name(status));
  egress:
   
-  if (flat_global)
-    free(flat_global);
+  free(flat_global);
   close(fh);
   
   return status;
diff -r c927e3761a96 -r e002282b79c8 tools/vtpm_manager/util/bsg.c
--- a/tools/vtpm_manager/util/bsg.c     Fri Nov 11 14:36:07 2005
+++ b/tools/vtpm_manager/util/bsg.c     Fri Nov 11 14:36:16 2005
@@ -616,8 +616,7 @@
   else if (format == __FMT_SIZE || format == __FMT_HSIZE) {
     s += size;
     BSG_BYTE* ptr = *(BSG_BYTE**) s;
-    if (ptr)
-      free(ptr);
+    free(ptr);
     s += sizeof(void*);
   } else if (format == __FMT_PACKED) {
 
diff -r c927e3761a96 -r e002282b79c8 tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c    Fri Nov 11 14:36:07 2005
+++ b/tools/xenstat/libxenstat/src/xenstat.c    Fri Nov 11 14:36:16 2005
@@ -284,10 +284,8 @@
 
        if (node) {
                if (node->domains) {
-                       for (i = 0; i < node->num_domains; i++) {
-                               if (node->domains[i].name)
-                                       free(node->domains[i].name);
-                       }
+                       for (i = 0; i < node->num_domains; i++)
+                               free(node->domains[i].name);
 
                        for (i = 0; i < NUM_COLLECTORS; i++)
                                if((node->flags & collectors[i].flag)
diff -r c927e3761a96 -r e002282b79c8 tools/xenstore/xenstored_core.c
--- a/tools/xenstore/xenstored_core.c   Fri Nov 11 14:36:07 2005
+++ b/tools/xenstore/xenstored_core.c   Fri Nov 11 14:36:16 2005
@@ -1410,8 +1410,6 @@
                barf_perror("Could not create initial node %s", name);
        talloc_free(node);
 }
-
-#
 
 static void setup_structure(void)
 {
diff -r c927e3761a96 -r e002282b79c8 xen/acm/acm_chinesewall_hooks.c
--- a/xen/acm/acm_chinesewall_hooks.c   Fri Nov 11 14:36:07 2005
+++ b/xen/acm/acm_chinesewall_hooks.c   Fri Nov 11 14:36:16 2005
@@ -117,8 +117,7 @@
 static void chwall_free_domain_ssid(void *chwall_ssid)
 {
     traceprintk("%s.\n", __func__);
-    if (chwall_ssid != NULL)
-        xfree(chwall_ssid);
+    xfree(chwall_ssid);
     return;
 }
 
@@ -344,14 +343,10 @@
     chwall_bin_pol.max_types = chwall_buf->chwall_max_types;
     chwall_bin_pol.max_ssidrefs = chwall_buf->chwall_max_ssidrefs;
     chwall_bin_pol.max_conflictsets = chwall_buf->chwall_max_conflictsets;
-    if (chwall_bin_pol.ssidrefs != NULL)
-        xfree(chwall_bin_pol.ssidrefs);
-    if (chwall_bin_pol.conflict_aggregate_set != NULL)
-        xfree(chwall_bin_pol.conflict_aggregate_set);
-    if (chwall_bin_pol.running_types != NULL)
-        xfree(chwall_bin_pol.running_types);
-    if (chwall_bin_pol.conflict_sets != NULL)
-        xfree(chwall_bin_pol.conflict_sets);
+    xfree(chwall_bin_pol.ssidrefs);
+    xfree(chwall_bin_pol.conflict_aggregate_set);
+    xfree(chwall_bin_pol.running_types);
+    xfree(chwall_bin_pol.conflict_sets);
     chwall_bin_pol.ssidrefs = ssids;
     chwall_bin_pol.conflict_aggregate_set = conflict_aggregate_set;
     chwall_bin_pol.running_types = running_types;
@@ -360,14 +355,10 @@
 
  error_free:
     printk("%s: ERROR setting policy.\n", __func__);
-    if (ssids != NULL)
-        xfree(ssids);
-    if (conflict_sets != NULL)
-        xfree(conflict_sets);
-    if (running_types != NULL)
-        xfree(running_types);
-    if (conflict_aggregate_set != NULL)
-        xfree(conflict_aggregate_set);
+    xfree(ssids);
+    xfree(conflict_sets);
+    xfree(running_types);
+    xfree(conflict_aggregate_set);
     return -EFAULT;
 }
 
diff -r c927e3761a96 -r e002282b79c8 xen/acm/acm_simple_type_enforcement_hooks.c
--- a/xen/acm/acm_simple_type_enforcement_hooks.c       Fri Nov 11 14:36:07 2005
+++ b/xen/acm/acm_simple_type_enforcement_hooks.c       Fri Nov 11 14:36:16 2005
@@ -130,8 +130,7 @@
 ste_free_domain_ssid(void *ste_ssid)
 {
     traceprintk("%s.\n", __func__);
-    if (ste_ssid != NULL)
-        xfree(ste_ssid);
+    xfree(ste_ssid);
     return;
 }
 
@@ -320,8 +319,7 @@
     /* 3. replace old policy (activate new policy) */
     ste_bin_pol.max_types = ste_buf->ste_max_types;
     ste_bin_pol.max_ssidrefs = ste_buf->ste_max_ssidrefs;
-    if (ste_bin_pol.ssidrefs) 
-        xfree(ste_bin_pol.ssidrefs);
+    xfree(ste_bin_pol.ssidrefs);
     ste_bin_pol.ssidrefs = (domaintype_t *)ssidrefsbuf;
 
     /* clear all ste caches */
@@ -338,7 +336,7 @@
 
  error_free:
     printk("%s: ERROR setting policy.\n", __func__);
-    if (ssidrefsbuf != NULL) xfree(ssidrefsbuf);
+    xfree(ssidrefsbuf);
     return -EFAULT;
 }
 
diff -r c927e3761a96 -r e002282b79c8 xen/arch/ia64/linux-xen/sal.c
--- a/xen/arch/ia64/linux-xen/sal.c     Fri Nov 11 14:36:07 2005
+++ b/xen/arch/ia64/linux-xen/sal.c     Fri Nov 11 14:36:16 2005
@@ -14,12 +14,12 @@
 #include <linux/spinlock.h>
 #include <linux/string.h>
 
+#ifdef XEN
+#include <linux/smp.h>
+#endif
 #include <asm/page.h>
 #include <asm/sal.h>
 #include <asm/pal.h>
-#ifdef XEN
-#include <linux/smp.h>
-#endif
 
  __cacheline_aligned DEFINE_SPINLOCK(sal_lock);
 unsigned long sal_platform_features;
diff -r c927e3761a96 -r e002282b79c8 xen/arch/ia64/xen/grant_table.c
--- a/xen/arch/ia64/xen/grant_table.c   Fri Nov 11 14:36:07 2005
+++ b/xen/arch/ia64/xen/grant_table.c   Fri Nov 11 14:36:16 2005
@@ -1348,8 +1348,7 @@
     if ( t != NULL )
     {
         xfree(t->active);
-        if ( t->maptrack != NULL )
-            free_xenheap_page(t->maptrack);
+        free_xenheap_page(t->maptrack);
         xfree(t);
     }
     return -ENOMEM;
diff -r c927e3761a96 -r e002282b79c8 xen/arch/ia64/xen/process.c
--- a/xen/arch/ia64/xen/process.c       Fri Nov 11 14:36:07 2005
+++ b/xen/arch/ia64/xen/process.c       Fri Nov 11 14:36:16 2005
@@ -760,6 +760,22 @@
            case 30:
                // FIXME: Should we handle unaligned refs in Xen??
                vector = IA64_UNALIGNED_REF_VECTOR; break;
+           case 32:
+               printf("ia64_handle_reflection: handling FP fault");
+               vector = IA64_FP_FAULT_VECTOR; break;
+           case 33:
+               printf("ia64_handle_reflection: handling FP trap");
+               vector = IA64_FP_TRAP_VECTOR; break;
+           case 34:
+               printf("ia64_handle_reflection: handling lowerpriv trap");
+               vector = IA64_LOWERPRIV_TRANSFER_TRAP_VECTOR; break;
+           case 35:
+               printf("ia64_handle_reflection: handling taken branch trap");
+               vector = IA64_TAKEN_BRANCH_TRAP_VECTOR; break;
+           case 36:
+               printf("ia64_handle_reflection: handling single step trap");
+               vector = IA64_SINGLE_STEP_TRAP_VECTOR; break;
+
            default:
                printf("ia64_handle_reflection: unhandled 
vector=0x%lx\n",vector);
                while(vector);
diff -r c927e3761a96 -r e002282b79c8 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Fri Nov 11 14:36:07 2005
+++ b/xen/arch/x86/mm.c Fri Nov 11 14:36:16 2005
@@ -3369,10 +3369,8 @@
 
     if ( (x == NULL) || (y == NULL) )
     {
-        if ( x != NULL )
-            free_xenheap_page(x);
-        if ( y != NULL )
-            free_xenheap_page(y);
+        free_xenheap_page(x);
+        free_xenheap_page(y);
         return -ENOMEM;
     }
 
diff -r c927e3761a96 -r e002282b79c8 xen/arch/x86/mtrr/generic.c
--- a/xen/arch/x86/mtrr/generic.c       Fri Nov 11 14:36:07 2005
+++ b/xen/arch/x86/mtrr/generic.c       Fri Nov 11 14:36:16 2005
@@ -71,8 +71,7 @@
 /*  Free resources associated with a struct mtrr_state  */
 void __init finalize_mtrr_state(void)
 {
-       if (mtrr_state.var_ranges)
-               xfree(mtrr_state.var_ranges);
+       xfree(mtrr_state.var_ranges);
        mtrr_state.var_ranges = NULL;
 }
 
diff -r c927e3761a96 -r e002282b79c8 xen/arch/x86/vmx_io.c
--- a/xen/arch/x86/vmx_io.c     Fri Nov 11 14:36:07 2005
+++ b/xen/arch/x86/vmx_io.c     Fri Nov 11 14:36:16 2005
@@ -459,14 +459,56 @@
         }
         break;
 
-    case INSTR_MOVZ:
+    case INSTR_MOVZX:
         if (dst & REGISTER) {
+            switch (size) {
+            case BYTE:
+                p->u.data &= 0xFFULL;
+                break;
+
+            case WORD:
+                p->u.data &= 0xFFFFULL;
+                break;
+
+            case LONG:
+                p->u.data &= 0xFFFFFFFFULL;
+                break;
+
+            default:
+                printk("Impossible source operand size of movzx instr: %d\n", 
size);
+                domain_crash_synchronous();
+            }
             index = operand_index(dst);
+            set_reg_value(operand_size(dst), index, 0, regs, p->u.data);
+        }
+        break;
+
+    case INSTR_MOVSX:
+        if (dst & REGISTER) {
             switch (size) {
-            case BYTE: p->u.data = p->u.data & 0xFFULL; break;
-            case WORD: p->u.data = p->u.data & 0xFFFFULL; break;
-            case LONG: p->u.data = p->u.data & 0xFFFFFFFFULL; break;
+            case BYTE:
+                p->u.data &= 0xFFULL;
+                if ( p->u.data & 0x80ULL )
+                    p->u.data |= 0xFFFFFFFFFFFFFF00ULL;
+                break;
+
+            case WORD:
+                p->u.data &= 0xFFFFULL;
+                if ( p->u.data & 0x8000ULL )
+                    p->u.data |= 0xFFFFFFFFFFFF0000ULL;
+                break;
+
+            case LONG:
+                p->u.data &= 0xFFFFFFFFULL;
+                if ( p->u.data & 0x80000000ULL )
+                    p->u.data |= 0xFFFFFFFF00000000ULL;
+                break;
+
+            default:
+                printk("Impossible source operand size of movsx instr: %d\n", 
size);
+                domain_crash_synchronous();
             }
+            index = operand_index(dst);
             set_reg_value(operand_size(dst), index, 0, regs, p->u.data);
         }
         break;
diff -r c927e3761a96 -r e002282b79c8 xen/arch/x86/vmx_platform.c
--- a/xen/arch/x86/vmx_platform.c       Fri Nov 11 14:36:07 2005
+++ b/xen/arch/x86/vmx_platform.c       Fri Nov 11 14:36:16 2005
@@ -581,25 +581,39 @@
     }
 
     switch (*++opcode) {
-    case 0xB6: /* movz m8, r16/r32 */
-        instr->instr = INSTR_MOVZ;
+    case 0xB6: /* movzx m8, r16/r32/r64 */
+        instr->instr = INSTR_MOVZX;
         GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
         index = get_index(opcode + 1, rex);
         instr->operand[0] = mk_operand(BYTE, 0, 0, MEMORY);
         instr->operand[1] = mk_operand(instr->op_size, index, 0, REGISTER);
         return DECODE_success;
 
-    case 0xB7: /* movz m16/m32, r32/r64 */
-        instr->instr = INSTR_MOVZ;
+    case 0xB7: /* movzx m16/m32, r32/r64 */
+        instr->instr = INSTR_MOVZX;
+        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
         index = get_index(opcode + 1, rex);
-        if (rex & 0x8) {
-            instr->op_size = LONG;
-            instr->operand[1] = mk_operand(QUAD, index, 0, REGISTER);
-        } else {
-            instr->op_size = WORD;
-            instr->operand[1] = mk_operand(LONG, index, 0, REGISTER);
-        }
-        instr->operand[0] = mk_operand(instr->op_size, 0, 0, MEMORY);
+        if (rex & 0x8)
+            instr->operand[0] = mk_operand(LONG, 0, 0, MEMORY);
+        else
+            instr->operand[0] = mk_operand(WORD, 0, 0, MEMORY);
+        instr->operand[1] = mk_operand(instr->op_size, index, 0, REGISTER);
+        return DECODE_success;
+
+    case 0xBE: /* movsx m8, r16/r32/r64 */
+        instr->instr = INSTR_MOVSX;
+        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
+        index = get_index(opcode + 1, rex);
+        instr->operand[0] = mk_operand(BYTE, 0, 0, MEMORY);
+        instr->operand[1] = mk_operand(instr->op_size, index, 0, REGISTER);
+        return DECODE_success;
+
+    case 0xBF: /* movsx m16, r32/r64 */
+        instr->instr = INSTR_MOVSX;
+        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
+        index = get_index(opcode + 1, rex);
+        instr->operand[0] = mk_operand(WORD, 0, 0, MEMORY);
+        instr->operand[1] = mk_operand(instr->op_size, index, 0, REGISTER);
         return DECODE_success;
 
     case 0xA3: /* bt r32, m32 */
@@ -702,7 +716,7 @@
         send_mmio_req(type, gpa, 1, inst->op_size, value, IOREQ_WRITE, 0);
     } else if (inst->operand[0] & MEMORY) { /* dest is register */
         /* send the request and wait for the value */
-        if (inst->instr == INSTR_MOVZ)
+        if ( (inst->instr == INSTR_MOVZX) || (inst->instr == INSTR_MOVSX) )
             send_mmio_req(type, gpa, 1, size_reg, 0, IOREQ_READ, 0);
         else
             send_mmio_req(type, gpa, 1, inst->op_size, 0, IOREQ_READ, 0);
@@ -827,7 +841,8 @@
         break;
     }
 
-    case INSTR_MOVZ:
+    case INSTR_MOVZX:
+    case INSTR_MOVSX:
         mmio_operands(IOREQ_TYPE_COPY, gpa, &mmio_inst, mmio_opp, regs);
         break;
 
diff -r c927e3761a96 -r e002282b79c8 xen/arch/x86/vmx_vlapic.c
--- a/xen/arch/x86/vmx_vlapic.c Fri Nov 11 14:36:07 2005
+++ b/xen/arch/x86/vmx_vlapic.c Fri Nov 11 14:36:16 2005
@@ -567,7 +567,9 @@
 
     if ( len != 4) {
         /* some bugs on kernel cause read this with byte*/
-        printk("Local APIC read with len = %lx, should be 4 instead\n", len);
+        VMX_DBG_LOG(DBG_LEVEL_VLAPIC,
+                    "Local APIC read with len = %lx, should be 4 instead\n",
+                    len);
     }
 
     alignment = offset & 0x3;
diff -r c927e3761a96 -r e002282b79c8 xen/arch/x86/vmx_vmcs.c
--- a/xen/arch/x86/vmx_vmcs.c   Fri Nov 11 14:36:07 2005
+++ b/xen/arch/x86/vmx_vmcs.c   Fri Nov 11 14:36:16 2005
@@ -564,19 +564,14 @@
 
 void destroy_vmcs(struct arch_vmx_struct *arch_vmx)
 {
-    if(arch_vmx->vmcs != NULL)
-        free_vmcs(arch_vmx->vmcs);
-    if(arch_vmx->io_bitmap_a != 0) {
-        free_xenheap_pages(
-            arch_vmx->io_bitmap_a, get_order_from_bytes(0x1000));
-        arch_vmx->io_bitmap_a = 0;
-    }
-    if(arch_vmx->io_bitmap_b != 0) {
-        free_xenheap_pages(
-            arch_vmx->io_bitmap_b, get_order_from_bytes(0x1000));
-        arch_vmx->io_bitmap_b = 0;
-    }
-    arch_vmx->vmcs = 0;
+    free_vmcs(arch_vmx->vmcs);
+    arch_vmx->vmcs = NULL;
+
+    free_xenheap_pages(arch_vmx->io_bitmap_a, get_order_from_bytes(0x1000));
+    arch_vmx->io_bitmap_a = NULL;
+
+    free_xenheap_pages(arch_vmx->io_bitmap_b, get_order_from_bytes(0x1000));
+    arch_vmx->io_bitmap_b = NULL;
 }
 
 /*
diff -r c927e3761a96 -r e002282b79c8 xen/common/event_channel.c
--- a/xen/common/event_channel.c        Fri Nov 11 14:36:07 2005
+++ b/xen/common/event_channel.c        Fri Nov 11 14:36:16 2005
@@ -621,8 +621,7 @@
             (void)__evtchn_close(d, i);
 
     for ( i = 0; i < NR_EVTCHN_BUCKETS; i++ )
-        if ( d->evtchn[i] != NULL )
-            xfree(d->evtchn[i]);
+        xfree(d->evtchn[i]);
 }
 
 /*
diff -r c927e3761a96 -r e002282b79c8 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Fri Nov 11 14:36:07 2005
+++ b/xen/common/grant_table.c  Fri Nov 11 14:36:16 2005
@@ -1107,8 +1107,7 @@
     if ( t != NULL )
     {
         xfree(t->active);
-        if ( t->maptrack != NULL )
-            free_xenheap_page(t->maptrack);
+        free_xenheap_page(t->maptrack);
         xfree(t);
     }
     return -ENOMEM;
diff -r c927e3761a96 -r e002282b79c8 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Fri Nov 11 14:36:07 2005
+++ b/xen/common/page_alloc.c   Fri Nov 11 14:36:16 2005
@@ -470,6 +470,9 @@
 {
     unsigned long flags;
 
+    if ( v == NULL )
+        return;
+
     memguard_guard_range(v, 1 << (order + PAGE_SHIFT));    
 
     local_irq_save(flags);
diff -r c927e3761a96 -r e002282b79c8 xen/include/asm-x86/vmx_platform.h
--- a/xen/include/asm-x86/vmx_platform.h        Fri Nov 11 14:36:07 2005
+++ b/xen/include/asm-x86/vmx_platform.h        Fri Nov 11 14:36:16 2005
@@ -55,17 +55,18 @@
 #define REPNZ   0x2
 #define OVERLAP 0x4
 
-#define INSTR_PIO 1
-#define INSTR_OR 2
-#define INSTR_AND 3
-#define INSTR_XOR 4
-#define INSTR_CMP 5
-#define INSTR_MOV 6
-#define INSTR_MOVS 7
-#define INSTR_MOVZ 8
-#define INSTR_STOS 9
-#define INSTR_TEST 10
-#define INSTR_BT 11
+#define INSTR_PIO   1
+#define INSTR_OR    2
+#define INSTR_AND   3
+#define INSTR_XOR   4
+#define INSTR_CMP   5
+#define INSTR_MOV   6
+#define INSTR_MOVS  7
+#define INSTR_MOVZX 8
+#define INSTR_MOVSX 9
+#define INSTR_STOS  10
+#define INSTR_TEST  11
+#define INSTR_BT    12
 
 struct instruction {
     __s8    instr; /* instruction type */
diff -r c927e3761a96 -r e002282b79c8 docs/src/user/securing_xen.tex
--- /dev/null   Fri Nov 11 14:36:07 2005
+++ b/docs/src/user/securing_xen.tex    Fri Nov 11 14:36:16 2005
@@ -0,0 +1,85 @@
+\chapter{Securing Xen}
+
+This chapter describes how to secure a Xen system. It describes a number
+of scenarios and provides a corresponding set of best practices. It
+begins with a section devoted to understanding the security implications
+of a Xen system.
+
+
+\section{Xen Security Considerations}
+
+When deploying a Xen system, one must be sure to secure the management
+domain (Domain-0) as much as possible. If the management domain is
+compromised, all other domains are also vulnerable. The following are a
+set of best practices for Domain-0:
+
+\begin{enumerate}
+\item \textbf{Run the smallest number of necessary services.} The less
+  things that are present in a management partition, the better.
+  Remember, a service running as root in the management domain has full
+  access to all other domains on the system.
+\item \textbf{Use a firewall to restrict the traffic to the management
+    domain.} A firewall with default-reject rules will help prevent
+  attacks on the management domain.
+\item \textbf{Do not allow users to access Domain-0.} The Linux kernel
+  has been known to have local-user root exploits. If you allow normal
+  users to access Domain-0 (even as unprivileged users) you run the risk
+  of a kernel exploit making all of your domains vulnerable.
+\end{enumerate}
+
+\section{Security Scenarios}
+
+
+\subsection{The Isolated Management Network}
+
+In this scenario, each node has two network cards in the cluster. One
+network card is connected to the outside world and one network card is a
+physically isolated management network specifically for Xen instances to
+use.
+
+As long as all of the management partitions are trusted equally, this is
+the most secure scenario. No additional configuration is needed other
+than forcing Xend to bind to the management interface for relocation.
+
+\textbf{FIXME:} What is the option to allow for this?
+
+
+\subsection{A Subnet Behind a Firewall}
+
+In this scenario, each node has only one network card but the entire
+cluster sits behind a firewall. This firewall should do at least the
+following:
+
+\begin{enumerate}
+\item Prevent IP spoofing from outside of the subnet.
+\item Prevent access to the relocation port of any of the nodes in the
+  cluster except from within the cluster.
+\end{enumerate}
+
+The following iptables rules can be used on each node to prevent
+migrations to that node from outside the subnet assuming the main
+firewall does not do this for you:
+
+\begin{verbatim}
+# this command disables all access to the Xen relocation
+# port:
+iptables -A INPUT -p tcp --destination-port 8002 -j REJECT
+
+# this command enables Xen relocations only from the specific
+# subnet:
+iptables -I INPUT -p tcp -{}-source 192.168.1.1/8 \
+    --destination-port 8002 -j ACCEPT
+\end{verbatim}
+
+\subsection{Nodes on an Untrusted Subnet}
+
+Migration on an untrusted subnet is not safe in current versions of Xen.
+It may be possible to perform migrations through a secure tunnel via an
+VPN or SSH. The only safe option in the absence of a secure tunnel is to
+disable migration completely. The easiest way to do this is with
+iptables:
+
+\begin{verbatim}
+# this command disables all access to the Xen relocation port
+iptables -A INPUT -p tcp -{}-destination-port 8002 -j REJECT
+\end{verbatim}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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