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

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



# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1218420292 -32400
# Node ID d24bc5f549ba2f1384c928456f86793fc53e66b9
# Parent  b086089f46432fccbc3f9b928217cf3eae385ebf
# Parent  4e3316ed1af512bd14a2ef975455cee6168f4bec
merge with xen-unstable.hg
---
 .hgtags                                 |    1 
 README                                  |   20 ++---
 extras/mini-os/fs-front.c               |   26 +++----
 extras/mini-os/include/fcntl.h          |    5 -
 extras/mini-os/include/fs.h             |    2 
 extras/mini-os/include/list.h           |  114 ++++++++++++++++----------------
 extras/mini-os/include/posix/sys/mman.h |    2 
 extras/mini-os/include/posix/sys/stat.h |    7 +
 extras/mini-os/include/sched.h          |    2 
 extras/mini-os/include/semaphore.h      |    2 
 extras/mini-os/include/wait.h           |   18 ++---
 extras/mini-os/include/waittypes.h      |    4 -
 extras/mini-os/lib/sys.c                |    9 --
 extras/mini-os/lib/xmalloc.c            |   20 ++---
 extras/mini-os/sched.c                  |   40 +++++------
 stubdom/newlib.patch                    |   80 ++++++++++++++++++++++
 tools/ioemu/audio/audio.c               |   38 +++++-----
 tools/ioemu/audio/audio.h               |    4 -
 tools/ioemu/audio/audio_int.h           |   34 ++++-----
 tools/ioemu/audio/audio_template.h      |   14 +--
 tools/ioemu/audio/sys-queue.h           |   12 +--
 tools/ioemu/block-vbd.c                 |    8 +-
 tools/ioemu/hw/pass-through.c           |   12 +--
 tools/ioemu/hw/pass-through.h           |    8 +-
 tools/ioemu/hw/serial.c                 |    2 
 tools/ioemu/monitor.c                   |    6 -
 tools/ioemu/vl.c                        |   10 +-
 tools/python/xen/xend/server/pciif.py   |    8 +-
 tools/python/xen/xm/create.py           |    2 
 unmodified_drivers/linux-2.6/README     |   10 +-
 xen/Makefile                            |    6 -
 xen/arch/x86/domain_build.c             |    6 -
 xen/arch/x86/mm.c                       |    6 +
 xen/arch/x86/time.c                     |    2 
 xen/arch/x86/x86_32/traps.c             |   36 ++++++----
 xen/arch/x86/x86_64/traps.c             |   36 ++++++----
 xen/include/asm-x86/spinlock.h          |    4 -
 37 files changed, 364 insertions(+), 252 deletions(-)

diff -r b086089f4643 -r d24bc5f549ba .hgtags
--- a/.hgtags   Mon Aug 11 10:59:39 2008 +0900
+++ b/.hgtags   Mon Aug 11 11:04:52 2008 +0900
@@ -27,3 +27,4 @@ 9facc624a238f2b9437b07fa28ff65884aa867f2
 9facc624a238f2b9437b07fa28ff65884aa867f2 3.2.0-rc6
 c3494402098e26507fc61a6579832c0149351d6a 3.3.0-rc1
 dde12ff94c96331668fe38a7b09506fa94d03c34 3.3.0-rc2
+57fca3648f25dcc085ee380954342960a7979987 3.3.0-rc3
diff -r b086089f4643 -r d24bc5f549ba README
--- a/README    Mon Aug 11 10:59:39 2008 +0900
+++ b/README    Mon Aug 11 11:04:52 2008 +0900
@@ -1,10 +1,10 @@
 #################################
- __  __            _  _    ___  
- \ \/ /___ _ __   | || |  / _ \ 
-  \  // _ \ '_ \  | || |_| | | |
-  /  \  __/ | | | |__   _| |_| |
- /_/\_\___|_| |_|    |_|(_)___/ 
-                                
+ __  __            _____  _____  
+ \ \/ /___ _ __   |___ / |___ /  
+  \  // _ \ '_ \    |_ \   |_ \  
+  /  \  __/ | | |  ___) | ___) | 
+ /_/\_\___|_| |_| |____(_)____/  
+                                 
 #################################
 
 http://www.xen.org/
@@ -21,7 +21,7 @@ by the original Xen development team to 
 by the original Xen development team to build enterprise products
 around Xen.
 
-The 4.0 release offers excellent performance, hardware support and
+The 3.3 release offers excellent performance, hardware support and
 enterprise-grade features such as x86_32-PAE, x86_64, SMP guests and
 live relocation of VMs. Ports to Linux 2.6, Linux 2.4, NetBSD, FreeBSD
 and Solaris are available from the community.
@@ -54,8 +54,8 @@ 2. Configure your bootloader to boot Xen
    /boot/grub/menu.lst: edit this file to include an entry like the
    following:
 
-    title Xen 4.0 / XenLinux 2.6
-       kernel /boot/xen-4.0.gz console=vga
+    title Xen 3.3 / XenLinux 2.6
+       kernel /boot/xen-3.3.gz console=vga
        module /boot/vmlinuz-2.6-xen root=<root-dev> ro console=tty0
        module /boot/initrd-2.6-xen.img
 
@@ -74,7 +74,7 @@ 2. Configure your bootloader to boot Xen
    32MB memory for internal use, which is not available for allocation
    to virtual machines.
 
-3. Reboot your system and select the "Xen 4.0 / XenLinux 2.6" menu
+3. Reboot your system and select the "Xen 3.3 / XenLinux 2.6" menu
    option. After booting Xen, Linux will start and your initialisation
    scripts should execute in the usual way.
 
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/fs-front.c
--- a/extras/mini-os/fs-front.c Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/fs-front.c Mon Aug 11 11:04:52 2008 +0900
@@ -1170,7 +1170,7 @@ done:
     return 1;
 }
 
