WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] merge with xen-unstable.hg

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] merge with xen-unstable.hg
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Oct 2006 12:11:35 +0000
Delivery-date: Thu, 26 Oct 2006 05:19:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID d246b79986d12e99db87339ba57bdac067950ec5
# Parent  aa8ca06d209e34db5ae2573e0fcc22c602ce6510
# Parent  fd5140c2854fe99e1181546383b40de6210f41ee
merge with xen-unstable.hg
---
 tools/xm-test/ramdisk/configs/buildroot                       |  330 ---------
 .hgignore                                                     |   11 
 linux-2.6-xen-sparse/drivers/xen/balloon/Makefile             |    2 
 linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c            |   91 +-
 linux-2.6-xen-sparse/drivers/xen/balloon/common.h             |   58 +
 linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c              |  165 ++++
 linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c            |   16 
 linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c              |  304 +++++---
 linux-2.6-xen-sparse/drivers/xen/netback/common.h             |    5 
 linux-2.6-xen-sparse/drivers/xen/netback/interface.c          |   54 -
 linux-2.6-xen-sparse/drivers/xen/netback/netback.c            |   43 -
 linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c             |    2 
 tools/ioemu/patches/domain-timeoffset                         |    8 
 tools/ioemu/patches/hypervisor-rtc                            |   26 
 tools/ioemu/patches/ide-cd-dma                                |   18 
 tools/ioemu/patches/qemu-bootorder                            |   22 
 tools/ioemu/patches/qemu-cleanup                              |   33 
 tools/ioemu/patches/qemu-daemonize                            |    4 
 tools/ioemu/patches/qemu-logging                              |    3 
 tools/ioemu/patches/qemu-target-i386-dm                       |   18 
 tools/ioemu/patches/serial-port-rate-limit                    |   47 +
 tools/ioemu/patches/series                                    |    6 
 tools/ioemu/patches/vnc-access-monitor-vt                     |    8 
 tools/ioemu/patches/vnc-backoff-screen-scan                   |   42 -
 tools/ioemu/patches/vnc-display-find-unused                   |   15 
 tools/ioemu/patches/vnc-fixes                                 |   17 
 tools/ioemu/patches/vnc-listen-specific-interface             |  142 ++++
 tools/ioemu/patches/vnc-password                              |  119 +++
 tools/ioemu/patches/vnc-protocol-fixes                        |   46 +
 tools/ioemu/patches/vnc-start-vncviewer                       |    8 
 tools/ioemu/patches/vnc-title-domain-name                     |    8 
 tools/ioemu/patches/xen-build                                 |   13 
 tools/ioemu/patches/xen-platform-device                       |   12 
 tools/ioemu/patches/xen-support-buffered-ioreqs               |    8 
 tools/ioemu/patches/xenstore-block-device-config              |   47 -
 tools/ioemu/patches/xenstore-write-vnc-port                   |   12 
 tools/libxc/xc_acm.c                                          |    6 
 tools/libxc/xc_domain.c                                       |   25 
 tools/libxc/xc_evtchn.c                                       |    6 
 tools/libxc/xc_hvm_build.c                                    |    6 
 tools/libxc/xc_linux_build.c                                  |    6 
 tools/libxc/xc_linux_restore.c                                |    8 
 tools/libxc/xc_linux_save.c                                   |   16 
 tools/libxc/xc_misc.c                                         |    4 
 tools/libxc/xc_private.c                                      |  112 +--
 tools/libxc/xc_private.h                                      |   11 
 tools/libxc/xc_tbuf.c                                         |    4 
 tools/libxc/xg_private.c                                      |   16 
 tools/misc/xenperf.c                                          |   26 
 tools/python/xen/lowlevel/acm/acm.c                           |   19 
 tools/python/xen/util/security.py                             |    9 
 tools/python/xen/xend/XendDomain.py                           |    3 
 tools/python/xen/xend/XendDomainInfo.py                       |   12 
 tools/python/xen/xm/create.py                                 |   16 
 tools/python/xen/xm/opts.py                                   |    6 
 tools/xm-test/README                                          |    4 
 tools/xm-test/configure.ac                                    |    4 
 tools/xm-test/lib/XmTestLib/Console.py                        |    5 
 tools/xm-test/lib/XmTestLib/XenDomain.py                      |   76 --
 tools/xm-test/lib/XmTestLib/acm.py                            |    2 
 tools/xm-test/lib/XmTestLib/arch.py                           |  148 ++++
 tools/xm-test/lib/XmTestReport/OSReport.py                    |   10 
 tools/xm-test/lib/XmTestReport/arch.py                        |   48 +
 tools/xm-test/ramdisk/Makefile.am                             |   42 -
 tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img         |   45 +
 tools/xm-test/ramdisk/configs/buildroot-i386                  |  346 ++++++++++
 tools/xm-test/ramdisk/configs/buildroot-powerpc               |  338 +++++++++
 tools/xm-test/runtest.sh                                      |   11 
 tools/xm-test/tests/create/11_create_concurrent_pos.py        |    2 
 tools/xm-test/tests/create/12_create_concurrent_stress_pos.py |    9 
 tools/xm-test/tests/create/15_create_smallmem_pos.py          |    4 
 tools/xm-test/tests/create/16_create_smallmem_neg.py          |    8 
 xen/arch/ia64/linux-xen/setup.c                               |    2 
 xen/arch/ia64/vmx/mmio.c                                      |   14 
 xen/arch/ia64/vmx/vmx_phy_mode.c                              |    8 
 xen/arch/ia64/vmx/vmx_vcpu.c                                  |    2 
 xen/arch/ia64/vmx/vmx_virt.c                                  |    6 
 xen/arch/ia64/xen/dom0_ops.c                                  |    6 
 xen/arch/ia64/xen/dom_fw.c                                    |   26 
 xen/arch/ia64/xen/domain.c                                    |   14 
 xen/arch/ia64/xen/faults.c                                    |   36 -
 xen/arch/ia64/xen/fw_emul.c                                   |   54 -
 xen/arch/ia64/xen/hypercall.c                                 |   12 
 xen/arch/ia64/xen/hyperprivop.S                               |    2 
 xen/arch/ia64/xen/irq.c                                       |    2 
 xen/arch/ia64/xen/mm.c                                        |   10 
 xen/arch/ia64/xen/privop.c                                    |   22 
 xen/arch/ia64/xen/regionreg.c                                 |    8 
 xen/arch/ia64/xen/tlb_track.c                                 |    2 
 xen/arch/ia64/xen/vcpu.c                                      |   96 +-
 xen/arch/ia64/xen/vhpt.c                                      |    6 
 xen/arch/ia64/xen/xencomm.c                                   |    6 
 xen/arch/ia64/xen/xenmisc.c                                   |    4 
 xen/arch/ia64/xen/xensetup.c                                  |    6 
 xen/arch/ia64/xen/xentime.c                                   |    2 
 xen/arch/powerpc/backtrace.c                                  |   20 
 xen/arch/powerpc/domain.c                                     |    8 
 xen/arch/powerpc/of-devwalk.c                                 |   18 
 xen/arch/powerpc/powerpc64/domain.c                           |    6 
 xen/arch/x86/boot/x86_32.S                                    |    2 
 xen/arch/x86/boot/x86_64.S                                    |    2 
 xen/arch/x86/domain.c                                         |    8 
 xen/arch/x86/hvm/hvm.c                                        |   13 
 xen/arch/x86/hvm/io.c                                         |    2 
 xen/arch/x86/hvm/platform.c                                   |    9 
 xen/arch/x86/hvm/svm/intr.c                                   |    2 
 xen/arch/x86/hvm/svm/svm.c                                    |   38 -
 xen/arch/x86/hvm/svm/vmcb.c                                   |   36 -
 xen/arch/x86/hvm/svm/x86_32/exits.S                           |    3 
 xen/arch/x86/hvm/svm/x86_64/exits.S                           |    2 
 xen/arch/x86/hvm/vmx/vmx.c                                    |    4 
 xen/arch/x86/hvm/vmx/x86_32/exits.S                           |    3 
 xen/arch/x86/hvm/vmx/x86_64/exits.S                           |    2 
 xen/arch/x86/setup.c                                          |    2 
 xen/arch/x86/x86_32/entry.S                                   |    2 
 xen/arch/x86/x86_32/supervisor_mode_kernel.S                  |    2 
 xen/arch/x86/x86_64/entry.S                                   |    2 
 xen/common/sched_sedf.c                                       |    6 
 xen/drivers/char/console.c                                    |    2 
 xen/include/asm-ia64/config.h                                 |    2 
 xen/include/asm-ia64/vcpu.h                                   |    2 
 xen/include/xen/event.h                                       |    7 
 xen/include/xen/lib.h                                         |    3 
 123 files changed, 2559 insertions(+), 1171 deletions(-)

diff -r aa8ca06d209e -r d246b79986d1 .hgignore
--- a/.hgignore Tue Oct 24 10:08:30 2006 -0600
+++ b/.hgignore Tue Oct 24 11:21:48 2006 -0600
@@ -184,6 +184,17 @@
 ^tools/xentrace/xenctx$
 ^tools/xentrace/xentrace$
 ^tools/xm-test/ramdisk/buildroot
+^tools/xm-test/aclocal.m4$
+^tools/xm-test/autom4te
+^tools/xm-test/install-sh$
+^tools/xm-test/mkinstalldirs$
+^tools/xm-test/missing$
+^tools/xm-test/config(ure|.log|.status|.guess|.sub)$
+^tools/xm-test/Makefile(.in)*$
+^tools/xm-test/.*/Makefile(.in)*$
+^tools/xm-test/lib/XmTestLib/config.py$
+^tools/xm-test/lib/XmTestReport/xmtest.py$
+^tools/xm-test/tests/.*\.test$
 ^xen/BLOG$
 ^xen/TAGS$
 ^xen/arch/x86/asm-offsets\.s$
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/balloon/Makefile
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/Makefile Tue Oct 24 10:08:30 
2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/Makefile Tue Oct 24 11:21:48 
2006 -0600
@@ -1,2 +1,2 @@
 
-obj-y += balloon.o
+obj-y := balloon.o sysfs.o
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
--- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Tue Oct 24 
10:08:30 2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c        Tue Oct 24 
11:21:48 2006 -0600
@@ -53,10 +53,8 @@
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
 #include <linux/list.h>
-
 #include <xen/xenbus.h>
-
-#define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10))
+#include "common.h"
 
 #ifdef CONFIG_PROC_FS
 static struct proc_dir_entry *balloon_pde;
@@ -71,9 +69,7 @@ static DECLARE_MUTEX(balloon_mutex);
  */
 DEFINE_SPINLOCK(balloon_lock);
 
-/* We aim for 'current allocation' == 'target allocation'. */
-static unsigned long current_pages;
-static unsigned long target_pages;
+struct balloon_stats balloon_stats;
 
 /* We increase/decrease in batches which fit in a page */
 static unsigned long frame_list[PAGE_SIZE / sizeof(unsigned long)];
@@ -81,18 +77,8 @@ static unsigned long frame_list[PAGE_SIZ
 /* VM /proc information for memory */
 extern unsigned long totalram_pages;
 
-/* We may hit the hard limit in Xen. If we do then we remember it. */
-static unsigned long hard_limit;
-
-/*
- * Drivers may alter the memory reservation independently, but they must
- * inform the balloon driver so that we can avoid hitting the hard limit.
- */
-static unsigned long driver_pages;
-
 /* List of ballooned pages, threaded through the mem_map array. */
 static LIST_HEAD(ballooned_pages);
-static unsigned long balloon_low, balloon_high;
 
 /* Main work function, always executed in process context. */
 static void balloon_process(void *unused);
@@ -124,10 +110,10 @@ static void balloon_append(struct page *
        /* Lowmem is re-populated first, so highmem pages go at list tail. */
        if (PageHighMem(page)) {
                list_add_tail(PAGE_TO_LIST(page), &ballooned_pages);
-               balloon_high++;
+               bs.balloon_high++;
        } else {
                list_add(PAGE_TO_LIST(page), &ballooned_pages);
-               balloon_low++;
+               bs.balloon_low++;
        }
 }
 
@@ -143,9 +129,9 @@ static struct page *balloon_retrieve(voi
        UNLIST_PAGE(page);
 
        if (PageHighMem(page))
-               balloon_high--;
+               bs.balloon_high--;
        else
-               balloon_low--;
+               bs.balloon_low--;
 
        return page;
 }
@@ -172,9 +158,9 @@ static void balloon_alarm(unsigned long 
 
 static unsigned long current_target(void)
 {
-       unsigned long target = min(target_pages, hard_limit);
-       if (target > (current_pages + balloon_low + balloon_high))
-               target = current_pages + balloon_low + balloon_high;
+       unsigned long target = min(bs.target_pages, bs.hard_limit);
+       if (target > (bs.current_pages + bs.balloon_low + bs.balloon_high))
+               target = bs.current_pages + bs.balloon_low + bs.balloon_high;
        return target;
 }
 
@@ -216,7 +202,8 @@ static int increase_reservation(unsigned
                        BUG_ON(ret != rc);
                }
                if (rc >= 0)
-                       hard_limit = current_pages + rc - driver_pages;
+                       bs.hard_limit = (bs.current_pages + rc -
+                                        bs.driver_pages);
                goto out;
        }
 
@@ -248,8 +235,8 @@ static int increase_reservation(unsigned
                __free_page(page);
        }
 
-       current_pages += nr_pages;
-       totalram_pages = current_pages;
+       bs.current_pages += nr_pages;
+       totalram_pages = bs.current_pages;
 
  out:
        balloon_unlock(flags);
@@ -317,8 +304,8 @@ static int decrease_reservation(unsigned
        ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation, &reservation);
        BUG_ON(ret != nr_pages);
 
-       current_pages -= nr_pages;
-       totalram_pages = current_pages;
+       bs.current_pages -= nr_pages;
+       totalram_pages = bs.current_pages;
 
        balloon_unlock(flags);
 
@@ -339,7 +326,7 @@ static void balloon_process(void *unused
        down(&balloon_mutex);
 
        do {
-               credit = current_target() - current_pages;
+               credit = current_target() - bs.current_pages;
                if (credit > 0)
                        need_sleep = (increase_reservation(credit) != 0);
                if (credit < 0)
@@ -352,18 +339,18 @@ static void balloon_process(void *unused
        } while ((credit != 0) && !need_sleep);
 
        /* Schedule more work if there is some still to be done. */
-       if (current_target() != current_pages)
+       if (current_target() != bs.current_pages)
                mod_timer(&balloon_timer, jiffies + HZ);
 
        up(&balloon_mutex);
 }
 
 /* Resets the Xen limit, sets new target, and kicks off processing. */
-static void set_new_target(unsigned long target)
+void balloon_set_new_target(unsigned long target)
 {
        /* No need for lock. Not read-modify-write updates. */
-       hard_limit   = ~0UL;
-       target_pages = target;
+       bs.hard_limit   = ~0UL;
+       bs.target_pages = target;
        schedule_work(&balloon_worker);
 }
 
@@ -388,7 +375,7 @@ static void watch_target(struct xenbus_w
        /* The given memory/target value is in KiB, so it needs converting to
         * pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10.
         */
-       set_new_target(new_target >> (PAGE_SHIFT - 10));
+       balloon_set_new_target(new_target >> (PAGE_SHIFT - 10));
 }
 
 static int balloon_init_watcher(struct notifier_block *notifier,
@@ -424,7 +411,7 @@ static int balloon_write(struct file *fi
        memstring[sizeof(memstring)-1] = '\0';
 
        target_bytes = memparse(memstring, &endchar);
-       set_new_target(target_bytes >> PAGE_SHIFT);
+       balloon_set_new_target(target_bytes >> PAGE_SHIFT);
 
        return count;
 }
@@ -442,12 +429,13 @@ static int balloon_read(char *page, char
                "High-mem balloon:   %8lu kB\n"
                "Driver pages:       %8lu kB\n"
                "Xen hard limit:     ",
-               PAGES2KB(current_pages), PAGES2KB(target_pages), 
-               PAGES2KB(balloon_low), PAGES2KB(balloon_high),
-               PAGES2KB(driver_pages));
-
-       if (hard_limit != ~0UL)
-               len += sprintf(page + len, "%8lu kB\n", PAGES2KB(hard_limit));
+               PAGES2KB(bs.current_pages), PAGES2KB(bs.target_pages), 
+               PAGES2KB(bs.balloon_low), PAGES2KB(bs.balloon_high),
+               PAGES2KB(bs.driver_pages));
+
+       if (bs.hard_limit != ~0UL)
+               len += sprintf(page + len, "%8lu kB\n",
+                              PAGES2KB(bs.hard_limit));
        else
                len += sprintf(page + len, "     ??? kB\n");
 
@@ -468,13 +456,13 @@ static int __init balloon_init(void)
 
        IPRINTK("Initialising balloon driver.\n");
 
-       current_pages = min(xen_start_info->nr_pages, max_pfn);
-       totalram_pages = current_pages;
-       target_pages  = current_pages;
-       balloon_low   = 0;
-       balloon_high  = 0;
-       driver_pages  = 0UL;
-       hard_limit    = ~0UL;
+       bs.current_pages = min(xen_start_info->nr_pages, max_pfn);
+       totalram_pages   = bs.current_pages;
+       bs.target_pages  = bs.current_pages;
+       bs.balloon_low   = 0;
+       bs.balloon_high  = 0;
+       bs.driver_pages  = 0UL;
+       bs.hard_limit    = ~0UL;
 
        init_timer(&balloon_timer);
        balloon_timer.data = 0;
@@ -489,6 +477,7 @@ static int __init balloon_init(void)
        balloon_pde->read_proc  = balloon_read;
        balloon_pde->write_proc = balloon_write;
 #endif
+       balloon_sysfs_init();
     
        /* Initialise the balloon with excess memory space. */
        for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) {
@@ -512,7 +501,7 @@ void balloon_update_driver_allowance(lon
        unsigned long flags;
 
        balloon_lock(flags);
-       driver_pages += delta;
+       bs.driver_pages += delta;
        balloon_unlock(flags);
 }
 
@@ -578,7 +567,7 @@ struct page **alloc_empty_pages_and_page
                        goto err;
                }
 
-               totalram_pages = --current_pages;
+               totalram_pages = --bs.current_pages;
 
                balloon_unlock(flags);
        }
@@ -624,7 +613,7 @@ void balloon_release_driver_page(struct 
 
        balloon_lock(flags);
        balloon_append(page);
-       driver_pages--;
+       bs.driver_pages--;
        balloon_unlock(flags);
 
        schedule_work(&balloon_worker);
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Tue Oct 24 
10:08:30 2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Tue Oct 24 
11:21:48 2006 -0600
@@ -293,7 +293,7 @@ static int do_block_io_op(blkif_t *blkif
 static int do_block_io_op(blkif_t *blkif)
 {
        blkif_back_ring_t *blk_ring = &blkif->blk_ring;
-       blkif_request_t *req;
+       blkif_request_t req;
        pending_req_t *pending_req;
        RING_IDX rc, rp;
        int more_to_do = 0;
@@ -311,22 +311,22 @@ static int do_block_io_op(blkif_t *blkif
                        break;
                }
 
-               req = RING_GET_REQUEST(blk_ring, rc);
+               memcpy(&req, RING_GET_REQUEST(blk_ring, rc), sizeof(req));
                blk_ring->req_cons = ++rc; /* before make_response() */
 
-               switch (req->operation) {
+               switch (req.operation) {
                case BLKIF_OP_READ:
                        blkif->st_rd_req++;
-                       dispatch_rw_block_io(blkif, req, pending_req);
+                       dispatch_rw_block_io(blkif, &req, pending_req);
                        break;
                case BLKIF_OP_WRITE:
                        blkif->st_wr_req++;
-                       dispatch_rw_block_io(blkif, req, pending_req);
+                       dispatch_rw_block_io(blkif, &req, pending_req);
                        break;
                default:
                        DPRINTK("error: unknown block io operation [%d]\n",
-                               req->operation);
-                       make_response(blkif, req->id, req->operation,
+                               req.operation);
+                       make_response(blkif, req.id, req.operation,
                                      BLKIF_RSP_ERROR);
                        free_req(pending_req);
                        break;
@@ -375,7 +375,7 @@ static void dispatch_rw_block_io(blkif_t
                        req->seg[i].first_sect + 1;
 
                if ((req->seg[i].last_sect >= (PAGE_SIZE >> 9)) ||
-                   (seg[i].nsec <= 0))
+                   (req->seg[i].last_sect < req->seg[i].first_sect))
                        goto fail_response;
                preq.nr_sects += seg[i].nsec;
 
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c  Tue Oct 24 10:08:30 
2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c  Tue Oct 24 11:21:48 
2006 -0600
@@ -9,6 +9,9 @@
  * Based on the blkback driver code.
  * 
  * Copyright (c) 2004-2005, Andrew Warfield and Julian Chesterfield
+ *
+ * Clean ups and fix ups:
+ *    Copyright (c) 2006, Steven Rostedt - Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License version 2
@@ -51,7 +54,7 @@
 #include <asm/tlbflush.h>
 #include <linux/devfs_fs_kernel.h>
 
-#define MAX_TAP_DEV 100     /*the maximum number of tapdisk ring devices    */
+#define MAX_TAP_DEV 256     /*the maximum number of tapdisk ring devices    */
 #define MAX_DEV_NAME 100    /*the max tapdisk ring device name e.g. blktap0 */
 
 
@@ -104,6 +107,12 @@ static int mmap_pages = MMAP_PAGES;
                      * have a bunch of pages reserved for shared
                      * memory rings.
                      */
+
+/*Data struct handed back to userspace for tapdisk device to VBD mapping*/
+typedef struct domid_translate {
+       unsigned short domid;
+       unsigned short busid;
+} domid_translate_t ;
 
 /*Data struct associated with each of the tapdisk devices*/
 typedef struct tap_blkif {
@@ -123,17 +132,11 @@ typedef struct tap_blkif {
        unsigned long *idx_map;       /*Record the user ring id to kern 
                                        [req id, idx] tuple                  */
        blkif_t *blkif;               /*Associate blkif with tapdev          */
-       int sysfs_set;                /*Set if it has a class device.        */
+       struct domid_translate trans; /*Translation from domid to bus.       */
 } tap_blkif_t;
 
-/*Data struct handed back to userspace for tapdisk device to VBD mapping*/
-typedef struct domid_translate {
-       unsigned short domid;
-       unsigned short busid;
-} domid_translate_t ;
-
-static domid_translate_t  translate_domid[MAX_TAP_DEV];
-static tap_blkif_t *tapfds[MAX_TAP_DEV];
+static struct tap_blkif *tapfds[MAX_TAP_DEV];
+static int blktap_next_minor;
 
 static int __init set_blkif_reqs(char *str)
 {
@@ -322,7 +325,7 @@ struct vm_operations_struct blktap_vm_op
  */
  
 /*Function Declarations*/
-static int get_next_free_dev(void);
+static tap_blkif_t *get_next_free_dev(void);
 static int blktap_open(struct inode *inode, struct file *filp);
 static int blktap_release(struct inode *inode, struct file *filp);
 static int blktap_mmap(struct file *filp, struct vm_area_struct *vma);
@@ -340,51 +343,96 @@ static struct file_operations blktap_fop
 };
 
 
-static int get_next_free_dev(void)
+static tap_blkif_t *get_next_free_dev(void)
 {
        tap_blkif_t *info;
-       int i = 0, ret = -1;
-       unsigned long flags;
-
-       spin_lock_irqsave(&pending_free_lock, flags);
-       
-       while (i < MAX_TAP_DEV) {
+       int minor;
+
+       /*
+        * This is called only from the ioctl, which
+        * means we should always have interrupts enabled.
+        */
+       BUG_ON(irqs_disabled());
+
+       spin_lock_irq(&pending_free_lock);
+
+       /* tapfds[0] is always NULL */
+
+       for (minor = 1; minor < blktap_next_minor; minor++) {
+               info = tapfds[minor];
+               /* we could have failed a previous attempt. */
+               if (!info ||
+                   ((info->dev_inuse == 0) &&
+                    (info->dev_pending == 0)) ) {
+                       info->dev_pending = 1;
+                       goto found;
+               }
+       }
+       info = NULL;
+       minor = -1;
+
+       /*
+        * We didn't find free device. If we can still allocate
+        * more, then we grab the next device minor that is
+        * available.  This is done while we are still under
+        * the protection of the pending_free_lock.
+        */
+       if (blktap_next_minor < MAX_TAP_DEV)
+               minor = blktap_next_minor++;
+found:
+       spin_unlock_irq(&pending_free_lock);
+
+       if (!info && minor > 0) {
+               info = kzalloc(sizeof(*info), GFP_KERNEL);
+               if (unlikely(!info)) {
+                       /*
+                        * If we failed here, try to put back
+                        * the next minor number. But if one
+                        * was just taken, then we just lose this
+                        * minor.  We can try to allocate this
+                        * minor again later.
+                        */
+                       spin_lock_irq(&pending_free_lock);
+                       if (blktap_next_minor == minor+1)
+                               blktap_next_minor--;
+                       spin_unlock_irq(&pending_free_lock);
+                       goto out;
+               }
+
+               info->minor = minor;
+               /*
+                * Make sure that we have a minor before others can
+                * see us.
+                */
+               wmb();
+               tapfds[minor] = info;
+
+               class_device_create(xen_class, NULL,
+                                   MKDEV(blktap_major, minor), NULL,
+                                   "blktap%d", minor);
+               devfs_mk_cdev(MKDEV(blktap_major, minor),
+                       S_IFCHR|S_IRUGO|S_IWUSR, "xen/blktap%d", minor);
+       }
+
+out:
+       return info;
+}
+
+int dom_to_devid(domid_t domid, int xenbus_id, blkif_t *blkif) 
+{
+       tap_blkif_t *info;
+       int i;
+
+       for (i = 1; i < blktap_next_minor; i++) {
                info = tapfds[i];
-               if ( (tapfds[i] != NULL) && (info->dev_inuse == 0)
-                       && (info->dev_pending == 0) ) {
-                       info->dev_pending = 1;
-                       ret = i;
-                       goto done;
-               }
-               i++;
-       }
-       
-done:
-       spin_unlock_irqrestore(&pending_free_lock, flags);
-
-       /*
-        * We are protected by having the dev_pending set.
-        */
-       if (!tapfds[i]->sysfs_set && xen_class) {
-               class_device_create(xen_class, NULL,
-                                   MKDEV(blktap_major, ret), NULL,
-                                   "blktap%d", ret);
-               tapfds[i]->sysfs_set = 1;
-       }
-       return ret;
-}
-
-int dom_to_devid(domid_t domid, int xenbus_id, blkif_t *blkif) 
-{
-       int i;
-               
-       for (i = 0; i < MAX_TAP_DEV; i++)
-               if ( (translate_domid[i].domid == domid)
-                   && (translate_domid[i].busid == xenbus_id) ) {
-                       tapfds[i]->blkif = blkif;
-                       tapfds[i]->status = RUNNING;
+               if ( info &&
+                    (info->trans.domid == domid) &&
+                    (info->trans.busid == xenbus_id) ) {
+                       info->blkif = blkif;
+                       info->status = RUNNING;
                        return i;
                }
+       }
        return -1;
 }
 
@@ -394,12 +442,16 @@ void signal_tapdisk(int idx)
        struct task_struct *ptask;
 
        info = tapfds[idx];
-       if ( (idx > 0) && (idx < MAX_TAP_DEV) && (info->pid > 0) ) {
+       if ((idx < 0) || (idx > MAX_TAP_DEV) || !info)
+               return;
+
+       if (info->pid > 0) {
                ptask = find_task_by_pid(info->pid);
                if (ptask)
                        info->status = CLEANSHUTDOWN;
        }
        info->blkif = NULL;
+
        return;
 }
 
@@ -410,14 +462,19 @@ static int blktap_open(struct inode *ino
        tap_blkif_t *info;
        int i;
        
-       if (tapfds[idx] == NULL) {
+       /* ctrl device, treat differently */
+       if (!idx)
+               return 0;
+
+       info = tapfds[idx];
+
+       if ((idx < 0) || (idx > MAX_TAP_DEV) || !info) {
                WPRINTK("Unable to open device /dev/xen/blktap%d\n",
-                      idx);
-               return -ENOMEM;
-       }
+                       idx);
+               return -ENODEV;
+       }
+
        DPRINTK("Opening device /dev/xen/blktap%d\n",idx);
-       
-       info = tapfds[idx];
        
        /*Only one process can access device at a time*/
        if (test_and_set_bit(0, &info->dev_inuse))
@@ -458,12 +515,10 @@ static int blktap_release(struct inode *
 {
        tap_blkif_t *info = filp->private_data;
        
-       /* can this ever happen? - sdr */
-       if (!info) {
-               WPRINTK("Trying to free device that doesn't exist "
-                      "[/dev/xen/blktap%d]\n",iminor(inode) - BLKTAP_MINOR);
-               return -EBADF;
-       }
+       /* check for control device */
+       if (!info)
+               return 0;
+
        info->dev_inuse = 0;
        DPRINTK("Freeing device [/dev/xen/blktap%d]\n",info->minor);
 
@@ -619,33 +674,31 @@ static int blktap_ioctl(struct inode *in
        {               
                uint64_t val = (uint64_t)arg;
                domid_translate_t *tr = (domid_translate_t *)&val;
-               int newdev;
 
                DPRINTK("NEWINTF Req for domid %d and bus id %d\n", 
                       tr->domid, tr->busid);
-               newdev = get_next_free_dev();
-               if (newdev < 1) {
+               info = get_next_free_dev();
+               if (!info) {
                        WPRINTK("Error initialising /dev/xen/blktap - "
                                "No more devices\n");
                        return -1;
                }
-               translate_domid[newdev].domid = tr->domid;
-               translate_domid[newdev].busid = tr->busid;
-               return newdev;
+               info->trans.domid = tr->domid;
+               info->trans.busid = tr->busid;
+               return info->minor;
        }
        case BLKTAP_IOCTL_FREEINTF:
        {
                unsigned long dev = arg;
                unsigned long flags;
 
-               /* Looking at another device */
-               info = NULL;
-
-               if ( (dev > 0) && (dev < MAX_TAP_DEV) )
-                       info = tapfds[dev];
+               info = tapfds[dev];
+
+               if ((dev > MAX_TAP_DEV) || !info)
+                       return 0; /* should this be an error? */
 
                spin_lock_irqsave(&pending_free_lock, flags);
-               if ( (info != NULL) && (info->dev_pending) )
+               if (info->dev_pending)
                        info->dev_pending = 0;
                spin_unlock_irqrestore(&pending_free_lock, flags);
 
@@ -655,16 +708,12 @@ static int blktap_ioctl(struct inode *in
        {
                unsigned long dev = arg;
 
-               /* Looking at another device */
-               info = NULL;
-               
-               if ( (dev > 0) && (dev < MAX_TAP_DEV) )
-                       info = tapfds[dev];
-               
-               if (info != NULL)
-                       return info->minor;
-               else
-                       return -1;
+               info = tapfds[dev];
+
+               if ((dev > MAX_TAP_DEV) || !info)
+                       return -EINVAL;
+
+               return info->minor;
        }
        case BLKTAP_IOCTL_MAJOR:
                return blktap_major;
@@ -683,13 +732,8 @@ static unsigned int blktap_poll(struct f
 {
        tap_blkif_t *info = filp->private_data;
        
-       if (!info) {
-               WPRINTK(" poll, retrieving idx failed\n");
-               return 0;
-       }
-
        /* do not work on the control device */
-       if (!info->minor)
+       if (!info)
                return 0;
 
        poll_wait(filp, &info->wait, wait);
@@ -704,13 +748,12 @@ void blktap_kick_user(int idx)
 {
        tap_blkif_t *info;
 
-       if (idx == 0)
+       info = tapfds[idx];
+
+       if ((idx < 0) || (idx > MAX_TAP_DEV) || !info)
                return;
-       
-       info = tapfds[idx];
-       
-       if (info != NULL)
-               wake_up_interruptible(&info->wait);
+
+       wake_up_interruptible(&info->wait);
 
        return;
 }
@@ -822,8 +865,8 @@ static void free_req(pending_req_t *req)
                wake_up(&pending_free_wq);
 }
 
-static void fast_flush_area(pending_req_t *req, int k_idx, int u_idx, int 
-                           tapidx)
+static void fast_flush_area(pending_req_t *req, int k_idx, int u_idx,
+                           int tapidx)
 {
        struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST*2];
        unsigned int i, invcount = 0;
@@ -831,13 +874,16 @@ static void fast_flush_area(pending_req_
        uint64_t ptep;
        int ret, mmap_idx;
        unsigned long kvaddr, uvaddr;
-
-       tap_blkif_t *info = tapfds[tapidx];
+       tap_blkif_t *info;
        
-       if (info == NULL) {
+
+       info = tapfds[tapidx];
+
+       if ((tapidx < 0) || (tapidx > MAX_TAP_DEV) || !info) {
                WPRINTK("fast_flush: Couldn't get info!\n");
                return;
        }
+
        mmap_idx = req->mem_idx;
 
        for (i = 0; i < req->nr_pages; i++) {
@@ -1042,7 +1088,7 @@ static int do_block_io_op(blkif_t *blkif
        rmb(); /* Ensure we see queued requests up to 'rp'. */
 
        /*Check blkif has corresponding UE ring*/
-       if (blkif->dev_num == -1) {
+       if (blkif->dev_num < 0) {
                /*oops*/
                if (print_dbug) {
                        WPRINTK("Corresponding UE " 
@@ -1053,7 +1099,8 @@ static int do_block_io_op(blkif_t *blkif
        }
 
        info = tapfds[blkif->dev_num];
-       if (info == NULL || !info->dev_inuse) {
+
+       if (blkif->dev_num > MAX_TAP_DEV || !info || !info->dev_inuse) {
                if (print_dbug) {
                        WPRINTK("Can't get UE info!\n");
                        print_dbug = 0;
@@ -1121,15 +1168,22 @@ static void dispatch_rw_block_io(blkif_t
        struct gnttab_map_grant_ref map[BLKIF_MAX_SEGMENTS_PER_REQUEST*2];
        unsigned int nseg;
        int ret, i;
-       tap_blkif_t *info = tapfds[blkif->dev_num];
+       tap_blkif_t *info;
        uint64_t sector;
-       
        blkif_request_t *target;
        int pending_idx = RTN_PEND_IDX(pending_req,pending_req->mem_idx);
-       int usr_idx = GET_NEXT_REQ(info->idx_map);
+       int usr_idx;
        uint16_t mmap_idx = pending_req->mem_idx;
 
+       if (blkif->dev_num < 0 || blkif->dev_num > MAX_TAP_DEV)
+               goto fail_response;
+
+       info = tapfds[blkif->dev_num];
+       if (info == NULL)
+               goto fail_response;
+
        /* Check we have space on user ring - should never fail. */
+       usr_idx = GET_NEXT_REQ(info->idx_map);
        if (usr_idx == INVALID_REQ)
                goto fail_response;
 
@@ -1330,7 +1384,6 @@ static int __init blkif_init(void)
 static int __init blkif_init(void)
 {
        int i,ret,blktap_dir;
-       tap_blkif_t *info;
 
        if (!is_running_on_xen())
                return -ENODEV;
@@ -1349,9 +1402,6 @@ static int __init blkif_init(void)
        alloc_pending_reqs = 0;
 
        tap_blkif_xenbus_init();
-
-       /*Create the blktap devices, but do not map memory or waitqueue*/
-       for(i = 0; i < MAX_TAP_DEV; i++) translate_domid[i].domid = 0xFFFF;
 
        /* Dynamically allocate a major for this device */
        ret = register_chrdev(0, "blktap", &blktap_fops);
@@ -1364,24 +1414,17 @@ static int __init blkif_init(void)
        
        blktap_major = ret;
 
-       for(i = 0; i < MAX_TAP_DEV; i++ ) {
-               info = tapfds[i] = kzalloc(sizeof(tap_blkif_t),GFP_KERNEL);
-               if(tapfds[i] == NULL)
-                       return -ENOMEM;
-               info->minor = i;
-               info->pid = 0;
-               info->blkif = NULL;
-
-               ret = devfs_mk_cdev(MKDEV(blktap_major, i),
-                       S_IFCHR|S_IRUGO|S_IWUSR, "xen/blktap%d", i);
-
-               if(ret != 0)
-                       return -ENOMEM;
-               info->dev_pending = info->dev_inuse = 0;
-
-               DPRINTK("Created misc_dev [/dev/xen/blktap%d]\n",i);
-       }
-       
+       /* tapfds[0] is always NULL */
+       blktap_next_minor++;
+
+       ret = devfs_mk_cdev(MKDEV(blktap_major, i),
+                           S_IFCHR|S_IRUGO|S_IWUSR, "xen/blktap%d", i);
+
+       if(ret != 0)
+               return -ENOMEM;
+
+       DPRINTK("Created misc_dev [/dev/xen/blktap%d]\n",i);
+
        /* Make sure the xen class exists */
        if (!setup_xen_class()) {
                /*
@@ -1394,7 +1437,6 @@ static int __init blkif_init(void)
                class_device_create(xen_class, NULL,
                                    MKDEV(blktap_major, 0), NULL,
                                    "blktap0");
-               tapfds[0]->sysfs_set = 1;
        } else {
                /* this is bad, but not fatal */
                WPRINTK("blktap: sysfs xen_class not created\n");
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/netback/common.h
--- a/linux-2.6-xen-sparse/drivers/xen/netback/common.h Tue Oct 24 10:08:30 
2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/common.h Tue Oct 24 11:21:48 
2006 -0600
@@ -92,6 +92,9 @@ typedef struct netif_st {
        unsigned long   remaining_credit;
        struct timer_list credit_timeout;
 
+       /* Enforce draining of the transmit queue. */
+       struct timer_list tx_queue_timeout;
+
        /* Miscellaneous private stuff. */
        struct list_head list;  /* scheduling list */
        atomic_t         refcnt;
@@ -119,6 +122,8 @@ int netif_map(netif_t *netif, unsigned l
 
 void netif_xenbus_init(void);
 
+#define netif_schedulable(dev) (netif_running(dev) && netif_carrier_ok(dev))
+
 void netif_schedule_work(netif_t *netif);
 void netif_deschedule_work(netif_t *netif);
 
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/netback/interface.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c      Tue Oct 24 
10:08:30 2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c      Tue Oct 24 
11:21:48 2006 -0600
@@ -44,12 +44,11 @@
  * For example, consider a packet that holds onto resources belonging to the
  * guest for which it is queued (e.g., packet received on vif1.0, destined for
  * vif1.1 which is not activated in the guest): in this situation the guest
- * will never be destroyed, unless vif1.1 is taken down (which flushes the
- * 'tx_queue').
- * 
- * Only set this parameter to non-zero value if you know what you are doing!
+ * will never be destroyed, unless vif1.1 is taken down. To avoid this, we
+ * run a timer (tx_queue_timeout) to drain the queue when the interface is
+ * blocked.
  */
-static unsigned long netbk_queue_length = 0;
+static unsigned long netbk_queue_length = 32;
 module_param_named(queue_length, netbk_queue_length, ulong, 0);
 
 static void __netif_up(netif_t *netif)
@@ -62,7 +61,6 @@ static void __netif_down(netif_t *netif)
 {
        disable_irq(netif->irq);
        netif_deschedule_work(netif);
-       del_timer_sync(&netif->credit_timeout);
 }
 
 static int net_open(struct net_device *dev)
@@ -153,7 +151,10 @@ netif_t *netif_alloc(domid_t domid, unsi
        netif->credit_bytes = netif->remaining_credit = ~0UL;
        netif->credit_usec  = 0UL;
        init_timer(&netif->credit_timeout);
+       /* Initialize 'expires' now: it's used to track the credit window. */
        netif->credit_timeout.expires = jiffies;
+
+       init_timer(&netif->tx_queue_timeout);
 
        dev->hard_start_xmit = netif_be_start_xmit;
        dev->get_stats       = netif_be_get_stats;
@@ -319,25 +320,6 @@ err_rx:
        return err;
 }
 
-static void netif_free(netif_t *netif)
-{
-       atomic_dec(&netif->refcnt);
-       wait_event(netif->waiting_to_free, atomic_read(&netif->refcnt) == 0);
-
-       if (netif->irq)
-               unbind_from_irqhandler(netif->irq, netif);
-       
-       unregister_netdev(netif->dev);
-
-       if (netif->tx.sring) {
-               unmap_frontend_pages(netif);
-               free_vm_area(netif->tx_comms_area);
-               free_vm_area(netif->rx_comms_area);
-       }
-
-       free_netdev(netif->dev);
-}
-
 void netif_disconnect(netif_t *netif)
 {
        if (netif_carrier_ok(netif->dev)) {
@@ -348,5 +330,23 @@ void netif_disconnect(netif_t *netif)
                rtnl_unlock();
                netif_put(netif);
        }
-       netif_free(netif);
-}
+
+       atomic_dec(&netif->refcnt);
+       wait_event(netif->waiting_to_free, atomic_read(&netif->refcnt) == 0);
+
+       del_timer_sync(&netif->credit_timeout);
+       del_timer_sync(&netif->tx_queue_timeout);
+
+       if (netif->irq)
+               unbind_from_irqhandler(netif->irq, netif);
+       
+       unregister_netdev(netif->dev);
+
+       if (netif->tx.sring) {
+               unmap_frontend_pages(netif);
+               free_vm_area(netif->tx_comms_area);
+               free_vm_area(netif->rx_comms_area);
+       }
+
+       free_netdev(netif->dev);
+}
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Tue Oct 24 
10:08:30 2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Tue Oct 24 
11:21:48 2006 -0600
@@ -264,6 +264,13 @@ static inline int netbk_queue_full(netif
               ((netif->rx.rsp_prod_pvt + NET_RX_RING_SIZE - peek) < needed);
 }
 
+static void tx_queue_callback(unsigned long data)
+{
+       netif_t *netif = (netif_t *)data;
+       if (netif_schedulable(netif->dev))
+               netif_wake_queue(netif->dev);
+}
+
 int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        netif_t *netif = netdev_priv(dev);
@@ -271,20 +278,13 @@ int netif_be_start_xmit(struct sk_buff *
        BUG_ON(skb->dev != dev);
 
        /* Drop the packet if the target domain has no receive buffers. */
-       if (unlikely(!netif_running(dev) || !netif_carrier_ok(dev)))
+       if (unlikely(!netif_schedulable(dev) || netbk_queue_full(netif)))
                goto drop;
 
-       if (unlikely(netbk_queue_full(netif))) {
-               /* Not a BUG_ON() -- misbehaving netfront can trigger this. */
-               if (netbk_can_queue(dev))
-                       DPRINTK("Queue full but not stopped!\n");
-               goto drop;
-       }
-
-       /* Copy the packet here if it's destined for a flipping
-          interface but isn't flippable (e.g. extra references to
-          data)
-       */
+       /*
+        * Copy the packet here if it's destined for a flipping interface
+        * but isn't flippable (e.g. extra references to data).
+        */
        if (!netif->copying_receiver && !is_flippable_skb(skb)) {
                struct sk_buff *nskb = netbk_copy_skb(skb);
                if ( unlikely(nskb == NULL) )
@@ -305,8 +305,19 @@ int netif_be_start_xmit(struct sk_buff *
                netif->rx.sring->req_event = netif->rx_req_cons_peek +
                        netbk_max_required_rx_slots(netif);
                mb(); /* request notification /then/ check & stop the queue */
-               if (netbk_queue_full(netif))
+               if (netbk_queue_full(netif)) {
                        netif_stop_queue(dev);
+                       /*
+                        * Schedule 500ms timeout to restart the queue, thus
+                        * ensuring that an inactive queue will be drained.
+                        * Packets will be immediately be dropped until more
+                        * receive buffers become available (see
+                        * netbk_queue_full() check above).
+                        */
+                       netif->tx_queue_timeout.data = (unsigned long)netif;
+                       netif->tx_queue_timeout.function = tx_queue_callback;
+                       __mod_timer(&netif->tx_queue_timeout, jiffies + HZ/2);
+               }
        }
 
        skb_queue_tail(&rx_queue, skb);
@@ -706,6 +717,7 @@ static void net_rx_action(unsigned long 
                }
 
                if (netif_queue_stopped(netif->dev) &&
+                   netif_schedulable(netif->dev) &&
                    !netbk_queue_full(netif))
                        netif_wake_queue(netif->dev);
 
@@ -763,8 +775,7 @@ static void add_to_net_schedule_list_tai
 
        spin_lock_irq(&net_schedule_list_lock);
        if (!__on_net_schedule_list(netif) &&
-           likely(netif_running(netif->dev) &&
-                  netif_carrier_ok(netif->dev))) {
+           likely(netif_schedulable(netif->dev))) {
                list_add_tail(&netif->list, &net_schedule_list);
                netif_get(netif);
        }
@@ -1358,7 +1369,7 @@ irqreturn_t netif_be_int(int irq, void *
        add_to_net_schedule_list_tail(netif);
        maybe_schedule_tx_action();
 
-       if (netif_queue_stopped(netif->dev) && !netbk_queue_full(netif))
+       if (netif_schedulable(netif->dev) && !netbk_queue_full(netif))
                netif_wake_queue(netif->dev);
 
        return IRQ_HANDLED;
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Tue Oct 24 10:08:30 
2006 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c Tue Oct 24 11:21:48 
2006 -0600
@@ -328,7 +328,7 @@ static void connect(struct backend_info 
 
        /* May not get a kick from the frontend, so start the tx_queue now. */
        if (!netbk_can_queue(be->netif->dev))
-               netif_start_queue(be->netif->dev);
+               netif_wake_queue(be->netif->dev);
 }
 
 
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/domain-timeoffset
--- a/tools/ioemu/patches/domain-timeoffset     Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/domain-timeoffset     Tue Oct 24 11:21:48 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/hw/mc146818rtc.c
 Index: ioemu/hw/mc146818rtc.c
 ===================================================================
---- ioemu.orig/hw/mc146818rtc.c        2006-09-21 19:33:25.000000000 +0100
-+++ ioemu/hw/mc146818rtc.c     2006-09-21 19:33:30.000000000 +0100
+--- ioemu.orig/hw/mc146818rtc.c        2006-10-24 14:45:21.000000000 +0100
++++ ioemu/hw/mc146818rtc.c     2006-10-24 14:45:39.000000000 +0100
 @@ -178,10 +178,27 @@
      }
  }
@@ -46,8 +46,8 @@ Index: ioemu/hw/mc146818rtc.c
  static void rtc_copy_date(RTCState *s)
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-09-21 19:33:30.000000000 +0100
-+++ ioemu/hw/pc.c      2006-09-21 19:33:30.000000000 +0100
+--- ioemu.orig/hw/pc.c 2006-10-24 14:45:38.000000000 +0100
++++ ioemu/hw/pc.c      2006-10-24 14:45:39.000000000 +0100
 @@ -159,7 +159,7 @@
  }
  
@@ -117,8 +117,8 @@ Index: ioemu/hw/pc.c
  QEMUMachine pc_machine = {
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:30.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:30.000000000 +0100
+--- ioemu.orig/vl.c    2006-10-24 14:45:38.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:45:39.000000000 +0100
 @@ -163,6 +163,8 @@
  
  int xc_handle;
@@ -174,8 +174,8 @@ Index: ioemu/vl.c
      if (usb_enabled) {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:33:30.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:33:30.000000000 +0100
+--- ioemu.orig/vl.h    2006-10-24 14:45:38.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:45:39.000000000 +0100
 @@ -576,7 +576,7 @@
                                   int boot_device,
               DisplayState *ds, const char **fd_filename, int snapshot,
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/qemu-bootorder
--- a/tools/ioemu/patches/qemu-bootorder        Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/qemu-bootorder        Tue Oct 24 11:21:48 2006 -0600
@@ -1,9 +1,9 @@ Index: ioemu/vl.c
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:32.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:32.000000000 +0100
-@@ -124,7 +124,7 @@
- int vncunused;
+--- ioemu.orig/vl.c    2006-10-24 14:33:47.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:47.000000000 +0100
+@@ -125,7 +125,7 @@
+ struct sockaddr_in vnclisten_addr;
  const char* keyboard_layout = NULL;
  int64_t ticks_per_sec;
 -int boot_device = 'c';
@@ -11,7 +11,7 @@ Index: ioemu/vl.c
  uint64_t ram_size;
  int pit_min_timer_count = 0;
  int nb_nics;
-@@ -6063,14 +6063,14 @@
+@@ -6075,14 +6075,14 @@
                  break;
  #endif /* !CONFIG_DM */
              case QEMU_OPTION_boot:
@@ -32,7 +32,7 @@ Index: ioemu/vl.c
                      exit(1);
                  }
                  break;
-@@ -6334,6 +6334,7 @@
+@@ -6349,6 +6349,7 @@
          fd_filename[0] == '\0')
          help();
      
@@ -40,7 +40,7 @@ Index: ioemu/vl.c
      /* boot to cd by default if no hard disk */
      if (hd_filename[0] == '\0' && boot_device == 'c') {
          if (fd_filename[0] != '\0')
-@@ -6341,6 +6342,7 @@
+@@ -6356,6 +6357,7 @@
          else
              boot_device = 'd';
      }
@@ -48,7 +48,7 @@ Index: ioemu/vl.c
  #endif /* !CONFIG_DM */
  
      setvbuf(stdout, NULL, _IOLBF, 0);
-@@ -6599,6 +6601,7 @@
+@@ -6614,6 +6616,7 @@
                    ds, fd_filename, snapshot,
                    kernel_filename, kernel_cmdline, initrd_filename,
                    timeoffset);
@@ -58,9 +58,9 @@ Index: ioemu/vl.c
      if (usb_enabled) {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:33:32.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:33:32.000000000 +0100
-@@ -576,7 +576,7 @@
+--- ioemu.orig/vl.h    2006-10-24 14:33:47.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:33:47.000000000 +0100
+@@ -578,7 +578,7 @@
  #ifndef QEMU_TOOL
  
  typedef void QEMUMachineInitFunc(uint64_t ram_size, int vga_ram_size, 
@@ -69,7 +69,7 @@ Index: ioemu/vl.h
               DisplayState *ds, const char **fd_filename, int snapshot,
               const char *kernel_filename, const char *kernel_cmdline,
               const char *initrd_filename, time_t timeoffset);
-@@ -1021,7 +1021,7 @@
+@@ -1023,7 +1023,7 @@
                      uint32_t start, uint32_t count);
  int PPC_NVRAM_set_params (m48t59_t *nvram, uint16_t NVRAM_size,
                            const unsigned char *arch,
@@ -80,8 +80,8 @@ Index: ioemu/vl.h
                            uint32_t initrd_image, uint32_t initrd_size,
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-09-21 19:33:32.000000000 +0100
-+++ ioemu/hw/pc.c      2006-09-21 19:33:32.000000000 +0100
+--- ioemu.orig/hw/pc.c 2006-10-24 14:33:47.000000000 +0100
++++ ioemu/hw/pc.c      2006-10-24 14:33:47.000000000 +0100
 @@ -158,8 +158,23 @@
      rtc_set_memory(s, info_ofs + 8, sectors);
  }
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/qemu-cleanup
--- a/tools/ioemu/patches/qemu-cleanup  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/qemu-cleanup  Tue Oct 24 11:21:48 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/hw/vga.c
 Index: ioemu/hw/vga.c
 ===================================================================
---- ioemu.orig/hw/vga.c        2006-08-06 02:03:51.906765409 +0100
-+++ ioemu/hw/vga.c     2006-08-06 02:15:10.364150665 +0100
+--- ioemu.orig/hw/vga.c        2006-10-24 14:44:03.000000000 +0100
++++ ioemu/hw/vga.c     2006-10-24 14:45:22.000000000 +0100
 @@ -1622,7 +1622,9 @@
  static void vga_save(QEMUFile *f, void *opaque)
  {
@@ -26,8 +26,8 @@ Index: ioemu/hw/vga.c
          return -EINVAL;
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-08-06 02:15:01.774108287 +0100
-+++ ioemu/vl.c 2006-08-06 02:15:31.040845624 +0100
+--- ioemu.orig/vl.c    2006-10-24 14:44:08.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:45:29.000000000 +0100
 @@ -39,6 +39,7 @@
  #include <sys/ioctl.h>
  #include <sys/socket.h>
@@ -36,6 +36,24 @@ Index: ioemu/vl.c
  #include <dirent.h>
  #include <netdb.h>
  #ifdef _BSD
+@@ -2932,7 +2933,7 @@
+     }
+ 
+     /* XXX: better tmp dir construction */
+-    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
++    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
+     if (mkdir(smb_dir, 0700) < 0) {
+         fprintf(stderr, "qemu: could not create samba server dir '%s'\n", 
smb_dir);
+         exit(1);
+@@ -3893,7 +3894,7 @@
+                 perror("Opening pidfile");
+                 exit(1);
+             }
+-            fprintf(f, "%d\n", getpid());
++            fprintf(f, "%ld\n", (long)getpid());
+             fclose(f);
+             pid_filename = qemu_strdup(filename);
+             if (!pid_filename) {
 @@ -5308,7 +5309,9 @@
      QEMU_OPTION_d,
      QEMU_OPTION_hdachs,
@@ -70,8 +88,8 @@ Index: ioemu/vl.c
                      fprintf(stderr, "qemu: too many network clients\n");
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-08-06 02:15:01.775108175 +0100
-+++ ioemu/vl.h 2006-08-06 02:15:10.368150219 +0100
+--- ioemu.orig/vl.h    2006-10-24 14:44:08.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:45:22.000000000 +0100
 @@ -957,7 +957,7 @@
               unsigned long vram_offset, int vram_size, int width, int height);
  
@@ -81,3 +99,18 @@ Index: ioemu/vl.h
  void slavio_intctl_set_cpu(void *opaque, unsigned int cpu, CPUState *env);
  void slavio_pic_info(void *opaque);
  void slavio_irq_info(void *opaque);
+Index: ioemu/usb-linux.c
+===================================================================
+--- ioemu.orig/usb-linux.c     2006-10-24 14:44:03.000000000 +0100
++++ ioemu/usb-linux.c  2006-10-24 14:44:08.000000000 +0100
+@@ -26,7 +26,9 @@
+ #if defined(__linux__)
+ #include <dirent.h>
+ #include <sys/ioctl.h>
+-#include <linux/compiler.h>
++/* Some versions of usbdevice_fs.h need __user to be defined for them.   */
++/* This may (harmlessly) conflict with a definition in linux/compiler.h. */
++#define __user
+ #include <linux/usbdevice_fs.h>
+ #include <linux/version.h>
+ 
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/qemu-daemonize
--- a/tools/ioemu/patches/qemu-daemonize        Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/qemu-daemonize        Tue Oct 24 11:21:48 2006 -0600
@@ -2,9 +2,9 @@ Changes required because qemu-dm runs da
 
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:32.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:32.000000000 +0100
-@@ -6042,10 +6042,11 @@
+--- ioemu.orig/vl.c    2006-10-24 14:33:47.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:47.000000000 +0100
+@@ -6054,10 +6054,11 @@
                  }
                  break;
              case QEMU_OPTION_nographic:
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/qemu-logging
--- a/tools/ioemu/patches/qemu-logging  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/qemu-logging  Tue Oct 24 11:21:48 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/vl.c
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-08-06 02:15:48.550893605 +0100
-+++ ioemu/vl.c 2006-08-06 02:16:31.246133963 +0100
+--- ioemu.orig/vl.c    2006-10-24 14:36:58.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:37:03.000000000 +0100
 @@ -5234,7 +5234,7 @@
             "-S              freeze CPU at startup (use 'c' to start 
execution)\n"
             "-s              wait gdb connection to port %d\n"
@@ -43,7 +43,7 @@ Index: ioemu/vl.c
      /* default mac address of the first network interface */
      
 +    /* init debug */
-+    sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%d.log", getpid());
++    sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%ld.log", 
(long)getpid());
 +    cpu_set_log_filename(qemu_dm_logfilename);
 +    cpu_set_log(0);
 +    
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/qemu-target-i386-dm
--- a/tools/ioemu/patches/qemu-target-i386-dm   Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/qemu-target-i386-dm   Tue Oct 24 11:21:48 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/Makefile.target
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-09-21 11:30:11.000000000 +0100
-+++ ioemu/Makefile.target      2006-09-21 18:54:22.000000000 +0100
+--- ioemu.orig/Makefile.target 2006-10-24 13:47:23.000000000 +0100
++++ ioemu/Makefile.target      2006-10-24 14:30:56.000000000 +0100
 @@ -62,6 +62,8 @@
  QEMU_SYSTEM=qemu-fast
  endif
@@ -32,8 +32,8 @@ Index: ioemu/Makefile.target
  DEFINES += -DHAS_AUDIO
 Index: ioemu/configure
 ===================================================================
---- ioemu.orig/configure       2006-09-21 11:30:11.000000000 +0100
-+++ ioemu/configure    2006-09-21 18:54:21.000000000 +0100
+--- ioemu.orig/configure       2006-10-24 13:47:23.000000000 +0100
++++ ioemu/configure    2006-10-24 14:29:34.000000000 +0100
 @@ -373,6 +373,8 @@
      if [ "$user" = "yes" ] ; then
          target_list="i386-user arm-user armeb-user sparc-user ppc-user 
mips-user mipsel-user $target_list"
@@ -45,8 +45,8 @@ Index: ioemu/configure
  fi
 Index: ioemu/monitor.c
 ===================================================================
---- ioemu.orig/monitor.c       2006-09-21 11:30:11.000000000 +0100
-+++ ioemu/monitor.c    2006-09-21 18:54:23.000000000 +0100
+--- ioemu.orig/monitor.c       2006-10-24 13:47:23.000000000 +0100
++++ ioemu/monitor.c    2006-10-24 14:30:56.000000000 +0100
 @@ -1262,6 +1262,10 @@
        "", "show profiling information", },
      { "capture", "", do_info_capture,
@@ -60,8 +60,8 @@ Index: ioemu/monitor.c
  
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 11:30:11.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 18:54:23.000000000 +0100
+--- ioemu.orig/vl.c    2006-10-24 13:47:23.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:30:56.000000000 +0100
 @@ -87,7 +87,7 @@
  
  #include "exec-all.h"
@@ -98,8 +98,8 @@ Index: ioemu/vl.c
  {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 11:30:11.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 18:54:23.000000000 +0100
+--- ioemu.orig/vl.h    2006-10-24 13:47:23.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:30:56.000000000 +0100
 @@ -37,6 +37,8 @@
  #include <unistd.h>
  #include <fcntl.h>
@@ -132,7 +132,7 @@ Index: ioemu/target-i386-dm/cpu.h
 Index: ioemu/target-i386-dm/cpu.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/cpu.h 2006-09-21 18:54:22.000000000 +0100
++++ ioemu/target-i386-dm/cpu.h 2006-10-24 14:30:56.000000000 +0100
 @@ -0,0 +1,86 @@
 +/*
 + * i386 virtual CPU header
@@ -223,7 +223,7 @@ Index: ioemu/target-i386-dm/exec-dm.c
 Index: ioemu/target-i386-dm/exec-dm.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/exec-dm.c     2006-09-21 18:54:22.000000000 +0100
++++ ioemu/target-i386-dm/exec-dm.c     2006-10-24 14:30:56.000000000 +0100
 @@ -0,0 +1,516 @@
 +/*
 + *  virtual page mapping and translated block handling
@@ -744,7 +744,7 @@ Index: ioemu/target-i386-dm/helper2.c
 Index: ioemu/target-i386-dm/helper2.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/helper2.c     2006-09-21 18:55:31.000000000 +0100
++++ ioemu/target-i386-dm/helper2.c     2006-10-24 14:31:01.000000000 +0100
 @@ -0,0 +1,469 @@
 +/*
 + *  i386 helpers (without register variable usage)
@@ -1205,8 +1205,8 @@ Index: ioemu/target-i386-dm/helper2.c
 +                break;
 +        }
 +
-+        /* Wait up to 100 msec. */
-+        main_loop_wait(100);
++        /* Wait up to 10 msec. */
++        main_loop_wait(10);
 +
 +        if (env->send_event) {
 +            env->send_event = 0;
@@ -1218,7 +1218,7 @@ Index: ioemu/target-i386-dm/i8259-dm.c
 Index: ioemu/target-i386-dm/i8259-dm.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/i8259-dm.c    2006-09-21 11:30:11.000000000 +0100
++++ ioemu/target-i386-dm/i8259-dm.c    2006-10-24 13:47:23.000000000 +0100
 @@ -0,0 +1,107 @@
 +/* Xen 8259 stub for interrupt controller emulation
 + * 
@@ -1330,7 +1330,7 @@ Index: ioemu/target-i386-dm/qemu-dm.debu
 Index: ioemu/target-i386-dm/qemu-dm.debug
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/qemu-dm.debug 2006-09-21 11:30:11.000000000 +0100
++++ ioemu/target-i386-dm/qemu-dm.debug 2006-10-24 13:47:23.000000000 +0100
 @@ -0,0 +1,5 @@
 +#!/bin/sh
 +
@@ -1340,7 +1340,7 @@ Index: ioemu/target-i386-dm/qemu-ifup
 Index: ioemu/target-i386-dm/qemu-ifup
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/qemu-ifup     2006-09-21 11:30:11.000000000 +0100
++++ ioemu/target-i386-dm/qemu-ifup     2006-10-24 13:47:23.000000000 +0100
 @@ -0,0 +1,10 @@
 +#!/bin/sh
 +
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/series
--- a/tools/ioemu/patches/series        Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/series        Tue Oct 24 11:21:48 2006 -0600
@@ -32,10 +32,12 @@ fix-vga-scanning-code-overflow
 fix-vga-scanning-code-overflow
 vnc-cleanup
 vnc-fixes
+vnc-protocol-fixes
 vnc-start-vncviewer
 vnc-title-domain-name
 vnc-access-monitor-vt
 vnc-display-find-unused
+vnc-listen-specific-interface
 vnc-backoff-screen-scan
 xenstore-block-device-config
 xenstore-write-vnc-port
@@ -47,3 +49,7 @@ qemu-bootorder
 qemu-bootorder
 qemu-tunable-ide-write-cache
 qemu-pci 
+serial-port-rate-limit
+hypervisor-rtc
+ide-cd-dma
+vnc-password
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-access-monitor-vt
--- a/tools/ioemu/patches/vnc-access-monitor-vt Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/vnc-access-monitor-vt Tue Oct 24 11:21:48 2006 -0600
@@ -1,8 +1,8 @@ Index: ioemu/vnc.c
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vnc.c        2006-09-21 19:33:31.000000000 +0100
-@@ -32,6 +32,10 @@
+--- ioemu.orig/vnc.c   2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:33:46.000000000 +0100
+@@ -33,6 +33,10 @@
  #include "vnc_keysym.h"
  #include "keymaps.c"
  
@@ -13,7 +13,7 @@ Index: ioemu/vnc.c
  typedef struct Buffer
  {
      size_t capacity;
-@@ -95,6 +99,8 @@
+@@ -96,6 +100,8 @@
      int visible_h;
  
      int slow_client;
@@ -22,7 +22,7 @@ Index: ioemu/vnc.c
  };
  
  #define DIRTY_PIXEL_BITS 64
-@@ -791,16 +797,80 @@
+@@ -794,16 +800,80 @@
  
  static void do_key_event(VncState *vs, int down, uint32_t sym)
  {
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-backoff-screen-scan
--- a/tools/ioemu/patches/vnc-backoff-screen-scan       Tue Oct 24 10:08:30 
2006 -0600
+++ b/tools/ioemu/patches/vnc-backoff-screen-scan       Tue Oct 24 11:21:48 
2006 -0600
@@ -1,10 +1,10 @@ Index: ioemu/vnc.c
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-09-21 19:31:03.000000000 +0100
-+++ ioemu/vnc.c        2006-09-21 19:32:23.000000000 +0100
-@@ -27,7 +27,19 @@
- #include "vl.h"
+--- ioemu.orig/vnc.c   2006-10-24 14:33:17.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:33:24.000000000 +0100
+@@ -28,7 +28,19 @@
  #include "qemu_socket.h"
+ #include <assert.h>
  
 -#define VNC_REFRESH_INTERVAL (1000 / 30)
 +/* The refresh interval starts at BASE.  If we scan the buffer and
@@ -23,7 +23,7 @@ Index: ioemu/vnc.c
  
  #include "vnc_keysym.h"
  #include "keymaps.c"
-@@ -64,10 +76,11 @@
+@@ -65,10 +77,11 @@
  struct VncState
  {
      QEMUTimer *timer;
@@ -36,7 +36,7 @@ Index: ioemu/vnc.c
      int width;
      int height;
      uint64_t *dirty_row;      /* screen regions which are possibly dirty */
-@@ -98,8 +111,6 @@
+@@ -99,8 +112,6 @@
      int visible_w;
      int visible_h;
  
@@ -45,7 +45,7 @@ Index: ioemu/vnc.c
      int ctl_keys;               /* Ctrl+Alt starts calibration */
  };
  
-@@ -380,7 +391,7 @@
+@@ -381,7 +392,7 @@
      int y = 0;
      int pitch = ds->linesize;
      VncState *vs = ds->opaque;
@@ -54,19 +54,19 @@ Index: ioemu/vnc.c
  
      if (src_x < vs->visible_x || src_y < vs->visible_y ||
        dst_x < vs->visible_x || dst_y < vs->visible_y ||
-@@ -390,11 +401,6 @@
+@@ -391,10 +402,8 @@
        (dst_y + h) > (vs->visible_y + vs->visible_h))
        updating_client = 0;
  
 -    if (updating_client) {
 -      vs->need_update = 1;
--      _vnc_update_client(vs);
++    if (updating_client)
+       _vnc_update_client(vs);
 -    }
--
+ 
      if (dst_y > src_y) {
        y = h - 1;
-       pitch = -pitch;
-@@ -445,110 +451,145 @@
+@@ -446,110 +455,149 @@
  static void _vnc_update_client(void *opaque)
  {
      VncState *vs = opaque;
@@ -279,12 +279,16 @@ Index: ioemu/vnc.c
 +             interested (e.g. minimised) it'll ignore this, and we
 +             can stop scanning the buffer until it sends another
 +             update request. */
-+          /* Note that there are bugs in xvncviewer which prevent
-+             this from actually working.  Leave the code in place
-+             for correct clients. */
++          /* It turns out that there's a bug in realvncviewer 4.1.2
++             which means that if you send a proper null update (with
++             no update rectangles), it gets a bit out of sync and
++             never sends any further requests, regardless of whether
++             it needs one or not.  Fix this by sending a single 1x1
++             update rectangle instead. */
 +          vnc_write_u8(vs, 0);
 +          vnc_write_u8(vs, 0);
-+          vnc_write_u16(vs, 0);
++          vnc_write_u16(vs, 1);
++          send_framebuffer_update(vs, 0, 0, 1, 1);
 +          vnc_flush(vs);
 +          vs->last_update_time = now;
 +          return;
@@ -295,7 +299,7 @@ Index: ioemu/vnc.c
  }
  
  static void vnc_update_client(void *opaque)
-@@ -561,8 +602,10 @@
+@@ -562,8 +610,10 @@
  
  static void vnc_timer_init(VncState *vs)
  {
@@ -307,7 +311,7 @@ Index: ioemu/vnc.c
  }
  
  static void vnc_dpy_refresh(DisplayState *ds)
-@@ -622,7 +665,6 @@
+@@ -623,7 +673,6 @@
        vs->csock = -1;
        buffer_reset(&vs->input);
        buffer_reset(&vs->output);
@@ -315,7 +319,7 @@ Index: ioemu/vnc.c
        return 0;
      }
      return ret;
-@@ -892,7 +934,6 @@
+@@ -895,7 +944,6 @@
                                       int x_position, int y_position,
                                       int w, int h)
  {
@@ -323,7 +327,7 @@ Index: ioemu/vnc.c
      if (!incremental)
        framebuffer_set_updated(vs, x_position, y_position, w, h);
      vs->visible_x = x_position;
-@@ -1015,6 +1056,7 @@
+@@ -1018,6 +1066,7 @@
  {
      int i;
      uint16_t limit;
@@ -331,7 +335,7 @@ Index: ioemu/vnc.c
  
      switch (data[0]) {
      case 0:
-@@ -1054,12 +1096,18 @@
+@@ -1061,12 +1110,18 @@
        if (len == 1)
            return 8;
  
@@ -352,15 +356,15 @@ Index: ioemu/vnc.c
      case 6:
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:31:03.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:32:23.000000000 +0100
-@@ -725,6 +725,12 @@
+--- ioemu.orig/vl.c    2006-10-24 14:33:17.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:24.000000000 +0100
+@@ -726,6 +726,12 @@
      }
  }
  
 +void qemu_advance_timer(QEMUTimer *ts, int64_t expire_time)
 +{
-+    if (ts->expire_time > expire_time)
++    if (ts->expire_time > expire_time || !qemu_timer_pending(ts))
 +      qemu_mod_timer(ts, expire_time);
 +}
 +
@@ -369,9 +373,9 @@ Index: ioemu/vl.c
  void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:31:03.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:32:23.000000000 +0100
-@@ -405,6 +405,7 @@
+--- ioemu.orig/vl.h    2006-10-24 14:33:17.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:33:24.000000000 +0100
+@@ -407,6 +407,7 @@
  void qemu_free_timer(QEMUTimer *ts);
  void qemu_del_timer(QEMUTimer *ts);
  void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time);
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-display-find-unused
--- a/tools/ioemu/patches/vnc-display-find-unused       Tue Oct 24 10:08:30 
2006 -0600
+++ b/tools/ioemu/patches/vnc-display-find-unused       Tue Oct 24 11:21:48 
2006 -0600
@@ -1,8 +1,8 @@ Index: ioemu/vnc.c
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vnc.c        2006-09-21 19:33:31.000000000 +0100
-@@ -1182,7 +1182,7 @@
+--- ioemu.orig/vnc.c   2006-10-24 14:31:09.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:31:36.000000000 +0100
+@@ -1195,7 +1195,7 @@
      }
  }
  
@@ -11,7 +11,7 @@ Index: ioemu/vnc.c
  {
      struct sockaddr_in addr;
      int reuse_addr, ret;
-@@ -1213,10 +1213,6 @@
+@@ -1226,10 +1226,6 @@
        exit(1);
      }
  
@@ -22,7 +22,7 @@ Index: ioemu/vnc.c
      reuse_addr = 1;
      ret = setsockopt(vs->lsock, SOL_SOCKET, SO_REUSEADDR,
                     (const char *)&reuse_addr, sizeof(reuse_addr));
-@@ -1225,7 +1221,16 @@
+@@ -1238,7 +1234,16 @@
        exit(1);
      }
  
@@ -39,7 +39,7 @@ Index: ioemu/vnc.c
        fprintf(stderr, "bind() failed\n");
        exit(1);
      }
-@@ -1246,6 +1251,8 @@
+@@ -1259,6 +1264,8 @@
      vs->ds->dpy_refresh = vnc_dpy_refresh;
  
      vnc_dpy_resize(vs->ds, 640, 400);
@@ -50,8 +50,8 @@ Index: ioemu/vnc.c
  int vnc_start_viewer(int port)
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:31.000000000 +0100
+--- ioemu.orig/vl.c    2006-10-24 14:31:09.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:31:41.000000000 +0100
 @@ -121,6 +121,7 @@
  static DisplayState display_state;
  int nographic;
@@ -99,7 +99,7 @@ Index: ioemu/vl.c
 +            case QEMU_OPTION_vncunused:
 +                vncunused++;
 +                if (vnc_display == -1)
-+                    vnc_display = -2;
++                    vnc_display = 0;
 +                break;
              }
          }
@@ -115,8 +115,8 @@ Index: ioemu/vl.c
      } else {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:33:31.000000000 +0100
+--- ioemu.orig/vl.h    2006-10-24 14:31:09.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:31:36.000000000 +0100
 @@ -785,7 +785,7 @@
  void cocoa_display_init(DisplayState *ds, int full_screen);
  
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-fixes
--- a/tools/ioemu/patches/vnc-fixes     Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/vnc-fixes     Tue Oct 24 11:21:48 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/vl.c
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:08:18.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:26:24.000000000 +0100
+--- ioemu.orig/vl.c    2006-10-24 13:47:23.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:19:36.000000000 +0100
 @@ -6534,8 +6534,10 @@
          }
      }
@@ -17,8 +17,8 @@ Index: ioemu/vl.c
      if (use_gdbstub) {
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-09-21 19:08:18.000000000 +0100
-+++ ioemu/vnc.c        2006-09-21 19:26:38.000000000 +0100
+--- ioemu.orig/vnc.c   2006-10-24 13:47:23.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:20:00.000000000 +0100
 @@ -3,6 +3,7 @@
   * 
   * Copyright (C) 2006 Anthony Liguori <anthony@xxxxxxxxxxxxx>
@@ -483,7 +483,16 @@ Index: ioemu/vnc.c
  
      vga_hw_invalidate();
      vga_hw_update();
-@@ -1010,11 +1101,11 @@
+@@ -924,6 +1015,8 @@
+ {
+     char pad[3] = { 0, 0, 0 };
+ 
++    vga_hw_update();
++
+     vs->width = vs->ds->width;
+     vs->height = vs->ds->height;
+     vnc_write_u16(vs, vs->ds->width);
+@@ -1010,11 +1103,11 @@
        vnc_write(vs, "RFB 003.003\n", 12);
        vnc_flush(vs);
        vnc_read_when(vs, protocol_version, 12);
@@ -497,7 +506,7 @@ Index: ioemu/vnc.c
      }
  }
  
-@@ -1071,17 +1162,15 @@
+@@ -1071,17 +1164,15 @@
        exit(1);
      }
  
@@ -520,8 +529,8 @@ Index: ioemu/vnc.c
  }
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:00:48.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:26:24.000000000 +0100
+--- ioemu.orig/vl.h    2006-10-24 13:47:23.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:19:36.000000000 +0100
 @@ -319,6 +319,7 @@
  int is_graphic_console(void);
  CharDriverState *text_console_init(DisplayState *ds);
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-start-vncviewer
--- a/tools/ioemu/patches/vnc-start-vncviewer   Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/vnc-start-vncviewer   Tue Oct 24 11:21:48 2006 -0600
@@ -1,8 +1,8 @@ Index: ioemu/vnc.c
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-09-21 19:26:38.000000000 +0100
-+++ ioemu/vnc.c        2006-09-21 19:29:58.000000000 +0100
-@@ -1174,3 +1174,25 @@
+--- ioemu.orig/vnc.c   2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:33:46.000000000 +0100
+@@ -1187,3 +1187,25 @@
  
      vnc_dpy_resize(vs->ds, 640, 400);
  }
@@ -30,8 +30,8 @@ Index: ioemu/vnc.c
 +}
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:26:24.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:29:50.000000000 +0100
+--- ioemu.orig/vl.c    2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:46.000000000 +0100
 @@ -120,6 +120,7 @@
  int bios_size;
  static DisplayState display_state;
@@ -93,8 +93,8 @@ Index: ioemu/vl.c
          sdl_display_init(ds, full_screen);
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:26:24.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:29:50.000000000 +0100
+--- ioemu.orig/vl.h    2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:33:46.000000000 +0100
 @@ -786,6 +786,7 @@
  
  /* vnc.c */
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-title-domain-name
--- a/tools/ioemu/patches/vnc-title-domain-name Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/vnc-title-domain-name Tue Oct 24 11:21:48 2006 -0600
@@ -1,16 +1,16 @@ Index: ioemu/vnc.c
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vnc.c        2006-09-21 19:33:31.000000000 +0100
-@@ -1013,6 +1013,7 @@
+--- ioemu.orig/vnc.c   2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:33:46.000000000 +0100
+@@ -1024,6 +1024,7 @@
  
  static int protocol_client_init(VncState *vs, char *data, size_t len)
  {
 +    size_t l;
      char pad[3] = { 0, 0, 0 };
  
-     vs->width = vs->ds->width;
-@@ -1058,8 +1059,10 @@
+     vga_hw_update();
+@@ -1071,8 +1072,10 @@
        
      vnc_write(vs, pad, 3);           /* padding */
  
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/xen-build
--- a/tools/ioemu/patches/xen-build     Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/xen-build     Tue Oct 24 11:21:48 2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/Makefile
 Index: ioemu/Makefile
 ===================================================================
---- ioemu.orig/Makefile        2006-08-28 20:19:23.000000000 +0100
-+++ ioemu/Makefile     2006-08-28 20:20:08.000000000 +0100
+--- ioemu.orig/Makefile        2006-10-24 14:37:25.000000000 +0100
++++ ioemu/Makefile     2006-10-24 14:37:28.000000000 +0100
 @@ -1,11 +1,14 @@
  # Makefile for QEMU.
  
@@ -85,8 +85,8 @@ Index: ioemu/Makefile
  info: qemu-doc.info qemu-tech.info
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-08-28 20:19:23.000000000 +0100
-+++ ioemu/Makefile.target      2006-08-28 20:19:47.000000000 +0100
+--- ioemu.orig/Makefile.target 2006-10-24 14:37:25.000000000 +0100
++++ ioemu/Makefile.target      2006-10-24 14:40:25.000000000 +0100
 @@ -1,5 +1,8 @@
  include config.mak
  
@@ -112,7 +112,7 @@ Index: ioemu/Makefile.target
  endif
 -CFLAGS=-Wall -O2 -g -fno-strict-aliasing
 +CFLAGS+=-Wall -O2 -g -fno-strict-aliasing
-+SSE2 := $(call test-gcc-flag,$(CC),-msse2)
++SSE2 := $(call cc-option,$(CC),-msse2,)
 +ifeq ($(SSE2),-msse2)
 +CFLAGS += -DUSE_SSE2=1 -msse2
 +endif
@@ -149,17 +149,18 @@ Index: ioemu/Makefile.target
  install: all 
 +      mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)"
  ifneq ($(PROGS),)
-       $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
- endif
-+      install -m 755 $(TARGET_PATH)/qemu-dm.debug "$(DESTDIR)$(bindir)"
-+      install -m 755 $(TARGET_PATH)/qemu-ifup "$(DESTDIR)$(configdir)"
+-      $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
++      $(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
+ endif
++      $(INSTALL_PROG) $(TARGET_PATH)/qemu-dm.debug "$(DESTDIR)$(bindir)"
++      $(INSTALL_PROG) $(TARGET_PATH)/qemu-ifup "$(DESTDIR)$(configdir)"
  
  ifneq ($(wildcard .depend),)
  include .depend
 Index: ioemu/configure
 ===================================================================
---- ioemu.orig/configure       2006-08-28 20:19:23.000000000 +0100
-+++ ioemu/configure    2006-08-28 20:19:47.000000000 +0100
+--- ioemu.orig/configure       2006-10-24 14:37:25.000000000 +0100
++++ ioemu/configure    2006-10-24 14:40:20.000000000 +0100
 @@ -18,8 +18,8 @@
  
  # default parameters
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/xen-platform-device
--- a/tools/ioemu/patches/xen-platform-device   Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/ioemu/patches/xen-platform-device   Tue Oct 24 11:21:48 2006 -0600
@@ -3,8 +3,8 @@ will come later.
 
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/Makefile.target      2006-09-21 19:33:32.000000000 +0100
+--- ioemu.orig/Makefile.target 2006-10-24 14:41:01.000000000 +0100
++++ ioemu/Makefile.target      2006-10-24 14:41:01.000000000 +0100
 @@ -359,6 +359,7 @@
  VL_OBJS+= usb-uhci.o
  VL_OBJS+= piix4acpi.o
@@ -15,8 +15,8 @@ Index: ioemu/Makefile.target
  ifeq ($(TARGET_BASE_ARCH), ppc)
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/hw/pc.c      2006-09-21 19:33:32.000000000 +0100
+--- ioemu.orig/hw/pc.c 2006-10-24 14:41:00.000000000 +0100
++++ ioemu/hw/pc.c      2006-10-24 14:41:01.000000000 +0100
 @@ -823,6 +823,9 @@
      }
  #endif /* !CONFIG_DM */
@@ -30,8 +30,8 @@ Index: ioemu/hw/xen_platform.c
 Index: ioemu/hw/xen_platform.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/hw/xen_platform.c    2006-09-21 19:33:32.000000000 +0100
-@@ -0,0 +1,138 @@
++++ ioemu/hw/xen_platform.c    2006-10-24 14:41:04.000000000 +0100
+@@ -0,0 +1,144 @@
 +/*
 + * XEN platform fake pci device, formerly known as the event channel device
 + * 
@@ -131,7 +131,8 @@ Index: ioemu/hw/xen_platform.c
 +    uint8_t  bist; /* Built in self test */
 +    uint32_t base_address_regs[6];
 +    uint32_t reserved1;
-+    uint32_t reserved2;
++    uint16_t subsystem_vendor_id;
++    uint16_t subsystem_id;
 +    uint32_t rom_addr;
 +    uint32_t reserved3;
 +    uint32_t reserved4;
@@ -160,6 +161,11 @@ Index: ioemu/hw/xen_platform.c
 +    pch->header_type = 0;
 +    pch->interrupt_pin = 1;
 +
++    /* Microsoft WHQL requires non-zero subsystem IDs. */
++    /* http://www.pcisig.com/reflector/msg02205.html.  */
++    pch->subsystem_vendor_id = pch->vendor_id; /* Duplicate vendor id.  */
++    pch->subsystem_id        = 0x0001;         /* Hardcode sub-id as 1. */
++
 +    pci_register_io_region(d, 0, 0x100, PCI_ADDRESS_SPACE_IO,
 +                           platform_ioport_map);
 +
@@ -172,9 +178,9 @@ Index: ioemu/hw/xen_platform.c
 +}
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:33:32.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:33:32.000000000 +0100
-@@ -1210,6 +1210,9 @@
+--- ioemu.orig/vl.h    2006-10-24 14:41:01.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:41:01.000000000 +0100
+@@ -1212,6 +1212,9 @@
  void xenstore_check_new_media_present(int timeout);
  void xenstore_write_vncport(int vnc_display);
  
diff -r aa8ca06d209e -r d246b79986d1 
tools/ioemu/patches/xen-support-buffered-ioreqs
--- a/tools/ioemu/patches/xen-support-buffered-ioreqs   Tue Oct 24 10:08:30 
2006 -0600
+++ b/tools/ioemu/patches/xen-support-buffered-ioreqs   Tue Oct 24 11:21:48 
2006 -0600
@@ -1,8 +1,8 @@ Index: ioemu/vl.c
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:32.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:32.000000000 +0100
-@@ -5844,6 +5844,7 @@
+--- ioemu.orig/vl.c    2006-10-24 14:33:47.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:47.000000000 +0100
+@@ -5854,6 +5854,7 @@
      unsigned long nr_pages, tmp_nr_pages, shared_page_nr;
      xen_pfn_t *page_array;
      extern void *shared_page;
@@ -10,7 +10,7 @@ Index: ioemu/vl.c
  
      char qemu_dm_logfilename[64];
  
-@@ -6425,6 +6426,18 @@
+@@ -6440,6 +6441,18 @@
      fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n",
              shared_page_nr, (uint64_t)(page_array[shared_page_nr]));
  
@@ -31,8 +31,8 @@ Index: ioemu/vl.c
  #elif defined(__ia64__)
 Index: ioemu/target-i386-dm/helper2.c
 ===================================================================
---- ioemu.orig/target-i386-dm/helper2.c        2006-09-21 19:33:30.000000000 
+0100
-+++ ioemu/target-i386-dm/helper2.c     2006-09-21 19:33:32.000000000 +0100
+--- ioemu.orig/target-i386-dm/helper2.c        2006-10-24 14:33:45.000000000 
+0100
++++ ioemu/target-i386-dm/helper2.c     2006-10-24 14:33:47.000000000 +0100
 @@ -76,6 +76,10 @@
  
  shared_iopage_t *shared_page = NULL;
diff -r aa8ca06d209e -r d246b79986d1 
tools/ioemu/patches/xenstore-block-device-config
--- a/tools/ioemu/patches/xenstore-block-device-config  Tue Oct 24 10:08:30 
2006 -0600
+++ b/tools/ioemu/patches/xenstore-block-device-config  Tue Oct 24 11:21:48 
2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/Makefile.target
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/Makefile.target      2006-09-21 19:33:31.000000000 +0100
+--- ioemu.orig/Makefile.target 2006-10-24 14:31:36.000000000 +0100
++++ ioemu/Makefile.target      2006-10-24 14:33:28.000000000 +0100
 @@ -358,6 +358,7 @@
  VL_OBJS+= cirrus_vga.o mixeng.o parallel.o acpi.o piix_pci.o
  VL_OBJS+= usb-uhci.o
@@ -13,7 +13,7 @@ Index: ioemu/xenstore.c
 Index: ioemu/xenstore.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/xenstore.c   2006-09-21 19:33:31.000000000 +0100
++++ ioemu/xenstore.c   2006-10-24 14:33:28.000000000 +0100
 @@ -0,0 +1,187 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General
@@ -204,9 +204,9 @@ Index: ioemu/xenstore.c
 +}
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:31.000000000 +0100
-@@ -5249,9 +5249,11 @@
+--- ioemu.orig/vl.c    2006-10-24 14:33:24.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:28.000000000 +0100
+@@ -5256,9 +5256,11 @@
             "Standard options:\n"
             "-M machine      select emulated machine (-M ? for list)\n"
             "-fda/-fdb file  use 'file' as floppy disk 0/1 image\n"
@@ -218,7 +218,7 @@ Index: ioemu/vl.c
             "-boot [a|c|d]   boot on floppy (a), hard disk (c) or CD-ROM (d)\n"
           "-snapshot       write to temporary files instead of disk image 
files\n"
  #ifdef TARGET_I386
-@@ -5378,11 +5380,13 @@
+@@ -5386,11 +5388,13 @@
      QEMU_OPTION_M,
      QEMU_OPTION_fda,
      QEMU_OPTION_fdb,
@@ -232,7 +232,7 @@ Index: ioemu/vl.c
      QEMU_OPTION_boot,
      QEMU_OPTION_snapshot,
  #ifdef TARGET_I386
-@@ -5454,11 +5458,13 @@
+@@ -5463,11 +5467,13 @@
      { "M", HAS_ARG, QEMU_OPTION_M },
      { "fda", HAS_ARG, QEMU_OPTION_fda },
      { "fdb", HAS_ARG, QEMU_OPTION_fdb },
@@ -246,7 +246,7 @@ Index: ioemu/vl.c
      { "boot", HAS_ARG, QEMU_OPTION_boot },
      { "snapshot", 0, QEMU_OPTION_snapshot },
  #ifdef TARGET_I386
-@@ -5807,10 +5813,16 @@
+@@ -5817,10 +5823,16 @@
  #ifdef CONFIG_GDBSTUB
      int use_gdbstub, gdbstub_port;
  #endif
@@ -265,7 +265,7 @@ Index: ioemu/vl.c
      const char *kernel_filename, *kernel_cmdline;
      DisplayState *ds = &display_state;
      int cyls, heads, secs, translation;
-@@ -5871,8 +5883,10 @@
+@@ -5881,8 +5893,10 @@
      initrd_filename = NULL;
      for(i = 0; i < MAX_FD; i++)
          fd_filename[i] = NULL;
@@ -276,7 +276,7 @@ Index: ioemu/vl.c
      ram_size = DEFAULT_RAM_SIZE * 1024 * 1024;
      vga_ram_size = VGA_RAM_SIZE;
      bios_size = BIOS_SIZE;
-@@ -5886,11 +5900,13 @@
+@@ -5896,11 +5910,13 @@
      vncunused = 0;
      kernel_filename = NULL;
      kernel_cmdline = "";
@@ -290,7 +290,7 @@ Index: ioemu/vl.c
      cyls = heads = secs = 0;
      translation = BIOS_ATA_TRANSLATION_AUTO;
      pstrcpy(monitor_device, sizeof(monitor_device), "vc");
-@@ -5923,7 +5939,11 @@
+@@ -5935,7 +5951,11 @@
              break;
          r = argv[optind];
          if (r[0] != '-') {
@@ -302,7 +302,7 @@ Index: ioemu/vl.c
          } else {
              const QEMUOption *popt;
  
-@@ -5967,6 +5987,7 @@
+@@ -5979,6 +5999,7 @@
              case QEMU_OPTION_initrd:
                  initrd_filename = optarg;
                  break;
@@ -310,7 +310,7 @@ Index: ioemu/vl.c
              case QEMU_OPTION_hda:
              case QEMU_OPTION_hdb:
              case QEMU_OPTION_hdc:
-@@ -5979,6 +6000,7 @@
+@@ -5991,6 +6012,7 @@
                          cdrom_index = -1;
                  }
                  break;
@@ -318,7 +318,7 @@ Index: ioemu/vl.c
              case QEMU_OPTION_snapshot:
                  snapshot = 1;
                  break;
-@@ -6031,11 +6053,13 @@
+@@ -6043,11 +6065,13 @@
              case QEMU_OPTION_append:
                  kernel_cmdline = optarg;
                  break;
@@ -332,7 +332,7 @@ Index: ioemu/vl.c
              case QEMU_OPTION_boot:
                  boot_device = optarg[0];
                  if (boot_device != 'a' && 
-@@ -6290,12 +6314,18 @@
+@@ -6305,12 +6329,18 @@
          }
      }
  
@@ -351,7 +351,7 @@ Index: ioemu/vl.c
      if (!linux_boot && 
          hd_filename[0] == '\0' && 
          (cdrom_index >= 0 && hd_filename[cdrom_index] == '\0') &&
-@@ -6309,6 +6339,7 @@
+@@ -6324,6 +6354,7 @@
          else
              boot_device = 'd';
      }
@@ -359,7 +359,7 @@ Index: ioemu/vl.c
  
      setvbuf(stdout, NULL, _IOLBF, 0);
      
-@@ -6441,6 +6472,7 @@
+@@ -6456,6 +6487,7 @@
  
  #endif /* !CONFIG_DM */
  
@@ -367,7 +367,7 @@ Index: ioemu/vl.c
      /* we always create the cdrom drive, even if no disk is there */
      bdrv_init();
      if (cdrom_index >= 0) {
-@@ -6467,6 +6499,7 @@
+@@ -6482,6 +6514,7 @@
              }
          }
      }
@@ -375,7 +375,7 @@ Index: ioemu/vl.c
  
      /* we always create at least one floppy disk */
      fd_table[0] = bdrv_new("fda");
-@@ -6545,6 +6578,8 @@
+@@ -6560,6 +6593,8 @@
          }
      }
  
@@ -386,8 +386,8 @@ Index: ioemu/vl.c
                    kernel_filename, kernel_cmdline, initrd_filename,
 Index: ioemu/monitor.c
 ===================================================================
---- ioemu.orig/monitor.c       2006-09-21 19:33:30.000000000 +0100
-+++ ioemu/monitor.c    2006-09-21 19:33:31.000000000 +0100
+--- ioemu.orig/monitor.c       2006-10-24 14:31:36.000000000 +0100
++++ ioemu/monitor.c    2006-10-24 14:33:28.000000000 +0100
 @@ -24,6 +24,7 @@
  #include "vl.h"
  #include "disas.h"
@@ -416,8 +416,8 @@ Index: ioemu/monitor.c
      int i;
 Index: ioemu/block.c
 ===================================================================
---- ioemu.orig/block.c 2006-09-21 19:33:25.000000000 +0100
-+++ ioemu/block.c      2006-09-21 19:33:31.000000000 +0100
+--- ioemu.orig/block.c 2006-10-24 14:31:36.000000000 +0100
++++ ioemu/block.c      2006-10-24 14:33:28.000000000 +0100
 @@ -758,6 +758,7 @@
  static void raw_close(BlockDriverState *bs)
  {
@@ -428,9 +428,9 @@ Index: ioemu/block.c
  
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:33:31.000000000 +0100
-@@ -1189,6 +1189,8 @@
+--- ioemu.orig/vl.h    2006-10-24 14:33:24.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:33:28.000000000 +0100
+@@ -1191,6 +1191,8 @@
  void term_print_help(void);
  void monitor_readline(const char *prompt, int is_password,
                        char *buf, int buf_size);
@@ -439,7 +439,7 @@ Index: ioemu/vl.h
  
  /* readline.c */
  typedef void ReadLineFunc(void *opaque, const char *str);
-@@ -1201,6 +1203,13 @@
+@@ -1203,6 +1205,13 @@
  void readline_start(const char *prompt, int is_password,
                      ReadLineFunc *readline_func, void *opaque);
  
@@ -455,8 +455,8 @@ Index: ioemu/vl.h
  extern char domain_name[];
 Index: ioemu/hw/ide.c
 ===================================================================
---- ioemu.orig/hw/ide.c        2006-09-21 19:33:30.000000000 +0100
-+++ ioemu/hw/ide.c     2006-09-21 19:33:31.000000000 +0100
+--- ioemu.orig/hw/ide.c        2006-10-24 14:31:36.000000000 +0100
++++ ioemu/hw/ide.c     2006-10-24 14:33:28.000000000 +0100
 @@ -1158,6 +1158,7 @@
          } else {
              ide_atapi_cmd_error(s, SENSE_NOT_READY, 
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/xenstore-write-vnc-port
--- a/tools/ioemu/patches/xenstore-write-vnc-port       Tue Oct 24 10:08:30 
2006 -0600
+++ b/tools/ioemu/patches/xenstore-write-vnc-port       Tue Oct 24 11:21:48 
2006 -0600
@@ -1,7 +1,7 @@ Index: ioemu/xenstore.c
 Index: ioemu/xenstore.c
 ===================================================================
---- ioemu.orig/xenstore.c      2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/xenstore.c   2006-09-21 19:33:32.000000000 +0100
+--- ioemu.orig/xenstore.c      2006-10-24 14:33:47.000000000 +0100
++++ ioemu/xenstore.c   2006-10-24 14:33:47.000000000 +0100
 @@ -185,3 +185,31 @@
      free(image);
      free(vec);
@@ -36,10 +36,10 @@ Index: ioemu/xenstore.c
 +}
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vl.c 2006-09-21 19:33:32.000000000 +0100
-@@ -6535,6 +6535,7 @@
-       vnc_display = vnc_display_init(ds, vnc_display, vncunused);
+--- ioemu.orig/vl.c    2006-10-24 14:33:47.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:33:47.000000000 +0100
+@@ -6550,6 +6550,7 @@
+       vnc_display = vnc_display_init(ds, vnc_display, vncunused, 
&vnclisten_addr);
        if (vncviewer)
            vnc_start_viewer(vnc_display);
 +      xenstore_write_vncport(vnc_display);
@@ -48,9 +48,9 @@ Index: ioemu/vl.c
          sdl_display_init(ds, full_screen);
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-09-21 19:33:31.000000000 +0100
-+++ ioemu/vl.h 2006-09-21 19:33:32.000000000 +0100
-@@ -1208,6 +1208,7 @@
+--- ioemu.orig/vl.h    2006-10-24 14:33:47.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:33:47.000000000 +0100
+@@ -1210,6 +1210,7 @@
  int xenstore_fd(void);
  void xenstore_process_event(void *opaque);
  void xenstore_check_new_media_present(int timeout);
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_acm.c
--- a/tools/libxc/xc_acm.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_acm.c      Tue Oct 24 11:21:48 2006 -0600
@@ -24,12 +24,12 @@ int xc_acm_op(int xc_handle, int cmd, vo
     hypercall.arg[0] = cmd;
     hypercall.arg[1] = (unsigned long) arg;
 
-    if (mlock(arg, arg_size) != 0) {
-        PERROR("xc_acm_op: arg mlock failed");
+    if (lock_pages(arg, arg_size) != 0) {
+        PERROR("xc_acm_op: arg lock failed");
         goto out;
     }
     ret = do_xen_hypercall(xc_handle, &hypercall);
-    safe_munlock(arg, arg_size);
+    unlock_pages(arg, arg_size);
  out:
     return ret;
 }
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_domain.c   Tue Oct 24 11:21:48 2006 -0600
@@ -72,7 +72,7 @@ int xc_domain_shutdown(int xc_handle,
     arg.domain_id = domid;
     arg.reason = reason;
 
-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( lock_pages(&arg, sizeof(arg)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out1;
@@ -80,7 +80,7 @@ int xc_domain_shutdown(int xc_handle,
 
     ret = do_xen_hypercall(xc_handle, &hypercall);
 
-    safe_munlock(&arg, sizeof(arg));
+    unlock_pages(&arg, sizeof(arg));
 
  out1:
     return ret;
@@ -103,7 +103,7 @@ int xc_vcpu_setaffinity(int xc_handle,
                          (uint8_t *)&cpumap);
     domctl.u.vcpuaffinity.cpumap.nr_cpus = sizeof(cpumap) * 8;
     
-    if ( mlock(&cpumap, sizeof(cpumap)) != 0 )
+    if ( lock_pages(&cpumap, sizeof(cpumap)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out;
@@ -111,7 +111,7 @@ int xc_vcpu_setaffinity(int xc_handle,
 
     ret = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(&cpumap, sizeof(cpumap));
+    unlock_pages(&cpumap, sizeof(cpumap));
 
  out:
     return ret;
@@ -134,7 +134,7 @@ int xc_vcpu_getaffinity(int xc_handle,
                          (uint8_t *)cpumap);
     domctl.u.vcpuaffinity.cpumap.nr_cpus = sizeof(*cpumap) * 8;
     
-    if ( mlock(cpumap, sizeof(*cpumap)) != 0 )
+    if ( lock_pages(cpumap, sizeof(*cpumap)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out;
@@ -142,7 +142,7 @@ int xc_vcpu_getaffinity(int xc_handle,
 
     ret = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(cpumap, sizeof(*cpumap));
+    unlock_pages(cpumap, sizeof(*cpumap));
 
  out:
     return ret;
@@ -213,7 +213,7 @@ int xc_domain_getinfolist(int xc_handle,
     int ret = 0;
     DECLARE_SYSCTL;
 
-    if ( mlock(info, max_domains*sizeof(xc_domaininfo_t)) != 0 )
+    if ( lock_pages(info, max_domains*sizeof(xc_domaininfo_t)) != 0 )
         return -1;
 
     sysctl.cmd = XEN_SYSCTL_getdomaininfolist;
@@ -226,8 +226,7 @@ int xc_domain_getinfolist(int xc_handle,
     else
         ret = sysctl.u.getdomaininfolist.num_domains;
 
-    if ( munlock(info, max_domains*sizeof(xc_domaininfo_t)) != 0 )
-        ret = -1;
+    unlock_pages(info, max_domains*sizeof(xc_domaininfo_t));
 
     return ret;
 }
@@ -245,12 +244,12 @@ int xc_vcpu_getcontext(int xc_handle,
     domctl.u.vcpucontext.vcpu   = (uint16_t)vcpu;
     set_xen_guest_handle(domctl.u.vcpucontext.ctxt, ctxt);
 
-    if ( (rc = mlock(ctxt, sizeof(*ctxt))) != 0 )
+    if ( (rc = lock_pages(ctxt, sizeof(*ctxt))) != 0 )
         return rc;
 
     rc = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(ctxt, sizeof(*ctxt));
+    unlock_pages(ctxt, sizeof(*ctxt));
 
     return rc;
 }
@@ -512,12 +511,12 @@ int xc_vcpu_setcontext(int xc_handle,
     domctl.u.vcpucontext.vcpu = vcpu;
     set_xen_guest_handle(domctl.u.vcpucontext.ctxt, ctxt);
 
-    if ( (rc = mlock(ctxt, sizeof(*ctxt))) != 0 )
+    if ( (rc = lock_pages(ctxt, sizeof(*ctxt))) != 0 )
         return rc;
 
     rc = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(ctxt, sizeof(*ctxt));
+    unlock_pages(ctxt, sizeof(*ctxt));
 
     return rc;
 
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_evtchn.c
--- a/tools/libxc/xc_evtchn.c   Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_evtchn.c   Tue Oct 24 11:21:48 2006 -0600
@@ -18,16 +18,16 @@ static int do_evtchn_op(int xc_handle, i
     hypercall.arg[0] = cmd;
     hypercall.arg[1] = (unsigned long)arg;
 
-    if ( mlock(arg, arg_size) != 0 )
+    if ( lock_pages(arg, arg_size) != 0 )
     {
-        PERROR("do_evtchn_op: arg mlock failed");
+        PERROR("do_evtchn_op: arg lock failed");
         goto out;
     }
 
     if ((ret = do_xen_hypercall(xc_handle, &hypercall)) < 0)
         ERROR("do_evtchn_op: HYPERVISOR_event_channel_op failed: %d", ret);
 
-    safe_munlock(arg, arg_size);
+    unlock_pages(arg, arg_size);
  out:
     return ret;
 }
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_hvm_build.c        Tue Oct 24 11:21:48 2006 -0600
@@ -38,13 +38,13 @@ static void xc_set_hvm_param(int handle,
     arg.domid = dom;
     arg.index = param;
     arg.value = value;
-    if ( mlock(&arg, sizeof(arg)) != 0 )
+    if ( lock_pages(&arg, sizeof(arg)) != 0 )
     {
         PERROR("Could not lock memory for set parameter");
         return;
     }
     rc = do_xen_hypercall(handle, &hypercall);
-    safe_munlock(&arg, sizeof(arg));
+    unlock_pages(&arg, sizeof(arg));
     if (rc < 0)
         PERROR("set HVM parameter failed (%d)", rc);
 }
@@ -403,7 +403,7 @@ static int xc_hvm_build_internal(int xc_
         goto error_out;
     }
 
-    if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
+    if ( lock_pages(&st_ctxt, sizeof(st_ctxt) ) )
     {
         PERROR("%s: ctxt mlock failed", __func__);
         return 1;
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_linux_build.c      Tue Oct 24 11:21:48 2006 -0600
@@ -1140,9 +1140,9 @@ static int xc_linux_build_internal(int x
     memset(&st_ctxt, 0, sizeof(st_ctxt));
 #endif
 
-    if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
-    {
-        PERROR("%s: ctxt mlock failed", __func__);
+    if ( lock_pages(&st_ctxt, sizeof(st_ctxt) ) )
+    {
+        PERROR("%s: ctxt lock failed", __func__);
         return 1;
     }
 
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_linux_restore.c    Tue Oct 24 11:21:48 2006 -0600
@@ -162,9 +162,9 @@ int xc_linux_restore(int xc_handle, int 
         return 1;
     }
 
-    if (mlock(&ctxt, sizeof(ctxt))) {
+    if (lock_pages(&ctxt, sizeof(ctxt))) {
         /* needed for build domctl, but might as well do early */
-        ERROR("Unable to mlock ctxt");
+        ERROR("Unable to lock ctxt");
         return 1;
     }
 
@@ -251,8 +251,8 @@ int xc_linux_restore(int xc_handle, int 
         goto out;
     }
 
-    if (mlock(region_mfn, sizeof(xen_pfn_t) * MAX_BATCH_SIZE)) {
-        ERROR("Could not mlock region_mfn");
+    if (lock_pages(region_mfn, sizeof(xen_pfn_t) * MAX_BATCH_SIZE)) {
+        ERROR("Could not lock region_mfn");
         goto out;
     }
 
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_linux_save.c       Tue Oct 24 11:21:48 2006 -0600
@@ -628,8 +628,8 @@ int xc_linux_save(int xc_handle, int io_
         return 1;
     }
 
-    if (mlock(&ctxt, sizeof(ctxt))) {
-        ERROR("Unable to mlock ctxt");
+    if (lock_pages(&ctxt, sizeof(ctxt))) {
+        ERROR("Unable to lock ctxt");
         return 1;
     }
 
@@ -767,14 +767,14 @@ int xc_linux_save(int xc_handle, int io_
 
     memset(to_send, 0xff, BITMAP_SIZE);
 
-    if (mlock(to_send, BITMAP_SIZE)) {
-        ERROR("Unable to mlock to_send");
+    if (lock_pages(to_send, BITMAP_SIZE)) {
+        ERROR("Unable to lock to_send");
         return 1;
     }
 
     /* (to fix is local only) */
-    if (mlock(to_skip, BITMAP_SIZE)) {
-        ERROR("Unable to mlock to_skip");
+    if (lock_pages(to_skip, BITMAP_SIZE)) {
+        ERROR("Unable to lock to_skip");
         return 1;
     }
 
@@ -790,8 +790,8 @@ int xc_linux_save(int xc_handle, int io_
         goto out;
     }
 
-    if (mlock(pfn_type, MAX_BATCH_SIZE * sizeof(*pfn_type))) {
-        ERROR("Unable to mlock");
+    if (lock_pages(pfn_type, MAX_BATCH_SIZE * sizeof(*pfn_type))) {
+        ERROR("Unable to lock");
         goto out;
     }
 
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_misc.c     Tue Oct 24 11:21:48 2006 -0600
@@ -21,13 +21,13 @@ int xc_readconsolering(int xc_handle,
     sysctl.u.readconsole.count  = nr_chars;
     sysctl.u.readconsole.clear  = clear;
 
-    if ( (ret = mlock(buffer, nr_chars)) != 0 )
+    if ( (ret = lock_pages(buffer, nr_chars)) != 0 )
         return ret;
 
     if ( (ret = do_sysctl(xc_handle, &sysctl)) == 0 )
         *pnr_chars = sysctl.u.readconsole.count;
 
-    safe_munlock(buffer, nr_chars);
+    unlock_pages(buffer, nr_chars);
 
     return ret;
 }
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_private.c  Tue Oct 24 11:21:48 2006 -0600
@@ -7,7 +7,23 @@
 #include <inttypes.h>
 #include "xc_private.h"
 
-/* NB: arr must be mlock'ed */
+int lock_pages(void *addr, size_t len)
+{
+      int e = 0;
+#ifndef __sun__
+      e = mlock(addr, len);
+#endif
+      return (e);
+}
+
+void unlock_pages(void *addr, size_t len)
+{
+#ifndef __sun__
+       safe_munlock(addr, len);
+#endif
+}
+
+/* NB: arr must be locked */
 int xc_get_pfn_type_batch(int xc_handle,
                           uint32_t dom, int num, unsigned long *arr)
 {
@@ -51,7 +67,7 @@ int xc_mmuext_op(
     hypercall.arg[2] = (unsigned long)0;
     hypercall.arg[3] = (unsigned long)dom;
 
-    if ( mlock(op, nr_ops*sizeof(*op)) != 0 )
+    if ( lock_pages(op, nr_ops*sizeof(*op)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out1;
@@ -59,7 +75,7 @@ int xc_mmuext_op(
 
     ret = do_xen_hypercall(xc_handle, &hypercall);
 
-    safe_munlock(op, nr_ops*sizeof(*op));
+    unlock_pages(op, nr_ops*sizeof(*op));
 
  out1:
     return ret;
@@ -79,9 +95,9 @@ static int flush_mmu_updates(int xc_hand
     hypercall.arg[2] = 0;
     hypercall.arg[3] = mmu->subject;
 
-    if ( mlock(mmu->updates, sizeof(mmu->updates)) != 0 )
-    {
-        PERROR("flush_mmu_updates: mmu updates mlock failed");
+    if ( lock_pages(mmu->updates, sizeof(mmu->updates)) != 0 )
+    {
+        PERROR("flush_mmu_updates: mmu updates lock_pages failed");
         err = 1;
         goto out;
     }
@@ -94,7 +110,7 @@ static int flush_mmu_updates(int xc_hand
 
     mmu->idx = 0;
 
-    safe_munlock(mmu->updates, sizeof(mmu->updates));
+    unlock_pages(mmu->updates, sizeof(mmu->updates));
 
  out:
     return err;
@@ -149,62 +165,62 @@ int xc_memory_op(int xc_handle,
     case XENMEM_increase_reservation:
     case XENMEM_decrease_reservation:
     case XENMEM_populate_physmap:
-        if ( mlock(reservation, sizeof(*reservation)) != 0 )
-        {
-            PERROR("Could not mlock");
+        if ( lock_pages(reservation, sizeof(*reservation)) != 0 )
+        {
+            PERROR("Could not lock");
             goto out1;
         }
         get_xen_guest_handle(extent_start, reservation->extent_start);
         if ( (extent_start != NULL) &&
-             (mlock(extent_start,
+             (lock_pages(extent_start,
                     reservation->nr_extents * sizeof(xen_pfn_t)) != 0) )
         {
-            PERROR("Could not mlock");
-            safe_munlock(reservation, sizeof(*reservation));
+            PERROR("Could not lock");
+            unlock_pages(reservation, sizeof(*reservation));
             goto out1;
         }
         break;
     case XENMEM_machphys_mfn_list:
-        if ( mlock(xmml, sizeof(*xmml)) != 0 )
-        {
-            PERROR("Could not mlock");
+        if ( lock_pages(xmml, sizeof(*xmml)) != 0 )
+        {
+            PERROR("Could not lock");
             goto out1;
         }
         get_xen_guest_handle(extent_start, xmml->extent_start);
-        if ( mlock(extent_start,
+        if ( lock_pages(extent_start,
                    xmml->max_extents * sizeof(xen_pfn_t)) != 0 )
         {
-            PERROR("Could not mlock");
-            safe_munlock(xmml, sizeof(*xmml));
+            PERROR("Could not lock");
+            unlock_pages(xmml, sizeof(*xmml));
             goto out1;
         }
         break;
     case XENMEM_add_to_physmap:
-        if ( mlock(arg, sizeof(struct xen_add_to_physmap)) )
-        {
-            PERROR("Could not mlock");
+        if ( lock_pages(arg, sizeof(struct xen_add_to_physmap)) )
+        {
+            PERROR("Could not lock");
             goto out1;
         }
         break;
     case XENMEM_translate_gpfn_list:
-        if ( mlock(trans, sizeof(*trans)) != 0 )
-        {
-            PERROR("Could not mlock");
+        if ( lock_pages(trans, sizeof(*trans)) != 0 )
+        {
+            PERROR("Could not lock");
             goto out1;
         }
         get_xen_guest_handle(gpfn_list, trans->gpfn_list);
-        if ( mlock(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)) != 0 )
-        {
-            PERROR("Could not mlock");
-            safe_munlock(trans, sizeof(*trans));
+        if ( lock_pages(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)) != 0 )
+        {
+            PERROR("Could not lock");
+            unlock_pages(trans, sizeof(*trans));
             goto out1;
         }
         get_xen_guest_handle(mfn_list, trans->mfn_list);
-        if ( mlock(mfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)) != 0 )
-        {
-            PERROR("Could not mlock");
-            safe_munlock(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t));
-            safe_munlock(trans, sizeof(*trans));
+        if ( lock_pages(mfn_list, trans->nr_gpfns * sizeof(xen_pfn_t)) != 0 )
+        {
+            PERROR("Could not lock");
+            unlock_pages(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t));
+            unlock_pages(trans, sizeof(*trans));
             goto out1;
         }
         break;
@@ -217,27 +233,27 @@ int xc_memory_op(int xc_handle,
     case XENMEM_increase_reservation:
     case XENMEM_decrease_reservation:
     case XENMEM_populate_physmap:
-        safe_munlock(reservation, sizeof(*reservation));
+        unlock_pages(reservation, sizeof(*reservation));
         get_xen_guest_handle(extent_start, reservation->extent_start);
         if ( extent_start != NULL )
-            safe_munlock(extent_start,
+            unlock_pages(extent_start,
                          reservation->nr_extents * sizeof(xen_pfn_t));
         break;
     case XENMEM_machphys_mfn_list:
-        safe_munlock(xmml, sizeof(*xmml));
+        unlock_pages(xmml, sizeof(*xmml));
         get_xen_guest_handle(extent_start, xmml->extent_start);
-        safe_munlock(extent_start,
+        unlock_pages(extent_start,
                      xmml->max_extents * sizeof(xen_pfn_t));
         break;
     case XENMEM_add_to_physmap:
-        safe_munlock(arg, sizeof(struct xen_add_to_physmap));
+        unlock_pages(arg, sizeof(struct xen_add_to_physmap));
         break;
     case XENMEM_translate_gpfn_list:
             get_xen_guest_handle(mfn_list, trans->mfn_list);
-            safe_munlock(mfn_list, trans->nr_gpfns * sizeof(xen_pfn_t));
+            unlock_pages(mfn_list, trans->nr_gpfns * sizeof(xen_pfn_t));
             get_xen_guest_handle(gpfn_list, trans->gpfn_list);
-            safe_munlock(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t));
-            safe_munlock(trans, sizeof(*trans));
+            unlock_pages(gpfn_list, trans->nr_gpfns * sizeof(xen_pfn_t));
+            unlock_pages(trans, sizeof(*trans));
         break;
     }
 
@@ -279,15 +295,15 @@ int xc_get_pfn_list(int xc_handle,
     memset(pfn_buf, 0, max_pfns * sizeof(xen_pfn_t));
 #endif
 
-    if ( mlock(pfn_buf, max_pfns * sizeof(xen_pfn_t)) != 0 )
-    {
-        PERROR("xc_get_pfn_list: pfn_buf mlock failed");
+    if ( lock_pages(pfn_buf, max_pfns * sizeof(xen_pfn_t)) != 0 )
+    {
+        PERROR("xc_get_pfn_list: pfn_buf lock failed");
         return -1;
     }
 
     ret = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(pfn_buf, max_pfns * sizeof(xen_pfn_t));
+    unlock_pages(pfn_buf, max_pfns * sizeof(xen_pfn_t));
 
 #if 0
 #ifdef DEBUG
@@ -419,7 +435,7 @@ int xc_version(int xc_handle, int cmd, v
         break;
     }
 
-    if ( (argsize != 0) && (mlock(arg, argsize) != 0) )
+    if ( (argsize != 0) && (lock_pages(arg, argsize) != 0) )
     {
         PERROR("Could not lock memory for version hypercall");
         return -ENOMEM;
@@ -433,7 +449,7 @@ int xc_version(int xc_handle, int cmd, v
     rc = do_xen_version(xc_handle, cmd, arg);
 
     if ( argsize != 0 )
-        safe_munlock(arg, argsize);
+        unlock_pages(arg, argsize);
 
     return rc;
 }
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_private.h  Tue Oct 24 11:21:48 2006 -0600
@@ -66,6 +66,9 @@ do {                                    
     errno = __saved_errno;                      \
 } while (0)
 
+int lock_pages(void *addr, size_t len);
+void unlock_pages(void *addr, size_t len);
+
 #define PERROR(_m, _a...)                               \
 do {                                                    \
     int __saved_errno = errno;                          \
@@ -104,7 +107,7 @@ static inline int do_domctl(int xc_handl
     hypercall.op     = __HYPERVISOR_domctl;
     hypercall.arg[0] = (unsigned long)domctl;
 
-    if ( mlock(domctl, sizeof(*domctl)) != 0 )
+    if ( lock_pages(domctl, sizeof(*domctl)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out1;
@@ -117,7 +120,7 @@ static inline int do_domctl(int xc_handl
                     " rebuild the user-space tool set?\n");
     }
 
-    safe_munlock(domctl, sizeof(*domctl));
+    unlock_pages(domctl, sizeof(*domctl));
 
  out1:
     return ret;
@@ -133,7 +136,7 @@ static inline int do_sysctl(int xc_handl
     hypercall.op     = __HYPERVISOR_sysctl;
     hypercall.arg[0] = (unsigned long)sysctl;
 
-    if ( mlock(sysctl, sizeof(*sysctl)) != 0 )
+    if ( lock_pages(sysctl, sizeof(*sysctl)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out1;
@@ -146,7 +149,7 @@ static inline int do_sysctl(int xc_handl
                     " rebuild the user-space tool set?\n");
     }
 
-    safe_munlock(sysctl, sizeof(*sysctl));
+    unlock_pages(sysctl, sizeof(*sysctl));
 
  out1:
     return ret;
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xc_tbuf.c
--- a/tools/libxc/xc_tbuf.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xc_tbuf.c     Tue Oct 24 11:21:48 2006 -0600
@@ -104,7 +104,7 @@ int xc_tbuf_set_cpu_mask(int xc_handle, 
     set_xen_guest_handle(sysctl.u.tbuf_op.cpu_mask.bitmap, (uint8_t *)&mask);
     sysctl.u.tbuf_op.cpu_mask.nr_cpus = sizeof(mask) * 8;
 
-    if ( mlock(&mask, sizeof(mask)) != 0 )
+    if ( lock_pages(&mask, sizeof(mask)) != 0 )
     {
         PERROR("Could not lock memory for Xen hypercall");
         goto out;
@@ -112,7 +112,7 @@ int xc_tbuf_set_cpu_mask(int xc_handle, 
 
     ret = do_sysctl(xc_handle, &sysctl);
 
-    safe_munlock(&mask, sizeof(mask));
+    unlock_pages(&mask, sizeof(mask));
 
  out:
     return ret;
diff -r aa8ca06d209e -r d246b79986d1 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/libxc/xg_private.c  Tue Oct 24 11:21:48 2006 -0600
@@ -10,6 +10,22 @@
 #include <strings.h>
 
 #include "xg_private.h"
+
+int lock_pages(void *addr, size_t len)
+{
+    int e = 0;
+#ifndef __sun__
+    e = mlock(addr, len);
+#endif
+    return (e);
+}
+
+void unlock_pages(void *addr, size_t len)
+{
+#ifndef __sun__
+    safe_munlock(addr, len);
+#endif
+}
 
 char *xc_read_image(const char *filename, unsigned long *size)
 {
diff -r aa8ca06d209e -r d246b79986d1 tools/misc/xenperf.c
--- a/tools/misc/xenperf.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/misc/xenperf.c      Tue Oct 24 11:21:48 2006 -0600
@@ -17,6 +17,22 @@
 #include <sys/mman.h>
 #include <errno.h>
 #include <string.h>
+
+int lock_pages(void *addr, size_t len)
+{
+    int e = 0;
+#ifndef __sun__
+    e = mlock(addr, len);
+#endif
+    return (e);
+}
+
+void unlock_pages(void *addr, size_t len)
+{
+#ifndef __sun__
+       munlock(addr, len);
+#endif
+}
 
 int main(int argc, char *argv[])
 {
@@ -87,11 +103,11 @@ int main(int argc, char *argv[])
        pcv = malloc(sizeof(*pcv) * num_val);
 
     if ( pcd == NULL
-                || mlock(pcd, sizeof(*pcd) * num_desc) != 0
+                || lock_pages(pcd, sizeof(*pcd) * num_desc) != 0
                 || pcv == NULL
-                || mlock(pcd, sizeof(*pcv) * num_val) != 0)
+                || lock_pages(pcd, sizeof(*pcv) * num_val) != 0)
     {
-        fprintf(stderr, "Could not alloc or mlock buffers: %d (%s)\n",
+        fprintf(stderr, "Could not alloc or lock buffers: %d (%s)\n",
                 errno, strerror(errno));
         exit(-1);
     }
@@ -104,8 +120,8 @@ int main(int argc, char *argv[])
         return 1;
     }
 
-    munlock(pcd, sizeof(*pcd) * num_desc);
-    munlock(pcv, sizeof(*pcv) * num_val);
+    unlock_pages(pcd, sizeof(*pcd) * num_desc);
+    unlock_pages(pcv, sizeof(*pcv) * num_val);
 
        val = pcv;
     for ( i = 0; i < num_desc; i++ )
diff -r aa8ca06d209e -r d246b79986d1 tools/python/xen/lowlevel/acm/acm.c
--- a/tools/python/xen/lowlevel/acm/acm.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/python/xen/lowlevel/acm/acm.c       Tue Oct 24 11:21:48 2006 -0600
@@ -147,9 +147,10 @@ static PyObject *getdecision(PyObject * 
 {
     char *arg1_name, *arg1, *arg2_name, *arg2, *decision = NULL;
     struct acm_getdecision getdecision;
-    int xc_handle;
-
-    if (!PyArg_ParseTuple(args, "ssss", &arg1_name, &arg1, &arg2_name, &arg2)) 
{
+    int xc_handle, rc;
+
+    if (!PyArg_ParseTuple(args, "ssss", &arg1_name,
+                          &arg1, &arg2_name, &arg2)) {
         return NULL;
     }
 
@@ -179,12 +180,16 @@ static PyObject *getdecision(PyObject * 
         getdecision.id2.ssidref = atol(arg2);
     }
 
-    if (xc_acm_op(xc_handle, ACMOP_getdecision, &getdecision, 
sizeof(getdecision)) < 0) {
+    rc = xc_acm_op(xc_handle, ACMOP_getdecision,
+                   &getdecision, sizeof(getdecision));
+
+    xc_interface_close(xc_handle);
+
+    if (rc < 0) {
         if (errno == EACCES)
             PERROR("ACM operation failed.");
-    }
-
-    xc_interface_close(xc_handle);
+        return NULL;
+    }
 
     if (getdecision.acm_decision == ACM_ACCESS_PERMITTED)
         decision = "PERMITTED";
diff -r aa8ca06d209e -r d246b79986d1 tools/python/xen/util/security.py
--- a/tools/python/xen/util/security.py Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/python/xen/util/security.py Tue Oct 24 11:21:48 2006 -0600
@@ -601,8 +601,15 @@ def unify_resname(resource):
     """Makes all resource locations absolute. In case of physical
     resources, '/dev/' is added to local file names"""
 
+    if not resource:
+        return resource
+
     # sanity check on resource name
-    (type, resfile) = resource.split(":")
+    try:
+        (type, resfile) = resource.split(":")
+    except:
+        err("Resource spec '%s' contains no ':' delimiter" % resource)
+
     if type == "phy":
         if not resfile.startswith("/"):
             resfile = "/dev/" + resfile
diff -r aa8ca06d209e -r d246b79986d1 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/python/xen/xend/XendDomain.py       Tue Oct 24 11:21:48 2006 -0600
@@ -227,6 +227,9 @@ class XendDomain:
         try:
             dominfo = XendDomainInfo.create(config)
             self._add_domain(dominfo)
+            self.domain_sched_credit_set(dominfo.getDomid(),
+                                         dominfo.getWeight(),
+                                         dominfo.getCap())
             return dominfo
         finally:
             self.domains_lock.release()
diff -r aa8ca06d209e -r d246b79986d1 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Oct 24 11:21:48 2006 -0600
@@ -131,7 +131,8 @@ ROUNDTRIPPING_CONFIG_ENTRIES = [
     ('uuid',            str),
     ('vcpus',           int),
     ('vcpu_avail',      int),
-    ('cpu_weight',      float),
+    ('cpu_cap',         int),
+    ('cpu_weight',      int),
     ('memory',          int),
     ('shadow_memory',   int),
     ('maxmem',          int),
@@ -562,7 +563,8 @@ class XendDomainInfo:
             defaultInfo('features',     lambda: "")
             defaultInfo('cpu',          lambda: None)
             defaultInfo('cpus',         lambda: [])
-            defaultInfo('cpu_weight',   lambda: 1.0)
+            defaultInfo('cpu_cap',      lambda: 0)
+            defaultInfo('cpu_weight',   lambda: 256)
 
             # some domains don't have a config file (e.g. dom0 )
             # to set number of vcpus so we derive available cpus
@@ -825,6 +827,12 @@ class XendDomainInfo:
 
     def getResume(self):
         return "%s" % self.info['resume']
+
+    def getCap(self):
+        return self.info['cpu_cap']
+
+    def getWeight(self):
+        return self.info['cpu_weight']
 
     def endRestore(self):
         self.setResume(False)
diff -r aa8ca06d209e -r d246b79986d1 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/python/xen/xm/create.py     Tue Oct 24 11:21:48 2006 -0600
@@ -189,10 +189,14 @@ gopts.var('vcpus', val='VCPUS',
           fn=set_int, default=1,
           use="# of Virtual CPUS in domain.")
 
+gopts.var('cpu_cap', val='CAP',
+          fn=set_int, default=None,
+          use="""Set the maximum amount of cpu.
+          CAP is a percentage that fixes the maximum amount of cpu.""")
+
 gopts.var('cpu_weight', val='WEIGHT',
-          fn=set_float, default=None,
-          use="""Set the new domain's cpu weight.
-          WEIGHT is a float that controls the domain's share of the cpu.""")
+          fn=set_int, default=None,
+          use="""Set the cpu time ratio to be allocated to the domain.""")
 
 gopts.var('restart', val='onreboot|always|never',
           fn=set_value, default=None,
@@ -687,6 +691,8 @@ def make_config(vals):
         config.append(['cpu', vals.cpu])
     if vals.cpus is not None:
         config.append(['cpus', vals.cpus])
+    if vals.cpu_cap is not None:
+        config.append(['cpu_cap', vals.cpu_cap])
     if vals.cpu_weight is not None:
         config.append(['cpu_weight', vals.cpu_weight])
     if vals.blkif:
@@ -1143,6 +1149,8 @@ def config_security_check(config, verbos
         except security.ACMError:
             print "   %s: DENIED" % (resource)
             (res_label, res_policy) = security.get_res_label(resource)
+            if not res_label:
+                res_label = ""
             print "   --> res:"+res_label+" ("+res_policy+")"
             print "   --> dom:"+domain_label+" ("+domain_policy+")"
             answer = 0
@@ -1181,7 +1189,7 @@ def main(argv):
         PrettyPrint.prettyprint(config)
     else:
         if not create_security_check(config):
-            raise OptionError('Security Configuration prevents domain from 
starting')
+            raise security.ACMError('Security Configuration prevents domain 
from starting')
         else:
             dom = make_domain(opts, config)
             if opts.vals.console_autoconnect:
diff -r aa8ca06d209e -r d246b79986d1 tools/python/xen/xm/opts.py
--- a/tools/python/xen/xm/opts.py       Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/python/xen/xm/opts.py       Tue Oct 24 11:21:48 2006 -0600
@@ -488,6 +488,8 @@ class Opts:
                 p = os.path.join(x, self.vals.defconfig)
             else:
                 p = self.vals.defconfig
+            if not p.startswith('/'):
+                p = os.path.join(os.path.curdir, p)
             if os.path.exists(p):
                 self.info('Using config file "%s".' % p)
                 self.load(p, help)
@@ -518,6 +520,10 @@ class Opts:
         exec cmd in globs, locs
         try:
             execfile(defconfig, globs, locs)
+        except SyntaxError,e:
+                raise SyntaxError, \
+                "Errors were found at line %d while processing %s:\n\t%s"\
+                %(e.lineno,defconfig,e.text)
         except:
             if not help: raise
         if help:
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/README
--- a/tools/xm-test/README      Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/README      Tue Oct 24 11:21:48 2006 -0600
@@ -45,7 +45,7 @@ NB: If you have the initrd.img from anot
 NB: If you have the initrd.img from another installation of xm-test,
 you can copy it into the ramdisk directory to eliminate the need to
 rebuild it.  If you do this, there is no need to run 'make' again.
-Simply copy the initrd-X.Y.img file into ramdisk/ and then run:
+Simply copy the initrd-X.Y-ARCH.img file into ramdisk/ and then run:
 
    # make existing
 
@@ -53,7 +53,7 @@ Or, you can run:
    # INITRD="http://url.of.initrd.repo/"; make existing
 
 You do not need to include the name of the image itself in the url, 
-however, an initrd with the right name (initrd.X.Y.img) and version 
+however, an initrd with the right name (initrd.X.Y-ARCH.img) and version 
 number must exist at that location.  The script will determine which 
 version of the initrd it needs and try to download the right file from 
 that location.
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/configure.ac
--- a/tools/xm-test/configure.ac        Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/configure.ac        Tue Oct 24 11:21:48 2006 -0600
@@ -1,8 +1,10 @@
 # xm-test configure.ac input script
 
 # Basic header information
-AC_INIT([xm-test], [0.8.0])
+AC_INIT([xm-test], [1.0.0])
 AM_INIT_AUTOMAKE([1.7 foreign])
+
+MK=''; AC_SUBST(MK)
 
 # Check for dependencies
 AC_PROG_CC
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py    Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Tue Oct 24 11:21:48 2006 -0600
@@ -31,6 +31,7 @@ import fcntl
 import fcntl
 import select
 
+import arch
 from Test import *
 
 TIMEDOUT = 1
@@ -120,6 +121,7 @@ class XmConsole:
     def __getprompt(self, fd):
         timeout = 0
         bytes = 0
+        buffer = ""
         while timeout < 180:
             # eat anything while total bytes less than limit else raise RUNAWAY
             while (not self.limit) or (bytes < self.limit):
@@ -130,6 +132,7 @@ class XmConsole:
                         if self.debugMe:
                             sys.stdout.write(foo)
                         bytes += 1
+                        buffer += foo
                     except Exception, exn:
                         raise ConsoleError(str(exn))
                 else:
@@ -137,6 +140,8 @@ class XmConsole:
             else:
                 raise ConsoleError("Console run-away (exceeded %i bytes)"
                                    % self.limit, RUNAWAY)
+            # Check to see if the buffer contains anything interetsing
+            arch.checkBuffer(buffer)
             # press enter
             os.write(self.consoleFd, "\n")
             # look for prompt
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Oct 24 11:21:48 2006 -0600
@@ -20,34 +20,23 @@
 
 import sys
 import commands
-import os
 import re
 import time
 
 from Xm import *
+from arch import *
 from Test import *
 from config import *
 from Console import *
 from XenDevice import *
 from acm import *
 
-BLOCK_ROOT_DEV = "hda"
-
-def getDeviceModel():
-    """Get the path to the device model based on
-    the architecture reported in uname"""
-    arch = os.uname()[4]
-    if re.search("64", arch):
-        return "/usr/lib64/xen/bin/qemu-dm"
-    else:
-        return "/usr/lib/xen/bin/qemu-dm"
 
 def getDefaultKernel():
-    """Get the path to the default DomU kernel"""
-    dom0Ver = commands.getoutput("uname -r");
-    domUVer = dom0Ver.replace("xen0", "xenU");
-    
-    return "/boot/vmlinuz-" + domUVer;
+    return arch.getDefaultKernel()
+
+def getRdPath():
+    return arch.getRdPath()
 
 def getUniqueName():
     """Get a uniqueish name for use in a domain"""
@@ -56,43 +45,8 @@ def getUniqueName():
     test_name = re.sub("\.test", "", test_name)
     test_name = re.sub("[\/\.]", "", test_name)
     name = "%s-%i" % (test_name, unixtime)
-    
+
     return name
-
-def getRdPath():
-    rdpath = os.environ.get("RD_PATH")
-    if not rdpath:
-        rdpath = "../../ramdisk"
-    rdpath = os.path.abspath(rdpath)
-
-    return rdpath
-
-ParavirtDefaults = {"memory"       : 64,
-                    "vcpus"        : 1,
-                    "kernel"       : getDefaultKernel(),
-                    "root"         : "/dev/ram0",
-                    "ramdisk"      : getRdPath() + "/initrd.img"
-                    }
-HVMDefaults =      {"memory"       : 64,
-                    "vcpus"        : 1,
-                    "acpi"         : 0,
-                    "apic"         : 0,
-                    "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
-                                   (getRdPath(), BLOCK_ROOT_DEV)],
-                    "kernel"       : "/usr/lib/xen/boot/hvmloader",
-                    "builder"      : "hvm",
-                    "sdl"          : 0,
-                    "vnc"          : 0,
-                    "vncviewer"    : 0,
-                    "nographic"    : 1,
-                    "serial"       : "pty",
-                    "device_model" : getDeviceModel()
-                    }
-
-if ENABLE_HVM_SUPPORT:
-    configDefaults = HVMDefaults
-else:
-    configDefaults = ParavirtDefaults
 
 class XenConfig:
     """An object to help create a xen-compliant config file"""
@@ -145,8 +99,12 @@ class XenConfig:
 
     def setOpt(self, name, value):
         """Set an option in the config"""
-        if name in self.opts.keys() and isinstance(self.opts[name], list) and 
not isinstance(value, list):
+        if name in self.opts.keys() and isinstance(self.opts[name] ,
+                                        list) and not isinstance(value, list):
                 self.opts[name] = [value]
+        # "extra" is special so append to it.
+        elif name == "extra" and name in self.opts.keys():
+            self.opts[name] += " %s" % (value)
         else:
             self.opts[name] = value
 
@@ -182,7 +140,7 @@ class DomainError(Exception):
             self.errorcode = int(errorcode)
         except Exception, e:
             self.errorcode = -1
-            
+
     def __str__(self):
         return str(self.msg)
 
@@ -204,7 +162,7 @@ class XenDomain:
         self.devices = {}
         self.netEnv = "bridge"
 
-        # Set domain type, either PV for ParaVirt domU or HVM for 
+        # Set domain type, either PV for ParaVirt domU or HVM for
         # FullVirt domain
         if ENABLE_HVM_SUPPORT:
             self.type = "HVM"
@@ -337,7 +295,8 @@ class XenDomain:
 
 class XmTestDomain(XenDomain):
 
-    def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
+    def __init__(self, name=None, extraConfig=None,
+                 baseConfig=arch.configDefaults):
         """Create a new xm-test domain
         @param name: The requested domain name
         @param extraConfig: Additional configuration options
@@ -356,11 +315,12 @@ class XmTestDomain(XenDomain):
         XenDomain.__init__(self, config.getOpt("name"), config=config)
 
     def minSafeMem(self):
-        return 32
+        return arch.minSafeMem
 
 class XmTestNetDomain(XmTestDomain):
 
-    def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
+    def __init__(self, name=None, extraConfig=None,
+                 baseConfig=arch.configDefaults):
         """Create a new xm-test domain with one network device
         @param name: The requested domain name
         @param extraConfig: Additional configuration options
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/lib/XmTestLib/acm.py
--- a/tools/xm-test/lib/XmTestLib/acm.py        Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/lib/XmTestLib/acm.py        Tue Oct 24 11:21:48 2006 -0600
@@ -26,7 +26,7 @@ except:
     ACM_LABEL_RESOURCES = False
 
 labeled_resources = {}
-acm_verbose = True
+acm_verbose = False
 
 def isACMEnabled():
     return security.on()
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/lib/XmTestReport/OSReport.py
--- a/tools/xm-test/lib/XmTestReport/OSReport.py        Tue Oct 24 10:08:30 
2006 -0600
+++ b/tools/xm-test/lib/XmTestReport/OSReport.py        Tue Oct 24 11:21:48 
2006 -0600
@@ -29,6 +29,7 @@ import os
 import os
 import commands
 import sys
+import arch
 
 class Machine:
 
@@ -89,8 +90,6 @@ class Machine:
         self.values = {}
         self.errors = 0
 
-        cpuValues = {"model_name"       : "Unknown",
-                     "flags"            : "Unknown"}
         xenValues = {"nr_cpus"          : "Unknown",
                      "nr_nodes"         : "Unknown",
                      "sockets_per_node" : "Unknown",
@@ -100,12 +99,7 @@ class Machine:
                      "total_memory"     : "Unknown"}
 
         xen = self.__getXenInfo(xenValues)
-        cpu = self.__getCpuInfo(cpuValues)
-
-        if cpu["model_name"] == "Unknown":   
-            cpuValues={"arch"  : "Unknown",
-                       "features": "Unknown"}
-            cpu=self.__getCpuInfo(cpuValues)
+        cpu = self.__getCpuInfo(arch.cpuValues)
 
         for k in xen.keys():
             self.values[k] = xen[k]
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/ramdisk/Makefile.am Tue Oct 24 11:21:48 2006 -0600
@@ -1,19 +1,39 @@ INITRD ?= http://xm-test.xensource.com/r
+#
+# make existing:
+#
+#   Download a pre-built ramdisk.
+#     INITRD = <Directory to download ramdisk from>
+#
+# make initrd:
+#
+#   Make a ramdisk from scratch.
+#     BR_URL = <The URL of the Buildroot source code>
+#     BR_SNAPSHOT = 1  Set BR_URL to the upstream Buildroot daily snapshot.
+#     BR_ARCH = <The build architecture for the initrd>
+#
+
 INITRD ?= http://xm-test.xensource.com/ramdisks
 
+BR_ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e 's/ppc\(64\)*/powerpc/')
+
+@MK@ifdef BR_SNAPSHOT
+  BR_URL = 
http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2
+@MK@else
+  BR_URL ?= http://xm-test.xensource.com/ramdisks/buildroot-20061023.tar.bz2
+@MK@endif
+BR_TAR = $(notdir $(BR_URL))
+
+BR_SRC = buildroot
+BR_IMG = $(BR_SRC)/rootfs.$(BR_ARCH).ext2
+
+BR_ROOT = build_$(BR_ARCH)/root
+
 EXTRA_DIST = skel configs patches
-
-BR_TAR = buildroot-20060606.tar.bz2
-BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
-#BR_URL = 
http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2
-BR_SRC = buildroot
-BR_IMG = $(BR_SRC)/rootfs.i386.ext2
-
-BR_ROOT = build_i386/root
 
 HVM_SCRIPT = bin/create_disk_image
 
 XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 
's/(\d+)\.(\d+)\.\d+/\1.\2/')
-XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
+XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER)-$(BR_ARCH).img
 
 EXTRA_ROOT_DIRS = sys
 
@@ -30,7 +50,7 @@ endif
        tar xjf $(BR_TAR)
 
 $(BR_IMG): $(BR_SRC)
-       cp configs/buildroot $(BR_SRC)/.config
+       cp configs/buildroot-$(BR_ARCH) $(BR_SRC)/.config
        cp configs/busybox $(BR_SRC)/package/busybox/busybox.config
        cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config
        (for i in patches/buildroot/*.patch; do \
@@ -42,7 +62,7 @@ endif
        (cd skel; mkdir -p $(EXTRA_ROOT_DIRS); tar cf - .) \
                | (cd $(BR_SRC)/$(BR_ROOT); tar xvf -)
        cd $(BR_SRC) && make
-       cp $(BR_IMG) initrd-$(XMTEST_MAJ_VER).img
+       cp $(BR_IMG) $(XMTEST_VER_IMG)
 
 initrd.img: $(XMTEST_VER_IMG)
        ln -sf $(XMTEST_VER_IMG) initrd.img
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/runtest.sh
--- a/tools/xm-test/runtest.sh  Tue Oct 24 10:08:30 2006 -0600
+++ b/tools/xm-test/runtest.sh  Tue Oct 24 11:21:48 2006 -0600
@@ -76,9 +76,11 @@ runnable_tests() {
     # using the right version
     realrd=$(readlink ramdisk/initrd.img)
     eval $(./lib/XmTestReport/xmtest.py)
-    rrdver="initrd-${XM_TEST_MAJ}.${XM_TEST_MIN}.img"
+    ARCH=$(uname -m | sed -e s/i.86/i386/ -e 's/ppc\(64\)*/powerpc/')
+    rrdver="initrd-${XM_TEST_MAJ}.${XM_TEST_MIN}-${ARCH}.img"
     if [ "$realrd" != "$rrdver" ]; then
-       echo "Error: ramdisk/initrd.img is from an old version"
+       echo "Error: ramdisk/initrd.img is from an old version, or is not for 
this "
+        echo "architecture ($ARCH)."
        echo "You need to build a ramdisk from at least 
${XM_TEST_MAJ}.${XM_TEST_MIN}"
        exit 1
     fi
@@ -197,7 +199,10 @@ unsafe=no
 unsafe=no
 GROUPENTERED=default
 
-cp -f tests/security-acm/xm-test-security_policy.xml 
/etc/xen/acm-security/policies
+if [ -d /etc/xen/acm-security/policies ]; then
+       cp -f tests/security-acm/xm-test-security_policy.xml \
+             /etc/xen/acm-security/policies
+fi
 
 # Resolve options
 while [ $# -gt 0 ]
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/tests/create/11_create_concurrent_pos.py
--- a/tools/xm-test/tests/create/11_create_concurrent_pos.py    Tue Oct 24 
10:08:30 2006 -0600
+++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py    Tue Oct 24 
11:21:48 2006 -0600
@@ -16,7 +16,7 @@ else:
     MAX_DOMS = 50
 
 MIN_DOMS    = 5
-MEM_PER_DOM = 24
+MEM_PER_DOM = minSafeMem()
 
 domains = []
 console = []
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/tests/create/12_create_concurrent_stress_pos.py
--- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py     Tue Oct 
24 10:08:30 2006 -0600
+++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py     Tue Oct 
24 11:21:48 2006 -0600
@@ -8,10 +8,17 @@ import time
 import time
 
 DOMS=5
-MEM=32
+MEM=minSafeMem()
 DUR=60
 
 domains = []
+
+free_mem = int(getInfo("free_memory"))
+NUM_DOMS = int(free_mem / MEM)
+
+if NUM_DOMS < DOMS:
+    SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" %
+         (DOMS * MEM, DOMS, MEM, free_mem))
 
 for i in range(0,DOMS):
     dom = XmTestDomain(extraConfig={"memory" : MEM})
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/tests/create/15_create_smallmem_pos.py
--- a/tools/xm-test/tests/create/15_create_smallmem_pos.py      Tue Oct 24 
10:08:30 2006 -0600
+++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py      Tue Oct 24 
11:21:48 2006 -0600
@@ -5,8 +5,8 @@
 
 from XmTestLib import *
 
-# 32MBs is the default lower limit for creating domains, it should work
-MEM = 32
+# Create a domain with the minimum memory allocation
+MEM = minSafeMem()
 
 domain = XmTestDomain(extraConfig={"memory": MEM,
                                    "extra" :"mem=%iM" % MEM})
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/tests/create/16_create_smallmem_neg.py
--- a/tools/xm-test/tests/create/16_create_smallmem_neg.py      Tue Oct 24 
10:08:30 2006 -0600
+++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py      Tue Oct 24 
11:21:48 2006 -0600
@@ -3,6 +3,7 @@
 # Copyright (C) International Business Machines Corp., 2005
 # Author: Dan Smith <danms@xxxxxxxxxx>
 
+import re
 from XmTestLib import *
 
 # This is under the default lower limit of 32 and we expect this test
@@ -16,13 +17,14 @@ try:
     console = domain.start()
     console.runCmd("ls")
 except DomainError, e:
-    FAIL("Unable to start a domain with %i MB" % MEM)
+    if not re.search('^Error: Domain memory must be at least \d+ KB', e.extra):
+        # PPC gracefully fails like this, rather than crashing.
+        FAIL("Unable to start a domain with %i MB" % MEM)
 except ConsoleError, e:
     if e.reason == RUNAWAY:
         print "Domain with %i MB has runaway console as expected" % MEM
-    else:
-        print "Starting a domain with %i MB failed as expected" % MEM
 else:
     FAIL("Starting a console with %i MB passed, expected test to fail" % MEM)
 
+print "Starting a domain with %i MB failed as expected" % MEM
 domain.destroy()
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/linux-xen/setup.c
--- a/xen/arch/ia64/linux-xen/setup.c   Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/linux-xen/setup.c   Tue Oct 24 11:21:48 2006 -0600
@@ -803,7 +803,7 @@ cpu_init (void)
        cpu_data = per_cpu_init();
 
 #ifdef XEN
-       printf ("cpu_init: current=%p\n", current);
+       printk("cpu_init: current=%p\n", current);
 #endif
 
        /*
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/vmx/mmio.c
--- a/xen/arch/ia64/vmx/mmio.c  Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/vmx/mmio.c  Tue Oct 24 11:21:48 2006 -0600
@@ -80,7 +80,7 @@ static void pib_write(VCPU *vcpu, void *
             }
         }
         else {      // upper half
-            printf("IPI-UHF write %lx\n",pib_off);
+            printk("IPI-UHF write %lx\n",pib_off);
             panic_domain(NULL,"Not support yet for SM-VP\n");
         }
         break;
@@ -114,7 +114,7 @@ static void pib_read(VCPU *vcpu, uint64_
             }
             else {
 #ifdef  IPI_DEBUG
-                printf("IPI-LHF read %lx\n",pib_off);
+                printk("IPI-LHF read %lx\n",pib_off);
 #endif
                 *(uint64_t *)dest = 0;  // TODO for SM-VP
             }
@@ -125,7 +125,7 @@ static void pib_read(VCPU *vcpu, uint64_
             }
             else {
 #ifdef  IPI_DEBUG
-                printf("IPI-UHF read %lx\n",pib_off);
+                printk("IPI-UHF read %lx\n",pib_off);
 #endif
                 *(uint8_t *)dest = 0;   // TODO for SM-VP
             }
@@ -321,7 +321,7 @@ static void deliver_ipi (VCPU *vcpu, uin
 static void deliver_ipi (VCPU *vcpu, uint64_t dm, uint64_t vector)
 {
 #ifdef  IPI_DEBUG
-  printf ("deliver_ipi %lx %lx\n",dm,vector);
+  printk ("deliver_ipi %lx %lx\n",dm,vector);
 #endif
     switch ( dm ) {
     case 0:     // INT
@@ -387,7 +387,7 @@ static void write_ipi (VCPU *vcpu, uint6
         memset (&c, 0, sizeof (c));
 
         if (arch_set_info_guest (targ, &c) != 0) {
-            printf ("arch_boot_vcpu: failure\n");
+            printk ("arch_boot_vcpu: failure\n");
             return;
         }
         /* First or next rendez-vous: set registers.  */
@@ -397,11 +397,11 @@ static void write_ipi (VCPU *vcpu, uint6
 
         if (test_and_clear_bit(_VCPUF_down,&targ->vcpu_flags)) {
             vcpu_wake(targ);
-            printf ("arch_boot_vcpu: vcpu %d awaken %016lx!\n",
+            printk ("arch_boot_vcpu: vcpu %d awaken %016lx!\n",
                     targ->vcpu_id, targ_regs->cr_iip);
         }
         else
-            printf ("arch_boot_vcpu: huu, already awaken!");
+            printk ("arch_boot_vcpu: huu, already awaken!");
     }
     else {
         int running = test_bit(_VCPUF_running,&targ->vcpu_flags);
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/vmx/vmx_phy_mode.c
--- a/xen/arch/ia64/vmx/vmx_phy_mode.c  Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/vmx/vmx_phy_mode.c  Tue Oct 24 11:21:48 2006 -0600
@@ -246,7 +246,7 @@ switch_mm_mode(VCPU *vcpu, IA64_PSR old_
     perfc_incra(vmx_switch_mm_mode, act);
     switch (act) {
     case SW_V2P:
-//        printf("V -> P mode transition: (0x%lx -> 0x%lx)\n",
+//        printk("V -> P mode transition: (0x%lx -> 0x%lx)\n",
 //               old_psr.val, new_psr.val);
         vcpu->arch.old_rsc = regs->ar_rsc;
         switch_to_physical_rid(vcpu);
@@ -258,7 +258,7 @@ switch_mm_mode(VCPU *vcpu, IA64_PSR old_
         vcpu->arch.mode_flags |= GUEST_IN_PHY;
         break;
     case SW_P2V:
-//        printf("P -> V mode transition: (0x%lx -> 0x%lx)\n",
+//        printk("P -> V mode transition: (0x%lx -> 0x%lx)\n",
 //               old_psr.val, new_psr.val);
         switch_to_virtual_rid(vcpu);
         /*
@@ -269,11 +269,11 @@ switch_mm_mode(VCPU *vcpu, IA64_PSR old_
         vcpu->arch.mode_flags &= ~GUEST_IN_PHY;
         break;
     case SW_SELF:
-        printf("Switch to self-0x%lx!!! MM mode doesn't change...\n",
+        printk("Switch to self-0x%lx!!! MM mode doesn't change...\n",
             old_psr.val);
         break;
     case SW_NOP:
-//        printf("No action required for mode transition: (0x%lx -> 0x%lx)\n",
+//        printk("No action required for mode transition: (0x%lx -> 0x%lx)\n",
 //               old_psr.val, new_psr.val);
         break;
     default:
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/vmx/vmx_vcpu.c
--- a/xen/arch/ia64/vmx/vmx_vcpu.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/vmx/vmx_vcpu.c      Tue Oct 24 11:21:48 2006 -0600
@@ -274,7 +274,7 @@ check_entry(u64 va, u64 ps, char *str)
       va == 0x600000000000C000UL ) {
     stop();
      }
-     if (tlb_debug) printf("%s at %lx %lx\n", str, va, 1UL<<ps);
+     if (tlb_debug) printk("%s at %lx %lx\n", str, va, 1UL<<ps);
 }
 #endif
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/vmx/vmx_virt.c
--- a/xen/arch/ia64/vmx/vmx_virt.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/vmx/vmx_virt.c      Tue Oct 24 11:21:48 2006 -0600
@@ -1364,7 +1364,7 @@ vmx_emulate(VCPU *vcpu, REGS *regs)
 #endif
 #if 0
 if ( (cause == 0xff && opcode == 0x1e000000000) || cause == 0 ) {
-               printf ("VMAL decode error: cause - %lx; op - %lx\n", 
+               printk ("VMAL decode error: cause - %lx; op - %lx\n", 
                        cause, opcode );
                return;
 }
@@ -1381,7 +1381,7 @@ if ( (cause == 0xff && opcode == 0x1e000
     else if (slot == 1)
         inst.inst = bundle.slot1a + (bundle.slot1b<<18);
     else if (slot == 2) inst.inst = bundle.slot2;
-    else printf("priv_handle_op: illegal slot: %d\n", slot);
+    else printk("priv_handle_op: illegal slot: %d\n", slot);
     slot_type = slot_types[bundle.template][slot];
     ia64_priv_decoder(slot_type, inst, &cause);
     if(cause==0){
@@ -1554,7 +1554,7 @@ if ( (cause == 0xff && opcode == 0x1e000
         status=vmx_emul_mov_from_cpuid(vcpu, inst);
         break;
     case EVENT_VMSW:
-        printf ("Unimplemented instruction %ld\n", cause);
+        printk ("Unimplemented instruction %ld\n", cause);
        status=IA64_FAULT;
         break;
     default:
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/dom0_ops.c      Tue Oct 24 11:21:48 2006 -0600
@@ -171,7 +171,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
     }
     break;
     default:
-        printf("arch_do_domctl: unrecognized domctl: %d!!!\n",op->cmd);
+        printk("arch_do_domctl: unrecognized domctl: %d!!!\n",op->cmd);
         ret = -ENOSYS;
 
     }
@@ -211,7 +211,7 @@ long arch_do_sysctl(xen_sysctl_t *op, XE
     break;
 
     default:
-        printf("arch_do_sysctl: unrecognized sysctl: %d!!!\n",op->cmd);
+        printk("arch_do_sysctl: unrecognized sysctl: %d!!!\n",op->cmd);
         ret = -ENOSYS;
 
     }
@@ -278,7 +278,7 @@ do_dom0vp_op(unsigned long cmd,
         break;
     default:
         ret = -1;
-               printf("unknown dom0_vp_op 0x%lx\n", cmd);
+               printk("unknown dom0_vp_op 0x%lx\n", cmd);
         break;
     }
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/dom_fw.c        Tue Oct 24 11:21:48 2006 -0600
@@ -204,9 +204,9 @@ print_md(efi_memory_desc_t *md)
 
        size = md->num_pages << EFI_PAGE_SHIFT;
        if (size > ONE_MB)
-               printf ("(%luMB)\n", size >> 20);
+               printk ("(%luMB)\n", size >> 20);
        else
-               printf ("(%luKB)\n", size >> 10);
+               printk ("(%luKB)\n", size >> 10);
 }
 
 static u32 lsapic_nbr;
@@ -574,7 +574,7 @@ complete_dom0_memmap(struct domain *d,
 
                default:
                        /* Print a warning but continue.  */
-                       printf("complete_dom0_memmap: warning: "
+                       printk("complete_dom0_memmap: warning: "
                               "unhandled MDT entry type %u\n", md->type);
                }
        }
@@ -734,47 +734,47 @@ dom_fw_init(struct domain *d,
                /* Write messages to the console.  */
                touch_acpi_table();
 
-               printf("Domain0 EFI passthrough:");
+               printk("Domain0 EFI passthrough:");
                if (efi.mps) {
                        tables->efi_tables[i].guid = MPS_TABLE_GUID;
                        tables->efi_tables[i].table = __pa(efi.mps);
-                       printf(" MPS=0x%lx",tables->efi_tables[i].table);
+                       printk(" MPS=0x%lx",tables->efi_tables[i].table);
                        i++;
                }
 
                if (efi.acpi20) {
                        tables->efi_tables[i].guid = ACPI_20_TABLE_GUID;
                        tables->efi_tables[i].table = __pa(efi.acpi20);
-                       printf(" ACPI 2.0=0x%lx",tables->efi_tables[i].table);
+                       printk(" ACPI 2.0=0x%lx",tables->efi_tables[i].table);
                        i++;
                }
                if (efi.acpi) {
                        tables->efi_tables[i].guid = ACPI_TABLE_GUID;
                        tables->efi_tables[i].table = __pa(efi.acpi);
-                       printf(" ACPI=0x%lx",tables->efi_tables[i].table);
+                       printk(" ACPI=0x%lx",tables->efi_tables[i].table);
                        i++;
                }
                if (efi.smbios) {
                        tables->efi_tables[i].guid = SMBIOS_TABLE_GUID;
                        tables->efi_tables[i].table = __pa(efi.smbios);
-                       printf(" SMBIOS=0x%lx",tables->efi_tables[i].table);
+                       printk(" SMBIOS=0x%lx",tables->efi_tables[i].table);
                        i++;
                }
                if (efi.hcdp) {
                        tables->efi_tables[i].guid = HCDP_TABLE_GUID;
                        tables->efi_tables[i].table = __pa(efi.hcdp);
-                       printf(" HCDP=0x%lx",tables->efi_tables[i].table);
+                       printk(" HCDP=0x%lx",tables->efi_tables[i].table);
                        i++;
                }
-               printf("\n");
+               printk("\n");
        } else {
-               printf("DomainU EFI build up:");
+               printk("DomainU EFI build up:");
 
                tables->efi_tables[i].guid = ACPI_20_TABLE_GUID;
                tables->efi_tables[i].table = FW_ACPI_BASE_PADDR;
-               printf(" ACPI 2.0=0x%lx",tables->efi_tables[i].table);
+               printk(" ACPI 2.0=0x%lx",tables->efi_tables[i].table);
                i++;
-               printf("\n");
+               printk("\n");
        }
 
        /* fill in the SAL system table: */
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c        Tue Oct 24 11:21:48 2006 -0600
@@ -441,7 +441,7 @@ int arch_domain_create(struct domain *d)
        d->arch.ioport_caps = rangeset_new(d, "I/O Ports",
                                           RANGESETF_prettyprint_hex);
 
-       printf ("arch_domain_create: domain=%p\n", d);
+       printk ("arch_domain_create: domain=%p\n", d);
        return 0;
 
 fail_nomem:
@@ -655,7 +655,7 @@ domain_set_shared_info_va (unsigned long
 
        /* Note: this doesn't work well if other cpus are already running.
           However this is part of the spec :-)  */
-       printf ("Domain set shared_info_va to 0x%016lx\n", va);
+       printk ("Domain set shared_info_va to 0x%016lx\n", va);
        d->arch.shared_info_va = va;
 
        for_each_vcpu (d, v1) {
@@ -955,7 +955,7 @@ int construct_dom0(struct domain *d,
        struct page_info *page = NULL;
 #endif
 
-//printf("construct_dom0: starting\n");
+//printk("construct_dom0: starting\n");
 
        /* Sanity! */
        BUG_ON(d != dom0);
@@ -1059,10 +1059,10 @@ int construct_dom0(struct domain *d,
        if (dom0_max_vcpus > MAX_VIRT_CPUS)
            dom0_max_vcpus = MAX_VIRT_CPUS;
        
-       printf ("Dom0 max_vcpus=%d\n", dom0_max_vcpus);
+       printk ("Dom0 max_vcpus=%d\n", dom0_max_vcpus);
        for ( i = 1; i < dom0_max_vcpus; i++ )
            if (alloc_vcpu(d, i, i) == NULL)
-               printf ("Cannot allocate dom0 vcpu %d\n", i);
+               printk ("Cannot allocate dom0 vcpu %d\n", i);
 
        /* Copy the OS image. */
        loaddomainelfimage(d,image_start);
@@ -1148,7 +1148,7 @@ void machine_restart(char * __unused)
 {
        console_start_sync();
        if (running_on_sim)
-               printf ("machine_restart called.  spinning...\n");
+               printk ("machine_restart called.  spinning...\n");
        else
                (*efi.reset_system)(EFI_RESET_WARM,0,0,NULL);
        while(1);
@@ -1160,7 +1160,7 @@ void machine_halt(void)
 {
        console_start_sync();
        if (running_on_sim)
-               printf ("machine_halt called.  spinning...\n");
+               printk ("machine_halt called.  spinning...\n");
        else
                cpu_halt();
        while(1);
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/faults.c
--- a/xen/arch/ia64/xen/faults.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/faults.c        Tue Oct 24 11:21:48 2006 -0600
@@ -105,11 +105,11 @@ void reflect_extint(struct pt_regs *regs
        static int first_extint = 1;
 
        if (first_extint) {
-               printf("Delivering first extint to domain: isr=0x%lx, 
iip=0x%lx\n", isr, regs->cr_iip);
+               printk("Delivering first extint to domain: isr=0x%lx, 
iip=0x%lx\n", isr, regs->cr_iip);
                first_extint = 0;
        }
        if (vcpu_timer_pending_early(v))
-printf("*#*#*#* about to deliver early timer to domain 
%d!!!\n",v->domain->domain_id);
+printk("*#*#*#* about to deliver early timer to domain 
%d!!!\n",v->domain->domain_id);
        PSCB(current,itir) = 0;
        reflect_interruption(isr,regs,IA64_EXTINT_VECTOR);
 }
@@ -129,7 +129,7 @@ void reflect_event(struct pt_regs *regs)
                return;
 
        if (!PSCB(v,interrupt_collection_enabled))
-               printf("psr.ic off, delivering event, 
ipsr=%lx,iip=%lx,isr=%lx,viip=0x%lx\n",
+               printk("psr.ic off, delivering event, 
ipsr=%lx,iip=%lx,isr=%lx,viip=0x%lx\n",
                       regs->cr_ipsr, regs->cr_iip, isr, PSCB(v, iip));
        PSCB(v,unat) = regs->ar_unat;  // not sure if this is really needed?
        PSCB(v,precover_ifs) = regs->cr_ifs;
@@ -245,7 +245,7 @@ void ia64_do_page_fault (unsigned long a
 
        if (!PSCB(current,interrupt_collection_enabled)) {
                check_bad_nested_interruption(isr,regs,fault);
-               //printf("Delivering NESTED DATA TLB fault\n");
+               //printk("Delivering NESTED DATA TLB fault\n");
                fault = IA64_DATA_NESTED_TLB_VECTOR;
                regs->cr_iip = ((unsigned long) PSCBX(current,iva) + fault) & 
~0xffUL;
                regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | 
DELIVER_PSR_SET;
@@ -374,7 +374,7 @@ ia64_fault (unsigned long vector, unsign
                "Unknown fault 13", "Unknown fault 14", "Unknown fault 15"
        };
 
-       printf("ia64_fault, vector=0x%lx, ifa=0x%016lx, iip=0x%016lx, 
ipsr=0x%016lx, isr=0x%016lx\n",
+       printk("ia64_fault, vector=0x%lx, ifa=0x%016lx, iip=0x%016lx, 
ipsr=0x%016lx, isr=0x%016lx\n",
               vector, ifa, regs->cr_iip, regs->cr_ipsr, isr);
 
 
@@ -384,7 +384,7 @@ ia64_fault (unsigned long vector, unsign
                 * the lfetch.
                 */
                ia64_psr(regs)->ed = 1;
-               printf("ia64_fault: handled lfetch.fault\n");
+               printk("ia64_fault: handled lfetch.fault\n");
                return;
        }
 
@@ -433,7 +433,7 @@ ia64_fault (unsigned long vector, unsign
                               regs->cr_iip + ia64_psr(regs)->ri,
                               regs->pr);
 # endif
-                       printf("ia64_fault: returning on hazard\n");
+                       printk("ia64_fault: returning on hazard\n");
                        return;
                }
                break;
@@ -592,7 +592,7 @@ ia64_handle_reflection (unsigned long if
                if (((isr >> 4L) & 0xfL) == 1) {
                        /* Fault is due to a register NaT consumption fault. */
                        //regs->eml_unat = 0;  FIXME: DO WE NEED THIS??
-                       printf("ia64_handle_reflection: handling regNaT 
fault\n");
+                       printk("ia64_handle_reflection: handling regNaT 
fault\n");
                        vector = IA64_NAT_CONSUMPTION_VECTOR; break;
                }
 #if 1
@@ -605,20 +605,20 @@ ia64_handle_reflection (unsigned long if
 #ifdef CONFIG_PRIVIFY
                /* Some privified operations are coded using reg+64 instead
                   of reg.  */
-               printf("*** NaT fault... attempting to handle as privop\n");
-               printf("isr=%016lx, ifa=%016lx, iip=%016lx, ipsr=%016lx\n",
+               printk("*** NaT fault... attempting to handle as privop\n");
+               printk("isr=%016lx, ifa=%016lx, iip=%016lx, ipsr=%016lx\n",
                       isr, ifa, regs->cr_iip, psr);
                //regs->eml_unat = 0;  FIXME: DO WE NEED THIS???
                // certain NaT faults are higher priority than privop faults
                vector = priv_emulate(v,regs,isr);
                if (vector == IA64_NO_FAULT) {
-                       printf("*** Handled privop masquerading as NaT 
fault\n");
+                       printk("*** Handled privop masquerading as NaT 
fault\n");
                        return;
                }
 #endif
                vector = IA64_NAT_CONSUMPTION_VECTOR; break;
            case 27:
-               //printf("*** Handled speculation vector, 
itc=%lx!\n",ia64_get_itc());
+               //printk("*** Handled speculation vector, 
itc=%lx!\n",ia64_get_itc());
                PSCB(current,iim) = iim;
                vector = IA64_SPECULATION_VECTOR; break;
            case 30:
@@ -633,7 +633,7 @@ ia64_handle_reflection (unsigned long if
                // fetch code fail
                if (IA64_RETRY == status)
                        return;
-               printf("ia64_handle_reflection: handling FP fault\n");
+               printk("ia64_handle_reflection: handling FP fault\n");
                vector = IA64_FP_FAULT_VECTOR; break;
            case 33:
                status = handle_fpu_swa(0, regs, isr);
@@ -642,20 +642,20 @@ ia64_handle_reflection (unsigned long if
                // fetch code fail
                if (IA64_RETRY == status)
                        return;
-               printf("ia64_handle_reflection: handling FP trap\n");
+               printk("ia64_handle_reflection: handling FP trap\n");
                vector = IA64_FP_TRAP_VECTOR; break;
            case 34:
-               printf("ia64_handle_reflection: handling lowerpriv trap\n");
+               printk("ia64_handle_reflection: handling lowerpriv trap\n");
                vector = IA64_LOWERPRIV_TRANSFER_TRAP_VECTOR; break;
            case 35:
-               printf("ia64_handle_reflection: handling taken branch trap\n");
+               printk("ia64_handle_reflection: handling taken branch trap\n");
                vector = IA64_TAKEN_BRANCH_TRAP_VECTOR; break;
            case 36:
-               printf("ia64_handle_reflection: handling single step trap\n");
+               printk("ia64_handle_reflection: handling single step trap\n");
                vector = IA64_SINGLE_STEP_TRAP_VECTOR; break;
 
            default:
-               printf("ia64_handle_reflection: unhandled 
vector=0x%lx\n",vector);
+               printk("ia64_handle_reflection: unhandled 
vector=0x%lx\n",vector);
                while(vector);
                return;
        }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/fw_emul.c
--- a/xen/arch/ia64/xen/fw_emul.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/fw_emul.c       Tue Oct 24 11:21:48 2006 -0600
@@ -75,20 +75,20 @@ sal_emulator (long index, unsigned long 
                        r9 = value;
                }
                else
-                    printf("NON-PRIV DOMAIN CALLED SAL_PCI_CONFIG_READ\n");
+                    printk("NON-PRIV DOMAIN CALLED SAL_PCI_CONFIG_READ\n");
                break;
            case SAL_PCI_CONFIG_WRITE:
                if (current->domain == dom0) {
                        if (((in1 & ~0xffffffffUL) && (in4 == 0)) ||
                            (in4 > 1) ||
                            (in2 > 8) || (in2 & (in2-1)))
-                               printf("*** 
SAL_PCI_CONF_WRITE?!?(adr=0x%lx,typ=0x%lx,sz=0x%lx,val=0x%lx)\n",
+                               printk("*** 
SAL_PCI_CONF_WRITE?!?(adr=0x%lx,typ=0x%lx,sz=0x%lx,val=0x%lx)\n",
                                        in1,in4,in2,in3);
                        // note that args are in a different order!!
                        status = ia64_sal_pci_config_write(in1,in4,in2,in3);
                }
                else
-                    printf("NON-PRIV DOMAIN CALLED SAL_PCI_CONFIG_WRITE\n");
+                    printk("NON-PRIV DOMAIN CALLED SAL_PCI_CONFIG_WRITE\n");
                break;
            case SAL_SET_VECTORS:
                if (in1 == SAL_VECTOR_OS_BOOT_RENDEZ) {
@@ -104,7 +104,7 @@ sal_emulator (long index, unsigned long 
                        }
                }
                else
-                       printf("*** CALLED SAL_SET_VECTORS %lu.  IGNORED...\n",
+                       printk("*** CALLED SAL_SET_VECTORS %lu.  IGNORED...\n",
                               in1);
                break;
            case SAL_GET_STATE_INFO:
@@ -121,10 +121,10 @@ sal_emulator (long index, unsigned long 
                /* Noop.  */
                break;
            case SAL_MC_RENDEZ:
-               printf("*** CALLED SAL_MC_RENDEZ.  IGNORED...\n");
+               printk("*** CALLED SAL_MC_RENDEZ.  IGNORED...\n");
                break;
            case SAL_MC_SET_PARAMS:
-               printf("*** CALLED SAL_MC_SET_PARAMS.  IGNORED...\n");
+               printk("*** CALLED SAL_MC_SET_PARAMS.  IGNORED...\n");
                break;
            case SAL_CACHE_FLUSH:
                if (1) {
@@ -141,13 +141,13 @@ sal_emulator (long index, unsigned long 
                }
                break;
            case SAL_CACHE_INIT:
-               printf("*** CALLED SAL_CACHE_INIT.  IGNORED...\n");
+               printk("*** CALLED SAL_CACHE_INIT.  IGNORED...\n");
                break;
            case SAL_UPDATE_PAL:
-               printf("*** CALLED SAL_UPDATE_PAL.  IGNORED...\n");
+               printk("*** CALLED SAL_UPDATE_PAL.  IGNORED...\n");
                break;
            default:
-               printf("*** CALLED SAL_ WITH UNKNOWN INDEX.  IGNORED...\n");
+               printk("*** CALLED SAL_ WITH UNKNOWN INDEX.  IGNORED...\n");
                status = -1;
                break;
        }
@@ -362,7 +362,7 @@ xen_pal_emulator(unsigned long index, u6
                break;
            case PAL_HALT:
                if (current->domain == dom0) {
-                       printf ("Domain0 halts the machine\n");
+                       printk ("Domain0 halts the machine\n");
                        console_start_sync();
                        (*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL);
                }
@@ -429,7 +429,7 @@ efi_emulate_get_time(
        struct page_info *tc_page = NULL;
        efi_status_t status = 0;
 
-       //printf("efi_get_time(%016lx,%016lx) called\n", tv_addr, tc_addr);
+       //printk("efi_get_time(%016lx,%016lx) called\n", tv_addr, tc_addr);
        tv = efi_translate_domain_addr(tv_addr, fault, &tv_page);
        if (*fault != IA64_NO_FAULT)
                goto errout;
@@ -439,9 +439,9 @@ efi_emulate_get_time(
                        goto errout;
        }
 
-       //printf("efi_get_time(%016lx,%016lx) translated to xen virtual 
address\n", tv, tc);
+       //printk("efi_get_time(%016lx,%016lx) translated to xen virtual 
address\n", tv, tc);
        status = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc);
-       //printf("efi_get_time returns %lx\n", status);
+       //printk("efi_get_time returns %lx\n", status);
 
 errout:
        if (tc_page != NULL)
@@ -695,14 +695,14 @@ efi_emulate_set_virtual_address_map(
        fpswa_interface_t *fpswa_inf = d->arch.fpswa_inf;
 
        if (descriptor_version != EFI_MEMDESC_VERSION) {
-               printf ("efi_emulate_set_virtual_address_map: memory "
+               printk ("efi_emulate_set_virtual_address_map: memory "
                        "descriptor version unmatched (%d vs %d)\n",
                        (int)descriptor_version, EFI_MEMDESC_VERSION);
                return EFI_INVALID_PARAMETER;
        }
 
        if (descriptor_size != sizeof(efi_memory_desc_t)) {
-               printf ("efi_emulate_set_virtual_address_map: memory descriptor 
size unmatched\n");
+               printk ("efi_emulate_set_virtual_address_map: memory descriptor 
size unmatched\n");
                return EFI_INVALID_PARAMETER;
        }
 
@@ -715,7 +715,7 @@ efi_emulate_set_virtual_address_map(
 
        for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
                if (copy_from_user(&entry, p, sizeof(efi_memory_desc_t))) {
-                       printf ("efi_emulate_set_virtual_address_map: 
copy_from_user() fault. addr=0x%p\n", p);
+                       printk ("efi_emulate_set_virtual_address_map: 
copy_from_user() fault. addr=0x%p\n", p);
                        return EFI_UNSUPPORTED;
                }
 
@@ -843,7 +843,7 @@ efi_emulator (struct pt_regs *regs, IA64
                status = EFI_UNSUPPORTED;
                break;
            default:
-               printf("unknown ia64 fw hypercall %lx\n", regs->r2);
+               printk("unknown ia64 fw hypercall %lx\n", regs->r2);
                status = EFI_UNSUPPORTED;
        }
 
@@ -864,7 +864,7 @@ do_ssc(unsigned long ssc, struct pt_regs
            case SSC_PUTCHAR:
                buf[0] = arg0;
                buf[1] = '\0';
-               printf(buf);
+               printk(buf);
                break;
            case SSC_GETCHAR:
                retval = ia64_ssc(0,0,0,0,ssc);
@@ -877,7 +877,7 @@ do_ssc(unsigned long ssc, struct pt_regs
 /**/                   stat = (struct ssc_disk_stat *)__va(arg0);
 ///**/                 if (stat->fd == last_fd) stat->count = last_count;
 /**/                   stat->count = last_count;
-//if (last_count >= PAGE_SIZE) printf("ssc_wait: 
stat->fd=%d,last_fd=%d,last_count=%d\n",stat->fd,last_fd,last_count);
+//if (last_count >= PAGE_SIZE) printk("ssc_wait: 
stat->fd=%d,last_fd=%d,last_count=%d\n",stat->fd,last_fd,last_count);
 ///**/                 retval = ia64_ssc(arg0,0,0,0,ssc);
 /**/                   retval = 0;
                }
@@ -886,7 +886,7 @@ do_ssc(unsigned long ssc, struct pt_regs
                break;
            case SSC_OPEN:
                arg1 = vcpu_get_gr(current,33); // access rights
-if (!running_on_sim) { printf("SSC_OPEN, not implemented on hardware.  
(ignoring...)\n"); arg0 = 0; }
+if (!running_on_sim) { printk("SSC_OPEN, not implemented on hardware.  
(ignoring...)\n"); arg0 = 0; }
                if (arg0) {     // metaphysical address
                        arg0 = translate_domain_mpaddr(arg0, NULL);
                        retval = ia64_ssc(arg0,arg1,0,0,ssc);
@@ -896,7 +896,7 @@ if (!running_on_sim) { printf("SSC_OPEN,
                break;
            case SSC_WRITE:
            case SSC_READ:
-//if (ssc == SSC_WRITE) printf("DOING AN SSC_WRITE\n");
+//if (ssc == SSC_WRITE) printk("DOING AN SSC_WRITE\n");
                arg1 = vcpu_get_gr(current,33);
                arg2 = vcpu_get_gr(current,34);
                arg3 = vcpu_get_gr(current,35);
@@ -912,7 +912,7 @@ if (!running_on_sim) { printf("SSC_OPEN,
 /**/                   last_fd = arg1;
 /**/                   last_count = len;
                        mpaddr = req->addr;
-//if (last_count >= PAGE_SIZE) printf("do_ssc: read fd=%d, addr=%p, len=%lx 
",last_fd,mpaddr,len);
+//if (last_count >= PAGE_SIZE) printk("do_ssc: read fd=%d, addr=%p, len=%lx 
",last_fd,mpaddr,len);
                        retval = 0;
                        if ((mpaddr & PAGE_MASK) != ((mpaddr+len-1) & 
PAGE_MASK)) {
                                // do partial page first
@@ -923,7 +923,7 @@ if (!running_on_sim) { printf("SSC_OPEN,
                                arg3 += req->len; // file offset
 /**/                           last_stat.fd = last_fd;
 /**/                           
(void)ia64_ssc(__pa(&last_stat),0,0,0,SSC_WAIT_COMPLETION);
-//if (last_count >= PAGE_SIZE) printf("ssc(%p,%lx)[part]=%x 
",req->addr,req->len,retval);
+//if (last_count >= PAGE_SIZE) printk("ssc(%p,%lx)[part]=%x 
",req->addr,req->len,retval);
                        }
                        if (retval >= 0) while (len > 0) {
                                req->addr = translate_domain_mpaddr(mpaddr, 
NULL);
@@ -934,27 +934,27 @@ if (!running_on_sim) { printf("SSC_OPEN,
 // TEMP REMOVED AGAIN                          arg3 += req->len; // file offset
 /**/                           last_stat.fd = last_fd;
 /**/                           
(void)ia64_ssc(__pa(&last_stat),0,0,0,SSC_WAIT_COMPLETION);
-//if (last_count >= PAGE_SIZE) printf("ssc(%p,%lx)=%x 
",req->addr,req->len,retval);
+//if (last_count >= PAGE_SIZE) printk("ssc(%p,%lx)=%x 
",req->addr,req->len,retval);
                        }
                        // set it back to the original value
                        req->len = last_count;
                }
                else retval = -1L;
                vcpu_set_gr(current,8,retval,0);
-//if (last_count >= PAGE_SIZE) printf("retval=%x\n",retval);
+//if (last_count >= PAGE_SIZE) printk("retval=%x\n",retval);
                break;
            case SSC_CONNECT_INTERRUPT:
                arg1 = vcpu_get_gr(current,33);
                arg2 = vcpu_get_gr(current,34);
                arg3 = vcpu_get_gr(current,35);
-               if (!running_on_sim) { printf("SSC_CONNECT_INTERRUPT, not 
implemented on hardware.  (ignoring...)\n"); break; }
+               if (!running_on_sim) { printk("SSC_CONNECT_INTERRUPT, not 
implemented on hardware.  (ignoring...)\n"); break; }
                (void)ia64_ssc(arg0,arg1,arg2,arg3,ssc);
                break;
            case SSC_NETDEV_PROBE:
                vcpu_set_gr(current,8,-1L,0);
                break;
            default:
-               printf("ia64_handle_break: bad ssc code %lx, iip=0x%lx, 
b0=0x%lx... spinning\n",
+               printk("ia64_handle_break: bad ssc code %lx, iip=0x%lx, 
b0=0x%lx... spinning\n",
                        ssc, regs->cr_iip, regs->b0);
                while(1);
                break;
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/hypercall.c     Tue Oct 24 11:21:48 2006 -0600
@@ -163,7 +163,7 @@ fw_hypercall_ipi (struct pt_regs *regs)
                        memset (&c, 0, sizeof (c));
 
                        if (arch_set_info_guest (targ, &c) != 0) {
-                               printf ("arch_boot_vcpu: failure\n");
+                               printk ("arch_boot_vcpu: failure\n");
                                return;
                        }
                }
@@ -177,11 +177,11 @@ fw_hypercall_ipi (struct pt_regs *regs)
                if (test_and_clear_bit(_VCPUF_down,
                                       &targ->vcpu_flags)) {
                        vcpu_wake(targ);
-                       printf ("arch_boot_vcpu: vcpu %d awaken\n",
+                       printk ("arch_boot_vcpu: vcpu %d awaken\n",
                                targ->vcpu_id);
                }
                else
-                       printf ("arch_boot_vcpu: huu, already awaken!\n");
+                       printk ("arch_boot_vcpu: huu, already awaken!\n");
        }
        else {
                int running = test_bit(_VCPUF_running,
@@ -220,7 +220,7 @@ ia64_hypercall(struct pt_regs *regs)
                return xen_fast_hypercall(regs);
 
        case FW_HYPERCALL_PAL_CALL:
-               //printf("*** PAL hypercall: index=%d\n",regs->r28);
+               //printk("*** PAL hypercall: index=%d\n",regs->r28);
                //FIXME: This should call a C routine
 #if 0
                // This is very conservative, but avoids a possible
@@ -235,7 +235,7 @@ ia64_hypercall(struct pt_regs *regs)
                                event_pending(v)) {
                                perfc_incrc(idle_when_pending);
                                vcpu_pend_unspecified_interrupt(v);
-//printf("idle w/int#%d pending!\n",pi);
+//printk("idle w/int#%d pending!\n",pi);
 //this shouldn't happen, but it apparently does quite a bit!  so don't
 //allow it to happen... i.e. if a domain has an interrupt pending and
 //it tries to halt itself because it thinks it is idle, just return here
@@ -301,7 +301,7 @@ ia64_hypercall(struct pt_regs *regs)
                regs->r11 = fpswa_ret.err2;
                break;
        default:
-               printf("unknown ia64 fw hypercall %lx\n", regs->r2);
+               printk("unknown ia64 fw hypercall %lx\n", regs->r2);
                regs->r8 = do_ni_hypercall();
        }
        return IA64_NO_FAULT;
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/hyperprivop.S
--- a/xen/arch/ia64/xen/hyperprivop.S   Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/hyperprivop.S   Tue Oct 24 11:21:48 2006 -0600
@@ -203,7 +203,7 @@ END(fast_hyperprivop)
 
 // give up for now if: ipsr.be==1, ipsr.pp==1
 // from reflect_interruption, don't need to:
-//  - printf first extint (debug only)
+//  - printk first extint (debug only)
 //  - check for interrupt collection enabled (routine will force on)
 //  - set ifa (not valid for extint)
 //  - set iha (not valid for extint)
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c   Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/irq.c   Tue Oct 24 11:21:48 2006 -0600
@@ -481,7 +481,7 @@ xen_debug_irq(unsigned long vector, stru
                firstirq = 0;
        }
        if (firsttime[vector]) {
-               printf("**** (entry) First received int on 
vector=%lu,itc=%lx\n",
+               printk("**** (entry) First received int on 
vector=%lu,itc=%lx\n",
                        (unsigned long) vector, ia64_get_itc());
                firsttime[vector] = 0;
        }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/mm.c    Tue Oct 24 11:21:48 2006 -0600
@@ -469,7 +469,7 @@ u64 translate_domain_pte(u64 pteval, u64
                           This can happen when domU tries to touch i/o
                           port space.  Also prevents possible address
                           aliasing issues.  */
-                       printf("Warning: UC to WB for mpaddr=%lx\n", mpaddr);
+                       printk("Warning: UC to WB for mpaddr=%lx\n", mpaddr);
                        pteval = (pteval & ~_PAGE_MA_MASK) | _PAGE_MA_WB;
                }
                break;
@@ -720,7 +720,7 @@ xencomm_paddr_to_maddr(unsigned long pad
 
     pa = ____lookup_domain_mpa(d, paddr);
     if (pa == INVALID_MFN) {
-        printf("%s: called with bad memory address: 0x%lx - iip=%lx\n",
+        printk("%s: called with bad memory address: 0x%lx - iip=%lx\n",
                __func__, paddr, vcpu_regs(v)->cr_iip);
         return 0;
     }
@@ -740,7 +740,7 @@ __assign_new_domain_page(struct domain *
 
     p = alloc_domheap_page(d);
     if (unlikely(!p)) {
-        printf("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
+        printk("assign_new_domain_page: Can't alloc!!!! Aaaargh!\n");
         return(p);
     }
 
@@ -751,7 +751,7 @@ __assign_new_domain_page(struct domain *
                  && maddr < __get_cpu_var(vhpt_pend))) {
         /* FIXME: how can this happen ?
            vhpt is allocated by alloc_domheap_page.  */
-        printf("assign_new_domain_page: reassigned vhpt page %lx!!\n",
+        printk("assign_new_domain_page: reassigned vhpt page %lx!!\n",
                maddr);
     }
 
@@ -1749,7 +1749,7 @@ void domain_cache_flush (struct domain *
             }
         }
     }
-    //printf ("domain_cache_flush: %d %d pages\n", d->domain_id, nbr_page);
+    //printk ("domain_cache_flush: %d %d pages\n", d->domain_id, nbr_page);
 }
 
 #ifdef VERBOSE
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/privop.c
--- a/xen/arch/ia64/xen/privop.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/privop.c        Tue Oct 24 11:21:48 2006 -0600
@@ -594,16 +594,16 @@ static IA64FAULT priv_handle_op(VCPU * v
        if (iip == 0xa000000100001820) {
                static int firstpagefault = 1;
                if (firstpagefault) {
-                       printf("*** First time to domain page fault!\n");
+                       printk("*** First time to domain page fault!\n");
                        firstpagefault = 0;
                }
        }
 #endif
        if (privop_trace) {
                static long i = 400;
-               //if (i > 0) printf("priv_handle_op: at 0x%lx\n",iip);
+               //if (i > 0) printk("priv_handle_op: at 0x%lx\n",iip);
                if (i > 0)
-                       printf("priv_handle_op: privop trace at 0x%lx, "
+                       printk("priv_handle_op: privop trace at 0x%lx, "
                               "itc=%lx, itm=%lx\n",
                               iip, ia64_get_itc(), ia64_get_itm());
                i--;
@@ -617,11 +617,11 @@ static IA64FAULT priv_handle_op(VCPU * v
        else if (slot == 2)
                inst.inst = (bundle.i64[1] >> 23) & MASK_41;
        else
-               printf("priv_handle_op: illegal slot: %d\n", slot);
+               printk("priv_handle_op: illegal slot: %d\n", slot);
 
        slot_type = slot_types[bundle.template][slot];
        if (priv_verbose) {
-               printf("priv_handle_op: checking bundle at 0x%lx "
+               printk("priv_handle_op: checking bundle at 0x%lx "
                       "(op=0x%016lx) slot %d (type=%d)\n",
                       iip, (u64) inst.inst, slot, slot_type);
        }
@@ -734,11 +734,11 @@ static IA64FAULT priv_handle_op(VCPU * v
        default:
                break;
        }
-       //printf("We who are about do die salute you\n");
-       printf("priv_handle_op: can't handle privop at 0x%lx (op=0x%016lx) "
+       //printk("We who are about do die salute you\n");
+       printk("priv_handle_op: can't handle privop at 0x%lx (op=0x%016lx) "
               "slot %d (type=%d), ipsr=0x%lx\n",
               iip, (u64) inst.inst, slot, slot_type, ipsr);
-       //printf("vtop(0x%lx)==0x%lx\n", iip, tr_vtop(iip));
+       //printk("vtop(0x%lx)==0x%lx\n", iip, tr_vtop(iip));
        //thread_mozambique("privop fault\n");
        return IA64_ILLOP_FAULT;
 }
@@ -762,8 +762,8 @@ IA64FAULT priv_emulate(VCPU * vcpu, REGS
 
        // handle privops masked as illops? and breaks (6)
        if (isrcode != 1 && isrcode != 2 && isrcode != 0 && isrcode != 6) {
-               printf("priv_emulate: isrcode != 0 or 1 or 2\n");
-               printf("priv_emulate: returning ILLOP, not implemented!\n");
+               printk("priv_emulate: isrcode != 0 or 1 or 2\n");
+               printk("priv_emulate: returning ILLOP, not implemented!\n");
                while (1) ;
                return IA64_ILLOP_FAULT;
        }
@@ -777,7 +777,7 @@ IA64FAULT priv_emulate(VCPU * vcpu, REGS
                (void)vcpu_increment_iip(vcpu);
        }
        if (fault == IA64_ILLOP_FAULT)
-               printf("priv_emulate: priv_handle_op fails, "
+               printk("priv_emulate: priv_handle_op fails, "
                       "isr=0x%lx iip=%lx\n", isr, regs->cr_iip);
        return fault;
 }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/regionreg.c
--- a/xen/arch/ia64/xen/regionreg.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/regionreg.c     Tue Oct 24 11:21:48 2006 -0600
@@ -106,7 +106,7 @@ void init_rid_allocator (void)
        /* Due to RID mangling, we expect 24 RID bits!
           This test should be removed if RID mangling is removed/modified.  */
        if (implemented_rid_bits != 24) {
-               printf ("RID mangling expected 24 RID bits, got only %d!\n",
+               printk ("RID mangling expected 24 RID bits, got only %d!\n",
                        implemented_rid_bits);
                BUG();
        }
@@ -117,14 +117,14 @@ void init_rid_allocator (void)
 
        /* Check for too small values.  */
        if (domain_rid_bits_default < IA64_MIN_IMPL_RID_BITS) {
-               printf ("Default domain rid bits %d is too small, use %d\n",
+               printk ("Default domain rid bits %d is too small, use %d\n",
                        domain_rid_bits_default, IA64_MIN_IMPL_RID_BITS);
                domain_rid_bits_default = IA64_MIN_IMPL_RID_BITS;
        }
 
        log_blocks = (implemented_rid_bits - IA64_MIN_IMPL_RID_BITS);
 
-       printf ("Maximum number of domains: %d; %d RID bits per domain\n",
+       printk ("Maximum number of domains: %d; %d RID bits per domain\n",
                (1 << (implemented_rid_bits - domain_rid_bits_default)) - 1,
                domain_rid_bits_default);
        
@@ -185,7 +185,7 @@ int allocate_rid_range(struct domain *d,
        d->arch.metaphysical_rr0 = allocate_metaphysical_rr(d, 0);
        d->arch.metaphysical_rr4 = allocate_metaphysical_rr(d, 1);
 
-       printf("### domain %p: rid=%x-%x mp_rid=%x\n",
+       printk("### domain %p: rid=%x-%x mp_rid=%x\n",
               d, d->arch.starting_rid, d->arch.ending_rid,
               d->arch.starting_mp_rid);
        
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/tlb_track.c
--- a/xen/arch/ia64/xen/tlb_track.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/tlb_track.c     Tue Oct 24 11:21:48 2006 -0600
@@ -29,7 +29,7 @@
 #define CONFIG_TLB_TRACK_DEBUG
 #ifdef CONFIG_TLB_TRACK_DEBUG
 # define tlb_track_printd(fmt, ...)     \
-    printf("%s:%d " fmt, __func__, __LINE__, ##__VA_ARGS__)
+    printk("%s:%d " fmt, __func__, __LINE__, ##__VA_ARGS__)
 #else
 # define tlb_track_printd(fmt, ...)     do { } while (0)
 #endif
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/vcpu.c  Tue Oct 24 11:21:48 2006 -0600
@@ -199,7 +199,7 @@ IA64FAULT vcpu_set_ar(VCPU * vcpu, u64 r
        else if (reg == 27)
                return IA64_ILLOP_FAULT;
        else if (reg == 24)
-               printf("warning: setting ar.eflg is a no-op; no IA-32 "
+               printk("warning: setting ar.eflg is a no-op; no IA-32 "
                       "support\n");
        else if (reg > 7)
                return IA64_ILLOP_FAULT;
@@ -213,7 +213,7 @@ IA64FAULT vcpu_get_ar(VCPU * vcpu, u64 r
 IA64FAULT vcpu_get_ar(VCPU * vcpu, u64 reg, u64 * val)
 {
        if (reg == 24)
-               printf("warning: getting ar.eflg is a no-op; no IA-32 "
+               printk("warning: getting ar.eflg is a no-op; no IA-32 "
                       "support\n");
        else if (reg > 7)
                return IA64_ILLOP_FAULT;
@@ -337,7 +337,7 @@ IA64FAULT vcpu_set_psr_sm(VCPU * vcpu, u
        }
        if (imm.i) {
                if (vcpu->vcpu_info->evtchn_upcall_mask) {
-//printf("vcpu_set_psr_sm: psr.ic 0->1\n");
+//printk("vcpu_set_psr_sm: psr.ic 0->1\n");
                        enabling_interrupts = 1;
                }
                vcpu->vcpu_info->evtchn_upcall_mask = 0;
@@ -362,7 +362,7 @@ IA64FAULT vcpu_set_psr_sm(VCPU * vcpu, u
                psr.up = 1;
        }
        if (imm.be) {
-               printf("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
+               printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
                return IA64_ILLOP_FAULT;
        }
        if (imm.dt)
@@ -437,7 +437,7 @@ IA64FAULT vcpu_set_psr_l(VCPU * vcpu, u6
        else
                vcpu_set_metaphysical_mode(vcpu, TRUE);
        if (newpsr.be) {
-               printf("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
+               printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
                return IA64_ILLOP_FAULT;
        }
        if (enabling_interrupts &&
@@ -489,7 +489,7 @@ u64 vcpu_get_ipsr_int_state(VCPU * vcpu,
        u64 dcr = PSCBX(vcpu, dcr);
        PSR psr;
 
-       //printf("*** vcpu_get_ipsr_int_state (0x%016lx)...\n",prevpsr);
+       //printk("*** vcpu_get_ipsr_int_state (0x%016lx)...\n",prevpsr);
        psr.i64 = prevpsr;
        psr.ia64_psr.be = 0;
        if (dcr & IA64_DCR_BE)
@@ -506,7 +506,7 @@ u64 vcpu_get_ipsr_int_state(VCPU * vcpu,
        if (psr.ia64_psr.cpl == 2)
                psr.ia64_psr.cpl = 0;   // !!!! fool domain
        // psr.pk = 1;
-       //printf("returns 0x%016lx...\n",psr.i64);
+       //printk("returns 0x%016lx...\n",psr.i64);
        return psr.i64;
 }
 
@@ -606,7 +606,7 @@ IA64FAULT vcpu_get_iipa(VCPU * vcpu, u64
        u64 val = PSCB(vcpu, iipa);
        // SP entry code does not save iipa yet nor does it get
        //  properly delivered in the pscb
-//     printf("*** vcpu_get_iipa: cr.iipa not fully implemented yet!!\n");
+//     printk("*** vcpu_get_iipa: cr.iipa not fully implemented yet!!\n");
        *pval = val;
        return IA64_NO_FAULT;
 }
@@ -657,7 +657,7 @@ IA64FAULT vcpu_set_pta(VCPU * vcpu, u64 
 IA64FAULT vcpu_set_pta(VCPU * vcpu, u64 val)
 {
        if (val & IA64_PTA_LFMT) {
-               printf("*** No support for VHPT long format yet!!\n");
+               printk("*** No support for VHPT long format yet!!\n");
                return IA64_ILLOP_FAULT;
        }
        if (val & (0x3f << 9))  /* reserved fields */
@@ -714,7 +714,7 @@ IA64FAULT vcpu_set_iipa(VCPU * vcpu, u64
 {
        // SP entry code does not save iipa yet nor does it get
        //  properly delivered in the pscb
-//     printf("*** vcpu_set_iipa: cr.iipa not fully implemented yet!!\n");
+//     printk("*** vcpu_set_iipa: cr.iipa not fully implemented yet!!\n");
        PSCB(vcpu, iipa) = val;
        return IA64_NO_FAULT;
 }
@@ -750,12 +750,12 @@ void vcpu_pend_interrupt(VCPU * vcpu, u6
 void vcpu_pend_interrupt(VCPU * vcpu, u64 vector)
 {
        if (vector & ~0xff) {
-               printf("vcpu_pend_interrupt: bad vector\n");
+               printk("vcpu_pend_interrupt: bad vector\n");
                return;
        }
 
        if (vcpu->arch.event_callback_ip) {
-               printf("Deprecated interface. Move to new event based "
+               printk("Deprecated interface. Move to new event based "
                       "solution\n");
                return;
        }
@@ -814,7 +814,7 @@ u64 vcpu_check_pending_interrupts(VCPU *
        }
        // have a pending,deliverable interrupt... see if it is masked
        bitnum = ia64_fls(bits);
-//printf("XXXXXXX vcpu_check_pending_interrupts: got bitnum=%p...\n",bitnum);
+//printk("XXXXXXX vcpu_check_pending_interrupts: got bitnum=%p...\n",bitnum);
        vector = bitnum + (i * 64);
        mask = 1L << bitnum;
        /* sanity check for guest timer interrupt */
@@ -826,23 +826,23 @@ u64 vcpu_check_pending_interrupts(VCPU *
                        goto check_start;
                }
        }
-//printf("XXXXXXX vcpu_check_pending_interrupts: got vector=%p...\n",vector);
+//printk("XXXXXXX vcpu_check_pending_interrupts: got vector=%p...\n",vector);
        if (*r >= mask) {
                // masked by equal inservice
-//printf("but masked by equal inservice\n");
+//printk("but masked by equal inservice\n");
                return SPURIOUS_VECTOR;
        }
        if (PSCB(vcpu, tpr) & IA64_TPR_MMI) {
                // tpr.mmi is set
-//printf("but masked by tpr.mmi\n");
+//printk("but masked by tpr.mmi\n");
                return SPURIOUS_VECTOR;
        }
        if (((PSCB(vcpu, tpr) & IA64_TPR_MIC) + 15) >= vector) {
                //tpr.mic masks class
-//printf("but masked by tpr.mic\n");
+//printk("but masked by tpr.mic\n");
                return SPURIOUS_VECTOR;
        }
-//printf("returned to caller\n");
+//printk("returned to caller\n");
        return vector;
 }
 
@@ -902,7 +902,7 @@ IA64FAULT vcpu_get_ivr(VCPU * vcpu, u64 
 #if 0
        if (vector == (PSCB(vcpu, itv) & 0xff)) {
                if (!(++count[domid] & ((HEARTBEAT_FREQ * 1024) - 1))) {
-                       printf("Dom%d heartbeat... ticks=%lx,nonticks=%lx\n",
+                       printk("Dom%d heartbeat... ticks=%lx,nonticks=%lx\n",
                               domid, count[domid], nonclockcount[domid]);
                        //count[domid] = 0;
                        //dump_runq();
@@ -916,7 +916,7 @@ IA64FAULT vcpu_get_ivr(VCPU * vcpu, u64 
        // getting ivr has "side effects"
 #ifdef IRQ_DEBUG
        if (firsttime[vector]) {
-               printf("*** First get_ivr on vector=%lu,itc=%lx\n",
+               printk("*** First get_ivr on vector=%lu,itc=%lx\n",
                       vector, ia64_get_itc());
                firsttime[vector] = 0;
        }
@@ -930,7 +930,7 @@ IA64FAULT vcpu_get_ivr(VCPU * vcpu, u64 
 
        i = vector >> 6;
        mask = 1L << (vector & 0x3f);
-//printf("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %lu\n",vector);
+//printk("ZZZZZZ vcpu_get_ivr: setting insvc mask for vector %lu\n",vector);
        PSCBX(vcpu, insvc[i]) |= mask;
        PSCBX(vcpu, irr[i]) &= ~mask;
        //PSCB(vcpu,pending_interruption)--;
@@ -995,7 +995,7 @@ IA64FAULT vcpu_get_lrr0(VCPU * vcpu, u64
 IA64FAULT vcpu_get_lrr0(VCPU * vcpu, u64 * pval)
 {
        // fix this when setting values other than m-bit is supported
-       printf("vcpu_get_lrr0: Unmasked interrupts unsupported\n");
+       printk("vcpu_get_lrr0: Unmasked interrupts unsupported\n");
        *pval = (1L << 16);
        return IA64_NO_FAULT;
 }
@@ -1003,14 +1003,14 @@ IA64FAULT vcpu_get_lrr1(VCPU * vcpu, u64
 IA64FAULT vcpu_get_lrr1(VCPU * vcpu, u64 * pval)
 {
        // fix this when setting values other than m-bit is supported
-       printf("vcpu_get_lrr1: Unmasked interrupts unsupported\n");
+       printk("vcpu_get_lrr1: Unmasked interrupts unsupported\n");
        *pval = (1L << 16);
        return IA64_NO_FAULT;
 }
 
 IA64FAULT vcpu_set_lid(VCPU * vcpu, u64 val)
 {
-       printf("vcpu_set_lid: Setting cr.lid is unsupported\n");
+       printk("vcpu_set_lid: Setting cr.lid is unsupported\n");
        return IA64_ILLOP_FAULT;
 }
 
@@ -1034,7 +1034,7 @@ IA64FAULT vcpu_set_eoi(VCPU * vcpu, u64 
        for (i = 3; (i >= 0) && !(bits = *p); i--, p--)
                ;
        if (i < 0) {
-               printf("Trying to EOI interrupt when none are in-service.\n");
+               printk("Trying to EOI interrupt when none are in-service.\n");
                return IA64_NO_FAULT;
        }
        bitnum = ia64_fls(bits);
@@ -1046,18 +1046,18 @@ IA64FAULT vcpu_set_eoi(VCPU * vcpu, u64 
        if (!vcpu->vcpu_info->evtchn_upcall_mask) {     // but only if 
enabled...
                // worry about this later... Linux only calls eoi
                // with interrupts disabled
-               printf("Trying to EOI interrupt with interrupts enabled\n");
+               printk("Trying to EOI interrupt with interrupts enabled\n");
        }
        if (vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR)
                PSCB(vcpu, pending_interruption) = 1;
-//printf("YYYYY vcpu_set_eoi: Successful\n");
+//printk("YYYYY vcpu_set_eoi: Successful\n");
        return IA64_NO_FAULT;
 }
 
 IA64FAULT vcpu_set_lrr0(VCPU * vcpu, u64 val)
 {
        if (!(val & (1L << 16))) {
-               printf("vcpu_set_lrr0: Unmasked interrupts unsupported\n");
+               printk("vcpu_set_lrr0: Unmasked interrupts unsupported\n");
                return IA64_ILLOP_FAULT;
        }
        // no place to save this state but nothing to do anyway
@@ -1067,7 +1067,7 @@ IA64FAULT vcpu_set_lrr1(VCPU * vcpu, u64
 IA64FAULT vcpu_set_lrr1(VCPU * vcpu, u64 val)
 {
        if (!(val & (1L << 16))) {
-               printf("vcpu_set_lrr0: Unmasked interrupts unsupported\n");
+               printk("vcpu_set_lrr0: Unmasked interrupts unsupported\n");
                return IA64_ILLOP_FAULT;
        }
        // no place to save this state but nothing to do anyway
@@ -1158,7 +1158,7 @@ void vcpu_safe_set_itm(unsigned long val
 
        local_irq_save(flags);
        while (1) {
-//printf("*** vcpu_safe_set_itm: Setting itm to %lx, itc=%lx\n",val,now);
+//printk("*** vcpu_safe_set_itm: Setting itm to %lx, itc=%lx\n",val,now);
                ia64_set_itm(val);
                if (val > (now = ia64_get_itc()))
                        break;
@@ -1179,7 +1179,7 @@ void vcpu_set_next_timer(VCPU * vcpu)
         * but it doesn't matter right now */
 
        if (is_idle_domain(vcpu->domain)) {
-//             printf("****** vcpu_set_next_timer called during idle!!\n");
+//             printk("****** vcpu_set_next_timer called during idle!!\n");
                vcpu_safe_set_itm(s);
                return;
        }
@@ -1198,7 +1198,7 @@ IA64FAULT vcpu_set_itm(VCPU * vcpu, u64 
        //UINT now = ia64_get_itc();
 
        //if (val < now) val = now + 1000;
-//printf("*** vcpu_set_itm: called with %lx\n",val);
+//printk("*** vcpu_set_itm: called with %lx\n",val);
        PSCBX(vcpu, domain_itm) = val;
        vcpu_set_next_timer(vcpu);
        return IA64_NO_FAULT;
@@ -1210,8 +1210,8 @@ IA64FAULT vcpu_set_itc(VCPU * vcpu, u64 
 #ifdef DISALLOW_SETTING_ITC_FOR_NOW
        static int did_print;
        if (!did_print) {
-               printf("vcpu_set_itc: Setting ar.itc is currently disabled\n");
-               printf("(this message is only displayed one)\n");
+               printk("vcpu_set_itc: Setting ar.itc is currently disabled\n");
+               printk("(this message is only displayed one)\n");
                did_print = 1;
        }
 #else
@@ -1224,7 +1224,7 @@ IA64FAULT vcpu_set_itc(VCPU * vcpu, u64 
 
        local_irq_disable();
        if (olditm) {
-               printf("**** vcpu_set_itc(%lx): vitm changed to %lx\n", val,
+               printk("**** vcpu_set_itc(%lx): vitm changed to %lx\n", val,
                       newnow + d);
                PSCBX(vcpu, domain_itm) = newnow + d;
        }
@@ -1248,7 +1248,7 @@ IA64FAULT vcpu_get_itm(VCPU * vcpu, u64 
 IA64FAULT vcpu_get_itm(VCPU * vcpu, u64 * pval)
 {
        //FIXME: Implement this
-       printf("vcpu_get_itm: Getting cr.itm is unsupported... continuing\n");
+       printk("vcpu_get_itm: Getting cr.itm is unsupported... continuing\n");
        return IA64_NO_FAULT;
        //return IA64_ILLOP_FAULT;
 }
@@ -1256,7 +1256,7 @@ IA64FAULT vcpu_get_itc(VCPU * vcpu, u64 
 IA64FAULT vcpu_get_itc(VCPU * vcpu, u64 * pval)
 {
        //TODO: Implement this
-       printf("vcpu_get_itc: Getting ar.itc is unsupported\n");
+       printk("vcpu_get_itc: Getting ar.itc is unsupported\n");
        return IA64_ILLOP_FAULT;
 }
 
@@ -1349,7 +1349,7 @@ IA64FAULT vcpu_rfi(VCPU * vcpu)
        psr.ia64_psr.bn = 1;
        //psr.pk = 1;  // checking pkeys shouldn't be a problem but seems broken
        if (psr.ia64_psr.be) {
-               printf("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
+               printk("*** DOMAIN TRYING TO TURN ON BIG-ENDIAN!!!\n");
                return IA64_ILLOP_FAULT;
        }
        PSCB(vcpu, incomplete_regframe) = 0;    // is this necessary?
@@ -1416,7 +1416,7 @@ IA64FAULT vcpu_thash(VCPU * vcpu, u64 va
 
 IA64FAULT vcpu_ttag(VCPU * vcpu, u64 vadr, u64 * padr)
 {
-       printf("vcpu_ttag: ttag instruction unsupported\n");
+       printk("vcpu_ttag: ttag instruction unsupported\n");
        return IA64_ILLOP_FAULT;
 }
 
@@ -1730,7 +1730,7 @@ IA64FAULT vcpu_tpa(VCPU * vcpu, u64 vadr
 
 IA64FAULT vcpu_tak(VCPU * vcpu, u64 vadr, u64 * key)
 {
-       printf("vcpu_tak: tak instruction unsupported\n");
+       printk("vcpu_tak: tak instruction unsupported\n");
        return IA64_ILLOP_FAULT;
        // HACK ALERT: tak does a thash for now
        //return vcpu_thash(vcpu,vadr,key);
@@ -1781,7 +1781,7 @@ IA64FAULT vcpu_set_pmc(VCPU * vcpu, u64 
        // TODO: Should set Logical CPU state, not just physical
        // NOTE: Writes to unimplemented PMC registers are discarded
 #ifdef DEBUG_PFMON
-       printf("vcpu_set_pmc(%x,%lx)\n", reg, val);
+       printk("vcpu_set_pmc(%x,%lx)\n", reg, val);
 #endif
        ia64_set_pmc(reg, val);
        return IA64_NO_FAULT;
@@ -1792,7 +1792,7 @@ IA64FAULT vcpu_set_pmd(VCPU * vcpu, u64 
        // TODO: Should set Logical CPU state, not just physical
        // NOTE: Writes to unimplemented PMD registers are discarded
 #ifdef DEBUG_PFMON
-       printf("vcpu_set_pmd(%x,%lx)\n", reg, val);
+       printk("vcpu_set_pmd(%x,%lx)\n", reg, val);
 #endif
        ia64_set_pmd(reg, val);
        return IA64_NO_FAULT;
@@ -1803,7 +1803,7 @@ IA64FAULT vcpu_get_pmc(VCPU * vcpu, u64 
        // NOTE: Reads from unimplemented PMC registers return zero
        u64 val = (u64) ia64_get_pmc(reg);
 #ifdef DEBUG_PFMON
-       printf("%lx=vcpu_get_pmc(%x)\n", val, reg);
+       printk("%lx=vcpu_get_pmc(%x)\n", val, reg);
 #endif
        *pval = val;
        return IA64_NO_FAULT;
@@ -1814,7 +1814,7 @@ IA64FAULT vcpu_get_pmd(VCPU * vcpu, u64 
        // NOTE: Reads from unimplemented PMD registers return zero
        u64 val = (u64) ia64_get_pmd(reg);
 #ifdef DEBUG_PFMON
-       printf("%lx=vcpu_get_pmd(%x)\n", val, reg);
+       printk("%lx=vcpu_get_pmd(%x)\n", val, reg);
 #endif
        *pval = val;
        return IA64_NO_FAULT;
@@ -2061,7 +2061,7 @@ IA64FAULT vcpu_itr_d(VCPU * vcpu, u64 sl
        vcpu_purge_tr_entry(&PSCBX(vcpu, dtlb));
 
        trp = &PSCBX(vcpu, dtrs[slot]);
-//printf("***** itr.d: setting slot %d: ifa=%p\n",slot,ifa);
+//printk("***** itr.d: setting slot %d: ifa=%p\n",slot,ifa);
        vcpu_set_tr_entry(trp, pte, itir, ifa);
        vcpu_quick_region_set(PSCBX(vcpu, dtr_regions), ifa);
 
@@ -2088,7 +2088,7 @@ IA64FAULT vcpu_itr_i(VCPU * vcpu, u64 sl
        vcpu_purge_tr_entry(&PSCBX(vcpu, itlb));
 
        trp = &PSCBX(vcpu, itrs[slot]);
-//printf("***** itr.i: setting slot %d: ifa=%p\n",slot,ifa);
+//printk("***** itr.i: setting slot %d: ifa=%p\n",slot,ifa);
        vcpu_set_tr_entry(trp, pte, itir, ifa);
        vcpu_quick_region_set(PSCBX(vcpu, itr_regions), ifa);
 
@@ -2171,7 +2171,7 @@ vcpu_itc_no_srlz(VCPU * vcpu, u64 IorD, 
                // FIXME: this is dangerous... vhpt_flush_address ensures these
                // addresses never get flushed.  More work needed if this
                // ever happens.
-//printf("vhpt_insert(%p,%p,%p)\n",vaddr,pte,1L<<logps);
+//printk("vhpt_insert(%p,%p,%p)\n",vaddr,pte,1L<<logps);
                if (logps > PAGE_SHIFT)
                        vhpt_multiple_insert(vaddr, pte, logps);
                else
@@ -2307,7 +2307,7 @@ IA64FAULT vcpu_ptc_ga(VCPU * vcpu, u64 v
        // FIXME: validate not flushing Xen addresses
        // if (Xen address) return(IA64_ILLOP_FAULT);
        // FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE
-//printf("######## vcpu_ptc_ga(%p,%p) ##############\n",vadr,addr_range);
+//printk("######## vcpu_ptc_ga(%p,%p) ##############\n",vadr,addr_range);
 
        check_xen_space_overlap("ptc_ga", vadr, addr_range);
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/vhpt.c
--- a/xen/arch/ia64/xen/vhpt.c  Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/vhpt.c  Tue Oct 24 11:21:48 2006 -0600
@@ -109,7 +109,7 @@ void vhpt_multiple_insert(unsigned long 
                //  only a few times/second, so OK for now.
                //  An alternate solution would be to just insert the one
                //  16KB in the vhpt (but with the full mapping)?
-               //printf("vhpt_multiple_insert: logps-PAGE_SHIFT==%d,"
+               //printk("vhpt_multiple_insert: logps-PAGE_SHIFT==%d,"
                        //"va=%p, pa=%p, pa-masked=%p\n",
                        //logps-PAGE_SHIFT,vaddr,pte&_PFN_MASK,
                        //(pte&_PFN_MASK)&~mask);
@@ -142,7 +142,7 @@ void vhpt_init(void)
                panic("vhpt_init: bad VHPT alignment!\n");
        __get_cpu_var(vhpt_paddr) = paddr;
        __get_cpu_var(vhpt_pend) = paddr + (1 << VHPT_SIZE_LOG2) - 1;
-       printf("vhpt_init: vhpt paddr=0x%lx, end=0x%lx\n",
+       printk("vhpt_init: vhpt paddr=0x%lx, end=0x%lx\n",
                paddr, __get_cpu_var(vhpt_pend));
        vhpt_erase(paddr);
        // we don't enable VHPT here.
@@ -336,7 +336,7 @@ void domain_flush_vtlb_range (struct dom
 #if 0
        // this only seems to occur at shutdown, but it does occur
        if ((!addr_range) || addr_range & (addr_range - 1)) {
-               printf("vhpt_flush_address: weird range, spinning...\n");
+               printk("vhpt_flush_address: weird range, spinning...\n");
                while(1);
        }
 #endif
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/xencomm.c
--- a/xen/arch/ia64/xen/xencomm.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/xencomm.c       Tue Oct 24 11:21:48 2006 -0600
@@ -92,7 +92,7 @@ xencomm_copy_from_guest(
     unsigned int i = 0;
 
     if (xencomm_debug)
-        printf("xencomm_copy_from_guest: from=%lx+%u n=%u\n",
+        printk("xencomm_copy_from_guest: from=%lx+%u n=%u\n",
                (unsigned long)from, skip, n);
 
     if (XENCOMM_IS_INLINE(from)) {
@@ -158,7 +158,7 @@ xencomm_copy_from_guest(
            int res;
 
             if (xencomm_debug > 1)
-                printf ("src_paddr=%lx i=%d, skip=%d\n",
+                printk ("src_paddr=%lx i=%d, skip=%d\n",
                         src_paddr, i, chunk_skip);
 
             res = xencomm_copy_chunk_from((unsigned long)to + to_pos,
@@ -233,7 +233,7 @@ xencomm_copy_to_guest(
     unsigned int i = 0;
 
     if (xencomm_debug)
-        printf ("xencomm_copy_to_guest: to=%lx+%u n=%u\n",
+        printk ("xencomm_copy_to_guest: to=%lx+%u n=%u\n",
                 (unsigned long)to, skip, n);
 
     if (XENCOMM_IS_INLINE(to)) {
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/xenmisc.c       Tue Oct 24 11:21:48 2006 -0600
@@ -179,13 +179,13 @@ void panic_domain(struct pt_regs *regs, 
        char buf[256];
        struct vcpu *v = current;
 
-       printf("$$$$$ PANIC in domain %d (k6=0x%lx): ",
+       printk("$$$$$ PANIC in domain %d (k6=0x%lx): ",
                v->domain->domain_id,
                __get_cpu_var(cpu_kr)._kr[IA64_KR_CURRENT]);
        va_start(args, fmt);
        (void)vsnprintf(buf, sizeof(buf), fmt, args);
        va_end(args);
-       printf(buf);
+       printk(buf);
        if (regs) show_registers(regs);
        if (regs) {
                debugger_trap_fatal(0 /* don't care */, regs);
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/xensetup.c
--- a/xen/arch/ia64/xen/xensetup.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/xensetup.c      Tue Oct 24 11:21:48 2006 -0600
@@ -389,13 +389,13 @@ void start_kernel(void)
     /* first find highest page frame number */
     max_page = 0;
     efi_memmap_walk(find_max_pfn, &max_page);
-    printf("find_memory: efi_memmap_walk returns max_page=%lx\n",max_page);
+    printk("find_memory: efi_memmap_walk returns max_page=%lx\n",max_page);
     efi_print();
 
     xen_heap_start = memguard_init(ia64_imva(&_end));
-    printf("Before xen_heap_start: %p\n", xen_heap_start);
+    printk("Before xen_heap_start: %p\n", xen_heap_start);
     xen_heap_start = __va(init_boot_allocator(__pa(xen_heap_start)));
-    printf("After xen_heap_start: %p\n", xen_heap_start);
+    printk("After xen_heap_start: %p\n", xen_heap_start);
 
     efi_memmap_walk(filter_rsvd_memory, init_boot_pages);
     efi_memmap_walk(xen_count_pages, &nr_pages);
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/ia64/xen/xentime.c
--- a/xen/arch/ia64/xen/xentime.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/ia64/xen/xentime.c       Tue Oct 24 11:21:48 2006 -0600
@@ -115,7 +115,7 @@ xen_timer_interrupt (int irq, void *dev_
 #ifdef HEARTBEAT_FREQ
        static long count = 0;
        if (!(++count & ((HEARTBEAT_FREQ*1024)-1))) {
-               printf("Heartbeat... iip=%p\n", /*",psr.i=%d,pend=%d\n", */
+               printk("Heartbeat... iip=%p\n", /*",psr.i=%d,pend=%d\n", */
                        regs->cr_iip /*,
                        !current->vcpu_info->evtchn_upcall_mask,
                        VCPU(current,pending_interruption) */);
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/powerpc/backtrace.c
--- a/xen/arch/powerpc/backtrace.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/powerpc/backtrace.c      Tue Oct 24 11:21:48 2006 -0600
@@ -93,13 +93,13 @@ static void xmon_print_symbol(unsigned l
        const char *name = NULL;
        unsigned long offset, size;
 
-       printf(REG, address);
+       printk(REG, address);
 
     name = symbols_lookup(address, &size, &offset, namebuf);
        if (name) {
-               printf("%s%s+%#lx/%#lx", mid, name, offset, size);
+               printk("%s%s+%#lx/%#lx", mid, name, offset, size);
        }
-       printf("%s", after);
+       printk("%s", after);
 }
 
 static void backtrace(
@@ -114,13 +114,13 @@ static void backtrace(
        do {
                if (sp > xenheap_phys_end) {
                        if (sp != 0)
-                               printf("SP (%lx) is not in xen space\n", sp);
+                               printk("SP (%lx) is not in xen space\n", sp);
                        break;
                }
 
                if (!mread(sp + LRSAVE_OFFSET, &ip, sizeof(unsigned long))
                    || !mread(sp, &newsp, sizeof(unsigned long))) {
-                       printf("Couldn't read stack frame at %lx\n", sp);
+                       printk("Couldn't read stack frame at %lx\n", sp);
                        break;
                }
 
@@ -147,17 +147,17 @@ static void backtrace(
                                printip = 0;
                        } else if (lr < xenheap_phys_end
                        && !(fnstart <= lr && lr < fnend)) {
-                               printf("[link register   ] ");
+                               printk("[link register   ] ");
                                xmon_print_symbol(lr, " ", "\n");
                        }
                        if (printip) {
-                               printf("["REG"] ", sp);
+                               printk("["REG"] ", sp);
                                xmon_print_symbol(ip, " ", " (unreliable)\n");
                        }
                        pc = lr = 0;
 
                } else {
-                       printf("["REG"] ", sp);
+                       printk("["REG"] ", sp);
                        xmon_print_symbol(ip, " ", "\n");
                }
 
@@ -167,11 +167,11 @@ static void backtrace(
                    && marker == REG_FRAME_MARKER) {
                        if (mread(sp + REGS_OFFSET, &regs, sizeof(regs))
                            != sizeof(regs)) {
-                               printf("Couldn't read registers at %lx\n",
+                               printk("Couldn't read registers at %lx\n",
                                       sp + REGS_OFFSET);
                                break;
                        }
-            printf("--- Exception: %x %s at ", regs.entry_vector,
+            printk("--- Exception: %x %s at ", regs.entry_vector,
                               getvecname(TRAP(&regs)));
                        pc = regs.pc;
                        lr = regs.lr;
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/powerpc/domain.c Tue Oct 24 11:21:48 2006 -0600
@@ -97,14 +97,14 @@ void arch_domain_destroy(struct domain *
 
 void machine_halt(void)
 {
-    printf("machine_halt called: spinning....\n");
+    printk("machine_halt called: spinning....\n");
     console_start_sync();
     while(1);
 }
 
 void machine_restart(char * __unused)
 {
-    printf("machine_restart called: spinning....\n");
+    printk("machine_restart called: spinning....\n");
     console_start_sync();
     while(1);
 }
@@ -134,7 +134,7 @@ int arch_set_info_guest(struct vcpu *v, 
 { 
     memcpy(&v->arch.ctxt, &c->user_regs, sizeof(c->user_regs));
 
-    printf("Domain[%d].%d: initializing\n",
+    printk("Domain[%d].%d: initializing\n",
            v->domain->domain_id, v->vcpu_id);
 
     if (v->domain->arch.htab.order == 0)
@@ -186,7 +186,7 @@ void context_switch(struct vcpu *prev, s
     unsigned int cpu = smp_processor_id();
 
 #if 0
-    printf("%s: dom %x to dom %x\n", __func__, prev->domain->domain_id,
+    printk("%s: dom %x to dom %x\n", __func__, prev->domain->domain_id,
             next->domain->domain_id);
 #endif
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/powerpc/of-devwalk.c
--- a/xen/arch/powerpc/of-devwalk.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/powerpc/of-devwalk.c     Tue Oct 24 11:21:48 2006 -0600
@@ -35,7 +35,7 @@ void ofd_prop_print(
     if ( path[0] == '/' && path[1] == '\0' ) {
         path = "";
     }
-    printf("%s: %s/%s: 0x%lx\n", head, path,  name, sz);
+    printk("%s: %s/%s: 0x%lx\n", head, path,  name, sz);
 
 #define DEBUG_PROP
 #ifdef DEBUG_PROP
@@ -56,24 +56,24 @@ void ofd_prop_print(
     }
 
     if ( isstr > 0 ) {
-        printf("%s: \t%s\n", head, b);
+        printk("%s: \t%s\n", head, b);
     } else if ( sz != 0 ) {
-        printf("%s: \t0x", head);
+        printk("%s: \t0x", head);
 
         for ( i = 0; i < sz; i++ ) {
             if ( (i % 4) == 0 && i != 0 ) {
                 if ( (i % 16) == 0 && i != 0 ) {
-                    printf("\n%s: \t0x", head);
+                    printk("\n%s: \t0x", head);
                 } else {
-                    printf(" 0x");
+                    printk(" 0x");
                 }
             }
             if (b[i] < 0x10) {
-                printf("0");
+                printk("0");
             }
-            printf("%x", b[i]);
+            printk("%x", b[i]);
         }
-        printf("\n");
+        printk("\n");
     }
 #else
     (void)prop;
@@ -95,7 +95,7 @@ void ofd_dump_props(void *mem, ofdn_t n,
     }
 
     if (dump & OFD_DUMP_NAMES) {
-        printf("of_walk: %s: phandle 0x%x\n", path, n);
+        printk("of_walk: %s: phandle 0x%x\n", path, n);
     }
 
     p = ofd_nextprop(mem, n, NULL, name);
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/powerpc/powerpc64/domain.c
--- a/xen/arch/powerpc/powerpc64/domain.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/powerpc/powerpc64/domain.c       Tue Oct 24 11:21:48 2006 -0600
@@ -112,7 +112,7 @@ void save_segments(struct vcpu *v)
         slb_entry[i].slb_esid = esid;
 #ifdef SLB_DEBUG
         if (vsid != 0) {
-            printf("%s: DOM[0x%x]: S%02d: 0x%016lx 0x%016lx\n",
+            printk("%s: DOM[0x%x]: S%02d: 0x%016lx 0x%016lx\n",
                     __func__, v->domain->domain_id, i, vsid, esid);
         }
 #endif
@@ -146,7 +146,7 @@ void load_segments(struct vcpu *v)
 
 #ifdef SLB_DEBUG
         if (vsid != 0) {
-            printf("%s: DOM[0x%x]: R%02d: 0x%016lx 0x%016lx\n",
+            printk("%s: DOM[0x%x]: R%02d: 0x%016lx 0x%016lx\n",
                     __func__, v->domain->domain_id, i, vsid, esid);
         }
 #endif
@@ -173,6 +173,6 @@ void dump_segments(int valid)
 
         if (valid && !(esid & SLB_ESID_VALID))
             continue;
-        printf("S%02d: 0x%016lx 0x%016lx\n", i, vsid, esid);
+        printk("S%02d: 0x%016lx 0x%016lx\n", i, vsid, esid);
     }
 }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/boot/x86_32.S
--- a/xen/arch/x86/boot/x86_32.S        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/boot/x86_32.S        Tue Oct 24 11:21:48 2006 -0600
@@ -185,7 +185,7 @@ ignore_int:
         mov     %eax,%ds
         mov     %eax,%es
         pushl   $int_msg
-        call    printf
+        call    printk
 1:      jmp     1b
 
 /*** STACK LOCATION ***/
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/boot/x86_64.S
--- a/xen/arch/x86/boot/x86_64.S        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/boot/x86_64.S        Tue Oct 24 11:21:48 2006 -0600
@@ -186,7 +186,7 @@ ignore_int:
         cld
         leaq    int_msg(%rip),%rdi
         xorl    %eax,%eax
-        call    printf
+        call    printk
 1:      jmp     1b
 
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/domain.c     Tue Oct 24 11:21:48 2006 -0600
@@ -378,6 +378,7 @@ arch_do_vcpu_op(
     case VCPUOP_register_runstate_memory_area:
     {
         struct vcpu_register_runstate_memory_area area;
+        struct vcpu_runstate_info runstate;
 
         rc = -EFAULT;
         if ( copy_from_guest(&area, arg, 1) )
@@ -390,8 +391,15 @@ arch_do_vcpu_op(
         v->runstate_guest = area.addr.v;
 
         if ( v == current )
+        {
             __copy_to_user(v->runstate_guest, &v->runstate,
                            sizeof(v->runstate));
+        }
+        else
+        {
+            vcpu_runstate_get(v, &runstate);
+            __copy_to_user(v->runstate_guest, &runstate, sizeof(runstate));
+        }
 
         break;
     }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/hvm.c    Tue Oct 24 11:21:48 2006 -0600
@@ -237,13 +237,18 @@ void hvm_do_resume(struct vcpu *v)
     }
 
     p = &get_vio(v->domain, v->vcpu_id)->vp_ioreq;
-    wait_on_xen_event_channel(v->arch.hvm.xen_port,
+    wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port,
                               p->state != STATE_IOREQ_READY &&
                               p->state != STATE_IOREQ_INPROCESS);
-    if ( p->state == STATE_IORESP_READY )
+    switch ( p->state )
+    {
+    case STATE_IORESP_READY:
         hvm_io_assist(v);
-    if ( p->state != STATE_INVALID ) {
-        printf("Weird HVM iorequest state %d.\n", p->state);
+        break;
+    case STATE_INVALID:
+        break;
+    default:
+        printk("Weird HVM iorequest state %d.\n", p->state);
         domain_crash(v->domain);
     }
 }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/io.c     Tue Oct 24 11:21:48 2006 -0600
@@ -723,7 +723,7 @@ void hvm_io_assist(struct vcpu *v)
     vio = get_vio(v->domain, v->vcpu_id);
 
     if ( vio == 0 ) {
-        printf("bad shared page: %lx\n", (unsigned long)vio);
+        printk("bad shared page: %lx\n", (unsigned long)vio);
         domain_crash_synchronous();
     }
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/platform.c
--- a/xen/arch/x86/hvm/platform.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/platform.c       Tue Oct 24 11:21:48 2006 -0600
@@ -727,7 +727,8 @@ static void hvm_send_assist_req(struct v
         domain_crash(v->domain);
         return;
     }
-    wmb();
+
+    prepare_wait_on_xen_event_channel(v->arch.hvm_vcpu.xen_port);
     p->state = STATE_IOREQ_READY;
     notify_via_xen_event_channel(v->arch.hvm_vcpu.xen_port);
 }
@@ -740,7 +741,8 @@ void send_pio_req(unsigned long port, un
     ioreq_t *p;
 
     if ( size == 0 || count == 0 ) {
-        printf("null pio request? port %lx, count %lx, size %d, value %lx, dir 
%d, pvalid %d.\n",
+        printk("null pio request? port %lx, count %lx, "
+               "size %d, value %lx, dir %d, pvalid %d.\n",
                port, count, size, value, dir, pvalid);
     }
 
@@ -793,7 +795,8 @@ static void send_mmio_req(unsigned char 
     ioreq_t *p;
 
     if ( size == 0 || count == 0 ) {
-        printf("null mmio request? type %d, gpa %lx, count %lx, size %d, value 
%lx, dir %d, pvalid %d.\n",
+        printk("null mmio request? type %d, gpa %lx, "
+               "count %lx, size %d, value %lx, dir %d, pvalid %d.\n",
                type, gpa, count, size, value, dir, pvalid);
     }
 
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/svm/intr.c       Tue Oct 24 11:21:48 2006 -0600
@@ -59,7 +59,7 @@ static inline int svm_inject_extint(stru
     intr.fields.prio = 0xF;
     intr.fields.ign_tpr = 1;
     vmcb->vintr = intr;
-//  printf( "IRQ = %d\n", trap );
+
     return 0;
 }
     
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/svm/svm.c        Tue Oct 24 11:21:48 2006 -0600
@@ -1021,7 +1021,7 @@ static void svm_do_general_protection_fa
     error_code = vmcb->exitinfo1;
 
     if (vmcb->idtr.limit == 0) {
-        printf("Huh? We got a GP Fault with an invalid IDTR!\n");
+        printk("Huh? We got a GP Fault with an invalid IDTR!\n");
         svm_dump_vmcb(__func__, vmcb);
         svm_dump_regs(__func__, regs);
         svm_dump_inst(vmcb->rip);
@@ -2295,7 +2295,7 @@ static int svm_do_vmmcall(struct vcpu *v
         /* VMMCALL sanity check */
         if ( vmcb->cpl > get_vmmcall_cpl(regs->edi) )
         {
-            printf("VMMCALL CPL check failed\n");
+            printk("VMMCALL CPL check failed\n");
             return -1;
         }
 
@@ -2305,7 +2305,7 @@ static int svm_do_vmmcall(struct vcpu *v
         case VMMCALL_RESET_TO_REALMODE:
             if ( svm_do_vmmcall_reset_to_realmode(v, regs) )
             {
-                printf("svm_do_vmmcall_reset_to_realmode() failed\n");
+                printk("svm_do_vmmcall_reset_to_realmode() failed\n");
                 return -1;
             }
             /* since we just reset the VMCB, return without adjusting
@@ -2313,7 +2313,7 @@ static int svm_do_vmmcall(struct vcpu *v
             return 0;
 
         case VMMCALL_DEBUG:
-            printf("DEBUG features not implemented yet\n");
+            printk("DEBUG features not implemented yet\n");
             break;
         default:
             break;
@@ -2344,16 +2344,16 @@ void svm_dump_inst(unsigned long eip)
     if (hvm_copy_from_guest_virt(opcode, ptr, sizeof(opcode)) == 0)
         len = sizeof(opcode);
 
-    printf("Code bytes around(len=%d) %lx:", len, eip);
+    printk("Code bytes around(len=%d) %lx:", len, eip);
     for (i = 0; i < len; i++)
     {
         if ((i & 0x0f) == 0)
-            printf("\n%08lx:", ptr+i);
-
-        printf("%02x ", opcode[i]);
-    }
-
-    printf("\n");
+            printk("\n%08lx:", ptr+i);
+
+        printk("%02x ", opcode[i]);
+    }
+
+    printk("\n");
 }
 
 
@@ -2363,7 +2363,7 @@ void svm_dump_regs(const char *from, str
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     unsigned long pt = v->arch.hvm_vcpu.hw_cr3;
 
-    printf("%s: guest registers from %s:\n", __func__, from);
+    printk("%s: guest registers from %s:\n", __func__, from);
 #if defined (__x86_64__)
     printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
@@ -2378,15 +2378,15 @@ void svm_dump_regs(const char *from, str
     printk("r15: %016lx   cr0: %016lx   cr3: %016lx\n",
            regs->r15, v->arch.hvm_svm.cpu_shadow_cr0, vmcb->cr3);
 #else
-    printf("eax: %08x, ebx: %08x, ecx: %08x, edx: %08x\n", 
+    printk("eax: %08x, ebx: %08x, ecx: %08x, edx: %08x\n", 
            regs->eax, regs->ebx, regs->ecx, regs->edx);
-    printf("edi: %08x, esi: %08x, ebp: %08x, esp: %08x\n", 
+    printk("edi: %08x, esi: %08x, ebp: %08x, esp: %08x\n", 
            regs->edi, regs->esi, regs->ebp, regs->esp);
-    printf("%s: guest cr0: %lx\n", __func__, 
+    printk("%s: guest cr0: %lx\n", __func__, 
            v->arch.hvm_svm.cpu_shadow_cr0);
-    printf("guest CR3 = %llx\n", vmcb->cr3);
+    printk("guest CR3 = %llx\n", vmcb->cr3);
 #endif
-    printf("%s: pt = %lx\n", __func__, pt);
+    printk("%s: pt = %lx\n", __func__, pt);
 }
 
 
@@ -2395,12 +2395,12 @@ void svm_dump_host_regs(const char *from
     struct vcpu *v = current;
     unsigned long pt = pt = pagetable_get_paddr(v->arch.monitor_table);
     unsigned long cr3, cr0;
-    printf("Host registers at %s\n", from);
+    printk("Host registers at %s\n", from);
 
     __asm__ __volatile__ ("\tmov %%cr0,%0\n"
                           "\tmov %%cr3,%1\n"
                           : "=r" (cr0), "=r"(cr3));
-    printf("%s: pt = %lx, cr3 = %lx, cr0 = %lx\n", __func__, pt, cr3, cr0);
+    printk("%s: pt = %lx, cr3 = %lx, cr0 = %lx\n", __func__, pt, cr3, cr0);
 }
 
 #ifdef SVM_EXTRA_DEBUG
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Tue Oct 24 11:21:48 2006 -0600
@@ -408,7 +408,7 @@ void svm_do_launch(struct vcpu *v)
 
 static void svm_dump_sel(char *name, segment_selector_t *s)
 {
-    printf("%s: sel=0x%04x, attr=0x%04x, limit=0x%08x, base=0x%016llx\n", 
+    printk("%s: sel=0x%04x, attr=0x%04x, limit=0x%08x, base=0x%016llx\n", 
            name, s->sel, s->attributes.bytes, s->limit,
            (unsigned long long)s->base);
 }
@@ -416,50 +416,50 @@ static void svm_dump_sel(char *name, seg
 
 void svm_dump_vmcb(const char *from, struct vmcb_struct *vmcb)
 {
-    printf("Dumping guest's current state at %s...\n", from);
-    printf("Size of VMCB = %d, address = %p\n", 
+    printk("Dumping guest's current state at %s...\n", from);
+    printk("Size of VMCB = %d, address = %p\n", 
             (int) sizeof(struct vmcb_struct), vmcb);
 
-    printf("cr_intercepts = 0x%08x dr_intercepts = 0x%08x "
+    printk("cr_intercepts = 0x%08x dr_intercepts = 0x%08x "
            "exception_intercepts = 0x%08x\n", 
            vmcb->cr_intercepts, vmcb->dr_intercepts, 
            vmcb->exception_intercepts);
-    printf("general1_intercepts = 0x%08x general2_intercepts = 0x%08x\n", 
+    printk("general1_intercepts = 0x%08x general2_intercepts = 0x%08x\n", 
            vmcb->general1_intercepts, vmcb->general2_intercepts);
-    printf("iopm_base_pa = %016llx msrpm_base_pa = 0x%016llx tsc_offset = "
+    printk("iopm_base_pa = %016llx msrpm_base_pa = 0x%016llx tsc_offset = "
             "0x%016llx\n", 
            (unsigned long long) vmcb->iopm_base_pa,
            (unsigned long long) vmcb->msrpm_base_pa,
            (unsigned long long) vmcb->tsc_offset);
-    printf("tlb_control = 0x%08x vintr = 0x%016llx interrupt_shadow = "
+    printk("tlb_control = 0x%08x vintr = 0x%016llx interrupt_shadow = "
             "0x%016llx\n", vmcb->tlb_control,
            (unsigned long long) vmcb->vintr.bytes,
            (unsigned long long) vmcb->interrupt_shadow);
-    printf("exitcode = 0x%016llx exitintinfo = 0x%016llx\n", 
+    printk("exitcode = 0x%016llx exitintinfo = 0x%016llx\n", 
            (unsigned long long) vmcb->exitcode,
            (unsigned long long) vmcb->exitintinfo.bytes);
-    printf("exitinfo1 = 0x%016llx exitinfo2 = 0x%016llx \n",
+    printk("exitinfo1 = 0x%016llx exitinfo2 = 0x%016llx \n",
            (unsigned long long) vmcb->exitinfo1,
            (unsigned long long) vmcb->exitinfo2);
-    printf("np_enable = 0x%016llx guest_asid = 0x%03x\n", 
+    printk("np_enable = 0x%016llx guest_asid = 0x%03x\n", 
            (unsigned long long) vmcb->np_enable, vmcb->guest_asid);
-    printf("cpl = %d efer = 0x%016llx star = 0x%016llx lstar = 0x%016llx\n", 
+    printk("cpl = %d efer = 0x%016llx star = 0x%016llx lstar = 0x%016llx\n", 
            vmcb->cpl, (unsigned long long) vmcb->efer,
            (unsigned long long) vmcb->star, (unsigned long long) vmcb->lstar);
-    printf("CR0 = 0x%016llx CR2 = 0x%016llx\n",
+    printk("CR0 = 0x%016llx CR2 = 0x%016llx\n",
            (unsigned long long) vmcb->cr0, (unsigned long long) vmcb->cr2);
-    printf("CR3 = 0x%016llx CR4 = 0x%016llx\n", 
+    printk("CR3 = 0x%016llx CR4 = 0x%016llx\n", 
            (unsigned long long) vmcb->cr3, (unsigned long long) vmcb->cr4);
-    printf("RSP = 0x%016llx  RIP = 0x%016llx\n", 
+    printk("RSP = 0x%016llx  RIP = 0x%016llx\n", 
            (unsigned long long) vmcb->rsp, (unsigned long long) vmcb->rip);
-    printf("RAX = 0x%016llx  RFLAGS=0x%016llx\n",
+    printk("RAX = 0x%016llx  RFLAGS=0x%016llx\n",
            (unsigned long long) vmcb->rax, (unsigned long long) vmcb->rflags);
-    printf("DR6 = 0x%016llx, DR7 = 0x%016llx\n", 
+    printk("DR6 = 0x%016llx, DR7 = 0x%016llx\n", 
            (unsigned long long) vmcb->dr6, (unsigned long long) vmcb->dr7);
-    printf("CSTAR = 0x%016llx SFMask = 0x%016llx\n",
+    printk("CSTAR = 0x%016llx SFMask = 0x%016llx\n",
            (unsigned long long) vmcb->cstar, 
            (unsigned long long) vmcb->sfmask);
-    printf("KernGSBase = 0x%016llx PAT = 0x%016llx \n", 
+    printk("KernGSBase = 0x%016llx PAT = 0x%016llx \n", 
            (unsigned long long) vmcb->kerngsbase,
            (unsigned long long) vmcb->g_pat);
     
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/svm/x86_32/exits.S
--- a/xen/arch/x86/hvm/svm/x86_32/exits.S       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/svm/x86_32/exits.S       Tue Oct 24 11:21:48 2006 -0600
@@ -139,9 +139,6 @@ ENTRY(svm_asm_do_resume)
 ENTRY(svm_asm_do_resume)
 svm_test_all_events:
         GET_CURRENT(%ebx)
-        pushl %ebx
-        call hvm_do_resume
-        addl $4, %esp
 /*test_all_events:*/
         xorl %ecx,%ecx
         notl %ecx
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/svm/x86_64/exits.S
--- a/xen/arch/x86/hvm/svm/x86_64/exits.S       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/svm/x86_64/exits.S       Tue Oct 24 11:21:48 2006 -0600
@@ -153,8 +153,6 @@ ENTRY(svm_asm_do_resume)
 ENTRY(svm_asm_do_resume)
 svm_test_all_events:
         GET_CURRENT(%rbx)
-        movq %rbx, %rdi
-        call hvm_do_resume
 /*test_all_events:*/
         cli                             # tests must not race interrupts
 /*test_softirqs:*/
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Oct 24 11:21:48 2006 -0600
@@ -1087,7 +1087,7 @@ static int check_for_null_selector(unsig
     memset(inst, 0, MAX_INST_LEN);
     if ( inst_copy_from_guest(inst, eip, inst_len) != inst_len )
     {
-        printf("check_for_null_selector: get guest instruction failed\n");
+        printk("check_for_null_selector: get guest instruction failed\n");
         domain_crash_synchronous();
     }
 
@@ -1470,7 +1470,7 @@ static int vmx_assist(struct vcpu *v, in
     }
 
  error:
-    printf("Failed to transfer to vmxassist\n");
+    printk("Failed to transfer to vmxassist\n");
     domain_crash_synchronous();
     return 0;
 }
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/vmx/x86_32/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_32/exits.S       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S       Tue Oct 24 11:21:48 2006 -0600
@@ -97,9 +97,6 @@ vmx_process_softirqs:
         ALIGN
 ENTRY(vmx_asm_do_vmentry)
         GET_CURRENT(%ebx)
-        pushl %ebx
-        call hvm_do_resume
-        addl $4, %esp
         cli                             # tests must not race interrupts
 
         movl VCPU_processor(%ebx),%eax
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Tue Oct 24 11:21:48 2006 -0600
@@ -106,8 +106,6 @@ vmx_process_softirqs:
         ALIGN
 ENTRY(vmx_asm_do_vmentry)
         GET_CURRENT(%rbx)
-        movq %rbx, %rdi
-        call hvm_do_resume
         cli                             # tests must not race interrupts
 
         movl  VCPU_processor(%rbx),%eax
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/setup.c      Tue Oct 24 11:21:48 2006 -0600
@@ -296,7 +296,7 @@ void __init __start_xen(multiboot_info_t
 
     init_console();
 
-    printf("Command line: %s\n", cmdline);
+    printk("Command line: %s\n", cmdline);
 
     /* Check that we have at least one Multiboot module. */
     if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/x86_32/entry.S       Tue Oct 24 11:21:48 2006 -0600
@@ -398,7 +398,7 @@ domain_crash_synchronous_string:
 
 domain_crash_synchronous:
         pushl $domain_crash_synchronous_string
-        call  printf
+        call  printk
         jmp   __domain_crash_synchronous
 
         ALIGN
diff -r aa8ca06d209e -r d246b79986d1 
xen/arch/x86/x86_32/supervisor_mode_kernel.S
--- a/xen/arch/x86/x86_32/supervisor_mode_kernel.S      Tue Oct 24 10:08:30 
2006 -0600
+++ b/xen/arch/x86/x86_32/supervisor_mode_kernel.S      Tue Oct 24 11:21:48 
2006 -0600
@@ -141,5 +141,5 @@ domain_crash_synchronous_string:
 
 domain_crash_synchronous:
         pushl $domain_crash_synchronous_string
-        call  printf
+        call  printk
         jmp   __domain_crash_synchronous
diff -r aa8ca06d209e -r d246b79986d1 xen/arch/x86/x86_64/entry.S
--- a/xen/arch/x86/x86_64/entry.S       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/arch/x86/x86_64/entry.S       Tue Oct 24 11:21:48 2006 -0600
@@ -328,7 +328,7 @@ domain_crash_synchronous:
         # printk(domain_crash_synchronous_string)
         leaq  domain_crash_synchronous_string(%rip),%rdi
         xorl  %eax,%eax
-        call  printf
+        call  printk
         jmp  __domain_crash_synchronous
 
         ALIGN
diff -r aa8ca06d209e -r d246b79986d1 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c   Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/common/sched_sedf.c   Tue Oct 24 11:21:48 2006 -0600
@@ -1190,10 +1190,10 @@ static void sedf_dump_domain(struct vcpu
     
 #ifdef SEDF_STATS
     if ( EDOM_INFO(d)->block_time_tot != 0 )
-        printf(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
+        printk(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
                EDOM_INFO(d)->block_time_tot);
     if ( EDOM_INFO(d)->block_tot != 0 )
-        printf("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
+        printk("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
                "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
                EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
                (EDOM_INFO(d)->short_block_tot * 100) 
@@ -1206,7 +1206,7 @@ static void sedf_dump_domain(struct vcpu
                (EDOM_INFO(d)->block_time_tot) / EDOM_INFO(d)->block_tot,
                (EDOM_INFO(d)->penalty_time_tot) / EDOM_INFO(d)->block_tot);
 #endif
-    printf("\n");
+    printk("\n");
 }
 
 
diff -r aa8ca06d209e -r d246b79986d1 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c        Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/drivers/char/console.c        Tue Oct 24 11:21:48 2006 -0600
@@ -294,7 +294,7 @@ static inline void __putstr(const char *
     }
 }
 
-void printf(const char *fmt, ...)
+void printk(const char *fmt, ...)
 {
     static char   buf[1024];
     static int    start_of_line = 1;
diff -r aa8ca06d209e -r d246b79986d1 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/include/asm-ia64/config.h     Tue Oct 24 11:21:48 2006 -0600
@@ -232,7 +232,7 @@ extern unsigned long loops_per_jiffy;
 extern unsigned long loops_per_jiffy;
 extern char saved_command_line[];
 struct screen_info { };
-#define seq_printf(a,b...) printf(b)
+#define seq_printf(a,b...) printk(b)
 //#define CONFIG_BLK_DEV_INITRD // needed to reserve memory for domain0
 
 #define CONFIG_SHADOW  1
diff -r aa8ca06d209e -r d246b79986d1 xen/include/asm-ia64/vcpu.h
--- a/xen/include/asm-ia64/vcpu.h       Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/include/asm-ia64/vcpu.h       Tue Oct 24 11:21:48 2006 -0600
@@ -200,7 +200,7 @@ static inline s64 vcpu_get_next_timer_ns
        return vcpu_get_next_timer_ns;
 }
 
-#define verbose(a...) do {if (vcpu_verbose) printf(a);} while(0)
+#define verbose(a...) do {if (vcpu_verbose) printk(a);} while(0)
 
 //#define vcpu_quick_region_check(_tr_regions,_ifa) 1
 #define vcpu_quick_region_check(_tr_regions,_ifa)           \
diff -r aa8ca06d209e -r d246b79986d1 xen/include/xen/event.h
--- a/xen/include/xen/event.h   Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/include/xen/event.h   Tue Oct 24 11:21:48 2006 -0600
@@ -70,4 +70,11 @@ void notify_via_xen_event_channel(int lp
         do_softirq();                                                   \
     } while ( 0 )
 
+#define prepare_wait_on_xen_event_channel(port)                         \
+    do {                                                                \
+        set_bit(_VCPUF_blocked_in_xen, &current->vcpu_flags);           \
+        raise_softirq(SCHEDULE_SOFTIRQ);                                \
+        mb(); /* set blocked status /then/ caller does his work */      \
+    } while ( 0 )
+
 #endif /* __XEN_EVENT_H__ */
diff -r aa8ca06d209e -r d246b79986d1 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h     Tue Oct 24 10:08:30 2006 -0600
+++ b/xen/include/xen/lib.h     Tue Oct 24 11:21:48 2006 -0600
@@ -51,8 +51,7 @@ extern void debugtrace_printk(const char
 
 /* Allows us to use '%p' as general-purpose machine-word format char. */
 #define _p(_x) ((void *)(unsigned long)(_x))
-#define printk(_f , _a...) printf( _f , ## _a )
-extern void printf(const char *format, ...)
+extern void printk(const char *format, ...)
     __attribute__ ((format (printf, 1, 2)));
 extern void panic(const char *format, ...)
     __attribute__ ((format (printf, 1, 2)));
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/balloon/common.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/common.h Tue Oct 24 11:21:48 
2006 -0600
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * balloon/common.h
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_BALLOON_COMMON_H__
+#define __XEN_BALLOON_COMMON_H__
+
+#define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10))
+
+struct balloon_stats {
+       /* We aim for 'current allocation' == 'target allocation'. */
+       unsigned long current_pages;
+       unsigned long target_pages;
+       /* We may hit the hard limit in Xen. If we do then we remember it. */
+       unsigned long hard_limit;
+       /*
+        * Drivers may alter the memory reservation independently, but they
+        * must inform the balloon driver so we avoid hitting the hard limit.
+        */
+       unsigned long driver_pages;
+       /* Number of pages in high- and low-memory balloons. */
+       unsigned long balloon_low;
+       unsigned long balloon_high;
+};
+
+extern struct balloon_stats balloon_stats;
+#define bs balloon_stats
+
+int balloon_sysfs_init(void);
+void balloon_sysfs_exit(void);
+
+void balloon_set_new_target(unsigned long target);
+
+#endif /* __XEN_BALLOON_COMMON_H__ */
diff -r aa8ca06d209e -r d246b79986d1 
linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c  Tue Oct 24 11:21:48 
2006 -0600
@@ -0,0 +1,165 @@
+/******************************************************************************
+ * balloon/sysfs.c
+ *
+ * Xen balloon driver - sysfs interfaces.
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <linux/config.h>
+#include <linux/capability.h>
+#include <linux/stat.h>
+#include <linux/sysdev.h>
+#include "common.h"
+
+#define BALLOON_CLASS_NAME "memory"
+
+#define BALLOON_SHOW(name, format, args...)                    \
+       static ssize_t show_##name(struct sys_device *dev,      \
+                                  char *buf)                   \
+       {                                                       \
+               return sprintf(buf, format, ##args);            \
+       }                                                       \
+       static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL)
+
+BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(bs.current_pages));
+BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(bs.balloon_low));
+BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(bs.balloon_high));
+BALLOON_SHOW(hard_limit_kb,
+            (bs.hard_limit!=~0UL) ? "%lu\n" : "???\n",
+            (bs.hard_limit!=~0UL) ? PAGES2KB(bs.hard_limit) : 0);
+BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(bs.driver_pages));
+
+static ssize_t show_target_kb(struct sys_device *dev, char *buf)
+{
+       return sprintf(buf, "%lu\n", PAGES2KB(bs.target_pages));
+}
+
+static ssize_t store_target_kb(struct sys_device *dev,
+                              const char *buf,
+                              size_t count)
+{
+       char memstring[64], *endchar;
+       unsigned long long target_bytes;
+
+       if (!capable(CAP_SYS_ADMIN))
+               return -EPERM;
+       
+       if (count <= 1)
+               return -EBADMSG; /* runt */
+       if (count > sizeof(memstring))
+               return -EFBIG;   /* too long */
+       strcpy(memstring, buf);
+       
+       target_bytes = memparse(memstring, &endchar);
+       balloon_set_new_target(target_bytes >> PAGE_SHIFT);
+       
+       return count;
+}
+
+static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR,
+                  show_target_kb, store_target_kb);
+
+static struct sysdev_attribute *balloon_attrs[] = {
+       &attr_target_kb,
+};
+
+static struct attribute *balloon_info_attrs[] = {
+       &attr_current_kb.attr,
+       &attr_low_kb.attr,
+       &attr_high_kb.attr,
+       &attr_hard_limit_kb.attr,
+       &attr_driver_kb.attr,
+       NULL
+};
+
+static struct attribute_group balloon_info_group = {
+       .name = "info",
+       .attrs = balloon_info_attrs,
+};
+
+static struct sysdev_class balloon_sysdev_class = {
+       set_kset_name(BALLOON_CLASS_NAME),
+};
+
+static struct sys_device balloon_sysdev;
+
+static int register_balloon(struct sys_device *sysdev)
+{
+       int i, error;
+
+       error = sysdev_class_register(&balloon_sysdev_class);
+       if (error)
+               return error;
+
+       sysdev->id = 0;
+       sysdev->cls = &balloon_sysdev_class;
+
+       error = sysdev_register(sysdev);
+       if (error) {
+               sysdev_class_unregister(&balloon_sysdev_class);
+               return error;
+       }
+
+       for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) {
+               error = sysdev_create_file(sysdev, balloon_attrs[i]);
+               if (error)
+                       goto fail;
+       }
+
+       error = sysfs_create_group(&sysdev->kobj, &balloon_info_group);
+       if (error)
+               goto fail;
+       
+       return 0;
+
+ fail:
+       while (--i >= 0)
+               sysdev_remove_file(sysdev, balloon_attrs[i]);
+       sysdev_unregister(sysdev);
+       sysdev_class_unregister(&balloon_sysdev_class);
+       return error;
+}
+
+static void unregister_balloon(struct sys_device *sysdev)
+{
+       int i;
+
+       sysfs_remove_group(&sysdev->kobj, &balloon_info_group);
+       for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++)
+               sysdev_remove_file(sysdev, balloon_attrs[i]);
+       sysdev_unregister(sysdev);
+       sysdev_class_unregister(&balloon_sysdev_class);
+}
+
+int balloon_sysfs_init(void)
+{
+       return register_balloon(&balloon_sysdev);
+}
+
+void balloon_sysfs_exit(void)
+{
+       unregister_balloon(&balloon_sysdev);
+}
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/hypervisor-rtc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ioemu/patches/hypervisor-rtc        Tue Oct 24 11:21:48 2006 -0600
@@ -0,0 +1,143 @@
+# HG changeset patch
+# User kfraser@xxxxxxxxxxxxxxxxxxxxx
+# Node ID 71e2a165aa7f81602c569430b18ba1ea705f0b70
+# Parent  da66691687dfd90c55420cfdf27f55d18cca7810
+[HVM] Move RTC emulation into the hypervisor.
+Signed-off-by: Xiaowei Yang <xiaowei.yang@xxxxxxxxx>
+
+--- ioemu/Makefile.target      Wed Oct 18 18:13:57 2006 +0100
++++ ioemu/Makefile.target      Wed Oct 18 18:35:21 2006 +0100
+@@ -294,7 +294,11 @@ endif
+ endif
+ 
+ # qemu-dm objects
++ifeq ($(ARCH),ia64)
+ LIBOBJS=helper2.o exec-dm.o i8259-dm.o
++else
++LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o
++endif
+ 
+ all: $(PROGS)
+ 
+@@ -354,7 +358,11 @@ ifeq ($(TARGET_BASE_ARCH), i386)
+ ifeq ($(TARGET_BASE_ARCH), i386)
+ # Hardware support
+ VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
++ifeq ($(ARCH),ia64)
+ VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o
++else
++VL_OBJS+= fdc.o serial.o pc.o
++endif
+ VL_OBJS+= cirrus_vga.o mixeng.o parallel.o acpi.o piix_pci.o
+ VL_OBJS+= usb-uhci.o
+ VL_OBJS+= piix4acpi.o
+--- /dev/null  Thu Jan 01 00:00:00 1970 +0000
++++ ioemu/target-i386-dm/rtc-dm.c      Wed Oct 18 18:35:21 2006 +0100
+@@ -0,0 +1,107 @@
++/*
++ * QEMU MC146818 RTC emulation
++ * 
++ * Copyright (c) 2003-2004 Fabrice Bellard
++ * 
++ * Permission is hereby granted, free of charge, to any person obtaining a 
copy
++ * of this software and associated documentation files (the "Software"), to 
deal
++ * in the Software without restriction, including without limitation the 
rights
++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ * copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++ * THE SOFTWARE.
++ */
++
++#include "vl.h"
++
++//#define DEBUG_CMOS
++
++struct RTCState {
++    uint8_t cmos_data[128];
++    uint8_t cmos_index;
++};
++
++void rtc_set_memory(RTCState *s, int addr, int val)
++{
++    if (addr >= 0 && addr <= 127)
++        s->cmos_data[addr] = val;
++}
++
++static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data)
++{
++    RTCState *s = opaque;
++
++    if ((addr & 1) == 0) {
++        s->cmos_index = data & 0x7f;
++    } else {
++#ifdef DEBUG_CMOS
++        printf("cmos: write index=0x%02x val=0x%02x\n",
++               s->cmos_index, data);
++#endif        
++        s->cmos_data[s->cmos_index] = data;
++    }
++}
++
++static uint32_t cmos_ioport_read(void *opaque, uint32_t addr)
++{
++    RTCState *s = opaque;
++    int ret;
++    if ((addr & 1) == 0) {
++        return 0xff;
++    } else {
++        ret = s->cmos_data[s->cmos_index];
++#ifdef DEBUG_CMOS
++        printf("cmos: read index=0x%02x val=0x%02x\n",
++               s->cmos_index, ret);
++#endif
++        return ret;
++    }
++}
++
++static void rtc_save(QEMUFile *f, void *opaque)
++{
++    RTCState *s = opaque;
++
++    qemu_put_buffer(f, s->cmos_data, 128);
++    qemu_put_8s(f, &s->cmos_index);
++}
++
++static int rtc_load(QEMUFile *f, void *opaque, int version_id)
++{
++    RTCState *s = opaque;
++
++    if (version_id != 1)
++        return -EINVAL;
++
++    qemu_get_buffer(f, s->cmos_data, 128);
++    qemu_get_8s(f, &s->cmos_index);
++
++    return 0;
++}
++
++RTCState *rtc_init(int base, int irq)
++{
++    RTCState *s;
++
++    s = qemu_mallocz(sizeof(RTCState));
++    if (!s)
++        return NULL;
++
++    register_ioport_write(base, 2, 1, cmos_ioport_write, s);
++    register_ioport_read(base, 2, 1, cmos_ioport_read, s);
++
++    register_savevm("mc146818rtc", base, 1, rtc_save, rtc_load, s);
++    return s;
++}
++
++void rtc_set_date(RTCState *s, const struct tm *tm) {}
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/ide-cd-dma
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ioemu/patches/ide-cd-dma    Tue Oct 24 11:21:48 2006 -0600
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User kfraser@xxxxxxxxxxxxxxxxxxxxx
+# Node ID 1e8ba8d2117548d4f13b7b438d1e992b1815f580
+# Parent  f247e0b52dda257c0000c9da5a0cdff507b3ced8
+[HVM] Enable DMA mode for CD-ROM IDE ATAPI interface.
+Signed-off-by: Winston Wang <winston.l.wang@xxxxxxxxx
+
+--- ioemu/hw/ide.c     Wed Oct 18 18:37:18 2006 +0100
++++ ioemu/hw/ide.c     Wed Oct 18 18:41:47 2006 +0100
+@@ -557,9 +557,9 @@ static void ide_atapi_identify(IDEState 
+     padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */
+     padstr((uint8_t *)(p + 27), "QEMU CD-ROM", 40); /* model */
+     put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */
+-    put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */
++    put_le16(p + 49, (1 << 11) | (1 << 9) | (1 << 8)); /* DMA and LBA 
supported */
+     put_le16(p + 53, 3); /* words 64-70, 54-58 valid */
+-    put_le16(p + 63, 0x103); /* DMA modes XXX: may be incorrect */
++    put_le16(p + 63, 0x07); /* mdma0-2 supported */
+     put_le16(p + 64, 1); /* PIO modes */
+     put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
+     put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/serial-port-rate-limit
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ioemu/patches/serial-port-rate-limit        Tue Oct 24 11:21:48 
2006 -0600
@@ -0,0 +1,116 @@
+# HG changeset patch
+# User Steven Smith <ssmith@xxxxxxxxxxxxx>
+# Node ID 1d3f52eb256e3522edc12daca91039b319dbbbe5
+# Parent  b7b653e36d20811831f26bb951ea66dca5854b17
+[HVM] Rate limit guest accesses to the qemu virtual serial port.  This stops
+grub's boot menu from hammering dom0.
+
+Signed-off-by: Steven Smith <sos22@xxxxxxxxx>
+
+--- ioemu/hw/serial.c  Mon Sep 25 16:31:02 2006 +0100
++++ ioemu/hw/serial.c  Mon Sep 25 17:27:18 2006 +0100
+@@ -22,6 +22,9 @@
+  * THE SOFTWARE.
+  */
+ #include "vl.h"
++#include <sys/time.h>
++#include <time.h>
++#include <assert.h>
+ 
+ //#define DEBUG_SERIAL
+ 
+@@ -138,6 +141,67 @@ static void serial_update_parameters(Ser
+     printf("speed=%d parity=%c data=%d stop=%d\n", 
+            speed, parity, data_bits, stop_bits);
+ #endif
++}
++
++/* Rate limit serial requests so that e.g. grub on a serial console
++   doesn't kill dom0.  Simple token bucket.  If we get some actual
++   data from the user, instantly refil the bucket. */
++
++/* How long it takes to generate a token, in microseconds. */
++#define TOKEN_PERIOD 1000
++/* Maximum and initial size of token bucket */
++#define TOKENS_MAX 100000
++
++static int tokens_avail;
++
++static void serial_get_token(void)
++{
++    static struct timeval last_refil_time;
++    static int started;
++
++    assert(tokens_avail >= 0);
++    if (!tokens_avail) {
++      struct timeval delta, now;
++      int generated;
++
++      if (!started) {
++          gettimeofday(&last_refil_time, NULL);
++          tokens_avail = TOKENS_MAX;
++          started = 1;
++          return;
++      }
++    retry:
++      gettimeofday(&now, NULL);
++      delta.tv_sec = now.tv_sec - last_refil_time.tv_sec;
++      delta.tv_usec = now.tv_usec - last_refil_time.tv_usec;
++      if (delta.tv_usec < 0) {
++          delta.tv_usec += 1000000;
++          delta.tv_sec--;
++      }
++      assert(delta.tv_usec >= 0 && delta.tv_sec >= 0);
++      if (delta.tv_usec < TOKEN_PERIOD) {
++          struct timespec ts;
++          /* Wait until at least one token is available. */
++          ts.tv_sec = TOKEN_PERIOD / 1000000;
++          ts.tv_nsec = (TOKEN_PERIOD % 1000000) * 1000;
++          while (nanosleep(&ts, &ts) < 0 && errno == EINTR)
++              ;
++          goto retry;
++      }
++      generated = (delta.tv_sec * 1000000) / TOKEN_PERIOD;
++      generated +=
++          ((delta.tv_sec * 1000000) % TOKEN_PERIOD + delta.tv_usec) / 
TOKEN_PERIOD;
++      assert(generated > 0);
++
++      last_refil_time.tv_usec += (generated * TOKEN_PERIOD) % 1000000;
++      last_refil_time.tv_sec  += last_refil_time.tv_usec / 1000000;
++      last_refil_time.tv_usec %= 1000000;
++      last_refil_time.tv_sec  += (generated * TOKEN_PERIOD) / 1000000;
++      if (generated > TOKENS_MAX)
++          generated = TOKENS_MAX;
++      tokens_avail = generated;
++    }
++    tokens_avail--;
+ }
+ 
+ static void serial_ioport_write(void *opaque, uint32_t addr, uint32_t val)
+@@ -245,9 +309,11 @@ static uint32_t serial_ioport_read(void 
+         ret = s->mcr;
+         break;
+     case 5:
++      serial_get_token();
+         ret = s->lsr;
+         break;
+     case 6:
++      serial_get_token();
+         if (s->mcr & UART_MCR_LOOP) {
+             /* in loopback, the modem output pins are connected to the
+                inputs */
+@@ -296,12 +362,14 @@ static void serial_receive1(void *opaque
+ static void serial_receive1(void *opaque, const uint8_t *buf, int size)
+ {
+     SerialState *s = opaque;
++    tokens_avail = TOKENS_MAX;
+     serial_receive_byte(s, buf[0]);
+ }
+ 
+ static void serial_event(void *opaque, int event)
+ {
+     SerialState *s = opaque;
++    tokens_avail = TOKENS_MAX;
+     if (event == CHR_EVENT_BREAK)
+         serial_receive_break(s);
+ }
diff -r aa8ca06d209e -r d246b79986d1 
tools/ioemu/patches/vnc-listen-specific-interface
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ioemu/patches/vnc-listen-specific-interface Tue Oct 24 11:21:48 
2006 -0600
@@ -0,0 +1,177 @@
+# HG changeset patch
+# User Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
+# Node ID a95dfbc8dca8ecddcb9be51d78f446b0fa461892
+# Parent  8959876abbe319963974fab21dda7185e0ad84e6
+[HVM/vncserver] Implement a 'vnclisten' option to limit the interface
+that the VNC server from qemu listens on. 
+
+Defaults to only listen on 127.0.0.1
+
+The old behaviour (listen on all interfaces) can be restored, by
+- changing the system-wide default in /etc/xen/xend-config.sxp by adding:
+(vnc-listen '0.0.0.0')
+- changing individual domain config files by adding:
+vnclisten="0.0.0.0"
+
+Also allows specifying the hostname associated with an interface to limit
+to that interface.
+
+Signed-off-by:  Daniel P. Berrange <berrange@xxxxxxxxxx>
+
+Index: ioemu/vl.c
+===================================================================
+--- ioemu.orig/vl.c    2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vl.c 2006-10-24 14:34:28.000000000 +0100
+@@ -122,6 +122,7 @@
+ int nographic;
+ int vncviewer;
+ int vncunused;
++struct sockaddr_in vnclisten_addr;
+ const char* keyboard_layout = NULL;
+ int64_t ticks_per_sec;
+ int boot_device = 'c';
+@@ -2777,10 +2778,22 @@
+     return -1;
+ }
+ 
++int parse_host(struct sockaddr_in *saddr, const char *buf)
++{
++    struct hostent *he;
++
++    if ((he = gethostbyname(buf)) != NULL) {
++        saddr->sin_addr = *(struct in_addr *)he->h_addr;
++    } else {
++        if (!inet_aton(buf, &saddr->sin_addr))
++            return -1;
++    }
++    return 0;
++}
++
+ int parse_host_port(struct sockaddr_in *saddr, const char *str)
+ {
+     char buf[512];
+-    struct hostent *he;
+     const char *p, *r;
+     int port;
+ 
+@@ -2791,14 +2804,8 @@
+     if (buf[0] == '\0') {
+         saddr->sin_addr.s_addr = 0;
+     } else {
+-        if (isdigit(buf[0])) {
+-            if (!inet_aton(buf, &saddr->sin_addr))
+-                return -1;
+-        } else {
+-            if ((he = gethostbyname(buf)) == NULL)
+-                return - 1;
+-            saddr->sin_addr = *(struct in_addr *)he->h_addr;
+-        }
++        if (parse_host(saddr, buf) == -1)
++            return -1;
+     }
+     port = strtol(p, (char **)&r, 0);
+     if (r == p)
+@@ -5344,6 +5351,7 @@
+          "-vnc display    start a VNC server on display\n"
+            "-vncviewer      start a vncviewer process for this domain\n"
+            "-vncunused      bind the VNC server to an unused port\n"
++           "-vnclisten      bind the VNC server to this address\n"
+            "-timeoffset     time offset (in seconds) from local time\n"
+            "-acpi           disable or enable ACPI of HVM domain \n"
+            "\n"
+@@ -5434,6 +5442,7 @@
+     QEMU_OPTION_acpi,
+     QEMU_OPTION_vncviewer,
+     QEMU_OPTION_vncunused,
++    QEMU_OPTION_vnclisten,
+ };
+ 
+ typedef struct QEMUOption {
+@@ -5510,6 +5519,7 @@
+     { "vnc", HAS_ARG, QEMU_OPTION_vnc },
+     { "vncviewer", 0, QEMU_OPTION_vncviewer },
+     { "vncunused", 0, QEMU_OPTION_vncunused },
++    { "vnclisten", HAS_ARG, QEMU_OPTION_vnclisten },
+     
+     /* temporary options */
+     { "usb", 0, QEMU_OPTION_usb },
+@@ -5905,6 +5915,8 @@
+ 
+     nb_nics = 0;
+     /* default mac address of the first network interface */
++
++    memset(&vnclisten_addr.sin_addr, 0, sizeof(vnclisten_addr.sin_addr));
+     
+     /* init debug */
+     sprintf(qemu_dm_logfilename, "/var/log/xen/qemu-dm.%d.log", getpid());
+@@ -6280,6 +6292,9 @@
+                 if (vnc_display == -1)
+                     vnc_display = 0;
+                 break;
++            case QEMU_OPTION_vnclisten:
++                parse_host(&vnclisten_addr, optarg);
++                break;
+             }
+         }
+     }
+@@ -6493,7 +6508,7 @@
+     if (nographic) {
+         dumb_display_init(ds);
+     } else if (vnc_display != -1) {
+-      vnc_display = vnc_display_init(ds, vnc_display, vncunused);
++      vnc_display = vnc_display_init(ds, vnc_display, vncunused, 
&vnclisten_addr);
+       if (vncviewer)
+           vnc_start_viewer(vnc_display);
+     } else {
+Index: ioemu/vl.h
+===================================================================
+--- ioemu.orig/vl.h    2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vl.h 2006-10-24 14:34:22.000000000 +0100
+@@ -37,6 +37,8 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/types.h>
+ #include "xenctrl.h"
+ #include "xs.h"
+ #include <xen/hvm/e820.h>
+@@ -785,7 +787,7 @@
+ void cocoa_display_init(DisplayState *ds, int full_screen);
+ 
+ /* vnc.c */
+-int vnc_display_init(DisplayState *ds, int display, int find_unused);
++int vnc_display_init(DisplayState *ds, int display, int find_unused, struct 
sockaddr_in *addr);
+ int vnc_start_viewer(int port);
+ 
+ /* ide.c */
+Index: ioemu/vnc.c
+===================================================================
+--- ioemu.orig/vnc.c   2006-10-24 14:33:46.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:34:22.000000000 +0100
+@@ -1195,9 +1195,8 @@
+     }
+ }
+ 
+-int vnc_display_init(DisplayState *ds, int display, int find_unused)
++int vnc_display_init(DisplayState *ds, int display, int find_unused, struct 
sockaddr_in *addr)
+ {
+-    struct sockaddr_in addr;
+     int reuse_addr, ret;
+     VncState *vs;
+ 
+@@ -1235,11 +1234,10 @@
+     }
+ 
+  retry:
+-    addr.sin_family = AF_INET;
+-    addr.sin_port = htons(5900 + display);
+-    memset(&addr.sin_addr, 0, sizeof(addr.sin_addr));
++    addr->sin_family = AF_INET;
++    addr->sin_port = htons(5900 + display);
+ 
+-    if (bind(vs->lsock, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
++    if (bind(vs->lsock, (struct sockaddr *)addr, sizeof(struct sockaddr_in)) 
== -1) {
+       if (find_unused && errno == EADDRINUSE) {
+           display++;
+           goto retry;
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-password
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ioemu/patches/vnc-password  Tue Oct 24 11:21:48 2006 -0600
@@ -0,0 +1,785 @@
+# HG changeset patch
+# User kfraser@xxxxxxxxxxxxxxxxxxxxx
+# Node ID 02506a7443155611d6bbf03e49fbf193e96d24db
+# Parent  328606e0705f0341bebda14cdd17962e463868e8
+[HVM] Implement password authentication of VNC connections.
+
+The specification is as mentioned at
+http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00666.html
+(However, password came to describe plain text)
+
+The difference is follows.
+- protocol_authtype() without the necessity was deleted.
+- The check on the protocol version was added.
+- And, some small modification.
+
+Signed-off-by: Masami Watanabe <masami.watanabe@xxxxxxxxxxxxxx>
+
+--- ioemu/Makefile.target      Fri Oct 20 09:32:16 2006 +0100
++++ ioemu/Makefile.target      Fri Oct 20 09:50:09 2006 +0100
+@@ -406,6 +406,7 @@ VL_OBJS+=sdl.o
+ VL_OBJS+=sdl.o
+ endif
+ VL_OBJS+=vnc.o
++VL_OBJS+=d3des.o
+ ifdef CONFIG_COCOA
+ VL_OBJS+=cocoa.o
+ COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
+@@ -464,6 +465,9 @@ sdl.o: sdl.c keymaps.c sdl_keysym.h
+       $(CC) $(CFLAGS) $(DEFINES) $(SDL_CFLAGS) -c -o $@ $<
+ 
+ vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
++      $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
++
++d3des.o: d3des.c d3des.h
+       $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
+ 
+ sdlaudio.o: sdlaudio.c
+--- ioemu/vl.c Fri Oct 20 09:32:16 2006 +0100
++++ ioemu/vl.c Fri Oct 20 09:50:09 2006 +0100
+@@ -170,6 +170,9 @@ time_t timeoffset = 0;
+ 
+ char domain_name[1024] = { 'H','V', 'M', 'X', 'E', 'N', '-'};
+ extern int domid;
++
++char vncpasswd[64];
++unsigned char challenge[AUTHCHALLENGESIZE];
+ 
+ /***********************************************************/
+ /* x86 ISA bus support */
+@@ -5911,6 +5914,7 @@ int main(int argc, char **argv)
+     vncunused = 0;
+     kernel_filename = NULL;
+     kernel_cmdline = "";
++    *vncpasswd = '\0';
+ #ifndef CONFIG_DM
+ #ifdef TARGET_PPC
+     cdrom_index = 1;
+@@ -6559,6 +6563,10 @@ int main(int argc, char **argv)
+ 
+     init_ioports();
+ 
++    /* read vncpasswd from xenstore */
++    if (0 > xenstore_read_vncpasswd(domid))
++        exit(1);
++
+     /* terminal init */
+     if (nographic) {
+         dumb_display_init(ds);
+--- ioemu/vl.h Fri Oct 20 09:32:16 2006 +0100
++++ ioemu/vl.h Fri Oct 20 09:50:09 2006 +0100
+@@ -1211,6 +1211,7 @@ void xenstore_process_event(void *opaque
+ void xenstore_process_event(void *opaque);
+ void xenstore_check_new_media_present(int timeout);
+ void xenstore_write_vncport(int vnc_display);
++int xenstore_read_vncpasswd(int domid);
+ 
+ /* xen_platform.c */
+ void pci_xen_platform_init(PCIBus *bus);
+@@ -1222,4 +1223,7 @@ extern char domain_name[];
+ 
+ void destroy_hvm_domain(void);
+ 
++/* VNC Authentication */
++#define AUTHCHALLENGESIZE 16
++
+ #endif /* VL_H */
+--- ioemu/vnc.c        Fri Oct 20 09:32:16 2006 +0100
++++ ioemu/vnc.c        Fri Oct 20 09:50:09 2006 +0100
+@@ -44,6 +44,7 @@
+ 
+ #include "vnc_keysym.h"
+ #include "keymaps.c"
++#include "d3des.h"
+ 
+ #define XK_MISCELLANY
+ #define XK_LATIN1
+@@ -137,6 +138,9 @@ static void vnc_update_client(void *opaq
+ static void vnc_update_client(void *opaque);
+ static void vnc_client_read(void *opaque);
+ static void framebuffer_set_updated(VncState *vs, int x, int y, int w, int h);
++static int make_challenge(char *random, int size);
++static void set_seed(unsigned int *seedp);
++static void get_random(int len, unsigned char *buf);
+ 
+ #if 0
+ static inline void vnc_set_bit(uint32_t *d, int k)
+@@ -1208,23 +1212,92 @@ static int protocol_client_init(VncState
+     return 0;
+ }
+ 
++static int protocol_response(VncState *vs, char *client_response, size_t len)
++{
++    extern char vncpasswd[64];
++    extern unsigned char challenge[AUTHCHALLENGESIZE];
++    unsigned char cryptchallenge[AUTHCHALLENGESIZE];
++    unsigned char key[8];
++    int passwdlen, i, j;
++
++    memcpy(cryptchallenge, challenge, AUTHCHALLENGESIZE);
++
++    /* Calculate the sent challenge */
++    passwdlen = strlen(vncpasswd);
++    for (i=0; i<8; i++)
++      key[i] = i<passwdlen ? vncpasswd[i] : 0;
++    deskey(key, EN0);
++    for (j = 0; j < AUTHCHALLENGESIZE; j += 8)
++      des(cryptchallenge+j, cryptchallenge+j);
++
++    /* Check the actual response */
++    if (memcmp(cryptchallenge, client_response, AUTHCHALLENGESIZE) != 0) {
++      /* password error */
++      vnc_write_u32(vs, 1);
++      vnc_write_u32(vs, 22);
++      vnc_write(vs, "Authentication failure", 22);
++      vnc_flush(vs);
++      fprintf(stderr, "VNC Password error.\n");
++      vnc_client_error(vs);
++      return 0;
++    }
++
++    vnc_write_u32(vs, 0);
++    vnc_flush(vs);
++
++    vnc_read_when(vs, protocol_client_init, 1);
++
++    return 0;
++}
++
+ static int protocol_version(VncState *vs, char *version, size_t len)
+ {
++    extern char vncpasswd[64];
++    extern unsigned char challenge[AUTHCHALLENGESIZE];
+     char local[13];
+-    int maj, min;
++    int  support, maj, min;
+ 
+     memcpy(local, version, 12);
+     local[12] = 0;
+ 
++    /* protocol version check */
+     if (sscanf(local, "RFB %03d.%03d\n", &maj, &min) != 2) {
++      fprintf(stderr, "Protocol version error.\n");
+       vnc_client_error(vs);
+       return 0;
+     }
+ 
+-    vnc_write_u32(vs, 1); /* None */
+-    vnc_flush(vs);
+-
+-    vnc_read_when(vs, protocol_client_init, 1);
++
++    support = 0;
++    if (maj = 3) {
++      if (min == 3 || min ==4) {
++          support = 1;
++      }
++    }
++
++    if (! support) {
++      fprintf(stderr, "Client uses unsupported protocol version %d.%d.\n",
++              maj, min);
++      vnc_client_error(vs);
++      return 0;
++    }
++
++    if (*vncpasswd == '\0') {
++      /* AuthType is None */
++      vnc_write_u32(vs, 1);
++      vnc_flush(vs);
++      vnc_read_when(vs, protocol_client_init, 1);
++    } else {
++      /* AuthType is VncAuth */
++      vnc_write_u32(vs, 2);
++
++      /* Challenge-Responce authentication */
++      /* Send Challenge */
++      make_challenge(challenge, AUTHCHALLENGESIZE);
++      vnc_write(vs, challenge, AUTHCHALLENGESIZE);
++      vnc_flush(vs);
++      vnc_read_when(vs, protocol_response, AUTHCHALLENGESIZE);
++    }
+ 
+     return 0;
+ }
+@@ -1342,3 +1415,32 @@ int vnc_start_viewer(int port)
+       return pid;
+     }
+ }
++
++unsigned int seed;
++
++static int make_challenge(char *random, int size)
++{
++ 
++    set_seed(&seed);
++    get_random(size, random);
++
++    return 0;
++}
++
++static void set_seed(unsigned int *seedp)
++{
++    *seedp += (unsigned int)(time(NULL)+getpid()+getpid()*987654+rand());
++    srand(*seedp);
++
++    return;
++}
++
++static void get_random(int len, unsigned char *buf)
++{
++    int i;
++
++    for (i=0; i<len; i++)
++      buf[i] = (int) (256.0*rand()/(RAND_MAX+1.0));
++
++    return;
++}
+--- ioemu/xenstore.c   Fri Oct 20 09:32:16 2006 +0100
++++ ioemu/xenstore.c   Fri Oct 20 09:50:09 2006 +0100
+@@ -213,3 +213,54 @@ void xenstore_write_vncport(int display)
+     free(portstr);
+     free(buf);
+ }
++
++int xenstore_read_vncpasswd(int domid)
++{
++    extern char vncpasswd[64];
++    char *buf = NULL, *path, *uuid = NULL, *passwd = NULL;
++    unsigned int i, len, rc = 0;
++
++    if (xsh == NULL) {
++      return -1;
++    }
++
++    path = xs_get_domain_path(xsh, domid);
++    if (path == NULL) {
++      fprintf(logfile, "xs_get_domain_path() error. domid %d.\n", domid);
++      return -1;
++    }
++
++    pasprintf(&buf, "%s/vm", path);
++    uuid = xs_read(xsh, XBT_NULL, buf, &len);
++    if (uuid == NULL) {
++      fprintf(logfile, "xs_read(): uuid get error. %s.\n", buf);
++      free(path);
++      return -1;
++    }
++
++    pasprintf(&buf, "%s/vncpasswd", uuid);
++    passwd = xs_read(xsh, XBT_NULL, buf, &len);
++    if (passwd == NULL) {
++      fprintf(logfile, "xs_read(): vncpasswd get error. %s.\n", buf);
++      free(uuid);
++      free(path);
++      return rc;
++    }
++
++    for (i=0; i<len && i<63; i++) {
++      vncpasswd[i] = passwd[i];
++      passwd[i] = '\0';
++    }
++    vncpasswd[len] = '\0';
++    pasprintf(&buf, "%s/vncpasswd", uuid);
++    if (xs_write(xsh, XBT_NULL, buf, passwd, len) == 0) {
++      fprintf(logfile, "xs_write() vncpasswd failed.\n");
++      rc = -1;
++    }
++
++    free(passwd);
++    free(uuid);
++    free(path);
++
++    return rc;
++}
+--- /dev/null  Thu Jan 01 00:00:00 1970 +0000
++++ ioemu/d3des.c      Fri Oct 20 09:50:09 2006 +0100
+@@ -0,0 +1,434 @@
++/*
++ * This is D3DES (V5.09) by Richard Outerbridge with the double and
++ * triple-length support removed for use in VNC.  Also the bytebit[] array
++ * has been reversed so that the most significant bit in each byte of the
++ * key is ignored, not the least significant.
++ *
++ * These changes are:
++ *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++/* D3DES (V5.09) -
++ *
++ * A portable, public domain, version of the Data Encryption Standard.
++ *
++ * Written with Symantec's THINK (Lightspeed) C by Richard Outerbridge.
++ * Thanks to: Dan Hoey for his excellent Initial and Inverse permutation
++ * code;  Jim Gillogly & Phil Karn for the DES key schedule code; Dennis
++ * Ferguson, Eric Young and Dana How for comparing notes; and Ray Lau,
++ * for humouring me on.
++ *
++ * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge.
++ * (GEnie : OUTER; CIS : [71755,204]) Graven Imagery, 1992.
++ */
++
++#include "d3des.h"
++
++static void scrunch(unsigned char *, unsigned long *);
++static void unscrun(unsigned long *, unsigned char *);
++static void desfunc(unsigned long *, unsigned long *);
++static void cookey(unsigned long *);
++
++static unsigned long KnL[32] = { 0L };
++
++static unsigned short bytebit[8]      = {
++      01, 02, 04, 010, 020, 040, 0100, 0200 };
++
++static unsigned long bigbyte[24] = {
++      0x800000L,      0x400000L,      0x200000L,      0x100000L,
++      0x80000L,       0x40000L,       0x20000L,       0x10000L,
++      0x8000L,        0x4000L,        0x2000L,        0x1000L,
++      0x800L,         0x400L,         0x200L,         0x100L,
++      0x80L,          0x40L,          0x20L,          0x10L,
++      0x8L,           0x4L,           0x2L,           0x1L    };
++
++/* Use the key schedule specified in the Standard (ANSI X3.92-1981). */
++
++static unsigned char pc1[56] = {
++      56, 48, 40, 32, 24, 16,  8,      0, 57, 49, 41, 33, 25, 17,
++       9,  1, 58, 50, 42, 34, 26,     18, 10,  2, 59, 51, 43, 35,
++      62, 54, 46, 38, 30, 22, 14,      6, 61, 53, 45, 37, 29, 21,
++      13,  5, 60, 52, 44, 36, 28,     20, 12,  4, 27, 19, 11,  3 };
++
++static unsigned char totrot[16] = {
++      1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28 };
++
++static unsigned char pc2[48] = {
++      13, 16, 10, 23,  0,  4,  2, 27, 14,  5, 20,  9,
++      22, 18, 11,  3, 25,  7, 15,  6, 26, 19, 12,  1,
++      40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47,
++      43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };
++
++void deskey(key, edf) /* Thanks to James Gillogly & Phil Karn! */
++unsigned char *key;
++int edf;
++{
++      register int i, j, l, m, n;
++      unsigned char pc1m[56], pcr[56];
++      unsigned long kn[32];
++
++      for ( j = 0; j < 56; j++ ) {
++              l = pc1[j];
++              m = l & 07;
++              pc1m[j] = (key[l >> 3] & bytebit[m]) ? 1 : 0;
++              }
++      for( i = 0; i < 16; i++ ) {
++              if( edf == DE1 ) m = (15 - i) << 1;
++              else m = i << 1;
++              n = m + 1;
++              kn[m] = kn[n] = 0L;
++              for( j = 0; j < 28; j++ ) {
++                      l = j + totrot[i];
++                      if( l < 28 ) pcr[j] = pc1m[l];
++                      else pcr[j] = pc1m[l - 28];
++                      }
++              for( j = 28; j < 56; j++ ) {
++                  l = j + totrot[i];
++                  if( l < 56 ) pcr[j] = pc1m[l];
++                  else pcr[j] = pc1m[l - 28];
++                  }
++              for( j = 0; j < 24; j++ ) {
++                      if( pcr[pc2[j]] ) kn[m] |= bigbyte[j];
++                      if( pcr[pc2[j+24]] ) kn[n] |= bigbyte[j];
++                      }
++              }
++      cookey(kn);
++      return;
++      }
++
++static void cookey(raw1)
++register unsigned long *raw1;
++{
++      register unsigned long *cook, *raw0;
++      unsigned long dough[32];
++      register int i;
++
++      cook = dough;
++      for( i = 0; i < 16; i++, raw1++ ) {
++              raw0 = raw1++;
++              *cook    = (*raw0 & 0x00fc0000L) << 6;
++              *cook   |= (*raw0 & 0x00000fc0L) << 10;
++              *cook   |= (*raw1 & 0x00fc0000L) >> 10;
++              *cook++ |= (*raw1 & 0x00000fc0L) >> 6;
++              *cook    = (*raw0 & 0x0003f000L) << 12;
++              *cook   |= (*raw0 & 0x0000003fL) << 16;
++              *cook   |= (*raw1 & 0x0003f000L) >> 4;
++              *cook++ |= (*raw1 & 0x0000003fL);
++              }
++      usekey(dough);
++      return;
++      }
++
++void cpkey(into)
++register unsigned long *into;
++{
++      register unsigned long *from, *endp;
++
++      from = KnL, endp = &KnL[32];
++      while( from < endp ) *into++ = *from++;
++      return;
++      }
++
++void usekey(from)
++register unsigned long *from;
++{
++      register unsigned long *to, *endp;
++
++      to = KnL, endp = &KnL[32];
++      while( to < endp ) *to++ = *from++;
++      return;
++      }
++
++void des(inblock, outblock)
++unsigned char *inblock, *outblock;
++{
++      unsigned long work[2];
++
++      scrunch(inblock, work);
++      desfunc(work, KnL);
++      unscrun(work, outblock);
++      return;
++      }
++
++static void scrunch(outof, into)
++register unsigned char *outof;
++register unsigned long *into;
++{
++      *into    = (*outof++ & 0xffL) << 24;
++      *into   |= (*outof++ & 0xffL) << 16;
++      *into   |= (*outof++ & 0xffL) << 8;
++      *into++ |= (*outof++ & 0xffL);
++      *into    = (*outof++ & 0xffL) << 24;
++      *into   |= (*outof++ & 0xffL) << 16;
++      *into   |= (*outof++ & 0xffL) << 8;
++      *into   |= (*outof   & 0xffL);
++      return;
++      }
++
++static void unscrun(outof, into)
++register unsigned long *outof;
++register unsigned char *into;
++{
++      *into++ = (unsigned char)((*outof >> 24) & 0xffL);
++      *into++ = (unsigned char)((*outof >> 16) & 0xffL);
++      *into++ = (unsigned char)((*outof >>  8) & 0xffL);
++      *into++ = (unsigned char)(*outof++       & 0xffL);
++      *into++ = (unsigned char)((*outof >> 24) & 0xffL);
++      *into++ = (unsigned char)((*outof >> 16) & 0xffL);
++      *into++ = (unsigned char)((*outof >>  8) & 0xffL);
++      *into   =  (unsigned char)(*outof        & 0xffL);
++      return;
++      }
++
++static unsigned long SP1[64] = {
++      0x01010400L, 0x00000000L, 0x00010000L, 0x01010404L,
++      0x01010004L, 0x00010404L, 0x00000004L, 0x00010000L,
++      0x00000400L, 0x01010400L, 0x01010404L, 0x00000400L,
++      0x01000404L, 0x01010004L, 0x01000000L, 0x00000004L,
++      0x00000404L, 0x01000400L, 0x01000400L, 0x00010400L,
++      0x00010400L, 0x01010000L, 0x01010000L, 0x01000404L,
++      0x00010004L, 0x01000004L, 0x01000004L, 0x00010004L,
++      0x00000000L, 0x00000404L, 0x00010404L, 0x01000000L,
++      0x00010000L, 0x01010404L, 0x00000004L, 0x01010000L,
++      0x01010400L, 0x01000000L, 0x01000000L, 0x00000400L,
++      0x01010004L, 0x00010000L, 0x00010400L, 0x01000004L,
++      0x00000400L, 0x00000004L, 0x01000404L, 0x00010404L,
++      0x01010404L, 0x00010004L, 0x01010000L, 0x01000404L,
++      0x01000004L, 0x00000404L, 0x00010404L, 0x01010400L,
++      0x00000404L, 0x01000400L, 0x01000400L, 0x00000000L,
++      0x00010004L, 0x00010400L, 0x00000000L, 0x01010004L };
++
++static unsigned long SP2[64] = {
++      0x80108020L, 0x80008000L, 0x00008000L, 0x00108020L,
++      0x00100000L, 0x00000020L, 0x80100020L, 0x80008020L,
++      0x80000020L, 0x80108020L, 0x80108000L, 0x80000000L,
++      0x80008000L, 0x00100000L, 0x00000020L, 0x80100020L,
++      0x00108000L, 0x00100020L, 0x80008020L, 0x00000000L,
++      0x80000000L, 0x00008000L, 0x00108020L, 0x80100000L,
++      0x00100020L, 0x80000020L, 0x00000000L, 0x00108000L,
++      0x00008020L, 0x80108000L, 0x80100000L, 0x00008020L,
++      0x00000000L, 0x00108020L, 0x80100020L, 0x00100000L,
++      0x80008020L, 0x80100000L, 0x80108000L, 0x00008000L,
++      0x80100000L, 0x80008000L, 0x00000020L, 0x80108020L,
++      0x00108020L, 0x00000020L, 0x00008000L, 0x80000000L,
++      0x00008020L, 0x80108000L, 0x00100000L, 0x80000020L,
++      0x00100020L, 0x80008020L, 0x80000020L, 0x00100020L,
++      0x00108000L, 0x00000000L, 0x80008000L, 0x00008020L,
++      0x80000000L, 0x80100020L, 0x80108020L, 0x00108000L };
++
++static unsigned long SP3[64] = {
++      0x00000208L, 0x08020200L, 0x00000000L, 0x08020008L,
++      0x08000200L, 0x00000000L, 0x00020208L, 0x08000200L,
++      0x00020008L, 0x08000008L, 0x08000008L, 0x00020000L,
++      0x08020208L, 0x00020008L, 0x08020000L, 0x00000208L,
++      0x08000000L, 0x00000008L, 0x08020200L, 0x00000200L,
++      0x00020200L, 0x08020000L, 0x08020008L, 0x00020208L,
++      0x08000208L, 0x00020200L, 0x00020000L, 0x08000208L,
++      0x00000008L, 0x08020208L, 0x00000200L, 0x08000000L,
++      0x08020200L, 0x08000000L, 0x00020008L, 0x00000208L,
++      0x00020000L, 0x08020200L, 0x08000200L, 0x00000000L,
++      0x00000200L, 0x00020008L, 0x08020208L, 0x08000200L,
++      0x08000008L, 0x00000200L, 0x00000000L, 0x08020008L,
++      0x08000208L, 0x00020000L, 0x08000000L, 0x08020208L,
++      0x00000008L, 0x00020208L, 0x00020200L, 0x08000008L,
++      0x08020000L, 0x08000208L, 0x00000208L, 0x08020000L,
++      0x00020208L, 0x00000008L, 0x08020008L, 0x00020200L };
++
++static unsigned long SP4[64] = {
++      0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,
++      0x00802080L, 0x00800081L, 0x00800001L, 0x00002001L,
++      0x00000000L, 0x00802000L, 0x00802000L, 0x00802081L,
++      0x00000081L, 0x00000000L, 0x00800080L, 0x00800001L,
++      0x00000001L, 0x00002000L, 0x00800000L, 0x00802001L,
++      0x00000080L, 0x00800000L, 0x00002001L, 0x00002080L,
++      0x00800081L, 0x00000001L, 0x00002080L, 0x00800080L,
++      0x00002000L, 0x00802080L, 0x00802081L, 0x00000081L,
++      0x00800080L, 0x00800001L, 0x00802000L, 0x00802081L,
++      0x00000081L, 0x00000000L, 0x00000000L, 0x00802000L,
++      0x00002080L, 0x00800080L, 0x00800081L, 0x00000001L,
++      0x00802001L, 0x00002081L, 0x00002081L, 0x00000080L,
++      0x00802081L, 0x00000081L, 0x00000001L, 0x00002000L,
++      0x00800001L, 0x00002001L, 0x00802080L, 0x00800081L,
++      0x00002001L, 0x00002080L, 0x00800000L, 0x00802001L,
++      0x00000080L, 0x00800000L, 0x00002000L, 0x00802080L };
++
++static unsigned long SP5[64] = {
++      0x00000100L, 0x02080100L, 0x02080000L, 0x42000100L,
++      0x00080000L, 0x00000100L, 0x40000000L, 0x02080000L,
++      0x40080100L, 0x00080000L, 0x02000100L, 0x40080100L,
++      0x42000100L, 0x42080000L, 0x00080100L, 0x40000000L,
++      0x02000000L, 0x40080000L, 0x40080000L, 0x00000000L,
++      0x40000100L, 0x42080100L, 0x42080100L, 0x02000100L,
++      0x42080000L, 0x40000100L, 0x00000000L, 0x42000000L,
++      0x02080100L, 0x02000000L, 0x42000000L, 0x00080100L,
++      0x00080000L, 0x42000100L, 0x00000100L, 0x02000000L,
++      0x40000000L, 0x02080000L, 0x42000100L, 0x40080100L,
++      0x02000100L, 0x40000000L, 0x42080000L, 0x02080100L,
++      0x40080100L, 0x00000100L, 0x02000000L, 0x42080000L,
++      0x42080100L, 0x00080100L, 0x42000000L, 0x42080100L,
++      0x02080000L, 0x00000000L, 0x40080000L, 0x42000000L,
++      0x00080100L, 0x02000100L, 0x40000100L, 0x00080000L,
++      0x00000000L, 0x40080000L, 0x02080100L, 0x40000100L };
++
++static unsigned long SP6[64] = {
++      0x20000010L, 0x20400000L, 0x00004000L, 0x20404010L,
++      0x20400000L, 0x00000010L, 0x20404010L, 0x00400000L,
++      0x20004000L, 0x00404010L, 0x00400000L, 0x20000010L,
++      0x00400010L, 0x20004000L, 0x20000000L, 0x00004010L,
++      0x00000000L, 0x00400010L, 0x20004010L, 0x00004000L,
++      0x00404000L, 0x20004010L, 0x00000010L, 0x20400010L,
++      0x20400010L, 0x00000000L, 0x00404010L, 0x20404000L,
++      0x00004010L, 0x00404000L, 0x20404000L, 0x20000000L,
++      0x20004000L, 0x00000010L, 0x20400010L, 0x00404000L,
++      0x20404010L, 0x00400000L, 0x00004010L, 0x20000010L,
++      0x00400000L, 0x20004000L, 0x20000000L, 0x00004010L,
++      0x20000010L, 0x20404010L, 0x00404000L, 0x20400000L,
++      0x00404010L, 0x20404000L, 0x00000000L, 0x20400010L,
++      0x00000010L, 0x00004000L, 0x20400000L, 0x00404010L,
++      0x00004000L, 0x00400010L, 0x20004010L, 0x00000000L,
++      0x20404000L, 0x20000000L, 0x00400010L, 0x20004010L };
++
++static unsigned long SP7[64] = {
++      0x00200000L, 0x04200002L, 0x04000802L, 0x00000000L,
++      0x00000800L, 0x04000802L, 0x00200802L, 0x04200800L,
++      0x04200802L, 0x00200000L, 0x00000000L, 0x04000002L,
++      0x00000002L, 0x04000000L, 0x04200002L, 0x00000802L,
++      0x04000800L, 0x00200802L, 0x00200002L, 0x04000800L,
++      0x04000002L, 0x04200000L, 0x04200800L, 0x00200002L,
++      0x04200000L, 0x00000800L, 0x00000802L, 0x04200802L,
++      0x00200800L, 0x00000002L, 0x04000000L, 0x00200800L,
++      0x04000000L, 0x00200800L, 0x00200000L, 0x04000802L,
++      0x04000802L, 0x04200002L, 0x04200002L, 0x00000002L,
++      0x00200002L, 0x04000000L, 0x04000800L, 0x00200000L,
++      0x04200800L, 0x00000802L, 0x00200802L, 0x04200800L,
++      0x00000802L, 0x04000002L, 0x04200802L, 0x04200000L,
++      0x00200800L, 0x00000000L, 0x00000002L, 0x04200802L,
++      0x00000000L, 0x00200802L, 0x04200000L, 0x00000800L,
++      0x04000002L, 0x04000800L, 0x00000800L, 0x00200002L };
++
++static unsigned long SP8[64] = {
++      0x10001040L, 0x00001000L, 0x00040000L, 0x10041040L,
++      0x10000000L, 0x10001040L, 0x00000040L, 0x10000000L,
++      0x00040040L, 0x10040000L, 0x10041040L, 0x00041000L,
++      0x10041000L, 0x00041040L, 0x00001000L, 0x00000040L,
++      0x10040000L, 0x10000040L, 0x10001000L, 0x00001040L,
++      0x00041000L, 0x00040040L, 0x10040040L, 0x10041000L,
++      0x00001040L, 0x00000000L, 0x00000000L, 0x10040040L,
++      0x10000040L, 0x10001000L, 0x00041040L, 0x00040000L,
++      0x00041040L, 0x00040000L, 0x10041000L, 0x00001000L,
++      0x00000040L, 0x10040040L, 0x00001000L, 0x00041040L,
++      0x10001000L, 0x00000040L, 0x10000040L, 0x10040000L,
++      0x10040040L, 0x10000000L, 0x00040000L, 0x10001040L,
++      0x00000000L, 0x10041040L, 0x00040040L, 0x10000040L,
++      0x10040000L, 0x10001000L, 0x10001040L, 0x00000000L,
++      0x10041040L, 0x00041000L, 0x00041000L, 0x00001040L,
++      0x00001040L, 0x00040040L, 0x10000000L, 0x10041000L };
++
++static void desfunc(block, keys)
++register unsigned long *block, *keys;
++{
++      register unsigned long fval, work, right, leftt;
++      register int round;
++
++      leftt = block[0];
++      right = block[1];
++      work = ((leftt >> 4) ^ right) & 0x0f0f0f0fL;
++      right ^= work;
++      leftt ^= (work << 4);
++      work = ((leftt >> 16) ^ right) & 0x0000ffffL;
++      right ^= work;
++      leftt ^= (work << 16);
++      work = ((right >> 2) ^ leftt) & 0x33333333L;
++      leftt ^= work;
++      right ^= (work << 2);
++      work = ((right >> 8) ^ leftt) & 0x00ff00ffL;
++      leftt ^= work;
++      right ^= (work << 8);
++      right = ((right << 1) | ((right >> 31) & 1L)) & 0xffffffffL;
++      work = (leftt ^ right) & 0xaaaaaaaaL;
++      leftt ^= work;
++      right ^= work;
++      leftt = ((leftt << 1) | ((leftt >> 31) & 1L)) & 0xffffffffL;
++
++      for( round = 0; round < 8; round++ ) {
++              work  = (right << 28) | (right >> 4);
++              work ^= *keys++;
++              fval  = SP7[ work                & 0x3fL];
++              fval |= SP5[(work >>  8) & 0x3fL];
++              fval |= SP3[(work >> 16) & 0x3fL];
++              fval |= SP1[(work >> 24) & 0x3fL];
++              work  = right ^ *keys++;
++              fval |= SP8[ work                & 0x3fL];
++              fval |= SP6[(work >>  8) & 0x3fL];
++              fval |= SP4[(work >> 16) & 0x3fL];
++              fval |= SP2[(work >> 24) & 0x3fL];
++              leftt ^= fval;
++              work  = (leftt << 28) | (leftt >> 4);
++              work ^= *keys++;
++              fval  = SP7[ work                & 0x3fL];
++              fval |= SP5[(work >>  8) & 0x3fL];
++              fval |= SP3[(work >> 16) & 0x3fL];
++              fval |= SP1[(work >> 24) & 0x3fL];
++              work  = leftt ^ *keys++;
++              fval |= SP8[ work                & 0x3fL];
++              fval |= SP6[(work >>  8) & 0x3fL];
++              fval |= SP4[(work >> 16) & 0x3fL];
++              fval |= SP2[(work >> 24) & 0x3fL];
++              right ^= fval;
++              }
++
++      right = (right << 31) | (right >> 1);
++      work = (leftt ^ right) & 0xaaaaaaaaL;
++      leftt ^= work;
++      right ^= work;
++      leftt = (leftt << 31) | (leftt >> 1);
++      work = ((leftt >> 8) ^ right) & 0x00ff00ffL;
++      right ^= work;
++      leftt ^= (work << 8);
++      work = ((leftt >> 2) ^ right) & 0x33333333L;
++      right ^= work;
++      leftt ^= (work << 2);
++      work = ((right >> 16) ^ leftt) & 0x0000ffffL;
++      leftt ^= work;
++      right ^= (work << 16);
++      work = ((right >> 4) ^ leftt) & 0x0f0f0f0fL;
++      leftt ^= work;
++      right ^= (work << 4);
++      *block++ = right;
++      *block = leftt;
++      return;
++      }
++
++/* Validation sets:
++ *
++ * Single-length key, single-length plaintext -
++ * Key          : 0123 4567 89ab cdef
++ * Plain  : 0123 4567 89ab cde7
++ * Cipher : c957 4425 6a5e d31d
++ *
++ * Double-length key, single-length plaintext -
++ * Key          : 0123 4567 89ab cdef fedc ba98 7654 3210
++ * Plain  : 0123 4567 89ab cde7
++ * Cipher : 7f1d 0a77 826b 8aff
++ *
++ * Double-length key, double-length plaintext -
++ * Key          : 0123 4567 89ab cdef fedc ba98 7654 3210
++ * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff
++ * Cipher : 27a0 8440 406a df60 278f 47cf 42d6 15d7
++ *
++ * Triple-length key, single-length plaintext -
++ * Key          : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567
++ * Plain  : 0123 4567 89ab cde7
++ * Cipher : de0b 7c06 ae5e 0ed5
++ *
++ * Triple-length key, double-length plaintext -
++ * Key          : 0123 4567 89ab cdef fedc ba98 7654 3210 89ab cdef 0123 4567
++ * Plain  : 0123 4567 89ab cdef 0123 4567 89ab cdff
++ * Cipher : ad0d 1b30 ac17 cf07 0ed1 1c63 81e4 4de5
++ *
++ * d3des V5.0a rwo 9208.07 18:44 Graven Imagery
++ **********************************************************************/
+--- /dev/null  Thu Jan 01 00:00:00 1970 +0000
++++ ioemu/d3des.h      Fri Oct 20 09:50:09 2006 +0100
+@@ -0,0 +1,51 @@
++/*
++ * This is D3DES (V5.09) by Richard Outerbridge with the double and
++ * triple-length support removed for use in VNC.
++ *
++ * These changes are:
++ *  Copyright (C) 1999 AT&T Laboratories Cambridge.  All Rights Reserved.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ */
++
++/* d3des.h -
++ *
++ *    Headers and defines for d3des.c
++ *    Graven Imagery, 1992.
++ *
++ * Copyright (c) 1988,1989,1990,1991,1992 by Richard Outerbridge
++ *    (GEnie : OUTER; CIS : [71755,204])
++ */
++
++#define EN0   0       /* MODE == encrypt */
++#define DE1   1       /* MODE == decrypt */
++
++extern void deskey(unsigned char *, int);
++/*                  hexkey[8]     MODE
++ * Sets the internal key register according to the hexadecimal
++ * key contained in the 8 bytes of hexkey, according to the DES,
++ * for encryption or decryption according to MODE.
++ */
++
++extern void usekey(unsigned long *);
++/*                cookedkey[32]
++ * Loads the internal key register with the data in cookedkey.
++ */
++
++extern void cpkey(unsigned long *);
++/*               cookedkey[32]
++ * Copies the contents of the internal key register into the storage
++ * located at &cookedkey[0].
++ */
++
++extern void des(unsigned char *, unsigned char *);
++/*                from[8]           to[8]
++ * Encrypts/Decrypts (according to the key currently loaded in the
++ * internal key register) one block of eight bytes at address 'from'
++ * into the block at address 'to'.  They can be the same.
++ */
++
++/* d3des.h V5.09 rwo 9208.04 15:06 Graven Imagery
++ ********************************************************************/
diff -r aa8ca06d209e -r d246b79986d1 tools/ioemu/patches/vnc-protocol-fixes
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ioemu/patches/vnc-protocol-fixes    Tue Oct 24 11:21:48 2006 -0600
@@ -0,0 +1,63 @@
+# HG changeset patch
+# User Steven Smith <ssmith@xxxxxxxxxxxxx>
+# Node ID ca3abb3804f4400b24037a4366cb2ca5e51ed742
+# Parent  7fca81d456b2cb40d4effe2492f7ed1aafd32f52
+[HVM][VNC] Make sure that qemu doesn't go into an infinite loop when
+it receives certain invalid requests from the viewer.
+
+Signed-off-by: Steven Smith <sos22@xxxxxxxxx>
+
+Index: ioemu/vnc.c
+===================================================================
+--- ioemu.orig/vnc.c   2006-10-24 14:28:05.000000000 +0100
++++ ioemu/vnc.c        2006-10-24 14:30:11.000000000 +0100
+@@ -26,6 +26,7 @@
+ 
+ #include "vl.h"
+ #include "qemu_socket.h"
++#include <assert.h>
+ 
+ #define VNC_REFRESH_INTERVAL (1000 / 30)
+ 
+@@ -677,8 +678,10 @@
+           memmove(vs->input.buffer, vs->input.buffer + len,
+                   vs->input.offset - len);
+           vs->input.offset -= len;
+-      } else
++      } else {
++          assert(ret > vs->read_handler_expect);
+           vs->read_handler_expect = ret;
++      }
+     }
+ }
+ 
+@@ -961,8 +964,12 @@
+       if (len == 1)
+           return 4;
+ 
+-      if (len == 4)
+-          return 4 + (read_u16(data, 2) * 4);
++      if (len == 4) {
++          uint16_t v;
++          v = read_u16(data, 2);
++          if (v)
++              return 4 + v * 4;
++      }
+ 
+       limit = read_u16(data, 2);
+       for (i = 0; i < limit; i++) {
+@@ -996,8 +1003,12 @@
+       if (len == 1)
+           return 8;
+ 
+-      if (len == 8)
+-          return 8 + read_u32(data, 4);
++      if (len == 8) {
++          uint32_t v;
++          v = read_u32(data, 4);
++          if (v)
++              return 8 + v;
++      }
+ 
+       client_cut_text(vs, read_u32(data, 4), data + 8);
+       break;
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/lib/XmTestLib/arch.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xm-test/lib/XmTestLib/arch.py       Tue Oct 24 11:21:48 2006 -0600
@@ -0,0 +1,148 @@
+#!/usr/bin/python
+"""
+ arch.py - Encapsulate all logic regarding what type of hardware xen
+           is running on to make adding new platforms easier.
+
+ Copyright (C) 2006 Tony Breeds IBM Corporation
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; under version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+"""
+
+import os
+import re
+import config
+import commands
+
+from Test import *
+
+BLOCK_ROOT_DEV = "hda"
+
+# This isn't truly platform related but it makes the code tidier
+def getRdPath():
+    """Locate the full path to ramdisks needed by domUs"""
+    rdpath = os.environ.get("RD_PATH")
+    if not rdpath:
+        rdpath = "../../ramdisk"
+    rdpath = os.path.abspath(rdpath)
+
+    return rdpath
+
+# Begin: Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+def ia_checkBuffer(buffer):
+    return
+
+def ia_minSafeMem():
+    return 32
+
+def ia_getDeviceModel():
+    """Get the path to the device model based on
+    the architecture reported in uname"""
+    architecture = os.uname()[4]
+    if re.search("64", architecture):
+        return "/usr/lib64/xen/bin/qemu-dm"
+    else:
+        return "/usr/lib/xen/bin/qemu-dm"
+
+def ia_getDefaultKernel():
+    """Get the path to the default DomU kernel"""
+    dom0Ver = commands.getoutput("uname -r");
+    domUVer = dom0Ver.replace("xen0", "xenU");
+
+    return "/boot/vmlinuz-" + domUVer;
+
+ia_ParavirtDefaults = {"memory"       : 64,
+                       "vcpus"        : 1,
+                       "kernel"       : ia_getDefaultKernel(),
+                       "root"         : "/dev/ram0",
+                       "ramdisk"      : getRdPath() + "/initrd.img",
+}
+ia_HVMDefaults =      {"memory"       : 64,
+                       "vcpus"        : 1,
+                       "acpi"         : 0,
+                       "apic"         : 0,
+                       "disk"         : ["file:%s/disk.img,ioemu:%s,w!" %
+                                         (getRdPath(), BLOCK_ROOT_DEV)],
+                       "kernel"       : "/usr/lib/xen/boot/hvmloader",
+                       "builder"      : "hvm",
+                       "sdl"          : 0,
+                       "vnc"          : 0,
+                       "vncviewer"    : 0,
+                       "nographic"    : 1,
+                       "serial"       : "pty",
+                       "device_model" : ia_getDeviceModel(),
+}
+# End  : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
+
+# Begin: PowerPC
+def ppc_checkBuffer(buffer):
+    checks = [
+        {"pattern" : re.compile("^\d+:mon>\s*$", re.MULTILINE),
+         "message" : "domain trapped into XMON"},
+    ]
+
+    for i in range(0, len(checks)):
+        check=checks[i]
+        if check.get('pattern').search(buffer):
+               FAIL(check.get('message'))
+
+    return
+
+def ppc_minSafeMem():
+    return 64
+
+def ppc_getDefaultKernel():
+    """Get the path to the default DomU kernel"""
+    dom0Ver = commands.getoutput("uname -r");
+    domUVer = dom0Ver.replace("xen0", "xenU");
+
+    return "/boot/vmlinux-" + domUVer;
+
+ppc_ParavirtDefaults = {"memory"  : 64,
+                        "vcpus"   : 1,
+                        "kernel"  : ppc_getDefaultKernel(),
+                        "root"    : "/dev/ram0",
+                        "ramdisk" : getRdPath() + "/initrd.img",
+                        "extra"   : "xencons=tty128 console=tty128",
+}
+# End  : PowerPC
+
+"""Convert from uname specification to a more general platform."""
+_uname_to_arch_map = {
+    "i386"  : "x86",
+    "i486"  : "x86",
+    "i586"  : "x86",
+    "i686"  : "x86",
+    "ia64"  : "ia64",
+    "ppc"   : "powerpc",
+    "ppc64" : "powerpc",
+}
+
+# Lookup current platform.
+_arch = _uname_to_arch_map.get(os.uname()[4], "Unknown")
+if _arch == "x86" or _arch == "ia64":
+    minSafeMem = ia_minSafeMem
+    getDefaultKernel = ia_getDefaultKernel
+    checkBuffer = ia_checkBuffer
+    if config.ENABLE_HVM_SUPPORT:
+        configDefaults = ia_HVMDefaults
+    else:
+        configDefaults = ia_ParavirtDefaults
+elif _arch == "powerpc":
+    minSafeMem = ppc_minSafeMem
+    getDefaultKernel = ppc_getDefaultKernel
+    checkBuffer = ppc_checkBuffer
+    configDefaults = ppc_ParavirtDefaults
+else:
+    raise ValueError, "Unknown architecture!"
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/lib/XmTestReport/arch.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xm-test/lib/XmTestReport/arch.py    Tue Oct 24 11:21:48 2006 -0600
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+"""
+ arch.py - Encapsulate all logic regarding what type of hardware xen
+           is running on to make adding new platforms easier.
+
+ Copyright (C) 2006 Tony Breeds IBM Corporation
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; under version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+"""
+
+import os
+
+"""Convert from uname specification to a more general platform."""
+_uname_to_arch_map = {
+    "i386"  : "x86",
+    "i486"  : "x86",
+    "i586"  : "x86",
+    "i686"  : "x86",
+    "ia64"  : "ia64",
+    "ppc"   : "powerpc",
+    "ppc64" : "powerpc",
+}
+
+_arch = _uname_to_arch_map.get(os.uname()[4], "Unknown")
+if _arch == "x86":
+    cpuValues = {"model_name" : "Unknown",
+                 "flags"      : "Unknown"}
+elif _arch == "ia64":
+    cpuValues = {"arch"     : "Unknown",
+                 "features" : "Unknown"}
+elif _arch == "powerpc":
+    cpuValues = {"cpu"      : "Unknown",
+                 "platform" : "Unknown",
+                 "revision" : "Unknown"}
+else:
+    raise ValueError, "Unknown architecture!"
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img     Tue Oct 24 
11:21:48 2006 -0600
@@ -0,0 +1,45 @@
+XenSource xm-test 1.0 initrds
+=============================
+
+http://xm-test.xensource.com/ramdisks/initrd-1.0-i386.img and
+http://xm-test.xensource.com/ramdisks/initrd-1.0-powerpc.img are initrds
+suitable for use with Xen's xm-test regression testing suite.  They has been
+built and provided by XenSource, for the convenience of Xen users.  xm-test
+initrds may be mixed across minor xm-test versions, but not across major
+versions; this initrd is suitable for all 1.0.x versions of xm-test (as
+shipped with Xen 3.0.4 and the unstable tree leading up to that release).
+
+In order to use one of these initrds, run "./autogen; ./configure; make
+existing" inside the xm-test directory, and the appropriate initrd for your
+architecture will be downloaded automatically.  Alternatively, if you have
+already downloaded that file, place it into the xm-test/ramdisk directory and
+run the same command.  In either case, runtest.sh can then be used as normal.
+See xm-test/README for more details.
+
+These initrds were built using the infrastructure provided by xm-test.  Each
+is a full guest operating system and filesystem, and as such includes a large
+number of pieces of software.  The source code for the majority of these are
+included in full inside the file
+http://xm-test.xensource.com/ramdisks/<INITRD>-buildroot.tar.bz2, where
+<INITRD> is either initrd-1.0-i386 or initrd-1.0-powerpc as appropriate, or
+alongside this file.  Copyright statements and licences are contained therein.
+The remaining source code is included in the Xen distribution, at
+http://www.xensource.com/xen/downloads/archives.html.  The configurations used
+for BusyBox, uClibc, and Buildroot are available as
+http://xm-test.xensource.com/ramdisks/<INITRD>-busybox-config,
+http://xm-test.xensource.com/ramdisks/<INITRD>-uClibc-config, and
+http://xm-test.xensource.com/ramdisks/<INITRD>-buildroot-config respectively,
+or alongside this file.
+
+XenSource and the Xen contributors are grateful to the authors of these
+software packages for their contributions to free and open-source software.
+
+
+Buildroot and BusyBox are Copyright (c) Erik Andersen <andersen@xxxxxxxxxxxx>.
+BusyBox is licensed under the GNU General Public License (GPL).  A copy of
+this license is available in the file GPL-2,
+http://xm-test.xensource.com/ramdisks/GPL-2, or alongside this file.
+
+uClibc is licensed under the GNU Lesser General Public License (LGPL).  A copy
+of this license is available in the file
+http://xm-test.xensource.com/ramdisks/LGPL-2, or alongside this file.
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/ramdisk/configs/buildroot-i386
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xm-test/ramdisk/configs/buildroot-i386      Tue Oct 24 11:21:48 
2006 -0600
@@ -0,0 +1,346 @@
+#
+# Automatically generated make config: don't edit
+#
+BR2_HAVE_DOT_CONFIG=y
+# BR2_alpha is not set
+# BR2_arm is not set
+# BR2_armeb is not set
+# BR2_cris is not set
+BR2_i386=y
+# BR2_m68k is not set
+# BR2_mips is not set
+# BR2_mipsel is not set
+# BR2_nios2 is not set
+# BR2_powerpc is not set
+# BR2_sh is not set
+# BR2_sh64 is not set
+# BR2_sparc is not set
+# BR2_x86_64 is not set
+BR2_x86_i386=y
+# BR2_x86_i486 is not set
+# BR2_x86_i586 is not set
+# BR2_x86_i686 is not set
+BR2_ARCH="i386"
+BR2_ENDIAN="LITTLE"
+
+#
+# Build options
+#
+BR2_WGET="wget --passive-ftp"
+BR2_SVN="svn co"
+BR2_ZCAT="zcat"
+BR2_TAR_OPTIONS=""
+BR2_DL_DIR="$(BASE_DIR)/dl"
+BR2_SOURCEFORGE_MIRROR="easynews"
+BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
+BR2_TOPDIR_PREFIX=""
+BR2_TOPDIR_SUFFIX=""
+BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
+BR2_GNU_TARGET_SUFFIX="linux-uclibc"
+BR2_JLEVEL=1
+
+#
+# Toolchain Options
+#
+
+#
+# Kernel Header Options
+#
+# BR2_KERNEL_HEADERS_2_4_25 is not set
+# BR2_KERNEL_HEADERS_2_4_27 is not set
+# BR2_KERNEL_HEADERS_2_4_29 is not set
+# BR2_KERNEL_HEADERS_2_4_31 is not set
+# BR2_KERNEL_HEADERS_2_6_9 is not set
+# BR2_KERNEL_HEADERS_2_6_11 is not set
+BR2_KERNEL_HEADERS_2_6_12=y
+# BR2_KERNEL_HEADERS_2_6_18 is not set
+BR2_DEFAULT_KERNEL_HEADERS="2.6.12"
+
+#
+# uClibc Options
+#
+# BR2_UCLIBC_VERSION_SNAPSHOT is not set
+# BR2_ENABLE_LOCALE is not set
+# BR2_PTHREADS_NONE is not set
+# BR2_PTHREADS is not set
+BR2_PTHREADS_OLD=y
+# BR2_PTHREADS_NATIVE is not set
+
+#
+# Binutils Options
+#
+# BR2_BINUTILS_VERSION_2_14_90_0_8 is not set
+# BR2_BINUTILS_VERSION_2_15 is not set
+# BR2_BINUTILS_VERSION_2_15_94_0_2_2 is not set
+# BR2_BINUTILS_VERSION_2_16_1 is not set
+# BR2_BINUTILS_VERSION_2_16_90_0_3 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_5 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_6 is not set
+BR2_BINUTILS_VERSION_2_16_91_0_7=y
+# BR2_BINUTILS_VERSION_2_17 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_2 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_3 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_4 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_5 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_6 is not set
+BR2_BINUTILS_VERSION="2.16.91.0.7"
+BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
+
+#
+# Gcc Options
+#
+# BR2_GCC_VERSION_3_3_5 is not set
+# BR2_GCC_VERSION_3_3_6 is not set
+# BR2_GCC_VERSION_3_4_2 is not set
+# BR2_GCC_VERSION_3_4_3 is not set
+# BR2_GCC_VERSION_3_4_4 is not set
+# BR2_GCC_VERSION_3_4_5 is not set
+BR2_GCC_VERSION_3_4_6=y
+# BR2_GCC_VERSION_4_0_0 is not set
+# BR2_GCC_VERSION_4_0_1 is not set
+# BR2_GCC_VERSION_4_0_2 is not set
+# BR2_GCC_VERSION_4_0_3 is not set
+# BR2_GCC_VERSION_4_1_0 is not set
+# BR2_GCC_VERSION_4_1_1 is not set
+# BR2_GCC_VERSION_4_2 is not set
+# BR2_GCC_IS_SNAP is not set
+BR2_GCC_VERSION="3.4.6"
+# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
+BR2_EXTRA_GCC_CONFIG_OPTIONS=""
+# BR2_INSTALL_LIBSTDCPP is not set
+# BR2_INSTALL_OBJC is not set
+# BR2_GCC_SHARED_LIBGCC is not set
+
+#
+# Ccache Options
+#
+BR2_CCACHE=y
+
+#
+# Gdb Options
+#
+# BR2_PACKAGE_GDB is not set
+# BR2_PACKAGE_GDB_SERVER is not set
+# BR2_PACKAGE_GDB_HOST is not set
+
+#
+# elf2flt
+#
+# BR2_ELF2FLT is not set
+# BR2_MKLIBS is not set
+
+#
+# Common Toolchain Options
+#
+# BR2_PACKAGE_SSTRIP_TARGET is not set
+# BR2_PACKAGE_SSTRIP_HOST is not set
+BR2_ENABLE_MULTILIB=y
+BR2_LARGEFILE=y
+BR2_TARGET_OPTIMIZATION="-Os -pipe"
+BR2_CROSS_TOOLCHAIN_TARGET_UTILS=y
+
+#
+# Package Selection for the target
+#
+
+#
+# The default minimal system
+#
+BR2_PACKAGE_BUSYBOX=y
+# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
+BR2_PACKAGE_BUSYBOX_INSTALL_SYMLINKS=y
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
+
+#
+# The minimum needed to build a uClibc development system
+#
+# BR2_PACKAGE_BASH is not set
+# BR2_PACKAGE_BZIP2 is not set
+# BR2_PACKAGE_COREUTILS is not set
+# BR2_PACKAGE_DIFFUTILS is not set
+# BR2_PACKAGE_ED is not set
+# BR2_PACKAGE_FINDUTILS is not set
+# BR2_PACKAGE_FLEX is not set
+# BR2_PACKAGE_GAWK is not set
+# BR2_PACKAGE_GCC_TARGET is not set
+# BR2_PACKAGE_CCACHE_TARGET is not set
+# BR2_PACKAGE_GREP is not set
+# BR2_PACKAGE_MAKE is not set
+# BR2_PACKAGE_PATCH is not set
+# BR2_PACKAGE_SED is not set
+# BR2_PACKAGE_TAR is not set
+
+#
+# Other stuff
+#
+# BR2_PACKAGE_ACPID is not set
+# BR2_PACKAGE_ASTERISK is not set
+# BR2_PACKAGE_AT is not set
+# BR2_PACKAGE_AUTOCONF is not set
+# BR2_PACKAGE_AUTOMAKE is not set
+# BR2_PACKAGE_BERKELEYDB is not set
+# BR2_PACKAGE_BIND is not set
+# BR2_PACKAGE_BISON is not set
+# BR2_PACKAGE_BOA is not set
+# BR2_PACKAGE_BRIDGE is not set
+# BR2_PACKAGE_CUSTOMIZE is not set
+# BR2_PACKAGE_ISC_DHCP is not set
+# BR2_PACKAGE_DIALOG is not set
+# BR2_PACKAGE_DIRECTFB is not set
+# BR2_PACKAGE_DISTCC is not set
+# BR2_PACKAGE_DM is not set
+# BR2_PACKAGE_DMRAID is not set
+# BR2_PACKAGE_DNSMASQ is not set
+# BR2_PACKAGE_DROPBEAR is not set
+# BR2_PACKAGE_ETHTOOL is not set
+# BR2_PACKAGE_EXPAT is not set
+# BR2_PACKAGE_E2FSPROGS is not set
+# BR2_PACKAGE_FAKEROOT is not set
+# BR2_PACKAGE_FILE is not set
+# BR2_PACKAGE_FREETYPE is not set
+# BR2_PACKAGE_GETTEXT is not set
+# BR2_PACKAGE_LIBINTL is not set
+# BR2_PACKAGE_GZIP is not set
+# BR2_PACKAGE_HASERL is not set
+# BR2_PACKAGE_HDPARM is not set
+# BR2_PACKAGE_HOSTAP is not set
+# BR2_PACKAGE_HOTPLUG is not set
+# BR2_PACKAGE_IOSTAT is not set
+# BR2_PACKAGE_IPROUTE2 is not set
+# BR2_PACKAGE_IPSEC_TOOLS is not set
+# BR2_PACKAGE_IPTABLES is not set
+# BR2_PACKAGE_JPEG is not set
+# BR2_PACKAGE_LESS is not set
+# BR2_PACKAGE_LIBCGI is not set
+# BR2_PACKAGE_LIBCGICC is not set
+# BR2_PACKAGE_LIBELF is not set
+# BR2_PACKAGE_LIBFLOAT is not set
+# BR2_PACKAGE_LIBGLIB12 is not set
+# BR2_PACKAGE_LIBMAD is not set
+# BR2_PACKAGE_LIBPCAP is not set
+# BR2_PACKAGE_LIBPNG is not set
+# BR2_PACKAGE_LIBSYSFS is not set
+# BR2_PACKAGE_LIBTOOL is not set
+# BR2_PACKAGE_LIBUSB is not set
+# BR2_PACKAGE_LIGHTTPD is not set
+# BR2_PACKAGE_LINKS is not set
+# BR2_PACKAGE_LRZSZ is not set
+# BR2_PACKAGE_LSOF is not set
+# BR2_PACKAGE_LTP-TESTSUITE is not set
+# BR2_PACKAGE_LTT is not set
+# BR2_PACKAGE_LVM2 is not set
+# BR2_PACKAGE_LZO is not set
+# BR2_PACKAGE_LZMA is not set
+# BR2_PACKAGE_M4 is not set
+# BR2_PACKAGE_MDADM is not set
+# BR2_PACKAGE_MEMTESTER is not set
+# BR2_PACKAGE_MICROCOM is not set
+# BR2_PACKAGE_MICROPERL is not set
+# BR2_PACKAGE_MICROWIN is not set
+# BR2_PACKAGE_MKDOSFS is not set
+# BR2_PACKAGE_MODULE_INIT_TOOLS is not set
+# BR2_PACKAGE_MODUTILS is not set
+# BR2_PACKAGE_MPG123 is not set
+# BR2_PACKAGE_MROUTED is not set
+# BR2_PACKAGE_MTD is not set
+# BR2_PACKAGE_NANO is not set
+# BR2_PACKAGE_NBD is not set
+# BR2_PACKAGE_NCURSES is not set
+# BR2_PACKAGE_NETKITBASE is not set
+# BR2_PACKAGE_NETKITTELNET is not set
+# BR2_PACKAGE_NETSNMP is not set
+# BR2_PACKAGE_NEWT is not set
+# BR2_PACKAGE_NTP is not set
+# BR2_PACKAGE_OPENNTPD is not set
+# BR2_PACKAGE_OPENSSH is not set
+# BR2_PACKAGE_OPENSSL is not set
+# BR2_PACKAGE_OPENVPN is not set
+# BR2_PACKAGE_PCIUTILS is not set
+# BR2_PACKAGE_PKGCONFIG is not set
+# BR2_PACKAGE_PORTAGE is not set
+# BR2_PACKAGE_PORTMAP is not set
+# BR2_PACKAGE_PPPD is not set
+# BR2_PACKAGE_PROCPS is not set
+# BR2_PACKAGE_PSMISC is not set
+# BR2_PACKAGE_PYTHON is not set
+# BR2_PACKAGE_QTE is not set
+BR2_QTE_TMAKE_VERSION="1.13"
+# BR2_PACKAGE_RAIDTOOLS is not set
+# BR2_READLINE is not set
+# BR2_PACKAGE_RSYNC is not set
+# BR2_PACKAGE_RUBY is not set
+# BR2_PACKAGE_RXVT is not set
+# BR2_PACKAGE_SDL is not set
+# BR2_PACKAGE_SFDISK is not set
+# BR2_PACKAGE_SLANG is not set
+# BR2_PACKAGE_SMARTMONTOOLS is not set
+# BR2_PACKAGE_SOCAT is not set
+# BR2_PACKAGE_SQLITE is not set
+# BR2_PACKAGE_STRACE is not set
+# BR2_PACKAGE_SUDO is not set
+# BR2_PACKAGE_SYSKLOGD is not set
+# BR2_PACKAGE_SYSVINIT is not set
+# BR2_PACKAGE_TCL is not set
+# BR2_PACKAGE_TCPDUMP is not set
+# BR2_PACKAGE_TFTPD is not set
+# BR2_PACKAGE_THTTPD is not set
+# BR2_PACKAGE_TINYLOGIN is not set
+# BR2_PACKAGE_TINYX is not set
+# BR2_PACKAGE_TN5250 is not set
+# BR2_PACKAGE_TTCP is not set
+# BR2_PACKAGE_UDEV is not set
+# BR2_PACKAGE_UDHCP is not set
+# BR2_PACKAGE_UEMACS is not set
+# BR2_PACKAGE_USBUTILS is not set
+# BR2_PACKAGE_UTIL-LINUX is not set
+# BR2_PACKAGE_VALGRIND is not set
+# BR2_PACKAGE_VTUN is not set
+# BR2_PACKAGE_WGET is not set
+# BR2_PACKAGE_WHICH is not set
+# BR2_PACKAGE_WIPE is not set
+# BR2_PACKAGE_WIRELESS_TOOLS is not set
+# BR2_PACKAGE_XFSPROGS is not set
+# BR2_PACKAGE_ZLIB is not set
+BR2_PACKAGE_HPING=y
+
+#
+# Target Options
+#
+
+#
+# filesystem for target device
+#
+# BR2_TARGET_ROOTFS_CRAMFS is not set
+# BR2_TARGET_ROOTFS_CLOOP is not set
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_BLOCKS=0
+BR2_TARGET_ROOTFS_EXT2_INODES=0
+BR2_TARGET_ROOTFS_EXT2_RESBLKS=0
+BR2_TARGET_ROOTFS_EXT2_SQUASH=y
+BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2"
+# BR2_TARGET_ROOTFS_EXT2_GZ is not set
+BR2_TARGET_ROOTFS_EXT2_COPYTO=""
+# BR2_TARGET_ROOTFS_JFFS2 is not set
+# BR2_TARGET_ROOTFS_SQUASHFS is not set
+# BR2_TARGET_ROOTFS_TAR is not set
+# BR2_TARGET_ROOTFS_ISO9660 is not set
+
+#
+# bootloader for target device
+#
+# BR2_TARGET_GRUB is not set
+# BR2_TARGET_SYSLINUX is not set
+
+#
+# Board Support Options
+#
+# BR2_TARGET_SOEKRIS_NET4521 is not set
+# BR2_TARGET_SOEKRIS_NET4801 is not set
+# BR2_TARGET_VIA_EPIA_MII is not set
+
+#
+# Generic System Support
+#
+# BR2_TARGET_GENERIC_ACCESS_POINT is not set
+# BR2_TARGET_GENERIC_FIREWALL is not set
+# BR2_TARGET_GENERIC_DEV_SYSTEM is not set
diff -r aa8ca06d209e -r d246b79986d1 
tools/xm-test/ramdisk/configs/buildroot-powerpc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/xm-test/ramdisk/configs/buildroot-powerpc   Tue Oct 24 11:21:48 
2006 -0600
@@ -0,0 +1,338 @@
+#
+# Automatically generated make config: don't edit
+#
+BR2_HAVE_DOT_CONFIG=y
+# BR2_alpha is not set
+# BR2_arm is not set
+# BR2_armeb is not set
+# BR2_cris is not set
+# BR2_i386 is not set
+# BR2_m68k is not set
+# BR2_mips is not set
+# BR2_mipsel is not set
+# BR2_nios2 is not set
+BR2_powerpc=y
+# BR2_sh is not set
+# BR2_sh64 is not set
+# BR2_sparc is not set
+# BR2_x86_64 is not set
+BR2_ARCH="powerpc"
+BR2_ENDIAN="BIG"
+
+#
+# Build options
+#
+BR2_WGET="wget --passive-ftp"
+BR2_SVN="svn co"
+BR2_ZCAT="zcat"
+BR2_TAR_OPTIONS=""
+BR2_DL_DIR="$(BASE_DIR)/dl"
+BR2_SOURCEFORGE_MIRROR="easynews"
+BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
+BR2_TOPDIR_PREFIX=""
+BR2_TOPDIR_SUFFIX=""
+BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
+BR2_GNU_TARGET_SUFFIX="linux-uclibc"
+BR2_JLEVEL=1
+
+#
+# Toolchain Options
+#
+
+#
+# Kernel Header Options
+#
+# BR2_KERNEL_HEADERS_2_4_25 is not set
+# BR2_KERNEL_HEADERS_2_4_27 is not set
+# BR2_KERNEL_HEADERS_2_4_29 is not set
+# BR2_KERNEL_HEADERS_2_4_31 is not set
+# BR2_KERNEL_HEADERS_2_6_9 is not set
+# BR2_KERNEL_HEADERS_2_6_11 is not set
+BR2_KERNEL_HEADERS_2_6_12=y
+# BR2_KERNEL_HEADERS_2_6_18 is not set
+BR2_DEFAULT_KERNEL_HEADERS="2.6.12"
+
+#
+# uClibc Options
+#
+# BR2_UCLIBC_VERSION_SNAPSHOT is not set
+# BR2_ENABLE_LOCALE is not set
+# BR2_PTHREADS_NONE is not set
+# BR2_PTHREADS is not set
+BR2_PTHREADS_OLD=y
+# BR2_PTHREADS_NATIVE is not set
+
+#
+# Binutils Options
+#
+# BR2_BINUTILS_VERSION_2_14_90_0_8 is not set
+# BR2_BINUTILS_VERSION_2_15 is not set
+# BR2_BINUTILS_VERSION_2_15_94_0_2_2 is not set
+# BR2_BINUTILS_VERSION_2_16_1 is not set
+# BR2_BINUTILS_VERSION_2_16_90_0_3 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_5 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_6 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_7 is not set
+BR2_BINUTILS_VERSION_2_17=y
+# BR2_BINUTILS_VERSION_2_17_50_0_2 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_3 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_4 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_5 is not set
+# BR2_BINUTILS_VERSION_2_17_50_0_6 is not set
+BR2_BINUTILS_VERSION="2.17"
+BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
+
+#
+# Gcc Options
+#
+# BR2_GCC_VERSION_3_3_5 is not set
+# BR2_GCC_VERSION_3_3_6 is not set
+BR2_GCC_VERSION_3_4_2=y
+# BR2_GCC_VERSION_3_4_3 is not set
+# BR2_GCC_VERSION_3_4_4 is not set
+# BR2_GCC_VERSION_3_4_5 is not set
+# BR2_GCC_VERSION_3_4_6 is not set
+# BR2_GCC_VERSION_4_0_0 is not set
+# BR2_GCC_VERSION_4_0_1 is not set
+# BR2_GCC_VERSION_4_0_2 is not set
+# BR2_GCC_VERSION_4_0_3 is not set
+# BR2_GCC_VERSION_4_1_0 is not set
+# BR2_GCC_VERSION_4_1_1 is not set
+# BR2_GCC_VERSION_4_2 is not set
+# BR2_GCC_IS_SNAP is not set
+BR2_GCC_VERSION="3.4.2"
+# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
+BR2_EXTRA_GCC_CONFIG_OPTIONS=""
+# BR2_INSTALL_LIBSTDCPP is not set
+# BR2_INSTALL_OBJC is not set
+# BR2_GCC_SHARED_LIBGCC is not set
+
+#
+# Ccache Options
+#
+BR2_CCACHE=y
+
+#
+# Gdb Options
+#
+# BR2_PACKAGE_GDB is not set
+# BR2_PACKAGE_GDB_SERVER is not set
+# BR2_PACKAGE_GDB_HOST is not set
+
+#
+# elf2flt
+#
+# BR2_ELF2FLT is not set
+# BR2_MKLIBS is not set
+
+#
+# Common Toolchain Options
+#
+# BR2_PACKAGE_SSTRIP_TARGET is not set
+# BR2_PACKAGE_SSTRIP_HOST is not set
+BR2_ENABLE_MULTILIB=y
+BR2_LARGEFILE=y
+# BR2_SOFT_FLOAT is not set
+BR2_TARGET_OPTIMIZATION="-Os -pipe"
+BR2_CROSS_TOOLCHAIN_TARGET_UTILS=y
+
+#
+# Package Selection for the target
+#
+
+#
+# The default minimal system
+#
+BR2_PACKAGE_BUSYBOX=y
+# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
+BR2_PACKAGE_BUSYBOX_INSTALL_SYMLINKS=y
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
+
+#
+# The minimum needed to build a uClibc development system
+#
+# BR2_PACKAGE_BASH is not set
+# BR2_PACKAGE_BZIP2 is not set
+# BR2_PACKAGE_COREUTILS is not set
+# BR2_PACKAGE_DIFFUTILS is not set
+# BR2_PACKAGE_ED is not set
+# BR2_PACKAGE_FINDUTILS is not set
+# BR2_PACKAGE_FLEX is not set
+# BR2_PACKAGE_GAWK is not set
+# BR2_PACKAGE_GCC_TARGET is not set
+# BR2_PACKAGE_CCACHE_TARGET is not set
+# BR2_PACKAGE_GREP is not set
+# BR2_PACKAGE_MAKE is not set
+# BR2_PACKAGE_PATCH is not set
+# BR2_PACKAGE_SED is not set
+# BR2_PACKAGE_TAR is not set
+
+#
+# Other stuff
+#
+# BR2_PACKAGE_ACPID is not set
+# BR2_PACKAGE_ASTERISK is not set
+# BR2_PACKAGE_AT is not set
+# BR2_PACKAGE_AUTOCONF is not set
+# BR2_PACKAGE_AUTOMAKE is not set
+# BR2_PACKAGE_BERKELEYDB is not set
+# BR2_PACKAGE_BIND is not set
+# BR2_PACKAGE_BISON is not set
+# BR2_PACKAGE_BOA is not set
+# BR2_PACKAGE_BRIDGE is not set
+# BR2_PACKAGE_CUSTOMIZE is not set
+# BR2_PACKAGE_ISC_DHCP is not set
+# BR2_PACKAGE_DIALOG is not set
+# BR2_PACKAGE_DIRECTFB is not set
+# BR2_PACKAGE_DISTCC is not set
+# BR2_PACKAGE_DM is not set
+# BR2_PACKAGE_DMRAID is not set
+# BR2_PACKAGE_DNSMASQ is not set
+# BR2_PACKAGE_DROPBEAR is not set
+# BR2_PACKAGE_ETHTOOL is not set
+# BR2_PACKAGE_EXPAT is not set
+# BR2_PACKAGE_E2FSPROGS is not set
+# BR2_PACKAGE_FAKEROOT is not set
+# BR2_PACKAGE_FILE is not set
+# BR2_PACKAGE_FREETYPE is not set
+# BR2_PACKAGE_GETTEXT is not set
+# BR2_PACKAGE_LIBINTL is not set
+# BR2_PACKAGE_GZIP is not set
+# BR2_PACKAGE_HASERL is not set
+# BR2_PACKAGE_HDPARM is not set
+# BR2_PACKAGE_HOSTAP is not set
+# BR2_PACKAGE_HOTPLUG is not set
+# BR2_PACKAGE_IOSTAT is not set
+# BR2_PACKAGE_IPROUTE2 is not set
+# BR2_PACKAGE_IPSEC_TOOLS is not set
+# BR2_PACKAGE_IPTABLES is not set
+# BR2_PACKAGE_JPEG is not set
+# BR2_PACKAGE_LESS is not set
+# BR2_PACKAGE_LIBCGI is not set
+# BR2_PACKAGE_LIBCGICC is not set
+# BR2_PACKAGE_LIBELF is not set
+# BR2_PACKAGE_LIBFLOAT is not set
+# BR2_PACKAGE_LIBGLIB12 is not set
+# BR2_PACKAGE_LIBMAD is not set
+# BR2_PACKAGE_LIBPCAP is not set
+# BR2_PACKAGE_LIBPNG is not set
+# BR2_PACKAGE_LIBSYSFS is not set
+# BR2_PACKAGE_LIBTOOL is not set
+# BR2_PACKAGE_LIBUSB is not set
+# BR2_PACKAGE_LIGHTTPD is not set
+# BR2_PACKAGE_LINKS is not set
+# BR2_PACKAGE_LRZSZ is not set
+# BR2_PACKAGE_LSOF is not set
+# BR2_PACKAGE_LTP-TESTSUITE is not set
+# BR2_PACKAGE_LTT is not set
+# BR2_PACKAGE_LVM2 is not set
+# BR2_PACKAGE_LZO is not set
+# BR2_PACKAGE_LZMA is not set
+# BR2_PACKAGE_M4 is not set
+# BR2_PACKAGE_MDADM is not set
+# BR2_PACKAGE_MEMTESTER is not set
+# BR2_PACKAGE_MICROCOM is not set
+# BR2_PACKAGE_MICROPERL is not set
+# BR2_PACKAGE_MICROWIN is not set
+# BR2_PACKAGE_MKDOSFS is not set
+# BR2_PACKAGE_MODULE_INIT_TOOLS is not set
+# BR2_PACKAGE_MODUTILS is not set
+# BR2_PACKAGE_MPG123 is not set
+# BR2_PACKAGE_MROUTED is not set
+# BR2_PACKAGE_MTD is not set
+# BR2_PACKAGE_NANO is not set
+# BR2_PACKAGE_NBD is not set
+# BR2_PACKAGE_NCURSES is not set
+# BR2_PACKAGE_NETKITBASE is not set
+# BR2_PACKAGE_NETKITTELNET is not set
+# BR2_PACKAGE_NETSNMP is not set
+# BR2_PACKAGE_NEWT is not set
+# BR2_PACKAGE_NTP is not set
+# BR2_PACKAGE_OPENNTPD is not set
+# BR2_PACKAGE_OPENSSH is not set
+# BR2_PACKAGE_OPENSSL is not set
+# BR2_PACKAGE_OPENVPN is not set
+# BR2_PACKAGE_PCIUTILS is not set
+# BR2_PACKAGE_PKGCONFIG is not set
+# BR2_PACKAGE_PORTAGE is not set
+# BR2_PACKAGE_PORTMAP is not set
+# BR2_PACKAGE_PPPD is not set
+# BR2_PACKAGE_PROCPS is not set
+# BR2_PACKAGE_PSMISC is not set
+# BR2_PACKAGE_PYTHON is not set
+# BR2_PACKAGE_QTE is not set
+BR2_QTE_TMAKE_VERSION="1.13"
+# BR2_PACKAGE_RAIDTOOLS is not set
+# BR2_READLINE is not set
+# BR2_PACKAGE_RSYNC is not set
+# BR2_PACKAGE_RUBY is not set
+# BR2_PACKAGE_RXVT is not set
+# BR2_PACKAGE_SDL is not set
+# BR2_PACKAGE_SFDISK is not set
+# BR2_PACKAGE_SLANG is not set
+# BR2_PACKAGE_SMARTMONTOOLS is not set
+# BR2_PACKAGE_SOCAT is not set
+# BR2_PACKAGE_SQLITE is not set
+# BR2_PACKAGE_STRACE is not set
+# BR2_PACKAGE_SUDO is not set
+# BR2_PACKAGE_SYSKLOGD is not set
+# BR2_PACKAGE_SYSVINIT is not set
+# BR2_PACKAGE_TCL is not set
+# BR2_PACKAGE_TCPDUMP is not set
+# BR2_PACKAGE_TFTPD is not set
+# BR2_PACKAGE_THTTPD is not set
+# BR2_PACKAGE_TINYLOGIN is not set
+# BR2_PACKAGE_TINYX is not set
+# BR2_PACKAGE_TN5250 is not set
+# BR2_PACKAGE_TTCP is not set
+# BR2_PACKAGE_UDEV is not set
+# BR2_PACKAGE_UDHCP is not set
+# BR2_PACKAGE_UEMACS is not set
+# BR2_PACKAGE_USBUTILS is not set
+# BR2_PACKAGE_UTIL-LINUX is not set
+# BR2_PACKAGE_VALGRIND is not set
+# BR2_PACKAGE_VTUN is not set
+# BR2_PACKAGE_WGET is not set
+# BR2_PACKAGE_WHICH is not set
+# BR2_PACKAGE_WIPE is not set
+# BR2_PACKAGE_WIRELESS_TOOLS is not set
+# BR2_PACKAGE_XFSPROGS is not set
+# BR2_PACKAGE_ZLIB is not set
+BR2_PACKAGE_HPING=y
+
+#
+# Target Options
+#
+
+#
+# filesystem for target device
+#
+# BR2_TARGET_ROOTFS_CRAMFS is not set
+# BR2_TARGET_ROOTFS_CLOOP is not set
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_BLOCKS=0
+BR2_TARGET_ROOTFS_EXT2_INODES=0
+BR2_TARGET_ROOTFS_EXT2_RESBLKS=0
+BR2_TARGET_ROOTFS_EXT2_SQUASH=y
+BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2"
+# BR2_TARGET_ROOTFS_EXT2_GZ is not set
+BR2_TARGET_ROOTFS_EXT2_COPYTO=""
+# BR2_TARGET_ROOTFS_JFFS2 is not set
+# BR2_TARGET_ROOTFS_SQUASHFS is not set
+# BR2_TARGET_ROOTFS_TAR is not set
+
+#
+# bootloader for target device
+#
+# BR2_TARGET_YABOOT is not set
+
+#
+# Board Support Options
+#
+
+#
+# Generic System Support
+#
+# BR2_TARGET_GENERIC_ACCESS_POINT is not set
+# BR2_TARGET_GENERIC_FIREWALL is not set
+# BR2_TARGET_GENERIC_DEV_SYSTEM is not set
diff -r aa8ca06d209e -r d246b79986d1 tools/xm-test/ramdisk/configs/buildroot
--- a/tools/xm-test/ramdisk/configs/buildroot   Tue Oct 24 10:08:30 2006 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,330 +0,0 @@
-#
-# Automatically generated make config: don't edit
-#
-BR2_HAVE_DOT_CONFIG=y
-# BR2_alpha is not set
-# BR2_arm is not set
-# BR2_armeb is not set
-# BR2_cris is not set
-BR2_i386=y
-# BR2_m68k is not set
-# BR2_mips is not set
-# BR2_mipsel is not set
-# BR2_nios2 is not set
-# BR2_powerpc is not set
-# BR2_sh is not set
-# BR2_sparc is not set
-# BR2_x86_64 is not set
-BR2_x86_i386=y
-# BR2_x86_i486 is not set
-# BR2_x86_i586 is not set
-# BR2_x86_i686 is not set
-BR2_ARCH="i386"
-BR2_ENDIAN="LITTLE"
-
-#
-# Build options
-#
-BR2_WGET="wget --passive-ftp"
-BR2_SVN="svn co"
-BR2_TAR_OPTIONS=""
-BR2_DL_DIR="$(BASE_DIR)/dl"
-BR2_SOURCEFORGE_MIRROR="easynews"
-BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
-BR2_TOPDIR_PREFIX=""
-BR2_TOPDIR_SUFFIX=""
-BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
-BR2_JLEVEL=1
-
-#
-# Toolchain Options
-#
-
-#
-# Kernel Header Options
-#
-# BR2_KERNEL_HEADERS_2_4_25 is not set
-# BR2_KERNEL_HEADERS_2_4_27 is not set
-# BR2_KERNEL_HEADERS_2_4_29 is not set
-# BR2_KERNEL_HEADERS_2_4_31 is not set
-# BR2_KERNEL_HEADERS_2_6_9 is not set
-# BR2_KERNEL_HEADERS_2_6_11 is not set
-BR2_KERNEL_HEADERS_2_6_12=y
-BR2_DEFAULT_KERNEL_HEADERS="2.6.12"
-
-#
-# uClibc Options
-#
-# BR2_UCLIBC_VERSION_SNAPSHOT is not set
-# BR2_ENABLE_LOCALE is not set
-# BR2_PTHREADS_NONE is not set
-# BR2_PTHREADS is not set
-BR2_PTHREADS_OLD=y
-# BR2_PTHREADS_NATIVE is not set
-
-#
-# Binutils Options
-#
-# BR2_BINUTILS_VERSION_2_14_90_0_8 is not set
-# BR2_BINUTILS_VERSION_2_15 is not set
-# BR2_BINUTILS_VERSION_2_15_94_0_2_2 is not set
-# BR2_BINUTILS_VERSION_2_15_97 is not set
-# BR2_BINUTILS_VERSION_2_16_1 is not set
-# BR2_BINUTILS_VERSION_2_16_90_0_3 is not set
-# BR2_BINUTILS_VERSION_2_16_91_0_3 is not set
-# BR2_BINUTILS_VERSION_2_16_91_0_4 is not set
-# BR2_BINUTILS_VERSION_2_16_91_0_5 is not set
-# BR2_BINUTILS_VERSION_2_16_91_0_6 is not set
-BR2_BINUTILS_VERSION_2_16_91_0_7=y
-BR2_BINUTILS_VERSION="2.16.91.0.7"
-BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
-
-#
-# Gcc Options
-#
-# BR2_GCC_VERSION_3_3_5 is not set
-# BR2_GCC_VERSION_3_3_6 is not set
-# BR2_GCC_VERSION_3_4_2 is not set
-# BR2_GCC_VERSION_3_4_3 is not set
-# BR2_GCC_VERSION_3_4_4 is not set
-# BR2_GCC_VERSION_3_4_5 is not set
-BR2_GCC_VERSION_3_4_6=y
-# BR2_GCC_VERSION_4_0_0 is not set
-# BR2_GCC_VERSION_4_0_1 is not set
-# BR2_GCC_VERSION_4_0_2 is not set
-# BR2_GCC_VERSION_4_0_3 is not set
-# BR2_GCC_VERSION_4_1_0 is not set
-# BR2_GCC_VERSION_4_2 is not set
-# BR2_GCC_IS_SNAP is not set
-BR2_GCC_VERSION="3.4.6"
-# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
-BR2_EXTRA_GCC_CONFIG_OPTIONS=""
-# BR2_INSTALL_LIBSTDCPP is not set
-# BR2_INSTALL_OBJC is not set
-
-#
-# Ccache Options
-#
-BR2_CCACHE=y
-
-#
-# Gdb Options
-#
-# BR2_PACKAGE_GDB is not set
-# BR2_PACKAGE_GDB_SERVER is not set
-# BR2_PACKAGE_GDB_HOST is not set
-
-#
-# elf2flt
-#
-# BR2_ELF2FLT is not set
-
-#
-# Common Toolchain Options
-#
-# BR2_PACKAGE_SSTRIP_TARGET is not set
-# BR2_PACKAGE_SSTRIP_HOST is not set
-BR2_ENABLE_MULTILIB=y
-BR2_LARGEFILE=y
-BR2_TARGET_OPTIMIZATION="-Os -pipe"
-BR2_CROSS_TOOLCHAIN_TARGET_UTILS=y
-
-#
-# Package Selection for the target
-#
-
-#
-# The default minimal system
-#
-BR2_PACKAGE_BUSYBOX=y
-# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
-BR2_PACKAGE_BUSYBOX_INSTALL_SYMLINKS=y
-BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
-
-#
-# The minimum needed to build a uClibc development system
-#
-# BR2_PACKAGE_BASH is not set
-# BR2_PACKAGE_BZIP2 is not set
-# BR2_PACKAGE_COREUTILS is not set
-# BR2_PACKAGE_DIFFUTILS is not set
-# BR2_PACKAGE_ED is not set
-# BR2_PACKAGE_FINDUTILS is not set
-# BR2_PACKAGE_FLEX is not set
-# BR2_PACKAGE_GAWK is not set
-# BR2_PACKAGE_GCC_TARGET is not set
-# BR2_PACKAGE_CCACHE_TARGET is not set
-# BR2_PACKAGE_GREP is not set
-# BR2_PACKAGE_MAKE is not set
-# BR2_PACKAGE_PATCH is not set
-# BR2_PACKAGE_SED is not set
-# BR2_PACKAGE_TAR is not set
-
-#
-# Other stuff
-#
-# BR2_PACKAGE_ACPID is not set
-# BR2_PACKAGE_ASTERISK is not set
-# BR2_PACKAGE_AT is not set
-# BR2_PACKAGE_AUTOCONF is not set
-# BR2_PACKAGE_AUTOMAKE is not set
-# BR2_PACKAGE_BERKELEYDB is not set
-# BR2_PACKAGE_BIND is not set
-# BR2_PACKAGE_BISON is not set
-# BR2_PACKAGE_BOA is not set
-# BR2_PACKAGE_BRIDGE is not set
-# BR2_PACKAGE_CUSTOMIZE is not set
-# BR2_PACKAGE_ISC_DHCP is not set
-# BR2_PACKAGE_DIALOG is not set
-# BR2_PACKAGE_DIRECTFB is not set
-# BR2_PACKAGE_DISTCC is not set
-# BR2_PACKAGE_DM is not set
-# BR2_PACKAGE_DNSMASQ is not set
-# BR2_PACKAGE_DROPBEAR is not set
-# BR2_PACKAGE_ETHTOOL is not set
-# BR2_PACKAGE_EXPAT is not set
-# BR2_PACKAGE_E2FSPROGS is not set
-# BR2_PACKAGE_FAKEROOT is not set
-# BR2_PACKAGE_FILE is not set
-# BR2_PACKAGE_FREETYPE is not set
-# BR2_PACKAGE_GETTEXT is not set
-# BR2_PACKAGE_LIBINTL is not set
-# BR2_PACKAGE_GZIP is not set
-# BR2_PACKAGE_HASERL is not set
-# BR2_PACKAGE_HOSTAP is not set
-# BR2_PACKAGE_HOTPLUG is not set
-# BR2_PACKAGE_IOSTAT is not set
-# BR2_PACKAGE_IPROUTE2 is not set
-# BR2_PACKAGE_IPSEC_TOOLS is not set
-# BR2_PACKAGE_IPTABLES is not set
-# BR2_PACKAGE_JPEG is not set
-# BR2_PACKAGE_LESS is not set
-# BR2_PACKAGE_LIBCGI is not set
-# BR2_PACKAGE_LIBCGICC is not set
-# BR2_PACKAGE_LIBELF is not set
-# BR2_PACKAGE_LIBFLOAT is not set
-# BR2_PACKAGE_LIBGLIB12 is not set
-# BR2_PACKAGE_LIBMAD is not set
-# BR2_PACKAGE_LIBPCAP is not set
-# BR2_PACKAGE_LIBPNG is not set
-# BR2_PACKAGE_LIBSYSFS is not set
-# BR2_PACKAGE_LIBTOOL is not set
-# BR2_PACKAGE_LIBUSB is not set
-# BR2_PACKAGE_LIGHTTPD is not set
-# BR2_PACKAGE_LINKS is not set
-# BR2_PACKAGE_LRZSZ is not set
-# BR2_PACKAGE_LTP-TESTSUITE is not set
-# BR2_PACKAGE_LTT is not set
-# BR2_PACKAGE_LVM2 is not set
-# BR2_PACKAGE_LZO is not set
-# BR2_PACKAGE_M4 is not set
-# BR2_PACKAGE_MDADM is not set
-# BR2_PACKAGE_MEMTESTER is not set
-# BR2_PACKAGE_MICROCOM is not set
-# BR2_PACKAGE_MICROPERL is not set
-# BR2_PACKAGE_MICROWIN is not set
-# BR2_PACKAGE_MKDOSFS is not set
-# BR2_PACKAGE_MODULE_INIT_TOOLS is not set
-# BR2_PACKAGE_MODUTILS is not set
-# BR2_PACKAGE_MPG123 is not set
-# BR2_PACKAGE_MROUTED is not set
-# BR2_PACKAGE_MTD is not set
-# BR2_PACKAGE_NANO is not set
-# BR2_PACKAGE_NCURSES is not set
-# BR2_PACKAGE_NETKITBASE is not set
-# BR2_PACKAGE_NETKITTELNET is not set
-# BR2_PACKAGE_NETSNMP is not set
-# BR2_PACKAGE_NEWT is not set
-# BR2_PACKAGE_NTP is not set
-# BR2_PACKAGE_OPENNTPD is not set
-# BR2_PACKAGE_OPENSSH is not set
-# BR2_PACKAGE_OPENSSL is not set
-# BR2_PACKAGE_OPENVPN is not set
-# BR2_PACKAGE_PCIUTILS is not set
-# BR2_PACKAGE_PORTAGE is not set
-# BR2_PACKAGE_PORTMAP is not set
-# BR2_PACKAGE_PPPD is not set
-# BR2_PACKAGE_PROCPS is not set
-# BR2_PACKAGE_PSMISC is not set
-# BR2_PACKAGE_PYTHON is not set
-# BR2_PACKAGE_QTE is not set
-BR2_QTE_TMAKE_VERSION="1.13"
-# BR2_PACKAGE_RAIDTOOLS is not set
-# BR2_READLINE is not set
-# BR2_PACKAGE_RSYNC is not set
-# BR2_PACKAGE_RUBY is not set
-# BR2_PACKAGE_RXVT is not set
-# BR2_PACKAGE_SDL is not set
-# BR2_PACKAGE_SFDISK is not set
-# BR2_PACKAGE_SLANG is not set
-# BR2_PACKAGE_SMARTMONTOOLS is not set
-# BR2_PACKAGE_SOCAT is not set
-# BR2_PACKAGE_STRACE is not set
-# BR2_PACKAGE_SUDO is not set
-# BR2_PACKAGE_SYSKLOGD is not set
-# BR2_PACKAGE_SYSVINIT is not set
-# BR2_PACKAGE_TCL is not set
-# BR2_PACKAGE_TCPDUMP is not set
-# BR2_PACKAGE_TFTPD is not set
-# BR2_PACKAGE_THTTPD is not set
-# BR2_PACKAGE_TINYLOGIN is not set
-# BR2_PACKAGE_TINYX is not set
-# BR2_PACKAGE_TN5250 is not set
-# BR2_PACKAGE_TTCP is not set
-# BR2_PACKAGE_UDEV is not set
-# BR2_PACKAGE_UDHCP is not set
-# BR2_PACKAGE_UEMACS is not set
-# BR2_PACKAGE_USBUTILS is not set
-# BR2_PACKAGE_UTIL-LINUX is not set
-# BR2_PACKAGE_VALGRIND is not set
-# BR2_PACKAGE_VTUN is not set
-# BR2_PACKAGE_WGET is not set
-# BR2_PACKAGE_WHICH is not set
-# BR2_PACKAGE_WIPE is not set
-# BR2_PACKAGE_WIRELESS_TOOLS is not set
-# BR2_PACKAGE_XFSPROGS is not set
-# BR2_PACKAGE_XORG is not set
-# BR2_PACKAGE_ZLIB is not set
-BR2_PACKAGE_HPING=y
-
-#
-# Target Options
-#
-
-#
-# filesystem for target device
-#
-# BR2_TARGET_ROOTFS_CRAMFS is not set
-# BR2_TARGET_ROOTFS_CLOOP is not set
-BR2_TARGET_ROOTFS_EXT2=y
-BR2_TARGET_ROOTFS_EXT2_BLOCKS=0
-BR2_TARGET_ROOTFS_EXT2_INODES=0
-BR2_TARGET_ROOTFS_EXT2_RESBLKS=0
-BR2_TARGET_ROOTFS_EXT2_SQUASH=y
-BR2_TARGET_ROOTFS_EXT2_OUTPUT="$(IMAGE).ext2"
-# BR2_TARGET_ROOTFS_EXT2_GZ is not set
-BR2_TARGET_ROOTFS_EXT2_COPYTO=""
-# BR2_TARGET_ROOTFS_JFFS2 is not set
-# BR2_TARGET_ROOTFS_SQUASHFS is not set
-# BR2_TARGET_ROOTFS_TAR is not set
-# BR2_TARGET_ROOTFS_ISO9660 is not set
-
-#
-# bootloader for target device
-#
-# BR2_TARGET_GRUB is not set
-# BR2_TARGET_SYSLINUX is not set
-
-#
-# Board Support Options
-#
-# BR2_TARGET_SOEKRIS_NET4521 is not set
-# BR2_TARGET_SOEKRIS_NET4801 is not set
-# BR2_TARGET_VIA_EPIA_MII is not set
-
-#
-# Generic System Support
-#
-# BR2_TARGET_GENERIC_ACCESS_POINT is not set
-# BR2_TARGET_GENERIC_FIREWALL is not set
-# BR2_TARGET_GENERIC_DEV_SYSTEM is not set

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