direct-io.hg

changeset 2503:c7b0154dff73

bitkeeper revision 1.1159.1.163 (414febf9gzWkqLgct8GcojztsBLtAA)

Merge http://xen.bkbits.net:8080/xeno-unstable.bk
into gandalf.hpl.hp.com:/var/bk/xeno-unstable.bk
author xenbk@gandalf.hpl.hp.com
date Tue Sep 21 08:53:13 2004 +0000 (2004-09-21)
parents 879d7c8f0d19 691d8544fd52
children 03bd2991dbd4
files .rootkeys linux-2.4.27-xen-sparse/arch/xen/config.in linux-2.4.27-xen-sparse/arch/xen/defconfig-xen0 linux-2.4.27-xen-sparse/arch/xen/defconfig-xenU linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile linux-2.4.27-xen-sparse/include/asm-xen/page.h linux-2.4.27-xen-sparse/include/linux/skbuff.h linux-2.4.27-xen-sparse/mkbuildtree linux-2.6.8.1-xen-sparse/arch/xen/Kconfig linux-2.6.8.1-xen-sparse/arch/xen/configs/xen0_defconfig linux-2.6.8.1-xen-sparse/arch/xen/configs/xenU_defconfig linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6.8.1-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6.8.1-xen-sparse/arch/xen/kernel/Makefile linux-2.6.8.1-xen-sparse/arch/xen/kernel/skbuff.c linux-2.6.8.1-xen-sparse/drivers/xen/netback/netback.c linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6.8.1-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.8.1-xen-sparse/include/linux/skbuff.h tools/examples/init.d/xend tools/misc/xend tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xu/xu.c tools/python/xen/xend/server/SrvDaemon.py tools/xentrace/xentrace.c xen/common/page_alloc.c xen/common/trace.c xen/include/hypervisor-ifs/dom0_ops.h xen/include/hypervisor-ifs/trace.h
line diff
     1.1 --- a/.rootkeys	Fri Sep 17 16:10:38 2004 +0000
     1.2 +++ b/.rootkeys	Tue Sep 21 08:53:13 2004 +0000
     1.3 @@ -176,6 +176,7 @@ 4110f478aeQWllIN7J4kouAHiAqrPw linux-2.6
     1.4  412dfae9eA3_6e6bCGUtg1mj8b56fQ linux-2.6.8.1-xen-sparse/arch/xen/kernel/gnttab.c
     1.5  40f56239sFcjHiIRmnObRIDF-zaeKQ linux-2.6.8.1-xen-sparse/arch/xen/kernel/process.c
     1.6  40f562392LBhwmOxVPsYdkYXMxI_ZQ linux-2.6.8.1-xen-sparse/arch/xen/kernel/reboot.c
     1.7 +414c113396tK1HTVeUalm3u-1DF16g linux-2.6.8.1-xen-sparse/arch/xen/kernel/skbuff.c
     1.8  3f68905c5eiA-lBMQSvXLMWS1ikDEA linux-2.6.8.1-xen-sparse/arch/xen/kernel/xen_proc.c
     1.9  41261688yS8eAyy-7kzG4KBs0xbYCA linux-2.6.8.1-xen-sparse/drivers/Makefile
    1.10  4108f5c1WfTIrs0HZFeV39sttekCTw linux-2.6.8.1-xen-sparse/drivers/char/mem.c
     2.1 --- a/linux-2.4.27-xen-sparse/arch/xen/config.in	Fri Sep 17 16:10:38 2004 +0000
     2.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/config.in	Tue Sep 21 08:53:13 2004 +0000
     2.3 @@ -16,6 +16,7 @@ mainmenu_option next_comment
     2.4  comment 'Xen'
     2.5  bool 'Support for privileged operations (domain 0)' CONFIG_XEN_PRIVILEGED_GUEST
     2.6  bool 'Device-driver domain (physical device access)' CONFIG_XEN_PHYSDEV_ACCESS
     2.7 +bool 'Scrub memory before freeing it to Xen' CONFIG_XEN_SCRUB_PAGES
     2.8  endmenu
     2.9  # The IBM S/390 patch needs this.
    2.10  define_bool CONFIG_NO_IDLE_HZ y
     3.1 --- a/linux-2.4.27-xen-sparse/arch/xen/defconfig-xen0	Fri Sep 17 16:10:38 2004 +0000
     3.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/defconfig-xen0	Tue Sep 21 08:53:13 2004 +0000
     3.3 @@ -12,6 +12,7 @@ CONFIG_UID16=y
     3.4  #
     3.5  CONFIG_XEN_PRIVILEGED_GUEST=y
     3.6  CONFIG_XEN_PHYSDEV_ACCESS=y
     3.7 +CONFIG_XEN_SCRUB_PAGES=y
     3.8  CONFIG_NO_IDLE_HZ=y
     3.9  CONFIG_FOREIGN_PAGES=y
    3.10  
     4.1 --- a/linux-2.4.27-xen-sparse/arch/xen/defconfig-xenU	Fri Sep 17 16:10:38 2004 +0000
     4.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/defconfig-xenU	Tue Sep 21 08:53:13 2004 +0000
     4.3 @@ -12,6 +12,7 @@ CONFIG_UID16=y
     4.4  #
     4.5  # CONFIG_XEN_PRIVILEGED_GUEST is not set
     4.6  # CONFIG_XEN_PHYSDEV_ACCESS is not set
     4.7 +CONFIG_XEN_SCRUB_PAGES=y
     4.8  CONFIG_NO_IDLE_HZ=y
     4.9  # CONFIG_FOREIGN_PAGES is not set
    4.10  CONFIG_NETDEVICES=y
     5.1 --- a/linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c	Fri Sep 17 16:10:38 2004 +0000
     5.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/drivers/balloon/balloon.c	Tue Sep 21 08:53:13 2004 +0000
     5.3 @@ -104,8 +104,20 @@ static unsigned long inflate_balloon(uns
     5.4      {
     5.5  	unsigned long mfn = phys_to_machine_mapping[*currp];
     5.6          curraddr = (unsigned long)page_address(mem_map + *currp);
     5.7 +        /* Blow away page contents for security, and also p.t. ref if any. */
     5.8  	if ( curraddr != 0 )
     5.9 +        {
    5.10 +            scrub_pages(curraddr, 1);
    5.11              queue_l1_entry_update(get_ptep(curraddr), 0);
    5.12 +        }
    5.13 +#ifdef CONFIG_XEN_SCRUB_PAGES
    5.14 +        else
    5.15 +        {
    5.16 +            void *p = kmap(&mem_map[*currp]);
    5.17 +            scrub_pages(p, 1);
    5.18 +            kunmap(&mem_map[*currp]);
    5.19 +        }
    5.20 +#endif
    5.21          phys_to_machine_mapping[*currp] = DEAD;
    5.22          *currp = mfn;
    5.23      }
    5.24 @@ -388,9 +400,9 @@ static int balloon_write(struct file *fi
    5.25      }
    5.26  
    5.27      len = strnlen_user(buffer, count);
    5.28 -    if (len==0) return -EBADMSG;
    5.29 -    if (len==1) return 1; /* input starts with a NUL char */
    5.30 -    if ( strncpy_from_user(memstring, buffer, len) < 0)
    5.31 +    if ( len == 0 ) return -EBADMSG;
    5.32 +    if ( len == 1 ) return 1; /* input starts with a NUL char */
    5.33 +    if ( strncpy_from_user(memstring, buffer, len) < 0 )
    5.34          return -EFAULT;
    5.35  
    5.36      endchar = memstring;
     6.1 --- a/linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile	Fri Sep 17 16:10:38 2004 +0000
     6.2 +++ b/linux-2.4.27-xen-sparse/arch/xen/kernel/Makefile	Tue Sep 21 08:53:13 2004 +0000
     6.3 @@ -6,12 +6,12 @@ all: kernel.o head.o init_task.o
     6.4  
     6.5  O_TARGET := kernel.o
     6.6  
     6.7 -export-objs     := i386_ksyms.o gnttab.o
     6.8 +export-objs     := i386_ksyms.o gnttab.o skbuff.o
     6.9  
    6.10  obj-y	:= process.o semaphore.o signal.o entry.o traps.o irq.o  \
    6.11  		ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \
    6.12  		i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \
    6.13 -		reboot.o fixup.o gnttab.o
    6.14 +		reboot.o fixup.o gnttab.o skbuff.o
    6.15  
    6.16  ifdef CONFIG_PCI
    6.17  obj-y	+= pci-i386.o pci-pc.o
     7.1 --- a/linux-2.4.27-xen-sparse/include/asm-xen/page.h	Fri Sep 17 16:10:38 2004 +0000
     7.2 +++ b/linux-2.4.27-xen-sparse/include/asm-xen/page.h	Tue Sep 21 08:53:13 2004 +0000
     7.3 @@ -10,9 +10,16 @@
     7.4  #ifndef __ASSEMBLY__
     7.5  
     7.6  #include <linux/config.h>
     7.7 +#include <linux/string.h>
     7.8  #include <asm/types.h>
     7.9  #include <asm/hypervisor-ifs/hypervisor-if.h>
    7.10  
    7.11 +#ifdef CONFIG_XEN_SCRUB_PAGES
    7.12 +#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
    7.13 +#else
    7.14 +#define scrub_pages(_p,_n) ((void)0)
    7.15 +#endif
    7.16 +
    7.17  #ifdef CONFIG_X86_USE_3DNOW
    7.18  
    7.19  #include <asm/mmx.h>
     8.1 --- a/linux-2.4.27-xen-sparse/include/linux/skbuff.h	Fri Sep 17 16:10:38 2004 +0000
     8.2 +++ b/linux-2.4.27-xen-sparse/include/linux/skbuff.h	Tue Sep 21 08:53:13 2004 +0000
     8.3 @@ -1027,19 +1027,18 @@ static inline void __skb_queue_purge(str
     8.4   *
     8.5   *	%NULL is returned in there is no free memory.
     8.6   */
     8.7 - 
     8.8 +#ifndef CONFIG_XEN 
     8.9  static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
    8.10  					      int gfp_mask)
    8.11  {
    8.12 -	struct sk_buff *skb;
    8.13 -#if defined(CONFIG_XEN)
    8.14 -	length = (PAGE_SIZE/2)+1; /* force slab allocater to give us a page */
    8.15 -#endif
    8.16 -	skb = alloc_skb(length+16, gfp_mask);
    8.17 +	struct sk_buff *skb = alloc_skb(length+16, gfp_mask);
    8.18  	if (skb)
    8.19  		skb_reserve(skb,16);
    8.20  	return skb;
    8.21  }
    8.22 +#else
    8.23 +extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
    8.24 +#endif
    8.25  
    8.26  /**
    8.27   *	dev_alloc_skb - allocate an skbuff for sending
     9.1 --- a/linux-2.4.27-xen-sparse/mkbuildtree	Fri Sep 17 16:10:38 2004 +0000
     9.2 +++ b/linux-2.4.27-xen-sparse/mkbuildtree	Tue Sep 21 08:53:13 2004 +0000
     9.3 @@ -228,6 +228,7 @@ ln -sf ../../../${LINUX_26}/arch/xen/ker
     9.4  ln -sf ../../../${LINUX_26}/arch/xen/kernel/fixup.c
     9.5  ln -sf ../../../${LINUX_26}/arch/xen/kernel/gnttab.c
     9.6  ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c
     9.7 +ln -sf ../../../${LINUX_26}/arch/xen/kernel/skbuff.c
     9.8  ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c
     9.9  ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c
    9.10  
    10.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/Kconfig	Fri Sep 17 16:10:38 2004 +0000
    10.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/Kconfig	Tue Sep 21 08:53:13 2004 +0000
    10.3 @@ -100,16 +100,26 @@ config XEN_WRITABLE_PAGETABLES
    10.4  	help
    10.5  	  Use writable L1 pagetables
    10.6  
    10.7 +config XEN_SCRUB_PAGES
    10.8 +        bool "Scrub memory before freeing it to Xen"
    10.9 +        default y
   10.10 +        help
   10.11 +          Erase memory contents before freeing it back to Xen's global
   10.12 +          pool. This ensures that any secrets contained within that
   10.13 +          memory (e.g., private keys) cannot be found by other guests that
   10.14 +          may be running on the machine. Most people will want to say Y here.
   10.15 +          If security is not a concern then you may increase performance by
   10.16 +          saying N.
   10.17 +
   10.18  endmenu
   10.19  
   10.20  config FOREIGN_PAGES
   10.21  	bool
   10.22  	default y
   10.23  
   10.24 -config PAGESIZED_SKBS
   10.25 +config HAVE_ARCH_DEV_ALLOC_SKB
   10.26  	bool
   10.27 -	default y if XEN_NETDEV_BACKEND
   10.28 -	default n if !XEN_NETDEV_BACKEND
   10.29 +	default y
   10.30  
   10.31  #config VT
   10.32  #	bool
    11.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/configs/xen0_defconfig	Fri Sep 17 16:10:38 2004 +0000
    11.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/configs/xen0_defconfig	Tue Sep 21 08:53:13 2004 +0000
    11.3 @@ -16,8 +16,9 @@ CONFIG_XEN_BLKDEV_FRONTEND=y
    11.4  CONFIG_XEN_NETDEV_FRONTEND=y
    11.5  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    11.6  CONFIG_XEN_WRITABLE_PAGETABLES=y
    11.7 +CONFIG_XEN_SCRUB_PAGES=y
    11.8  CONFIG_FOREIGN_PAGES=y
    11.9 -CONFIG_PAGESIZED_SKBS=y
   11.10 +CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
   11.11  CONFIG_X86=y
   11.12  # CONFIG_X86_64 is not set
   11.13  
    12.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/configs/xenU_defconfig	Fri Sep 17 16:10:38 2004 +0000
    12.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/configs/xenU_defconfig	Tue Sep 21 08:53:13 2004 +0000
    12.3 @@ -16,8 +16,9 @@ CONFIG_XEN_BLKDEV_FRONTEND=y
    12.4  CONFIG_XEN_NETDEV_FRONTEND=y
    12.5  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    12.6  CONFIG_XEN_WRITABLE_PAGETABLES=y
    12.7 +CONFIG_XEN_SCRUB_PAGES=y
    12.8  CONFIG_FOREIGN_PAGES=y
    12.9 -# CONFIG_PAGESIZED_SKBS is not set
   12.10 +CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
   12.11  CONFIG_X86=y
   12.12  # CONFIG_X86_64 is not set
   12.13  
    13.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Fri Sep 17 16:10:38 2004 +0000
    13.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Tue Sep 21 08:53:13 2004 +0000
    13.3 @@ -55,6 +55,7 @@ void *dma_alloc_coherent(struct device *
    13.4  		pmd_t         *pmd;
    13.5  		pte_t         *pte;
    13.6  		unsigned long  pfn, i;
    13.7 +		scrub_pages(vstart, 1 << order);
    13.8  		/* 1. Zap current PTEs, giving away the underlying pages. */
    13.9  		for (i = 0; i < (1<<order); i++) {
   13.10  			pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
    14.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/i386/mm/hypervisor.c	Fri Sep 17 16:10:38 2004 +0000
    14.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/i386/mm/hypervisor.c	Tue Sep 21 08:53:13 2004 +0000
    14.3 @@ -414,6 +414,8 @@ unsigned long allocate_empty_lowmem_regi
    14.4      if ( vstart == 0 )
    14.5          return 0UL;
    14.6  
    14.7 +    scrub_pages(vstart, 1 << order);
    14.8 +
    14.9      pfn_array = vmalloc((1<<order) * sizeof(*pfn_array));
   14.10      if ( pfn_array == NULL )
   14.11          BUG();
    15.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/kernel/Makefile	Fri Sep 17 16:10:38 2004 +0000
    15.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/kernel/Makefile	Tue Sep 21 08:53:13 2004 +0000
    15.3 @@ -10,4 +10,4 @@ XENARCH	:= $(subst ",,$(CONFIG_XENARCH))
    15.4  extra-y += vmlinux.lds.s
    15.5  
    15.6  obj-y	:= ctrl_if.o evtchn.o fixup.o process.o reboot.o xen_proc.o empty.o \
    15.7 -           gnttab.o
    15.8 +           gnttab.o skbuff.o
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/kernel/skbuff.c	Tue Sep 21 08:53:13 2004 +0000
    16.3 @@ -0,0 +1,69 @@
    16.4 +
    16.5 +#include <linux/config.h>
    16.6 +#include <linux/module.h>
    16.7 +#include <linux/version.h>
    16.8 +#include <linux/kernel.h>
    16.9 +#include <linux/sched.h>
   16.10 +#include <linux/slab.h>
   16.11 +#include <linux/string.h>
   16.12 +#include <linux/errno.h>
   16.13 +#include <linux/netdevice.h>
   16.14 +#include <linux/inetdevice.h>
   16.15 +#include <linux/etherdevice.h>
   16.16 +#include <linux/skbuff.h>
   16.17 +#include <linux/init.h>
   16.18 +#include <asm/io.h>
   16.19 +#include <asm/page.h>
   16.20 +
   16.21 +EXPORT_SYMBOL(__dev_alloc_skb);
   16.22 +
   16.23 +/* Referenced in netback.c. */
   16.24 +/*static*/ kmem_cache_t *skbuff_cachep;
   16.25 +
   16.26 +struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask)
   16.27 +{
   16.28 +    struct sk_buff *skb;
   16.29 +    u8             *new_data, *new_shinfo; 
   16.30 +
   16.31 +    /*
   16.32 +     * Yuk! There is no way to get a skbuff head without allocating the
   16.33 +     * data area using kmalloc(). So we do that and then replace the default
   16.34 +     * data area with our own.
   16.35 +     */
   16.36 +    skb = alloc_skb(0, gfp_mask);
   16.37 +    if ( unlikely(skb == NULL) )
   16.38 +        return NULL;
   16.39 +
   16.40 +    new_data = kmem_cache_alloc(skbuff_cachep, gfp_mask);
   16.41 +    if ( new_data == NULL )
   16.42 +    {
   16.43 +        dev_kfree_skb(skb);
   16.44 +        return NULL;
   16.45 +    }
   16.46 +
   16.47 +    new_shinfo = 
   16.48 +        new_data + PAGE_SIZE - sizeof(struct skb_shared_info);
   16.49 +    memcpy(new_shinfo, skb_shinfo(skb), sizeof(struct skb_shared_info));
   16.50 +
   16.51 +    kfree(skb->head);
   16.52 +
   16.53 +    skb->head = new_data;
   16.54 +    skb->data = skb->tail = new_data + 16; /* __dev_alloc_skb does this */
   16.55 +    skb->end  = new_shinfo;
   16.56 +    skb->truesize = 1500;                  /* is this important? */
   16.57 +
   16.58 +    return skb;
   16.59 +}
   16.60 +
   16.61 +static void skbuff_ctor(void *buf, kmem_cache_t *cachep, unsigned long unused)
   16.62 +{
   16.63 +    scrub_pages(buf, 1);
   16.64 +}
   16.65 +
   16.66 +static int __init skbuff_init(void)
   16.67 +{
   16.68 +    skbuff_cachep = kmem_cache_create(
   16.69 +        "xen-skb", PAGE_SIZE, PAGE_SIZE, 0, skbuff_ctor, NULL);
   16.70 +    return 0;
   16.71 +}
   16.72 +__initcall(skbuff_init);
    17.1 --- a/linux-2.6.8.1-xen-sparse/drivers/xen/netback/netback.c	Fri Sep 17 16:10:38 2004 +0000
    17.2 +++ b/linux-2.6.8.1-xen-sparse/drivers/xen/netback/netback.c	Tue Sep 21 08:53:13 2004 +0000
    17.3 @@ -108,6 +108,21 @@ static inline void maybe_schedule_tx_act
    17.4          tasklet_schedule(&net_tx_tasklet);
    17.5  }
    17.6  
    17.7 +/*
    17.8 + * A gross way of confirming the origin of an skb data page. The slab
    17.9 + * allocator abuses a field in the page struct to cache the kmem_cache_t ptr.
   17.10 + */
   17.11 +static inline int is_xen_skb(struct sk_buff *skb)
   17.12 +{
   17.13 +    extern kmem_cache_t *skbuff_cachep;
   17.14 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   17.15 +    kmem_cache_t *cp = (kmem_cache_t *)virt_to_page(skb->head)->lru.next;
   17.16 +#else
   17.17 +    kmem_cache_t *cp = (kmem_cache_t *)virt_to_page(skb->head)->list.next;
   17.18 +#endif
   17.19 +    return (cp == skbuff_cachep);
   17.20 +}
   17.21 +
   17.22  int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev)
   17.23  {
   17.24      netif_t *netif = (netif_t *)dev->priv;
   17.25 @@ -122,17 +137,14 @@ int netif_be_start_xmit(struct sk_buff *
   17.26      /*
   17.27       * We do not copy the packet unless:
   17.28       *  1. The data is shared; or
   17.29 -     *  2. It spans a page boundary; or
   17.30 -     *  3. We cannot be sure the whole data page is allocated.
   17.31 +     *  2. The data is not allocated from our special cache.
   17.32       * The copying method is taken from skb_copy().
   17.33       * NB. We also couldn't cope with fragmented packets, but we won't get
   17.34       *     any because we not advertise the NETIF_F_SG feature.
   17.35       */
   17.36 -    if ( skb_shared(skb) || skb_cloned(skb) || 
   17.37 -         (((unsigned long)skb->end ^ (unsigned long)skb->head) & PAGE_MASK) ||
   17.38 -         ((skb->end - skb->head) < (PAGE_SIZE/2)) )
   17.39 +    if ( skb_shared(skb) || skb_cloned(skb) || !is_xen_skb(skb) )
   17.40      {
   17.41 -        struct sk_buff *nskb = alloc_skb(PAGE_SIZE-1024, GFP_ATOMIC);
   17.42 +        struct sk_buff *nskb = dev_alloc_skb(PAGE_SIZE);
   17.43          int hlen = skb->data - skb->head;
   17.44          if ( unlikely(nskb == NULL) )
   17.45              goto drop;
    18.1 --- a/linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c	Fri Sep 17 16:10:38 2004 +0000
    18.2 +++ b/linux-2.6.8.1-xen-sparse/drivers/xen/netfront/netfront.c	Tue Sep 21 08:53:13 2004 +0000
    18.3 @@ -39,6 +39,7 @@
    18.4  #ifndef __GFP_NOWARN
    18.5  #define __GFP_NOWARN 0
    18.6  #endif
    18.7 +#define alloc_skb_page() __dev_alloc_skb(PAGE_SIZE, GFP_ATOMIC|__GFP_NOWARN)
    18.8  
    18.9  /*
   18.10   * If the backend driver is pipelining transmit requests then we can be very
   18.11 @@ -193,35 +194,24 @@ static int netctrl_connected_count(void)
   18.12   * @param dev device
   18.13   * @return 0 on success, error code otherwise
   18.14   */
   18.15 -static int vif_wake(struct net_device *dev){
   18.16 -    int err = 0;
   18.17 +static int vif_wake(struct net_device *dev)
   18.18 +{
   18.19      struct sk_buff *skb;
   18.20 -    u32 src_ip;
   18.21 -    u32 dst_ip = INADDR_BROADCAST;
   18.22 -    unsigned char dst_hw[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
   18.23 +    u32             src_ip, dst_ip;
   18.24 +    unsigned char   dst_hw[ETH_ALEN];
   18.25  
   18.26 +    memset(dst_hw, 0xff, ETH_ALEN);
   18.27 +
   18.28 +    dst_ip = INADDR_BROADCAST;
   18.29      src_ip = inet_select_addr(dev, dst_ip, RT_SCOPE_LINK);
   18.30 +
   18.31      skb = arp_create(ARPOP_REQUEST, ETH_P_ARP,
   18.32                       dst_ip, dev, src_ip,
   18.33                       dst_hw, dev->dev_addr, NULL);
   18.34 -    if(skb == NULL){
   18.35 -        err = -ENOMEM;
   18.36 -        goto exit;
   18.37 -    }
   18.38 -    err = dev_queue_xmit(skb);
   18.39 -  exit:
   18.40 -    return err;
   18.41 -}
   18.42 +    if ( skb == NULL )
   18.43 +        return -ENOMEM;
   18.44  
   18.45 -static inline struct sk_buff *alloc_skb_page(void)
   18.46 -{
   18.47 -    struct sk_buff *skb;
   18.48 -    skb = __dev_alloc_skb((PAGE_SIZE/2)+1, GFP_ATOMIC|__GFP_NOWARN);
   18.49 -#if 0
   18.50 -    if ( skb && unlikely(((unsigned long)skb->head & (PAGE_SIZE-1)) != 0) )
   18.51 -        panic("alloc_skb needs to provide us page-aligned buffers.");
   18.52 -#endif
   18.53 -    return skb;
   18.54 +    return dev_queue_xmit(skb);
   18.55  }
   18.56  
   18.57  static int network_open(struct net_device *dev)
    19.1 --- a/linux-2.6.8.1-xen-sparse/include/asm-xen/asm-i386/page.h	Fri Sep 17 16:10:38 2004 +0000
    19.2 +++ b/linux-2.6.8.1-xen-sparse/include/asm-xen/asm-i386/page.h	Tue Sep 21 08:53:13 2004 +0000
    19.3 @@ -13,9 +13,16 @@
    19.4  #ifndef __ASSEMBLY__
    19.5  
    19.6  #include <linux/config.h>
    19.7 +#include <linux/string.h>
    19.8  #include <linux/types.h>
    19.9  #include <asm/hypervisor-ifs/hypervisor-if.h>
   19.10  
   19.11 +#ifdef CONFIG_XEN_SCRUB_PAGES
   19.12 +#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
   19.13 +#else
   19.14 +#define scrub_pages(_p,_n) ((void)0)
   19.15 +#endif
   19.16 +
   19.17  #ifdef CONFIG_X86_USE_3DNOW
   19.18  
   19.19  #include <asm/mmx.h>
    20.1 --- a/linux-2.6.8.1-xen-sparse/include/linux/skbuff.h	Fri Sep 17 16:10:38 2004 +0000
    20.2 +++ b/linux-2.6.8.1-xen-sparse/include/linux/skbuff.h	Tue Sep 21 08:53:13 2004 +0000
    20.3 @@ -936,18 +936,18 @@ static inline void __skb_queue_purge(str
    20.4   *
    20.5   *	%NULL is returned in there is no free memory.
    20.6   */
    20.7 +#ifndef CONFIG_HAVE_ARCH_DEV_ALLOC_SKB
    20.8  static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
    20.9  					      int gfp_mask)
   20.10  {
   20.11 -	struct sk_buff *skb;
   20.12 -#ifdef CONFIG_PAGESIZED_SKBS
   20.13 -	length = max(length, (unsigned int)(PAGE_SIZE - 16));
   20.14 -#endif
   20.15 -	skb = alloc_skb(length + 16, gfp_mask);
   20.16 +	struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
   20.17  	if (likely(skb))
   20.18  		skb_reserve(skb, 16);
   20.19  	return skb;
   20.20  }
   20.21 +#else
   20.22 +extern struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask);
   20.23 +#endif
   20.24  
   20.25  /**
   20.26   *	dev_alloc_skb - allocate an skbuff for sending
    21.1 --- a/tools/examples/init.d/xend	Fri Sep 17 16:10:38 2004 +0000
    21.2 +++ b/tools/examples/init.d/xend	Tue Sep 21 08:53:13 2004 +0000
    21.3 @@ -10,15 +10,15 @@
    21.4  case "$1" in
    21.5    start)
    21.6  	xend start
    21.7 -	exit $?
    21.8  	;;
    21.9    stop)
   21.10  	xend stop
   21.11 -	exit $?
   21.12  	;;
   21.13    status)
   21.14 +	xend status
   21.15  	;;
   21.16    restart|reload)
   21.17 +	xend restart
   21.18  	;;
   21.19    *)
   21.20  	# do not advertise unreasonable commands that there is no reason
   21.21 @@ -27,5 +27,5 @@ case "$1" in
   21.22  	exit 1
   21.23  esac
   21.24  
   21.25 -exit 0
   21.26 +exit $?
   21.27  
    22.1 --- a/tools/misc/xend	Fri Sep 17 16:10:38 2004 +0000
    22.2 +++ b/tools/misc/xend	Tue Sep 21 08:53:13 2004 +0000
    22.3 @@ -8,11 +8,12 @@
    22.4     Provides console server and HTTP management api.
    22.5  
    22.6     Run:
    22.7 -
    22.8     xend start
    22.9  
   22.10 +   Restart:
   22.11 +   xend restart
   22.12 +
   22.13     The daemon is stopped with:
   22.14 -
   22.15     xend stop
   22.16  
   22.17     The daemon should reconnect to device control interfaces
   22.18 @@ -107,6 +108,8 @@ def main():
   22.19          return daemon.stop()
   22.20      elif sys.argv[1] == 'restart':
   22.21          return daemon.stop() or daemon.start()
   22.22 +    elif sys.argv[1] == 'status':
   22.23 +        return daemon.status()
   22.24      else:
   22.25          print 'not an option:', sys.argv[1]
   22.26      return 1
    23.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 17 16:10:38 2004 +0000
    23.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Sep 21 08:53:13 2004 +0000
    23.3 @@ -1320,4 +1320,8 @@ PyMODINIT_FUNC initxc(void)
    23.4      PyDict_SetItemString(d, "error", xc_error);
    23.5  
    23.6      zero = PyInt_FromLong(0);
    23.7 +
    23.8 +    /* KAF: This ensures that we get debug output in a timely manner. */
    23.9 +    setbuf(stdout, NULL);
   23.10 +    setbuf(stderr, NULL);
   23.11  }
    24.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Fri Sep 17 16:10:38 2004 +0000
    24.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Tue Sep 21 08:53:13 2004 +0000
    24.3 @@ -1438,4 +1438,8 @@ PyMODINIT_FUNC initxu(void)
    24.4      d = PyModule_GetDict(m);
    24.5      port_error = PyErr_NewException(XENPKG ".PortError", NULL, NULL);
    24.6      PyDict_SetItemString(d, "PortError", port_error);
    24.7 +
    24.8 +    /* KAF: This ensures that we get debug output in a timely manner. */
    24.9 +    setbuf(stdout, NULL);
   24.10 +    setbuf(stderr, NULL);
   24.11  }
    25.1 --- a/tools/python/xen/xend/server/SrvDaemon.py	Fri Sep 17 16:10:38 2004 +0000
    25.2 +++ b/tools/python/xen/xend/server/SrvDaemon.py	Tue Sep 21 08:53:13 2004 +0000
    25.3 @@ -419,6 +419,18 @@ class Daemon:
    25.4          self.cleanup_xend(kill=kill)
    25.5          self.cleanup_xfrd(kill=kill)
    25.6              
    25.7 +    def status(self):
    25.8 +        """Returns the status of the xend and xfrd daemons.
    25.9 +        The return value is defined by the LSB:
   25.10 +        0  Running
   25.11 +        3  Not running
   25.12 +        """
   25.13 +        if (self.cleanup_process(XEND_PID_FILE, "xend", False) == 0 or
   25.14 +            self.cleanup_process(XFRD_PID_FILE, "xfrd", False) == 0):
   25.15 +            return 3
   25.16 +        else:
   25.17 +            return 0
   25.18 +
   25.19      def install_child_reaper(self):
   25.20          #signal.signal(signal.SIGCHLD, self.onSIGCHLD)
   25.21          # Ensure that zombie children are automatically reaped.
   25.22 @@ -451,22 +463,46 @@ class Daemon:
   25.23              pass
   25.24          else:
   25.25              # Child
   25.26 -            self.set_user()
   25.27              os.execl("/usr/sbin/xfrd", "xfrd")
   25.28              
   25.29      def start(self, trace=0):
   25.30 +        """Attempts to start the daemons.
   25.31 +        The return value is defined by the LSB:
   25.32 +        0  Success
   25.33 +        4  Insufficient privileges
   25.34 +        """
   25.35          xend_pid = self.cleanup_xend()
   25.36          xfrd_pid = self.cleanup_xfrd()
   25.37 +
   25.38 +        # Detach from TTY.
   25.39 +        os.setsid()
   25.40 +
   25.41 +        # Detach from standard file descriptors.
   25.42 +        # I do this at the file-descriptor level: the overlying Python file
   25.43 +        # objects also use fd's 0, 1 and 2.
   25.44 +        os.close(0)
   25.45 +        os.close(1)
   25.46 +        os.close(2)
   25.47 +        if DEBUG:
   25.48 +            os.open('/dev/null', os.O_RDONLY)
   25.49 +            # XXX KAF: Why doesn't this capture output from C extensions that
   25.50 +            # fprintf(stdout) or fprintf(stderr) ??
   25.51 +            os.open('/var/log/xend-debug.log', os.O_WRONLY|os.O_CREAT)
   25.52 +        else:
   25.53 +            os.open('/dev/null', os.O_RDWR)
   25.54 +            os.dup(0)
   25.55 +        os.dup(1)
   25.56 +
   25.57 +        if self.set_user():
   25.58 +            return 4
   25.59 +        os.chdir("/")
   25.60 +
   25.61          if xfrd_pid == 0:
   25.62              self.start_xfrd()
   25.63          if xend_pid > 0:
   25.64 -            return 1
   25.65 +            # Trying to run an already-running service is a success.
   25.66 +            return 0
   25.67  
   25.68 -        # Detach from TTY.
   25.69 -        if not DEBUG:
   25.70 -            os.setsid()
   25.71 -        if self.set_user():
   25.72 -            return 1
   25.73          self.install_child_reaper()
   25.74  
   25.75          if self.fork_pid(XEND_PID_FILE):
    26.1 --- a/tools/xentrace/xentrace.c	Fri Sep 17 16:10:38 2004 +0000
    26.2 +++ b/tools/xentrace/xentrace.c	Tue Sep 21 08:53:13 2004 +0000
    26.3 @@ -85,13 +85,13 @@ void write_rec(unsigned int cpu, struct 
    26.4  
    26.5  /**
    26.6   * get_tbufs - get pointer to and size of the trace buffers
    26.7 - * @phys_addr: location to store physical address if the trace buffers to
    26.8 + * @mach_addr: location to store machine address if the trace buffers to
    26.9   * @size:      location to store the size of a trace buffer to
   26.10   *
   26.11 - * Gets the physical address of the trace pointer area and the size of the
   26.12 + * Gets the machine address of the trace pointer area and the size of the
   26.13   * per CPU buffers.
   26.14   */
   26.15 -void get_tbufs(unsigned long *phys_addr, unsigned long *size)
   26.16 +void get_tbufs(unsigned long *mach_addr, unsigned long *size)
   26.17  {
   26.18      int ret;
   26.19      dom0_op_t op;                        /* dom0 op we'll build             */
   26.20 @@ -110,40 +110,40 @@ void get_tbufs(unsigned long *phys_addr,
   26.21          exit(EXIT_FAILURE);
   26.22      }
   26.23  
   26.24 -    *phys_addr = op.u.gettbufs.phys_addr;
   26.25 +    *mach_addr = op.u.gettbufs.mach_addr;
   26.26      *size      = op.u.gettbufs.size;
   26.27  }
   26.28  
   26.29  /**
   26.30   * map_tbufs - memory map Xen trace buffers into user space
   26.31 - * @tbufs:     physical address of the trace buffers
   26.32 + * @tbufs:     machine address of the trace buffers
   26.33   * @num:       number of trace buffers to map
   26.34   * @size:      size of each trace buffer
   26.35   *
   26.36   * Maps the Xen trace buffers them into process address space by memory mapping
   26.37   * /dev/mem.  Returns the location the buffers have been mapped to.
   26.38   */
   26.39 -struct t_buf *map_tbufs(unsigned long tbufs_phys, unsigned int num,
   26.40 +struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num,
   26.41                          unsigned long size)
   26.42  {
   26.43 -    int dm_fd;                               /* file descriptor for /dev/mem */
   26.44 +    int xc_handle;                  /* file descriptor for /proc/xen/privcmd */
   26.45      struct t_buf *tbufs_mapped;
   26.46  
   26.47 -    dm_fd = open("/dev/mem", O_RDONLY);
   26.48 +    xc_handle = xc_interface_open();
   26.49  
   26.50 -    if ( dm_fd < 0 ) 
   26.51 +    if ( xc_handle < 0 ) 
   26.52      {
   26.53 -        PERROR("Open /dev/mem when mapping trace buffers\n");
   26.54 +        PERROR("Open /proc/xen/privcmd when mapping trace buffers\n");
   26.55          exit(EXIT_FAILURE);
   26.56      }
   26.57  
   26.58 -    tbufs_mapped = (struct t_buf *)mmap(NULL, size * num,
   26.59 -                                        PROT_READ, MAP_SHARED,
   26.60 -                                        dm_fd, (off_t)tbufs_phys);
   26.61 +    tbufs_mapped = xc_map_foreign_range(xc_handle, 0 /* Dom 0 ID */,
   26.62 +					size * num, PROT_READ,
   26.63 +					tbufs_mach >> PAGE_SHIFT);
   26.64  
   26.65 -    close(dm_fd);
   26.66 +    xc_interface_close(xc_handle);
   26.67  
   26.68 -    if ( tbufs_mapped == MAP_FAILED ) 
   26.69 +    if ( tbufs_mapped == 0 ) 
   26.70      {
   26.71          PERROR("Failed to mmap trace buffers");
   26.72          exit(EXIT_FAILURE);
   26.73 @@ -187,16 +187,16 @@ struct t_buf **init_bufs_ptrs(void *bufs
   26.74  
   26.75  /**
   26.76   * init_rec_ptrs - initialises data area pointers to locations in user space
   26.77 - * @tbufs_phys:    physical base address of the trace buffer area
   26.78 + * @tbufs_mach:    machine base address of the trace buffer area
   26.79   * @tbufs_mapped:  user virtual address of base of trace buffer area
   26.80   * @meta:          array of user-space pointers to struct t_buf's of metadata
   26.81   * @num:           number of trace buffers
   26.82   *
   26.83   * Initialises data area pointers to the locations that data areas have been
   26.84 - * mapped in user space.  Note that the trace buffer metadata contains physical
   26.85 + * mapped in user space.  Note that the trace buffer metadata contains machine
   26.86   * pointers - the array returned allows more convenient access to them.
   26.87   */
   26.88 -struct t_rec **init_rec_ptrs(unsigned long tbufs_phys,
   26.89 +struct t_rec **init_rec_ptrs(unsigned long tbufs_mach,
   26.90                               struct t_buf *tbufs_mapped,
   26.91                               struct t_buf **meta,
   26.92                               unsigned int num)
   26.93 @@ -212,8 +212,8 @@ struct t_rec **init_rec_ptrs(unsigned lo
   26.94      }
   26.95  
   26.96      for ( i = 0; i<num; i++ )
   26.97 -        data[i] = (struct t_rec *)((unsigned long)meta[i]->data -
   26.98 -                                   tbufs_phys + (unsigned long)tbufs_mapped);
   26.99 +        data[i] = (struct t_rec *)(meta[i]->data - tbufs_mach
  26.100 +				   + (unsigned long)tbufs_mapped);
  26.101  
  26.102      return data;
  26.103  }
  26.104 @@ -283,7 +283,7 @@ int monitor_tbufs(FILE *logfile)
  26.105      struct t_rec **data;         /* pointers to the trace buffer data areas
  26.106                                    * where they are mapped into user space.   */
  26.107      unsigned long *cons;         /* store tail indexes for the trace buffers */
  26.108 -    unsigned long tbufs_phys;    /* physical address of the tbufs            */
  26.109 +    unsigned long tbufs_mach;    /* machine address of the tbufs             */
  26.110      unsigned int  num;           /* number of trace buffers / logical CPUS   */
  26.111      unsigned long size;          /* size of a single trace buffer            */
  26.112  
  26.113 @@ -293,36 +293,26 @@ int monitor_tbufs(FILE *logfile)
  26.114      num = get_num_cpus();
  26.115  
  26.116      /* setup access to trace buffers */
  26.117 -    get_tbufs(&tbufs_phys, &size);
  26.118 -    tbufs_mapped = map_tbufs(tbufs_phys, num, size);
  26.119 +    get_tbufs(&tbufs_mach, &size);
  26.120 +    tbufs_mapped = map_tbufs(tbufs_mach, num, size);
  26.121  
  26.122      size_in_recs = (size / sizeof(struct t_rec) )-1;
  26.123  
  26.124      /* build arrays of convenience ptrs */
  26.125      meta  = init_bufs_ptrs (tbufs_mapped, num, size);
  26.126 -    data  = init_rec_ptrs  (tbufs_phys, tbufs_mapped, meta, num);
  26.127 +    data  = init_rec_ptrs  (tbufs_mach, tbufs_mapped, meta, num);
  26.128      cons  = init_tail_idxs (meta, num);
  26.129  
  26.130      /* now, scan buffers for events */
  26.131      while ( !interrupted )
  26.132      {
  26.133          for ( i = 0; ( i < num ) && !interrupted; i++ )
  26.134 -        {	    
  26.135 -/*	    printf("XX%d: cons=%ld head=%ld  %p\n", i,
  26.136 -		   cons[i], meta[i]->head, data[i] + (cons[i] % size_in_recs) );
  26.137 -		   */
  26.138  	    while( cons[i] != meta[i]->head )
  26.139  	    {
  26.140 -/*
  26.141 -		if( (cons[i] % 6  ) == 0 )
  26.142 -		    printf("%d: cons=%ld head=%ld  %p\n", i,
  26.143 -		       cons[i], meta[i]->head, data[i] + (cons[i] % size_in_recs) );
  26.144 -		       */
  26.145  		write_rec(i, data[i] + (cons[i] % size_in_recs), logfile);
  26.146  		cons[i]++;
  26.147  	    }
  26.148  
  26.149 -        }
  26.150          nanosleep(&opts.poll_sleep, NULL);
  26.151      }
  26.152  
    27.1 --- a/xen/common/page_alloc.c	Fri Sep 17 16:10:38 2004 +0000
    27.2 +++ b/xen/common/page_alloc.c	Tue Sep 21 08:53:13 2004 +0000
    27.3 @@ -28,6 +28,7 @@
    27.4  #include <xen/spinlock.h>
    27.5  #include <xen/slab.h>
    27.6  #include <xen/irq.h>
    27.7 +#include <asm/domain_page.h>
    27.8  
    27.9  extern char opt_badpage[];
   27.10  
   27.11 @@ -427,6 +428,7 @@ void free_domheap_pages(struct pfn_info 
   27.12  {
   27.13      int            i, drop_dom_ref;
   27.14      struct domain *d = pg->u.inuse.domain;
   27.15 +    void          *p;
   27.16  
   27.17      if ( unlikely(IS_XEN_HEAP_FRAME(pg)) )
   27.18      {
   27.19 @@ -448,14 +450,22 @@ void free_domheap_pages(struct pfn_info 
   27.20  
   27.21          for ( i = 0; i < (1 << order); i++ )
   27.22          {
   27.23 -#ifndef NDEBUG
   27.24 -	    if ( pg[i].u.inuse.type_info & PGT_count_mask )
   27.25 -		printk("ERROR: type count not zero on free %x\n",
   27.26 -		       pg[i].u.inuse.type_info );
   27.27 -#endif
   27.28 +            ASSERT((pg[i].u.inuse.type_info & PGT_count_mask) == 0);
   27.29              pg[i].tlbflush_timestamp  = tlbflush_clock;
   27.30              pg[i].u.free.cpu_mask     = 1 << d->processor;
   27.31              list_del(&pg[i].list);
   27.32 +
   27.33 +            /*
   27.34 +             * Normally we expect a domain to clear pages before freeing them,
   27.35 +             * if it cares about the secrecy of their contents. However, after
   27.36 +             * a domain has died we assume responsibility for erasure.
   27.37 +             */
   27.38 +            if ( unlikely(test_bit(DF_DYING, &d->flags)) )
   27.39 +            {
   27.40 +                p = map_domain_mem(page_to_phys(&pg[i]));
   27.41 +                clear_page(p);
   27.42 +                unmap_domain_mem(p);
   27.43 +            }
   27.44          }
   27.45  
   27.46          d->tot_pages -= 1 << order;
    28.1 --- a/xen/common/trace.c	Fri Sep 17 16:10:38 2004 +0000
    28.2 +++ b/xen/common/trace.c	Tue Sep 21 08:53:13 2004 +0000
    28.3 @@ -83,7 +83,7 @@ void init_trace_bufs(void)
    28.4          buf->head_ptr = buf->vdata;
    28.5          
    28.6          /* For use in user space. */
    28.7 -        buf->data = (struct t_rec *)__pa(buf->vdata);
    28.8 +        buf->data = __pa(buf->vdata);
    28.9          buf->head = 0;
   28.10  
   28.11          /* For use in both. */
   28.12 @@ -92,7 +92,7 @@ void init_trace_bufs(void)
   28.13      }
   28.14  
   28.15      printk("Xen trace buffers: initialised\n");
   28.16 - 
   28.17 +    
   28.18      wmb(); /* above must be visible before tb_init_done flag set */
   28.19  
   28.20      tb_init_done = 1;
   28.21 @@ -102,7 +102,7 @@ void init_trace_bufs(void)
   28.22   * get_tb_info - get trace buffer details
   28.23   * @st: a pointer to a dom0_gettbufs_t to be filled out
   28.24   *
   28.25 - * Called by the %DOM0_GETTBUFS dom0 op to fetch the physical address of the
   28.26 + * Called by the %DOM0_GETTBUFS dom0 op to fetch the machine address of the
   28.27   * trace buffers.
   28.28   */
   28.29  int get_tb_info(dom0_gettbufs_t *st)
   28.30 @@ -111,14 +111,14 @@ int get_tb_info(dom0_gettbufs_t *st)
   28.31      {
   28.32          extern unsigned int opt_tbuf_size;
   28.33          
   28.34 -        st->phys_addr = __pa(t_bufs[0]);
   28.35 +        st->mach_addr = __pa(t_bufs[0]);
   28.36          st->size      = opt_tbuf_size * PAGE_SIZE;
   28.37          
   28.38          return 0;
   28.39      }
   28.40      else
   28.41      {
   28.42 -        st->phys_addr = 0;
   28.43 +        st->mach_addr = 0;
   28.44          st->size      = 0;
   28.45          return -ENODATA;
   28.46      }
    29.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Fri Sep 17 16:10:38 2004 +0000
    29.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Tue Sep 21 08:53:13 2004 +0000
    29.3 @@ -19,7 +19,7 @@
    29.4   * This makes sure that old versions of dom0 tools will stop working in a
    29.5   * well-defined way (rather than crashing the machine, for instance).
    29.6   */
    29.7 -#define DOM0_INTERFACE_VERSION   0xAAAA0014
    29.8 +#define DOM0_INTERFACE_VERSION   0xAAAA0015
    29.9  
   29.10  #define MAX_DOMAIN_NAME    16
   29.11  
   29.12 @@ -216,11 +216,11 @@ typedef struct {
   29.13      s32          cpu;                 /*  4: -1 implies unpin */
   29.14  } PACKED dom0_pincpudomain_t; /* 8 bytes */
   29.15  
   29.16 -/* Get trace buffers physical base pointer */
   29.17 +/* Get trace buffers machine base address */
   29.18  #define DOM0_GETTBUFS         21
   29.19  typedef struct {
   29.20      /* OUT variables */
   29.21 -    memory_t phys_addr;   /*  0: location of the trace buffers       */
   29.22 +    memory_t mach_addr;   /*  0: location of the trace buffers       */
   29.23      MEMORY_PADDING;
   29.24      u32      size;        /*  8: size of each trace buffer, in bytes */
   29.25  } PACKED dom0_gettbufs_t; /* 12 bytes */
    30.1 --- a/xen/include/hypervisor-ifs/trace.h	Fri Sep 17 16:10:38 2004 +0000
    30.2 +++ b/xen/include/hypervisor-ifs/trace.h	Tue Sep 21 08:53:13 2004 +0000
    30.3 @@ -17,13 +17,13 @@ struct t_rec {
    30.4   * field, indexes into an array of struct t_rec's.
    30.5   */
    30.6  struct t_buf {
    30.7 -    struct t_rec *data;     /* pointer to data area.  physical address
    30.8 -                             * for convenience in user space code            */
    30.9 +    unsigned long data;      /* pointer to data area.  machine address
   30.10 +                              * for convenience in user space code           */
   30.11  
   30.12      unsigned long size;      /* size of the data area, in t_recs             */
   30.13      unsigned long head;      /* array index of the most recent record        */
   30.14  
   30.15 -    /* Kernel-private elements follow... */
   30.16 +    /* Xen-private elements follow... */
   30.17      struct t_rec *head_ptr; /* pointer to the head record                    */
   30.18      struct t_rec *vdata;    /* virtual address pointer to data               */
   30.19  };