-static void add_export(struct list_head *exports, unsigned int domid)
+static void add_export(struct minios_list_head *exports, unsigned int domid)
 {
     char node[1024], **exports_list = NULL, *ret_msg;
     int j = 0;
@@ -1192,8 +1192,8 @@ static void add_export(struct list_head 
             import->dom_id = domid;
             import->export_id = export_id;
             import->import_id = import_id++;
-            INIT_LIST_HEAD(&import->list);
-            list_add(&import->list, exports);
+            MINIOS_INIT_LIST_HEAD(&import->list);
+            minios_list_add(&import->list, exports);
         }
         free(exports_list[j]);
         j++;
@@ -1205,14 +1205,14 @@ static void add_export(struct list_head 
 }
 
 #if 0
-static struct list_head* probe_exports(void)
-{
-    struct list_head *exports;
+static struct minios_list_head* probe_exports(void)
+{
+    struct minios_list_head *exports;
     char **node_list = NULL, *msg = NULL;
     int i = 0;
 
-    exports = xmalloc(struct list_head);
-    INIT_LIST_HEAD(exports);
+    exports = xmalloc(struct minios_list_head);
+    MINIOS_INIT_LIST_HEAD(exports);
     
     msg = xenbus_ls(XBT_NIL, "/local/domain", &node_list);
     if(msg)
@@ -1237,19 +1237,19 @@ exit:
 }
 #endif
 
-LIST_HEAD(exports);
+MINIOS_LIST_HEAD(exports);
 
 void init_fs_frontend(void)
 {
-    struct list_head *entry;
+    struct minios_list_head *entry;
     struct fs_import *import = NULL;
     printk("Initing FS fronend(s).\n");
 
     //exports = probe_exports();
     add_export(&exports, 0);
-    list_for_each(entry, &exports)
-    {
-        import = list_entry(entry, struct fs_import, list);
+    minios_list_for_each(entry, &exports)
+    {
+        import = minios_list_entry(entry, struct fs_import, list);
         printk("FS export [dom=%d, id=%d] found\n", 
                 import->dom_id, import->export_id);
         init_fs_import(import);
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/fcntl.h
--- a/extras/mini-os/include/fcntl.h    Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/fcntl.h    Mon Aug 11 11:04:52 2008 +0900
@@ -91,8 +91,9 @@ struct flock64 {
 #define F_LINUX_SPECIFIC_BASE  1024
 */
 
-int open(const char *path, int flags, ...);
-int fcntl(int fd, int cmd, ...);
 #endif
 
+int open(const char *path, int flags, ...) asm("open64");
+int fcntl(int fd, int cmd, ...);
+
 #endif
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/fs.h
--- a/extras/mini-os/include/fs.h       Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/fs.h       Mon Aug 11 11:04:52 2008 +0900
@@ -13,7 +13,7 @@ struct fs_import
     domid_t dom_id;                 /* dom id of the exporting domain       */ 
     u16 export_id;                  /* export id (exporting dom specific)   */
     u16 import_id;                  /* import id (specific to this domain)  */ 
-    struct list_head list;          /* list of all imports                  */
+    struct minios_list_head list;   /* list of all imports                  */
     unsigned int nr_entries;        /* Number of entries in rings & request
                                        array                                */
     struct fsif_front_ring ring;    /* frontend ring (contains shared ring) */
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/list.h
--- a/extras/mini-os/include/list.h     Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/list.h     Mon Aug 11 11:04:52 2008 +0900
@@ -11,23 +11,23 @@
  * using the generic single-entry routines.
  */
 
-struct list_head {
-       struct list_head *next, *prev;
+struct minios_list_head {
+       struct minios_list_head *next, *prev;
 };
 
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
+#define MINIOS_LIST_HEAD_INIT(name) { &(name), &(name) }
 
-#define LIST_HEAD(name) \
-       struct list_head name = LIST_HEAD_INIT(name)
+#define MINIOS_LIST_HEAD(name) \
+       struct minios_list_head name = MINIOS_LIST_HEAD_INIT(name)
 
-#define INIT_LIST_HEAD(ptr) do { \
+#define MINIOS_INIT_LIST_HEAD(ptr) do { \
        (ptr)->next = (ptr); (ptr)->prev = (ptr); \
 } while (0)
 
-#define list_top(head, type, member)                                     \
+#define minios_list_top(head, type, member)                                    
  \
 ({                                                                       \
-       struct list_head *_head = (head);                                 \
-       list_empty(_head) ? NULL : list_entry(_head->next, type, member); \
+       struct minios_list_head *_head = (head);                                
  \
+       minios_list_empty(_head) ? NULL : minios_list_entry(_head->next, type, 
member); \
 })
 
 /*
@@ -36,9 +36,9 @@ struct list_head {
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static __inline__ void __list_add(struct list_head * new,
-       struct list_head * prev,
-       struct list_head * next)
+static __inline__ void __minios_list_add(struct minios_list_head * new,
+       struct minios_list_head * prev,
+       struct minios_list_head * next)
 {
        next->prev = new;
        new->next = next;
@@ -47,29 +47,29 @@ static __inline__ void __list_add(struct
 }
 
 /**
- * list_add - add a new entry
+ * minios_list_add - add a new entry
  * @new: new entry to be added
  * @head: list head to add it after
  *
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static __inline__ void list_add(struct list_head *new, struct list_head *head)
+static __inline__ void minios_list_add(struct minios_list_head *new, struct 
minios_list_head *head)
 {
-       __list_add(new, head, head->next);
+       __minios_list_add(new, head, head->next);
 }
 
 /**
- * list_add_tail - add a new entry
+ * minios_list_add_tail - add a new entry
  * @new: new entry to be added
  * @head: list head to add it before
  *
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static __inline__ void list_add_tail(struct list_head *new, struct list_head 
*head)
+static __inline__ void minios_list_add_tail(struct minios_list_head *new, 
struct minios_list_head *head)
 {
-       __list_add(new, head->prev, head);
+       __minios_list_add(new, head->prev, head);
 }
 
 /*
@@ -79,54 +79,54 @@ static __inline__ void list_add_tail(str
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static __inline__ void __list_del(struct list_head * prev,
-                                 struct list_head * next)
+static __inline__ void __minios_list_del(struct minios_list_head * prev,
+                                 struct minios_list_head * next)
 {
        next->prev = prev;
        prev->next = next;
 }
 
 /**
- * list_del - deletes entry from list.
+ * minios_list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in 
an undefined state.
+ * Note: minios_list_empty on entry does not return true after this, the entry 
is in an undefined state.
  */
-static __inline__ void list_del(struct list_head *entry)
+static __inline__ void minios_list_del(struct minios_list_head *entry)
 {
-       __list_del(entry->prev, entry->next);
+       __minios_list_del(entry->prev, entry->next);
 }
 
 /**
- * list_del_init - deletes entry from list and reinitialize it.
+ * minios_list_del_init - deletes entry from list and reinitialize it.
  * @entry: the element to delete from the list.
  */
-static __inline__ void list_del_init(struct list_head *entry)
+static __inline__ void minios_list_del_init(struct minios_list_head *entry)
 {
-       __list_del(entry->prev, entry->next);
-       INIT_LIST_HEAD(entry); 
+       __minios_list_del(entry->prev, entry->next);
+       MINIOS_INIT_LIST_HEAD(entry); 
 }
 
 /**
- * list_empty - tests whether a list is empty
+ * minios_list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static __inline__ int list_empty(struct list_head *head)
+static __inline__ int minios_list_empty(struct minios_list_head *head)
 {
        return head->next == head;
 }
 
 /**
- * list_splice - join two lists
+ * minios_list_splice - join two lists
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static __inline__ void list_splice(struct list_head *list, struct list_head 
*head)
+static __inline__ void minios_list_splice(struct minios_list_head *list, 
struct minios_list_head *head)
 {
-       struct list_head *first = list->next;
+       struct minios_list_head *first = list->next;
 
        if (first != list) {
-               struct list_head *last = list->prev;
-               struct list_head *at = head->next;
+               struct minios_list_head *last = list->prev;
+               struct minios_list_head *at = head->next;
 
                first->prev = head;
                head->next = first;
@@ -137,54 +137,54 @@ static __inline__ void list_splice(struc
 }
 
 /**
- * list_entry - get the struct for this entry
- * @ptr:       the &struct list_head pointer.
+ * minios_list_entry - get the struct for this entry
+ * @ptr:       the &struct minios_list_head pointer.
  * @type:      the type of the struct this is embedded in.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the minios_list_struct within the struct.
  */
-#define list_entry(ptr, type, member) \
+#define minios_list_entry(ptr, type, member) \
        ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
 
 /**
- * list_for_each       -       iterate over a list
- * @pos:       the &struct list_head to use as a loop counter.
+ * minios_list_for_each        -       iterate over a list
+ * @pos:       the &struct minios_list_head to use as a loop counter.
  * @head:      the head for your list.
  */
-#define list_for_each(pos, head) \
+#define minios_list_for_each(pos, head) \
        for (pos = (head)->next; pos != (head); pos = pos->next)
                
 /**
- * list_for_each_safe  -       iterate over a list safe against removal of 
list entry
- * @pos:       the &struct list_head to use as a loop counter.
- * @n:         another &struct list_head to use as temporary storage
+ * minios_list_for_each_safe   -       iterate over a list safe against 
removal of list entry
+ * @pos:       the &struct minios_list_head to use as a loop counter.
+ * @n:         another &struct minios_list_head to use as temporary storage
  * @head:      the head for your list.
  */
-#define list_for_each_safe(pos, n, head) \
+#define minios_list_for_each_safe(pos, n, head) \
        for (pos = (head)->next, n = pos->next; pos != (head); \
                pos = n, n = pos->next)
 
 /**
- * list_for_each_entry -       iterate over list of given type
+ * minios_list_for_each_entry  -       iterate over list of given type
  * @pos:       the type * to use as a loop counter.
  * @head:      the head for your list.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the minios_list_struct within the struct.
  */
-#define list_for_each_entry(pos, head, member)                         \
-       for (pos = list_entry((head)->next, typeof(*pos), member);      \
+#define minios_list_for_each_entry(pos, head, member)                          
\
+       for (pos = minios_list_entry((head)->next, typeof(*pos), member);       
\
             &pos->member != (head);                                    \
-            pos = list_entry(pos->member.next, typeof(*pos), member))
+            pos = minios_list_entry(pos->member.next, typeof(*pos), member))
 
 /**
- * list_for_each_entry_safe - iterate over list of given type safe against 
removal of list entry
+ * minios_list_for_each_entry_safe - iterate over list of given type safe 
against removal of list entry
  * @pos:       the type * to use as a loop counter.
  * @n:         another type * to use as temporary storage
  * @head:      the head for your list.
- * @member:    the name of the list_struct within the struct.
+ * @member:    the name of the minios_list_struct within the struct.
  */
-#define list_for_each_entry_safe(pos, n, head, member)                 \
-       for (pos = list_entry((head)->next, typeof(*pos), member),      \
-               n = list_entry(pos->member.next, typeof(*pos), member); \
+#define minios_list_for_each_entry_safe(pos, n, head, member)                  
\
+       for (pos = minios_list_entry((head)->next, typeof(*pos), member),       
\
+               n = minios_list_entry(pos->member.next, typeof(*pos), member);  
\
             &pos->member != (head);                                    \
-            pos = n, n = list_entry(n->member.next, typeof(*n), member))
+            pos = n, n = minios_list_entry(n->member.next, typeof(*n), member))
 #endif /* _LINUX_LIST_H */
 
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/posix/sys/mman.h
--- a/extras/mini-os/include/posix/sys/mman.h   Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/posix/sys/mman.h   Mon Aug 11 11:04:52 2008 +0900
@@ -14,7 +14,7 @@
 
 #define MAP_FAILED     ((void*)0)
 
-void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t 
offset);
+void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t 
offset) asm("mmap64");
 int munmap(void *start, size_t length);
 #define munlock(addr, len) ((void)addr, (void)len, 0)
 #define mlock(addr, len) ((void)addr, (void)len, 0)
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/posix/sys/stat.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/extras/mini-os/include/posix/sys/stat.h   Mon Aug 11 11:04:52 2008 +0900
@@ -0,0 +1,7 @@
+#ifndef _POSIX_SYS_STAT_H
+#define _POSIX_SYS_STAT_H
+
+#include_next <sys/stat.h>
+int fstat(int fd, struct stat *buf) asm("fstat64");
+
+#endif /* _POSIX_SYS_STAT_H */
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/sched.h
--- a/extras/mini-os/include/sched.h    Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/sched.h    Mon Aug 11 11:04:52 2008 +0900
@@ -19,7 +19,7 @@ struct thread
 #else /* !defined(__ia64__) */
     thread_regs_t regs;
 #endif /* !defined(__ia64__) */
-    struct list_head thread_list;
+    struct minios_list_head thread_list;
     u32 flags;
     s_time_t wakeup_time;
 #ifdef HAVE_LIBC
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/semaphore.h
--- a/extras/mini-os/include/semaphore.h        Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/semaphore.h        Mon Aug 11 11:04:52 2008 +0900
@@ -21,7 +21,7 @@ struct rw_semaphore {
 struct rw_semaphore {
        signed long             count;
        spinlock_t              wait_lock;
-       struct list_head        wait_list;
+       struct minios_list_head wait_list;
        int                     debug;
 };
 
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/wait.h
--- a/extras/mini-os/include/wait.h     Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/wait.h     Mon Aug 11 11:04:52 2008 +0900
@@ -8,42 +8,42 @@
 #define DEFINE_WAIT(name)                               \
 struct wait_queue name = {                              \
     .thread       = current,                            \
-    .thread_list  = LIST_HEAD_INIT((name).thread_list), \
+    .thread_list  = MINIOS_LIST_HEAD_INIT((name).thread_list), \
 }
 
 
 static inline void init_waitqueue_head(struct wait_queue_head *h)
 {
-  INIT_LIST_HEAD(&h->thread_list);
+  MINIOS_INIT_LIST_HEAD(&h->thread_list);
 }
 
 static inline void init_waitqueue_entry(struct wait_queue *q, struct thread 
*thread)
 {
     q->thread = thread;
-    INIT_LIST_HEAD(&q->thread_list);
+    MINIOS_INIT_LIST_HEAD(&q->thread_list);
 }
 
 
 static inline void add_wait_queue(struct wait_queue_head *h, struct wait_queue 
*q)
 {
-    if (list_empty(&q->thread_list))
-        list_add(&q->thread_list, &h->thread_list);   
+    if (minios_list_empty(&q->thread_list))
+        minios_list_add(&q->thread_list, &h->thread_list);   
 }
 
 static inline void remove_wait_queue(struct wait_queue *q)
 {
-    list_del(&q->thread_list);
+    minios_list_del(&q->thread_list);
 }
 
 static inline void wake_up(struct wait_queue_head *head)
 {
     unsigned long flags;
-    struct list_head *tmp, *next;
+    struct minios_list_head *tmp, *next;
     local_irq_save(flags);
-    list_for_each_safe(tmp, next, &head->thread_list)
+    minios_list_for_each_safe(tmp, next, &head->thread_list)
     {
          struct wait_queue *curr;
-         curr = list_entry(tmp, struct wait_queue, thread_list);
+         curr = minios_list_entry(tmp, struct wait_queue, thread_list);
          wake(curr->thread);
     }
     local_irq_restore(flags);
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/include/waittypes.h
--- a/extras/mini-os/include/waittypes.h        Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/include/waittypes.h        Mon Aug 11 11:04:52 2008 +0900
@@ -7,13 +7,13 @@ struct wait_queue
 struct wait_queue
 {
     struct thread *thread;
-    struct list_head thread_list;
+    struct minios_list_head thread_list;
 };
 
 struct wait_queue_head
 {
     /* TODO - lock required? */
-    struct list_head thread_list;
+    struct minios_list_head thread_list;
 };
 
 #define DECLARE_WAIT_QUEUE_HEAD(name) \
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c  Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/lib/sys.c  Mon Aug 11 11:04:52 2008 +0900
@@ -204,9 +204,6 @@ int open(const char *pathname, int flags
     files[fd].file.offset = 0;
     return fd;
 }
-#if defined(__x86_64__) || defined(__ia64__)
-__typeof__(open) open64 __attribute__((__alias__("open")));
-#endif
 
 int isatty(int fd)
 {
@@ -347,9 +344,6 @@ off_t lseek(int fd, off_t offset, int wh
     }
     return files[fd].file.offset;
 }
-#if defined(__x86_64__) || defined(__ia64__)
-__typeof__(lseek) lseek64 __attribute__((__alias__("lseek")));
-#endif
 
 int fsync(int fd) {
     switch (files[fd].type) {
@@ -1120,9 +1114,6 @@ void *mmap(void *start, size_t length, i
         return map_frames_ex(&zero, n, 0, 0, 1, DOMID_SELF, 0, 0);
     } else ASSERT(0);
 }
-#if defined(__x86_64__) || defined(__ia64__)
-__typeof__(mmap) mmap64 __attribute__((__alias__("mmap")));
-#endif
 
 int munmap(void *start, size_t length)
 {
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/lib/xmalloc.c
--- a/extras/mini-os/lib/xmalloc.c      Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/lib/xmalloc.c      Mon Aug 11 11:04:52 2008 +0900
@@ -44,14 +44,14 @@
 #include <xmalloc.h>
 
 #ifndef HAVE_LIBC
-static LIST_HEAD(freelist);
+static MINIOS_LIST_HEAD(freelist);
 /* static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED; */
 
 struct xmalloc_hdr
 {
     /* Total including this hdr, unused padding and second hdr. */
     size_t size;
-    struct list_head freelist;
+    struct minios_list_head freelist;
 } __cacheline_aligned;
 
 /* Unused padding data between the two hdrs. */
@@ -82,7 +82,7 @@ static void maybe_split(struct xmalloc_h
         extra = (struct xmalloc_hdr *)((unsigned long)hdr + size);
         extra->size = leftover;
         /* spin_lock_irqsave(&freelist_lock, flags); */
-        list_add(&extra->freelist, &freelist);
+        minios_list_add(&extra->freelist, &freelist);
         /* spin_unlock_irqrestore(&freelist_lock, flags); */
     }
     else
@@ -155,14 +155,14 @@ void *_xmalloc(size_t size, size_t align
 
     /* Search free list. */
     /* spin_lock_irqsave(&freelist_lock, flags); */
-    list_for_each_entry_safe( i, tmp, &freelist, freelist )
+    minios_list_for_each_entry_safe( i, tmp, &freelist, freelist )
     {
         data_begin = align_up((uintptr_t)i + hdr_size, align);
 
         if ( data_begin + size > (uintptr_t)i + i->size )
             continue;
 
-        list_del(&i->freelist);
+        minios_list_del(&i->freelist);
         /* spin_unlock_irqrestore(&freelist_lock, flags); */
 
         uintptr_t size_before = (data_begin - hdr_size) - (uintptr_t)i;
@@ -173,7 +173,7 @@ void *_xmalloc(size_t size, size_t align
             new_i->size = i->size - size_before;
             i->size = size_before;
             /* spin_lock_irqsave(&freelist_lock, flags); */
-            list_add(&i->freelist, &freelist);
+            minios_list_add(&i->freelist, &freelist);
             /* spin_unlock_irqrestore(&freelist_lock, flags); */
             i = new_i;
         }
@@ -231,7 +231,7 @@ void xfree(const void *p)
 
     /* Merge with other free block, or put in list. */
     /* spin_lock_irqsave(&freelist_lock, flags); */
-    list_for_each_entry_safe( i, tmp, &freelist, freelist )
+    minios_list_for_each_entry_safe( i, tmp, &freelist, freelist )
     {
         unsigned long _i   = (unsigned long)i;
         unsigned long _hdr = (unsigned long)hdr;
@@ -243,7 +243,7 @@ void xfree(const void *p)
         /* We follow this block?  Swallow it. */
         if ( (_i + i->size) == _hdr )
         {
-            list_del(&i->freelist);
+            minios_list_del(&i->freelist);
             i->size += hdr->size;
             hdr = i;
         }
@@ -251,7 +251,7 @@ void xfree(const void *p)
         /* We precede this block? Swallow it. */
         if ( (_hdr + hdr->size) == _i )
         {
-            list_del(&i->freelist);
+            minios_list_del(&i->freelist);
             hdr->size += i->size;
         }
     }
@@ -268,7 +268,7 @@ void xfree(const void *p)
     }
     else
     {
-        list_add(&hdr->freelist, &freelist);
+        minios_list_add(&hdr->freelist, &freelist);
     }
 
     /* spin_unlock_irqrestore(&freelist_lock, flags); */
diff -r b086089f4643 -r d24bc5f549ba extras/mini-os/sched.c
--- a/extras/mini-os/sched.c    Mon Aug 11 10:59:39 2008 +0900
+++ b/extras/mini-os/sched.c    Mon Aug 11 11:04:52 2008 +0900
@@ -55,18 +55,18 @@
 #endif
 
 struct thread *idle_thread = NULL;
-LIST_HEAD(exited_threads);
+MINIOS_LIST_HEAD(exited_threads);
 static int threads_started;
 
 struct thread *main_thread;
 
 void inline print_runqueue(void)
 {
-    struct list_head *it;
+    struct minios_list_head *it;
     struct thread *th;
-    list_for_each(it, &idle_thread->thread_list)
-    {
-        th = list_entry(it, struct thread, thread_list);
+    minios_list_for_each(it, &idle_thread->thread_list)
+    {
+        th = minios_list_entry(it, struct thread, thread_list);
         printk("   Thread \"%s\", runnable=%d\n", th->name, is_runnable(th));
     }
     printk("\n");
@@ -75,7 +75,7 @@ void schedule(void)
 void schedule(void)
 {
     struct thread *prev, *next, *thread;
-    struct list_head *iterator, *next_iterator;
+    struct minios_list_head *iterator, *next_iterator;
     unsigned long flags;
 
     prev = current;
@@ -97,9 +97,9 @@ void schedule(void)
         s_time_t now = NOW();
         s_time_t min_wakeup_time = now + SECONDS(10);
         next = NULL;   
-        list_for_each_safe(iterator, next_iterator, &idle_thread->thread_list)
+        minios_list_for_each_safe(iterator, next_iterator, 
&idle_thread->thread_list)
         {
-            thread = list_entry(iterator, struct thread, thread_list);
+            thread = minios_list_entry(iterator, struct thread, thread_list);
             if (!is_runnable(thread) && thread->wakeup_time != 0LL)
             {
                 if (thread->wakeup_time <= now)
@@ -111,8 +111,8 @@ void schedule(void)
             {
                 next = thread;
                 /* Put this thread on the end of the list */
-                list_del(&thread->thread_list);
-                list_add_tail(&thread->thread_list, &idle_thread->thread_list);
+                minios_list_del(&thread->thread_list);
+                minios_list_add_tail(&thread->thread_list, 
&idle_thread->thread_list);
                 break;
             }
         }
@@ -128,12 +128,12 @@ void schedule(void)
        inturrupted at the return instruction. And therefore at safe point. */
     if(prev != next) switch_threads(prev, next);
 
-    list_for_each_safe(iterator, next_iterator, &exited_threads)
-    {
-        thread = list_entry(iterator, struct thread, thread_list);
+    minios_list_for_each_safe(iterator, next_iterator, &exited_threads)
+    {
+        thread = minios_list_entry(iterator, struct thread, thread_list);
         if(thread != prev)
         {
-            list_del(&thread->thread_list);
+            minios_list_del(&thread->thread_list);
             free_pages(thread->stack, STACK_SIZE_PAGE_ORDER);
             xfree(thread);
         }
@@ -155,7 +155,7 @@ struct thread* create_thread(char *name,
     set_runnable(thread);
     local_irq_save(flags);
     if(idle_thread != NULL) {
-        list_add_tail(&thread->thread_list, &idle_thread->thread_list); 
+        minios_list_add_tail(&thread->thread_list, &idle_thread->thread_list); 
     } else if(function != idle_thread_fn)
     {
         printk("BUG: Not allowed to create thread before initialising 
scheduler.\n");
@@ -208,10 +208,10 @@ void exit_thread(void)
     printk("Thread \"%s\" exited.\n", thread->name);
     local_irq_save(flags);
     /* Remove from the thread list */
-    list_del(&thread->thread_list);
+    minios_list_del(&thread->thread_list);
     clear_runnable(thread);
     /* Put onto exited list */
-    list_add(&thread->thread_list, &exited_threads);
+    minios_list_add(&thread->thread_list, &exited_threads);
     local_irq_restore(flags);
     /* Schedule will free the resources */
     while(1)
@@ -296,6 +296,6 @@ void init_sched(void)
     _REENT_INIT_PTR((&callback_reent))
 #endif
     idle_thread = create_thread("Idle", idle_thread_fn, NULL);
-    INIT_LIST_HEAD(&idle_thread->thread_list);
-}
-
+    MINIOS_INIT_LIST_HEAD(&idle_thread->thread_list);
+}
+
diff -r b086089f4643 -r d24bc5f549ba stubdom/newlib.patch
--- a/stubdom/newlib.patch      Mon Aug 11 10:59:39 2008 +0900
+++ b/stubdom/newlib.patch      Mon Aug 11 11:04:52 2008 +0900
@@ -627,3 +627,123 @@ diff -u -p -r1.1 memcpy.S
  
  #ifdef _I386MACH_NEED_SOTYPE_FUNCTION
  #define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
+
+
+We want to have a 64bit offsets libc even on 32bit platforms.
+
+--- ./newlib/configure.host.orig       2008-08-07 16:01:17.801946000 +0100
++++ ./newlib/configure.host    2008-08-07 16:01:34.181064000 +0100
+@@ -317,6 +317,8 @@
+     oext=lo
+     lpfx=
+     aext=la ;;
++  i[34567]86-xen-elf)
++    stdio64_dir=stdio64 ;;
+   *) ;; #shared library not supported for ${host}
+ esac
+ 
+--- newlib/libc/include/sys/_types.h.orig      2008-08-07 15:22:44.925008000 
+0100
++++ newlib/libc/include/sys/_types.h   2008-08-07 15:22:50.824044000 +0100
+@@ -13,8 +13,12 @@
+ #include <sys/lock.h>
+ 
+ #ifndef __off_t_defined
++#ifdef __MINIOS__
++typedef long long _off_t;
++#else
+ typedef long _off_t;
+ #endif
++#endif
+ 
+ #if defined(__rtems__)
+ /* device numbers are 32-bit major and and 32-bit minor */
+--- ./newlib/libc/include/sys/config.h.orig    2008-08-07 14:43:25.915866000 
+0100
++++ ./newlib/libc/include/sys/config.h 2008-08-07 14:44:13.508154000 +0100
+@@ -69,6 +69,10 @@
+ /* we use some glibc header files so turn on glibc large file feature */
+ #define _LARGEFILE64_SOURCE 1
+ #endif
++#ifdef __MINIOS__
++#define __LARGE64_FILES 1
++#define _LARGEFILE64_SOURCE 1
++#endif
+ #endif
+ 
+ #ifndef __DYNAMIC_REENT__
+--- ./newlib/libc/include/sys/_default_fcntl.h.orig    2008-08-07 
15:08:22.377836000 +0100
++++ ./newlib/libc/include/sys/_default_fcntl.h 2008-08-07 15:08:31.651890000 
+0100
+@@ -170,7 +170,11 @@
+ /* Provide _<systemcall> prototypes for functions provided by some versions
+    of newlib.  */
+ #ifdef _COMPILING_NEWLIB
+-extern int _open _PARAMS ((const char *, int, ...));
++extern int _open _PARAMS ((const char *, int, ...))
++#ifdef __MINIOS__
++    asm("open64")
++#endif
++    ;
+ extern int _fcntl _PARAMS ((int, int, ...));
+ #ifdef __LARGE64_FILES
+ extern int _open64 _PARAMS ((const char *, int, ...));
+--- ./newlib/libc/include/sys/unistd.h.orig    2008-08-07 15:09:36.449280000 
+0100
++++ ./newlib/libc/include/sys/unistd.h 2008-08-07 15:09:51.210370000 +0100
+@@ -101,7 +101,11 @@
+ int     _EXFUN(link, (const char *__path1, const char *__path2 ));
+ int   _EXFUN(nice, (int __nice_value ));
+ #if !defined(__INSIDE_CYGWIN__)
+-off_t   _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ));
++off_t   _EXFUN(lseek, (int __fildes, off_t __offset, int __whence ))
++#ifdef __MINIOS__
++    asm("lseek64")
++#endif
++    ;
+ #endif
+ #if defined(__SPU__)
+ #define F_ULOCK       0
+--- ./newlib/libc/include/sys/stat.h.orig      2008-08-07 16:08:50.495116000 
+0100
++++ ./newlib/libc/include/sys/stat.h   2008-08-07 16:10:21.799753000 +0100
+@@ -49,6 +49,9 @@
+   long        st_spare4[2];
+ #endif
+ };
++#ifdef __MINIOS__
++#define stat64 stat
++#endif
+ #endif
+ 
+ #define       _IFMT           0170000 /* type of file */
+@@ -132,7 +135,11 @@
+ /* Provide prototypes for most of the _<systemcall> names that are
+    provided in newlib for some compilers.  */
+ #ifdef _COMPILING_NEWLIB
+-int   _EXFUN(_fstat,( int __fd, struct stat *__sbuf ));
++int   _EXFUN(_fstat,( int __fd, struct stat *__sbuf ))
++#ifdef __MINIOS__
++    asm("fstat64")
++#endif
++    ;
+ int   _EXFUN(_stat,( const char *__path, struct stat *__sbuf ));
+ #ifdef __LARGE64_FILES
+ struct stat64;
+--- ./newlib/libc/include/_syslist.h.orig      2008-08-07 16:24:19.122605000 
+0100
++++ ./newlib/libc/include/_syslist.h   2008-08-07 16:24:21.548628000 +0100
+@@ -14,6 +14,7 @@
+ #define _kill kill
+ #define _link link
+ #define _lseek lseek
++#define _lseek64 lseek64
+ #define _open open
+ #define _read read
+ #define _sbrk sbrk
+--- newlib/libc/include/reent.h.orig   2008-08-07 16:28:49.846502000 +0100
++++ newlib/libc/include/reent.h        2008-08-07 16:29:02.096586000 +0100
+@@ -87,6 +87,9 @@
+ #if defined(__CYGWIN__) && defined(_COMPILING_NEWLIB)
+ #define stat64 __stat64
+ #endif
++#if defined(__MINIOS__)
++#define stat64 stat
++#endif
+ 
+ struct stat64;
+ 
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/audio/audio.c
--- a/tools/ioemu/audio/audio.c Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/audio/audio.c Mon Aug 11 11:04:52 2008 +0900
@@ -707,8 +707,8 @@ static void audio_detach_capture (HWVoic
             sw->rate = NULL;
         }
 
-        QEMU_LIST_REMOVE (sw, entries);
-        QEMU_LIST_REMOVE (sc, entries);
+        LIST_REMOVE (sw, entries);
+        LIST_REMOVE (sc, entries);
         qemu_free (sc);
         if (was_active) {
             /* We have removed soft voice from the capture:
@@ -751,8 +751,8 @@ static int audio_attach_capture (AudioSt
             qemu_free (sw);
             return -1;
         }
-        QEMU_LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
-        QEMU_LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
+        LIST_INSERT_HEAD (&hw_cap->sw_head, sw, entries);
+        LIST_INSERT_HEAD (&hw->cap_head, sc, entries);
 #ifdef DEBUG_CAPTURE
         asprintf (&sw->name, "for %p %d,%d,%d",
                   hw, sw->info.freq, sw->info.bits, sw->info.nchannels);
@@ -1620,12 +1620,12 @@ void AUD_register_card (AudioState *s, c
     card->audio = s;
     card->name = qemu_strdup (name);
     memset (&card->entries, 0, sizeof (card->entries));
-    QEMU_LIST_INSERT_HEAD (&s->card_head, card, entries);
+    LIST_INSERT_HEAD (&s->card_head, card, entries);
 }
 
 void AUD_remove_card (QEMUSoundCard *card)
 {
-    QEMU_LIST_REMOVE (card, entries);
+    LIST_REMOVE (card, entries);
     card->audio = NULL;
     qemu_free (card->name);
 }
@@ -1637,9 +1637,9 @@ AudioState *AUD_init (void)
     const char *drvname;
     AudioState *s = &glob_audio_state;
 
-    QEMU_LIST_INIT (&s->hw_head_out);
-    QEMU_LIST_INIT (&s->hw_head_in);
-    QEMU_LIST_INIT (&s->cap_head);
+    LIST_INIT (&s->hw_head_out);
+    LIST_INIT (&s->hw_head_in);
+    LIST_INIT (&s->cap_head);
     atexit (audio_atexit);
 
     s->ts = qemu_new_timer (vm_clock, audio_timer, s);
@@ -1731,7 +1731,7 @@ AudioState *AUD_init (void)
         return NULL;
     }
 
-    QEMU_LIST_INIT (&s->card_head);
+    LIST_INIT (&s->card_head);
     register_savevm ("audio", 0, 1, audio_save, audio_load, s);
     qemu_mod_timer (s->ts, qemu_get_clock (vm_clock) + conf.period.ticks);
     return s;
@@ -1769,7 +1769,7 @@ CaptureVoiceOut *AUD_add_capture (
 
     cap = audio_pcm_capture_find_specific (s, as);
     if (cap) {
-        QEMU_LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
+        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
         return cap;
     }
     else {
@@ -1784,8 +1784,8 @@ CaptureVoiceOut *AUD_add_capture (
         }
 
         hw = &cap->hw;
-        QEMU_LIST_INIT (&hw->sw_head);
-        QEMU_LIST_INIT (&cap->cb_head);
+        LIST_INIT (&hw->sw_head);
+        LIST_INIT (&cap->cb_head);
 
         /* XXX find a more elegant way */
         hw->samples = 4096 * 4;
@@ -1813,8 +1813,8 @@ CaptureVoiceOut *AUD_add_capture (
             [hw->info.swap_endianness]
             [hw->info.bits == 16];
 
-        QEMU_LIST_INSERT_HEAD (&s->cap_head, cap, entries);
-        QEMU_LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
+        LIST_INSERT_HEAD (&s->cap_head, cap, entries);
+        LIST_INSERT_HEAD (&cap->cb_head, cb, entries);
 
         hw = NULL;
         while ((hw = audio_pcm_hw_find_any_out (s, hw))) {
@@ -1840,7 +1840,7 @@ void AUD_del_capture (CaptureVoiceOut *c
     for (cb = cap->cb_head.lh_first; cb; cb = cb->entries.le_next) {
         if (cb->opaque == cb_opaque) {
             cb->ops.destroy (cb_opaque);
-            QEMU_LIST_REMOVE (cb, entries);
+            LIST_REMOVE (cb, entries);
             qemu_free (cb);
 
             if (!cap->cb_head.lh_first) {
@@ -1857,12 +1857,12 @@ void AUD_del_capture (CaptureVoiceOut *c
                         st_rate_stop (sw->rate);
                         sw->rate = NULL;
                     }
-                    QEMU_LIST_REMOVE (sw, entries);
-                    QEMU_LIST_REMOVE (sc, entries);
+                    LIST_REMOVE (sw, entries);
+                    LIST_REMOVE (sc, entries);
                     qemu_free (sc);
                     sw = sw1;
                 }
-                QEMU_LIST_REMOVE (cap, entries);
+                LIST_REMOVE (cap, entries);
                 qemu_free (cap);
             }
             return;
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/audio/audio.h
--- a/tools/ioemu/audio/audio.h Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/audio/audio.h Mon Aug 11 11:04:52 2008 +0900
@@ -68,7 +68,7 @@ typedef struct CaptureState {
 typedef struct CaptureState {
     void *opaque;
     struct capture_ops ops;
-    QEMU_LIST_ENTRY (CaptureState) entries;
+    LIST_ENTRY (CaptureState) entries;
 } CaptureState;
 
 typedef struct AudioState AudioState;
@@ -79,7 +79,7 @@ typedef struct QEMUSoundCard {
 typedef struct QEMUSoundCard {
     AudioState *audio;
     char *name;
-    QEMU_LIST_ENTRY (QEMUSoundCard) entries;
+    LIST_ENTRY (QEMUSoundCard) entries;
 } QEMUSoundCard;
 
 typedef struct QEMUAudioTimeStamp {
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/audio/audio_int.h
--- a/tools/ioemu/audio/audio_int.h     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/audio/audio_int.h     Mon Aug 11 11:04:52 2008 +0900
@@ -79,10 +79,10 @@ typedef struct HWVoiceOut {
     st_sample_t *mix_buf;
 
     int samples;
-    QEMU_LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
-    QEMU_LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
-    struct audio_pcm_ops *pcm_ops;
-    QEMU_LIST_ENTRY (HWVoiceOut) entries;
+    LIST_HEAD (sw_out_listhead, SWVoiceOut) sw_head;
+    LIST_HEAD (sw_cap_listhead, SWVoiceCap) cap_head;
+    struct audio_pcm_ops *pcm_ops;
+    LIST_ENTRY (HWVoiceOut) entries;
 } HWVoiceOut;
 
 typedef struct HWVoiceIn {
@@ -98,9 +98,9 @@ typedef struct HWVoiceIn {
     st_sample_t *conv_buf;
 
     int samples;
-    QEMU_LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
-    struct audio_pcm_ops *pcm_ops;
-    QEMU_LIST_ENTRY (HWVoiceIn) entries;
+    LIST_HEAD (sw_in_listhead, SWVoiceIn) sw_head;
+    struct audio_pcm_ops *pcm_ops;
+    LIST_ENTRY (HWVoiceIn) entries;
 } HWVoiceIn;
 
 struct SWVoiceOut {
@@ -116,7 +116,7 @@ struct SWVoiceOut {
     char *name;
     volume_t vol;
     struct audio_callback callback;
-    QEMU_LIST_ENTRY (SWVoiceOut) entries;
+    LIST_ENTRY (SWVoiceOut) entries;
 };
 
 struct SWVoiceIn {
@@ -131,7 +131,7 @@ struct SWVoiceIn {
     char *name;
     volume_t vol;
     struct audio_callback callback;
-    QEMU_LIST_ENTRY (SWVoiceIn) entries;
+    LIST_ENTRY (SWVoiceIn) entries;
 };
 
 struct audio_driver {
@@ -165,20 +165,20 @@ struct capture_callback {
 struct capture_callback {
     struct audio_capture_ops ops;
     void *opaque;
-    QEMU_LIST_ENTRY (capture_callback) entries;
+    LIST_ENTRY (capture_callback) entries;
 };
 
 struct CaptureVoiceOut {
     HWVoiceOut hw;
     void *buf;
-    QEMU_LIST_HEAD (cb_listhead, capture_callback) cb_head;
-    QEMU_LIST_ENTRY (CaptureVoiceOut) entries;
+    LIST_HEAD (cb_listhead, capture_callback) cb_head;
+    LIST_ENTRY (CaptureVoiceOut) entries;
 };
 
 struct SWVoiceCap {
     SWVoiceOut sw;
     CaptureVoiceOut *cap;
-    QEMU_LIST_ENTRY (SWVoiceCap) entries;
+    LIST_ENTRY (SWVoiceCap) entries;
 };
 
 struct AudioState {
@@ -186,10 +186,10 @@ struct AudioState {
     void *drv_opaque;
 
     QEMUTimer *ts;
-    QEMU_LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
-    QEMU_LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
-    QEMU_LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
-    QEMU_LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
+    LIST_HEAD (card_listhead, QEMUSoundCard) card_head;
+    LIST_HEAD (hw_in_listhead, HWVoiceIn) hw_head_in;
+    LIST_HEAD (hw_out_listhead, HWVoiceOut) hw_head_out;
+    LIST_HEAD (cap_listhead, CaptureVoiceOut) cap_head;
     int nb_hw_voices_out;
     int nb_hw_voices_in;
 };
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/audio/audio_template.h
--- a/tools/ioemu/audio/audio_template.h        Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/audio/audio_template.h        Mon Aug 11 11:04:52 2008 +0900
@@ -186,12 +186,12 @@ static void glue (audio_pcm_sw_fini_, TY
 
 static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
 {
-    QEMU_LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
+    LIST_INSERT_HEAD (&hw->sw_head, sw, entries);
 }
 
 static void glue (audio_pcm_hw_del_sw_, TYPE) (SW *sw)
 {
-    QEMU_LIST_REMOVE (sw, entries);
+    LIST_REMOVE (sw, entries);
 }
 
 static void glue (audio_pcm_hw_gc_, TYPE) (AudioState *s, HW **hwp)
@@ -202,7 +202,7 @@ static void glue (audio_pcm_hw_gc_, TYPE
 #ifdef DAC
         audio_detach_capture (hw);
 #endif
-        QEMU_LIST_REMOVE (hw, entries);
+        LIST_REMOVE (hw, entries);
         glue (s->nb_hw_voices_, TYPE) += 1;
         glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
         glue (hw->pcm_ops->fini_, TYPE) (hw);
@@ -267,9 +267,9 @@ static HW *glue (audio_pcm_hw_add_new_, 
     }
 
     hw->pcm_ops = drv->pcm_ops;
-    QEMU_LIST_INIT (&hw->sw_head);
-#ifdef DAC
-    QEMU_LIST_INIT (&hw->cap_head);
+    LIST_INIT (&hw->sw_head);
+#ifdef DAC
+    LIST_INIT (&hw->cap_head);
 #endif
     if (glue (hw->pcm_ops->init_, TYPE) (hw, as)) {
         goto err0;
@@ -294,7 +294,7 @@ static HW *glue (audio_pcm_hw_add_new_, 
         goto err1;
     }
 
-    QEMU_LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
+    LIST_INSERT_HEAD (&s->glue (hw_head_, TYPE), hw, entries);
     glue (s->nb_hw_voices_, TYPE) -= 1;
 #ifdef DAC
     audio_attach_capture (s, hw);
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/audio/sys-queue.h
--- a/tools/ioemu/audio/sys-queue.h     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/audio/sys-queue.h     Mon Aug 11 11:04:52 2008 +0900
@@ -64,12 +64,12 @@
 /*
  * List definitions.
  */
-#define QEMU_LIST_HEAD(name, type)                                     \
+#define LIST_HEAD(name, type)                                  \
 struct name {                                                          \
        struct type *lh_first;  /* first element */                     \
 }
 
-#define QEMU_LIST_ENTRY(type)                                          \
+#define LIST_ENTRY(type)                                               \
 struct {                                                               \
        struct type *le_next;   /* next element */                      \
        struct type **le_prev;  /* address of previous next element */  \
@@ -78,11 +78,11 @@ struct {                                                    
        \
 /*
  * List functions.
  */
-#define        QEMU_LIST_INIT(head) {                                          
\
+#define        LIST_INIT(head) {                                               
\
        (head)->lh_first = NULL;                                        \
 }
 
-#define QEMU_LIST_INSERT_AFTER(listelm, elm, field) {                  \
+#define LIST_INSERT_AFTER(listelm, elm, field) {                       \
        if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
                (listelm)->field.le_next->field.le_prev =               \
                    &(elm)->field.le_next;                              \
@@ -90,14 +90,14 @@ struct {                                                    
        \
        (elm)->field.le_prev = &(listelm)->field.le_next;               \
 }
 
-#define QEMU_LIST_INSERT_HEAD(head, elm, field) {                      \
+#define LIST_INSERT_HEAD(head, elm, field) {                   \
        if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
                (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
        (head)->lh_first = (elm);                                       \
        (elm)->field.le_prev = &(head)->lh_first;                       \
 }
 
-#define QEMU_LIST_REMOVE(elm, field) {                                 \
+#define LIST_REMOVE(elm, field) {                                      \
        if ((elm)->field.le_next != NULL)                               \
                (elm)->field.le_next->field.le_prev =                   \
                    (elm)->field.le_prev;                               \
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/block-vbd.c
--- a/tools/ioemu/block-vbd.c   Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/block-vbd.c   Mon Aug 11 11:04:52 2008 +0900
@@ -50,10 +50,10 @@ typedef struct BDRVVbdState {
     struct blkfront_dev *dev;
     int fd;
     struct blkfront_info info;
-    QEMU_LIST_ENTRY(BDRVVbdState) list;
+    LIST_ENTRY(BDRVVbdState) list;
 } BDRVVbdState;
 
-QEMU_LIST_HEAD(, BDRVVbdState) vbds;
+LIST_HEAD(, BDRVVbdState) vbds;
 
 static int vbd_probe(const uint8_t *buf, int buf_size, const char *filename)
 {
@@ -90,7 +90,7 @@ static int vbd_open(BlockDriverState *bs
     s->fd = blkfront_open(s->dev);
     qemu_set_fd_handler(s->fd, vbd_io_completed, NULL, s);
 
-    QEMU_LIST_INSERT_HEAD(&vbds, s, list);
+    LIST_INSERT_HEAD(&vbds, s, list);
 
     return 0;
 }
@@ -302,7 +302,7 @@ static void vbd_close(BlockDriverState *
         close(s->fd);
         s->fd = -1;
     }
-    QEMU_LIST_REMOVE(s, list);
+    LIST_REMOVE(s, list);
 }
 
 static int64_t  vbd_getlength(BlockDriverState *bs)
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/hw/pass-through.c
--- a/tools/ioemu/hw/pass-through.c     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/hw/pass-through.c     Mon Aug 11 11:04:52 2008 +0900
@@ -1644,7 +1644,7 @@ static int pt_config_reg_init(struct pt_
         reg_entry->data = data;
     }
     /* list add register entry */
-    QEMU_LIST_INSERT_HEAD(&reg_grp->reg_tbl_head, reg_entry, entries);
+    LIST_INSERT_HEAD(&reg_grp->reg_tbl_head, reg_entry, entries);
 
 out:
     return err;
@@ -1659,7 +1659,7 @@ static int pt_config_init(struct pt_dev 
     int i, j, err = 0;
 
     /* initialize register group list */
-    QEMU_LIST_INIT(&ptdev->reg_grp_tbl_head);
+    LIST_INIT(&ptdev->reg_grp_tbl_head);
 
     /* initialize register group */
     for (i=0; pt_emu_reg_grp_tbl[i].grp_size != 0; i++)
@@ -1682,12 +1682,12 @@ static int pt_config_init(struct pt_dev 
         }
 
         /* initialize register group entry */
-        QEMU_LIST_INIT(&reg_grp_entry->reg_tbl_head);
+        LIST_INIT(&reg_grp_entry->reg_tbl_head);
 
         /* need to declare here, to enable searching Cap Ptr reg 
          * (which is in the same reg group) when initializing Status reg 
          */
-        QEMU_LIST_INSERT_HEAD(&ptdev->reg_grp_tbl_head, reg_grp_entry, 
entries);
+        LIST_INSERT_HEAD(&ptdev->reg_grp_tbl_head, reg_grp_entry, entries);
 
         reg_grp_entry->base_offset = reg_grp_offset;
         reg_grp_entry->reg_grp = 
@@ -1740,11 +1740,11 @@ static void pt_config_delete(struct pt_d
         /* free all register entry */
         while ((reg_entry = reg_grp_entry->reg_tbl_head.lh_first) != NULL)
         {
-            QEMU_LIST_REMOVE(reg_entry, entries);
+            LIST_REMOVE(reg_entry, entries);
             qemu_free(reg_entry);
         }
 
-        QEMU_LIST_REMOVE(reg_grp_entry, entries);
+        LIST_REMOVE(reg_grp_entry, entries);
         qemu_free(reg_grp_entry);
     }
 }
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/hw/pass-through.h
--- a/tools/ioemu/hw/pass-through.h     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/hw/pass-through.h     Mon Aug 11 11:04:52 2008 +0900
@@ -136,7 +136,7 @@ struct pt_dev {
     PCIDevice dev;
     struct pci_dev *pci_dev;                    /* libpci struct */
     struct pt_region bases[PCI_NUM_REGIONS];    /* Access regions */
-    QEMU_LIST_HEAD (reg_grp_tbl_listhead, pt_reg_grp_tbl) reg_grp_tbl_head;
+    LIST_HEAD (reg_grp_tbl_listhead, pt_reg_grp_tbl) reg_grp_tbl_head;
                                                 /* emul reg group list */
     struct pt_msi_info *msi;                    /* MSI virtualization */
     struct pt_msix_info *msix;                  /* MSI-X virtualization */
@@ -163,7 +163,7 @@ int pt_init(PCIBus * e_bus, char * direc
 /* emul reg group management table */
 struct pt_reg_grp_tbl {
     /* emul reg group list */
-    QEMU_LIST_ENTRY (pt_reg_grp_tbl) entries;
+    LIST_ENTRY (pt_reg_grp_tbl) entries;
     /* emul reg group info table */
     struct pt_reg_grp_info_tbl *reg_grp;
     /* emul reg group base offset */
@@ -171,7 +171,7 @@ struct pt_reg_grp_tbl {
     /* emul reg group size */
     uint8_t size;
     /* emul reg management table list */
-    QEMU_LIST_HEAD (reg_tbl_listhead, pt_reg_tbl) reg_tbl_head;
+    LIST_HEAD (reg_tbl_listhead, pt_reg_tbl) reg_tbl_head;
 };
 
 /* emul reg group size initialize method */
@@ -195,7 +195,7 @@ struct pt_reg_grp_info_tbl {
 /* emul reg management table */
 struct pt_reg_tbl {
     /* emul reg table list */
-    QEMU_LIST_ENTRY (pt_reg_tbl) entries;
+    LIST_ENTRY (pt_reg_tbl) entries;
     /* emul reg info table */
     struct pt_reg_info_tbl *reg;
     /* emul reg value */
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/hw/serial.c
--- a/tools/ioemu/hw/serial.c   Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/hw/serial.c   Mon Aug 11 11:04:52 2008 +0900
@@ -211,7 +211,7 @@ static void serial_update_irq(SerialStat
     } else if ( s->timeout_ipending ) {
         tmp_iir = UART_IIR_CTI;
     } else if ( ( s->ier & UART_IER_RDI ) && (s->lsr & UART_LSR_DR ) ) {
-        if ( !(s->iir & UART_FCR_FE) ) {
+        if ( !(s->fcr & UART_FCR_FE) ) {
            tmp_iir = UART_IIR_RDI;
         } else if ( s->recv_fifo.count >= s->recv_fifo.itl ) {
            tmp_iir = UART_IIR_RDI;
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/monitor.c
--- a/tools/ioemu/monitor.c     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/monitor.c     Mon Aug 11 11:04:52 2008 +0900
@@ -1167,7 +1167,7 @@ static void do_info_profile(void)
 #endif
 
 /* Capture support */
-static QEMU_LIST_HEAD (capture_list_head, CaptureState) capture_head;
+static LIST_HEAD (capture_list_head, CaptureState) capture_head;
 
 static void do_info_capture (void)
 {
@@ -1188,7 +1188,7 @@ static void do_stop_capture (int n)
     for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
         if (i == n) {
             s->ops.destroy (s->opaque);
-            QEMU_LIST_REMOVE (s, entries);
+            LIST_REMOVE (s, entries);
             qemu_free (s);
             return;
         }
@@ -1220,7 +1220,7 @@ static void do_wav_capture (const char *
         term_printf ("Faied to add wave capture\n");
         qemu_free (s);
     }
-    QEMU_LIST_INSERT_HEAD (&capture_head, s, entries);
+    LIST_INSERT_HEAD (&capture_head, s, entries);
 }
 #endif
 
diff -r b086089f4643 -r d24bc5f549ba tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/ioemu/vl.c  Mon Aug 11 11:04:52 2008 +0900
@@ -6155,10 +6155,10 @@ struct vm_change_state_entry {
 struct vm_change_state_entry {
     VMChangeStateHandler *cb;
     void *opaque;
-    QEMU_LIST_ENTRY (vm_change_state_entry) entries;
+    LIST_ENTRY (vm_change_state_entry) entries;
 };
 
-static QEMU_LIST_HEAD(vm_change_state_head, vm_change_state_entry) 
vm_change_state_head;
+static LIST_HEAD(vm_change_state_head, vm_change_state_entry) 
vm_change_state_head;
 
 VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
                                                      void *opaque)
@@ -6171,13 +6171,13 @@ VMChangeStateEntry *qemu_add_vm_change_s
 
     e->cb = cb;
     e->opaque = opaque;
-    QEMU_LIST_INSERT_HEAD(&vm_change_state_head, e, entries);
+    LIST_INSERT_HEAD(&vm_change_state_head, e, entries);
     return e;
 }
 
 void qemu_del_vm_change_state_handler(VMChangeStateEntry *e)
 {
-    QEMU_LIST_REMOVE (e, entries);
+    LIST_REMOVE (e, entries);
     qemu_free (e);
 }
 
@@ -7138,7 +7138,7 @@ int main(int argc, char **argv)
     }
 #endif
 
-    QEMU_LIST_INIT (&vm_change_state_head);
+    LIST_INIT (&vm_change_state_head);
 #ifndef CONFIG_STUBDOM
 #ifndef _WIN32
     {
diff -r b086089f4643 -r d24bc5f549ba tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/python/xen/xend/server/pciif.py     Mon Aug 11 11:04:52 2008 +0900
@@ -21,6 +21,7 @@ import time
 import time
 
 from xen.xend import sxp
+from xen.xend import arch
 from xen.xend.XendError import VmError
 from xen.xend.XendLogging import log
 
@@ -284,12 +285,13 @@ class PciController(DevController):
                     "bind your slot/device to the PCI backend using sysfs" \
                     )%(dev.name))
 
-        if dev.has_non_page_aligned_bar:
+        if dev.has_non_page_aligned_bar and arch.type != "ia64":
             raise VmError("pci: %: non-page-aligned MMIO BAR found." % 
dev.name)
 
         self.CheckSiblingDevices(fe_domid, dev)
 
-        dev.do_FLR()
+        if arch.type != "ia64":
+            dev.do_FLR()
 
         PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain, 
                 bus, slot, func)
@@ -395,7 +397,7 @@ class PciController(DevController):
                                     ' the same guest with %s'
                                 raise VmError(err_msg % (f, dev.name))
             elif dev.dev_type == DEV_TYPE_PCI:
-                if dev.bus == 0:
+                if dev.bus == 0 or arch.type == "ia64":
                     if not dev.pci_af_flr:
                         # We cope with this case by using the Dstate transition
                         # method for now.
diff -r b086089f4643 -r d24bc5f549ba tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Mon Aug 11 10:59:39 2008 +0900
+++ b/tools/python/xen/xm/create.py     Mon Aug 11 11:04:52 2008 +0900
@@ -279,7 +279,7 @@ gopts.var('on_reboot', val='destroy|rest
                             renamed and a new domain started in its place.
           """)
 
-gopts.var('on_crash', 
val='destroy|restart|preserve|rename-restart|coredump-destroy|ciredump-restart',
+gopts.var('on_crash', 
val='destroy|restart|preserve|rename-restart|coredump-destroy|coredump-restart',
           fn=set_value, default=None,
           use="""Behaviour when a domain exits with reason 'crash'.
           - destroy:          the domain is cleaned up as normal;
diff -r b086089f4643 -r d24bc5f549ba unmodified_drivers/linux-2.6/README
--- a/unmodified_drivers/linux-2.6/README       Mon Aug 11 10:59:39 2008 +0900
+++ b/unmodified_drivers/linux-2.6/README       Mon Aug 11 11:04:52 2008 +0900
@@ -1,13 +1,15 @@ To build:
 To build:
 
-1. ./mkbuildtree
+1. ./mkbuildtree [<arch>]
    NB. You can override paths to Xen sources and a (stub) XenLinux
        build tree via the XEN and XL environment variable.
 
 2. make -C /path/to/kernel/build M=$PWD modules
    NB. This is your native kernel build tree (or a distro provided
        stub), not the XenLinux sources referred to in step 1.
+   NB. If you are cross compiling, you need to set ARCH and
+       CROSS_COMPILE too.
 
-You get four modules, xen-platform-pci.ko, xenbus.ko, xen-vbd.ko, and
-xen-vnif.ko.  Load xen-platform-pci first, then xenbus, and then
-whichever of xen-vbd and xen-vnif you happen to need.
+You get four modules, xen-platform-pci.ko, xen-vbd.ko, xen-vnif.ko and
+xen-balloon.ko.  Load xen-platform-pci first, and then
+whichever of xen-vbd, xen-vnif and xen-balloon.ko you happen to need.
diff -r b086089f4643 -r d24bc5f549ba xen/Makefile
--- a/xen/Makefile      Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/Makefile      Mon Aug 11 11:04:52 2008 +0900
@@ -1,8 +1,8 @@
 # This is the correct place to edit the build version.
 # All other places this is stored (eg. compile.h) should be autogenerated.
-export XEN_VERSION       = 4
-export XEN_SUBVERSION    = 0
-export XEN_EXTRAVERSION ?= .0-rc3-pre$(XEN_VENDORVERSION)
+export XEN_VERSION       = 3
+export XEN_SUBVERSION    = 3
+export XEN_EXTRAVERSION ?= .0-rc4-pre$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
diff -r b086089f4643 -r d24bc5f549ba xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/arch/x86/domain_build.c       Mon Aug 11 11:04:52 2008 +0900
@@ -704,16 +704,12 @@ int __init construct_dom0(
 
     if ( opt_dom0_max_vcpus == 0 )
         opt_dom0_max_vcpus = num_online_cpus();
-    if ( opt_dom0_max_vcpus > num_online_cpus() )
-        opt_dom0_max_vcpus = num_online_cpus();
     if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
         opt_dom0_max_vcpus = MAX_VIRT_CPUS;
-    if ( opt_dom0_max_vcpus > BITS_PER_GUEST_LONG(d) )
-        opt_dom0_max_vcpus = BITS_PER_GUEST_LONG(d);
     printk("Dom0 has maximum %u VCPUs\n", opt_dom0_max_vcpus);
 
     for ( i = 1; i < opt_dom0_max_vcpus; i++ )
-        (void)alloc_vcpu(d, i, i);
+        (void)alloc_vcpu(d, i, i % num_online_cpus());
 
     /* Set up CR3 value for write_ptbase */
     if ( paging_mode_enabled(v->domain) )
diff -r b086089f4643 -r d24bc5f549ba xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/arch/x86/mm.c Mon Aug 11 11:04:52 2008 +0900
@@ -2218,6 +2218,12 @@ static inline cpumask_t vcpumask_to_pcpu
     cpumask_t    pmask = CPU_MASK_NONE;
     struct vcpu *v;
 
+    /*
+     * Callers copy only a single guest-sized longword from the guest.
+     * This must be wide enough to reference all VCPUs. Worst case is 32 bits.
+     */
+    BUILD_BUG_ON(MAX_VIRT_CPUS > 32);
+
     while ( vmask != 0 )
     {
         vcpu_id = find_first_set_bit(vmask);
diff -r b086089f4643 -r d24bc5f549ba xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/arch/x86/time.c       Mon Aug 11 11:04:52 2008 +0900
@@ -802,6 +802,8 @@ int cpu_frequency_change(u64 freq)
     set_time_scale(&t->tsc_scale, freq);
     local_irq_enable();
 
+    update_vcpu_system_time(current);
+
     /* A full epoch should pass before we check for deviation. */
     if ( smp_processor_id() == 0 )
     {
diff -r b086089f4643 -r d24bc5f549ba xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c       Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/arch/x86/x86_32/traps.c       Mon Aug 11 11:04:52 2008 +0900
@@ -32,14 +32,26 @@ static void print_xen_info(void)
            arch, debug, print_tainted(taint_str));
 }
 
-static void _show_registers(const struct cpu_user_regs *regs,
-                            unsigned long crs[8], int guest_mode,
-                            const char *context)
-{
+enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
+
+static void _show_registers(
+    const struct cpu_user_regs *regs, unsigned long crs[8],
+    enum context context, const struct vcpu *v)
+{
+    const static char *context_names[] = {
+        [CTXT_hypervisor] = "hypervisor",
+        [CTXT_pv_guest]   = "pv guest",
+        [CTXT_hvm_guest]  = "hvm guest"
+    };
+
     printk("EIP:    %04x:[<%08x>]", regs->cs, regs->eip);
-    if ( !guest_mode )
+    if ( context == CTXT_hypervisor )
         print_symbol(" %s", regs->eip);
-    printk("\nEFLAGS: %08x   CONTEXT: %s\n", regs->eflags, context);
+    printk("\nEFLAGS: %08x   ", regs->eflags);
+    if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
+        printk("EM: %d   ", !!v->vcpu_info->evtchn_upcall_mask);
+    printk("CONTEXT: %s\n", context_names[context]);
+
     printk("eax: %08x   ebx: %08x   ecx: %08x   edx: %08x\n",
            regs->eax, regs->ebx, regs->ecx, regs->edx);
     printk("esi: %08x   edi: %08x   ebp: %08x   esp: %08x\n",
@@ -56,13 +68,13 @@ void show_registers(struct cpu_user_regs
 {
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
-    const char *context;
+    enum context context;
     struct vcpu *v = current;
 
     if ( is_hvm_vcpu(v) && guest_mode(regs) )
     {
         struct segment_register sreg;
-        context = "hvm";
+        context = CTXT_hvm_guest;
         fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0];
         fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2];
         fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3];
@@ -84,7 +96,7 @@ void show_registers(struct cpu_user_regs
     {
         if ( !guest_mode(regs) )
         {
-            context = "hypervisor";
+            context = CTXT_hypervisor;
             fault_regs.esp = (unsigned long)&regs->esp;
             fault_regs.ss = read_segment_register(ss);
             fault_regs.ds = read_segment_register(ds);
@@ -95,7 +107,7 @@ void show_registers(struct cpu_user_regs
         }
         else
         {
-            context = "guest";
+            context = CTXT_pv_guest;
             fault_crs[2] = v->vcpu_info->arch.cr2;
         }
 
@@ -106,7 +118,7 @@ void show_registers(struct cpu_user_regs
 
     print_xen_info();
     printk("CPU:    %d\n", smp_processor_id());
-    _show_registers(&fault_regs, fault_crs, guest_mode(regs), context);
+    _show_registers(&fault_regs, fault_crs, context, v);
 
     if ( this_cpu(ler_msr) && !guest_mode(regs) )
     {
@@ -130,7 +142,7 @@ void vcpu_show_registers(const struct vc
     crs[3] = pagetable_get_paddr(v->arch.guest_table);
     crs[4] = v->arch.guest_context.ctrlreg[4];
 
-    _show_registers(&v->arch.guest_context.user_regs, crs, 1, "guest");
+    _show_registers(&v->arch.guest_context.user_regs, crs, CTXT_pv_guest, v);
 }
 
 void show_page_walk(unsigned long addr)
diff -r b086089f4643 -r d24bc5f549ba xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c       Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/arch/x86/x86_64/traps.c       Mon Aug 11 11:04:52 2008 +0900
@@ -40,14 +40,26 @@ static void print_xen_info(void)
            debug, print_tainted(taint_str));
 }
 
-static void _show_registers(const struct cpu_user_regs *regs,
-                            unsigned long crs[8], int guest_mode,
-                            const char *context)
-{
+enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest };
+
+static void _show_registers(
+    const struct cpu_user_regs *regs, unsigned long crs[8],
+    enum context context, const struct vcpu *v)
+{
+    const static char *context_names[] = {
+        [CTXT_hypervisor] = "hypervisor",
+        [CTXT_pv_guest]   = "pv guest",
+        [CTXT_hvm_guest]  = "hvm guest"
+    };
+
     printk("RIP:    %04x:[<%016lx>]", regs->cs, regs->rip);
-    if ( !guest_mode )
+    if ( context == CTXT_hypervisor )
         print_symbol(" %s", regs->rip);
-    printk("\nRFLAGS: %016lx   CONTEXT: %s\n", regs->rflags, context);
+    printk("\nRFLAGS: %016lx   ", regs->rflags);
+    if ( (context == CTXT_pv_guest) && v && v->vcpu_info )
+        printk("EM: %d   ", !!vcpu_info(v, evtchn_upcall_mask));
+    printk("CONTEXT: %s\n", context_names[context]);
+
     printk("rax: %016lx   rbx: %016lx   rcx: %016lx\n",
            regs->rax, regs->rbx, regs->rcx);
     printk("rdx: %016lx   rsi: %016lx   rdi: %016lx\n",
@@ -71,13 +83,13 @@ void show_registers(struct cpu_user_regs
 {
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
-    const char *context;
+    enum context context;
     struct vcpu *v = current;
 
     if ( is_hvm_vcpu(v) && guest_mode(regs) )
     {
         struct segment_register sreg;
-        context = "hvm";
+        context = CTXT_hvm_guest;
         fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0];
         fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2];
         fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3];
@@ -99,12 +111,12 @@ void show_registers(struct cpu_user_regs
     {
         if ( guest_mode(regs) )
         {
-            context = "guest";
+            context = CTXT_pv_guest;
             fault_crs[2] = arch_get_cr2(v);
         }
         else
         {
-            context = "hypervisor";
+            context = CTXT_hypervisor;
             fault_crs[2] = read_cr2();
         }
 
@@ -119,7 +131,7 @@ void show_registers(struct cpu_user_regs
 
     print_xen_info();
     printk("CPU:    %d\n", smp_processor_id());
-    _show_registers(&fault_regs, fault_crs, guest_mode(regs), context);
+    _show_registers(&fault_regs, fault_crs, context, v);
 
     if ( this_cpu(ler_msr) && !guest_mode(regs) )
     {
@@ -146,7 +158,7 @@ void vcpu_show_registers(const struct vc
                                  v->arch.guest_table_user);
     crs[4] = v->arch.guest_context.ctrlreg[4];
 
-    _show_registers(regs, crs, 1, "guest");
+    _show_registers(regs, crs, CTXT_pv_guest, v);
 }
 
 void show_page_walk(unsigned long addr)
diff -r b086089f4643 -r d24bc5f549ba xen/include/asm-x86/spinlock.h
--- a/xen/include/asm-x86/spinlock.h    Mon Aug 11 10:59:39 2008 +0900
+++ b/xen/include/asm-x86/spinlock.h    Mon Aug 11 11:04:52 2008 +0900
@@ -23,8 +23,8 @@ static inline void _raw_spin_lock(spinlo
         "1:  lock; decb %0         \n"
         "    js 2f                 \n"
         ".section .text.lock,\"ax\"\n"
-        "2:  cmpb $0,%0            \n"
-        "    rep; nop              \n"
+        "2:  rep; nop              \n"
+        "    cmpb $0,%0            \n"
         "    jle 2b                \n"
         "    jmp 1b                \n"
         ".previous"

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


 


Rackspace

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