ia64/xen-unstable

changeset 3068:e93693f73344

bitkeeper revision 1.1159.179.14 (419e3557Bfp_tay_gkieArfoR5RwPA)

Merge arcadians.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xen-2.0-linux.bk
into arcadians.cl.cam.ac.uk:/local/scratch-2/cl349/xen-2.0-linux.bk
author cl349@arcadians.cl.cam.ac.uk
date Fri Nov 19 18:03:03 2004 +0000 (2004-11-19)
parents 8651c3cb88d9 3ca98cad4ced
children c52145d62855
files linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/io.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mmu_context.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/param.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgalloc.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/tlbflush.h linux-2.6.10-rc2-xen-sparse/net/core/skbuff.c
line diff
     1.1 --- a/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/time.c	Fri Nov 19 16:20:45 2004 +0000
     1.2 +++ b/linux-2.6.10-rc2-xen-sparse/arch/xen/i386/kernel/time.c	Fri Nov 19 18:03:03 2004 +0000
     1.3 @@ -616,7 +616,7 @@ void __init hpet_time_init(void)
     1.4  #endif
     1.5  
     1.6  /* Dynamically-mapped IRQ. */
     1.7 -static int time_irq;
     1.8 +static int TIMER_IRQ;
     1.9  
    1.10  static struct irqaction irq_timer = {
    1.11  	timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer",
    1.12 @@ -646,9 +646,9 @@ void __init time_init(void)
    1.13  		BUG();
    1.14  	printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name);
    1.15  
    1.16 -	time_irq = bind_virq_to_irq(VIRQ_TIMER);
    1.17 +	TIMER_IRQ = bind_virq_to_irq(VIRQ_TIMER);
    1.18  
    1.19 -	(void)setup_irq(time_irq, &irq_timer);
    1.20 +	(void)setup_irq(TIMER_IRQ, &irq_timer);
    1.21  }
    1.22  
    1.23  /* Convert jiffies to system time. Call with xtime_lock held for reading. */
     2.1 --- a/linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c	Fri Nov 19 16:20:45 2004 +0000
     2.2 +++ b/linux-2.6.10-rc2-xen-sparse/drivers/char/mem.c	Fri Nov 19 18:03:03 2004 +0000
     2.3 @@ -26,7 +26,6 @@
     2.4  
     2.5  #include <asm/uaccess.h>
     2.6  #include <asm/io.h>
     2.7 -#include <asm/pgalloc.h>
     2.8  
     2.9  #ifdef CONFIG_IA64
    2.10  # include <linux/efi.h>
    2.11 @@ -44,10 +43,10 @@ extern void tapechar_init(void);
    2.12  static inline int uncached_access(struct file *file, unsigned long addr)
    2.13  {
    2.14  #ifdef CONFIG_XEN
    2.15 -        if (file->f_flags & O_SYNC)
    2.16 -                return 1;
    2.17 -        /* Xen sets correct MTRR type on non-RAM for us. */
    2.18 -        return 0;
    2.19 +	if (file->f_flags & O_SYNC)
    2.20 +		return 1;
    2.21 +	/* Xen sets correct MTRR type on non-RAM for us. */
    2.22 +	return 0;
    2.23  #elif defined(__i386__)
    2.24  	/*
    2.25  	 * On the PPro and successors, the MTRRs are used to set
    2.26 @@ -215,6 +214,7 @@ static int mmap_mem(struct file * file, 
    2.27  				vma->vm_page_prot))
    2.28  		return -EAGAIN;
    2.29  #else
    2.30 +	/* Remap-pfn-range will mark the range VM_IO and VM_RESERVED */
    2.31  	if (remap_pfn_range(vma,
    2.32  			    vma->vm_start,
    2.33  			    vma->vm_pgoff,
     3.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/io.h	Fri Nov 19 16:20:45 2004 +0000
     3.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/io.h	Fri Nov 19 18:03:03 2004 +0000
     3.3 @@ -90,14 +90,17 @@ static inline void * phys_to_virt(unsign
     3.4   * Change "struct page" to physical address.
     3.5   */
     3.6  #define page_to_pseudophys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
     3.7 -#define page_to_phys(page)       (phys_to_machine(page_to_pseudophys(page)))
     3.8 +#define page_to_phys(page)	 (phys_to_machine(page_to_pseudophys(page)))
     3.9  
    3.10 -#define bio_to_pseudophys(bio)	(page_to_pseudophys(bio_page((bio))) + (unsigned long) bio_offset((bio)))
    3.11 -#define bvec_to_pseudophys(bv)	(page_to_pseudophys((bv)->bv_page) + (unsigned long) (bv)->bv_offset)
    3.12 +#define bio_to_pseudophys(bio)	 (page_to_pseudophys(bio_page((bio))) + \
    3.13 +				  (unsigned long) bio_offset((bio)))
    3.14 +#define bvec_to_pseudophys(bv)	 (page_to_pseudophys((bv)->bv_page) + \
    3.15 +				  (unsigned long) (bv)->bv_offset)
    3.16  
    3.17  #define BIOVEC_PHYS_MERGEABLE(vec1, vec2)	\
    3.18  	(((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) && \
    3.19 -	 ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) == bvec_to_pseudophys((vec2))))
    3.20 +	 ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) == \
    3.21 +	  bvec_to_pseudophys((vec2))))
    3.22  
    3.23  extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
    3.24  
    3.25 @@ -135,7 +138,8 @@ extern void bt_iounmap(void *addr, unsig
    3.26  #define isa_virt_to_bus(_x) isa_virt_to_bus_is_UNSUPPORTED->x
    3.27  #define isa_page_to_bus(_x) isa_page_to_bus_is_UNSUPPORTED->x
    3.28  #ifdef CONFIG_XEN_PRIVILEGED_GUEST
    3.29 -#define isa_bus_to_virt(_x) (void *)__fix_to_virt(FIX_ISAMAP_BEGIN - ((_x) >> PAGE_SHIFT))
    3.30 +#define isa_bus_to_virt(_x) (void *)__fix_to_virt(FIX_ISAMAP_BEGIN - \
    3.31 +						  ((_x) >> PAGE_SHIFT))
    3.32  #else
    3.33  #define isa_bus_to_virt(_x) isa_bus_to_virt_needs_PRIVILEGED_BUILD
    3.34  #endif
    3.35 @@ -367,7 +371,7 @@ static inline unsigned type in##bwl##_qu
    3.36  static inline unsigned type in##bwl(int port) { \
    3.37  	return in##bwl##_quad(port, 0); \
    3.38  }
    3.39 -#else 
    3.40 +#else
    3.41  #define __BUILDIO(bwl,bw,type) \
    3.42  static inline void out##bwl(unsigned type value, int port) { \
    3.43  	out##bwl##_local(value, port); \
     4.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h	Fri Nov 19 16:20:45 2004 +0000
     4.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h	Fri Nov 19 18:03:03 2004 +0000
     4.3 @@ -65,7 +65,7 @@
     4.4  #define FIRST_DEVICE_VECTOR	0x31
     4.5  #define FIRST_SYSTEM_VECTOR	0xef
     4.6  
     4.7 -/*  #define TIMER_IRQ _EVENT_TIMER */
     4.8 +#define TIMER_IRQ		timer_irq
     4.9  
    4.10  /*
    4.11   * 16 8259A IRQ's, 208 potential APIC interrupt sources.
    4.12 @@ -84,23 +84,6 @@
    4.13   * should be changed accordingly.
    4.14   */
    4.15  #define NR_VECTORS 256
    4.16 -
    4.17 -#ifdef CONFIG_PCI_USE_VECTOR
    4.18 -#define NR_IRQS FIRST_SYSTEM_VECTOR
    4.19 -#define NR_IRQ_VECTORS NR_IRQS
    4.20 -#else
    4.21 -#ifdef CONFIG_X86_IO_APIC
    4.22 -#define NR_IRQS 224
    4.23 -# if (224 >= 32 * NR_CPUS)
    4.24 -# define NR_IRQ_VECTORS NR_IRQS
    4.25 -# else
    4.26 -# define NR_IRQ_VECTORS (32 * NR_CPUS)
    4.27 -# endif
    4.28 -#else
    4.29 -#define NR_IRQS 16
    4.30 -#define NR_IRQ_VECTORS NR_IRQS
    4.31 -#endif
    4.32 -#endif
    4.33  #endif
    4.34  
    4.35  #define FPU_IRQ			13
    4.36 @@ -119,20 +102,20 @@
    4.37   *     are bound using the provided bind/unbind functions.
    4.38   */
    4.39  
    4.40 -#define PIRQ_BASE   0
    4.41 -#define NR_PIRQS  128
    4.42 +#define PIRQ_BASE		0
    4.43 +#define NR_PIRQS		128
    4.44  
    4.45 -#define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS)
    4.46 -#define NR_DYNIRQS  128
    4.47 +#define DYNIRQ_BASE		(PIRQ_BASE + NR_PIRQS)
    4.48 +#define NR_DYNIRQS		128
    4.49  
    4.50 -#define NR_IRQS   (NR_PIRQS + NR_DYNIRQS)
    4.51 -#define NR_IRQ_VECTORS NR_IRQS
    4.52 +#define NR_IRQS			(NR_PIRQS + NR_DYNIRQS)
    4.53 +#define NR_IRQ_VECTORS		NR_IRQS
    4.54  
    4.55 -#define pirq_to_irq(_x)   ((_x) + PIRQ_BASE)
    4.56 -#define irq_to_pirq(_x)   ((_x) - PIRQ_BASE)
    4.57 +#define pirq_to_irq(_x)		((_x) + PIRQ_BASE)
    4.58 +#define irq_to_pirq(_x)		((_x) - PIRQ_BASE)
    4.59  
    4.60 -#define dynirq_to_irq(_x) ((_x) + DYNIRQ_BASE)
    4.61 -#define irq_to_dynirq(_x) ((_x) - DYNIRQ_BASE)
    4.62 +#define dynirq_to_irq(_x)	((_x) + DYNIRQ_BASE)
    4.63 +#define irq_to_dynirq(_x)	((_x) - DYNIRQ_BASE)
    4.64  
    4.65  #ifndef __ASSEMBLY__
    4.66  /* Dynamic binding of event channels and VIRQ sources to Linux IRQ space. */
     5.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mmu_context.h	Fri Nov 19 16:20:45 2004 +0000
     5.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/mmu_context.h	Fri Nov 19 18:03:03 2004 +0000
     5.3 @@ -66,10 +66,9 @@ static inline void switch_mm(struct mm_s
     5.4  #define deactivate_mm(tsk, mm) \
     5.5  	asm("movl %0,%%fs ; movl %0,%%gs": :"r" (0))
     5.6  
     5.7 -#define activate_mm(prev, next) \
     5.8 -do { \
     5.9 -	switch_mm((prev),(next),NULL); \
    5.10 -	flush_page_update_queue();			\
    5.11 -} while ( 0 )
    5.12 +#define activate_mm(prev, next) do {		\
    5.13 +	switch_mm((prev),(next),NULL);		\
    5.14 +	flush_page_update_queue();		\
    5.15 +} while (0)
    5.16  
    5.17  #endif
     6.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/page.h	Fri Nov 19 16:20:45 2004 +0000
     6.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/page.h	Fri Nov 19 18:03:03 2004 +0000
     6.3 @@ -60,15 +60,15 @@ extern unsigned long *phys_to_machine_ma
     6.4  #define mfn_to_pfn(_mfn) (machine_to_phys_mapping[(_mfn)])
     6.5  static inline unsigned long phys_to_machine(unsigned long phys)
     6.6  {
     6.7 -    unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
     6.8 -    machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
     6.9 -    return machine;
    6.10 +	unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
    6.11 +	machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
    6.12 +	return machine;
    6.13  }
    6.14  static inline unsigned long machine_to_phys(unsigned long machine)
    6.15  {
    6.16 -    unsigned long phys = mfn_to_pfn(machine >> PAGE_SHIFT);
    6.17 -    phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
    6.18 -    return phys;
    6.19 +	unsigned long phys = mfn_to_pfn(machine >> PAGE_SHIFT);
    6.20 +	phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
    6.21 +	return phys;
    6.22  }
    6.23  
    6.24  /*
    6.25 @@ -89,16 +89,8 @@ typedef struct { unsigned long pmd; } pm
    6.26  typedef struct { unsigned long pgd; } pgd_t;
    6.27  typedef struct { unsigned long pgprot; } pgprot_t;
    6.28  #define boot_pte_t pte_t /* or would you rather have a typedef */
    6.29 -#if 0				/* XXXcl for MMU_UPDATE_DEBUG */
    6.30 -static inline unsigned long pte_val(pte_t x)
    6.31 -{
    6.32 -	unsigned long ret = x.pte_low;
    6.33 -	if ( (ret & 1) ) ret = machine_to_phys(ret);
    6.34 -	return ret;
    6.35 -}
    6.36 -#else
    6.37 -#define pte_val(x)	(((x).pte_low & 1) ? machine_to_phys((x).pte_low) : (x).pte_low)
    6.38 -#endif
    6.39 +#define pte_val(x)	(((x).pte_low & 1) ? machine_to_phys((x).pte_low) : \
    6.40 +			 (x).pte_low)
    6.41  #define pte_val_ma(x)	((x).pte_low)
    6.42  #define HPAGE_SHIFT	22
    6.43  #endif
    6.44 @@ -114,25 +106,25 @@ static inline unsigned long pte_val(pte_
    6.45  
    6.46  static inline unsigned long pmd_val(pmd_t x)
    6.47  {
    6.48 -    unsigned long ret = x.pmd;
    6.49 -    if ( (ret) ) ret = machine_to_phys(ret);
    6.50 -    return ret;
    6.51 +	unsigned long ret = x.pmd;
    6.52 +	if (ret) ret = machine_to_phys(ret);
    6.53 +	return ret;
    6.54  }
    6.55  #define pgd_val(x)	({ BUG(); (unsigned long)0; })
    6.56  #define pgprot_val(x)	((x).pgprot)
    6.57  
    6.58  static inline pte_t __pte(unsigned long x)
    6.59  {
    6.60 -	if ( (x & 1) ) x = phys_to_machine(x);
    6.61 +	if (x & 1) x = phys_to_machine(x);
    6.62  	return ((pte_t) { (x) });
    6.63  }
    6.64 -#define __pte_ma(x) ((pte_t) { (x) } )
    6.65 +#define __pte_ma(x)	((pte_t) { (x) } )
    6.66  static inline pmd_t __pmd(unsigned long x)
    6.67  {
    6.68 -	if ( (x & 1) ) x = phys_to_machine(x);
    6.69 +	if ((x & 1)) x = phys_to_machine(x);
    6.70  	return ((pmd_t) { (x) });
    6.71  }
    6.72 -#define __pgd(x) ({ BUG(); (pgprot_t) { 0 }; })
    6.73 +#define __pgd(x)	({ BUG(); (pgprot_t) { 0 }; })
    6.74  #define __pgprot(x)	((pgprot_t) { (x) } )
    6.75  
    6.76  #endif /* !__ASSEMBLY__ */
    6.77 @@ -179,14 +171,6 @@ extern int sysctl_legacy_va_layout;
    6.78  
    6.79  #endif /* __ASSEMBLY__ */
    6.80  
    6.81 -/* 
    6.82 - * XXXcl two options for PAGE_OFFSET
    6.83 - * - 0xC0000000:
    6.84 - *   change text offset in arch/xen/i386/kernel/vmlinux.lds.S
    6.85 - *   change __pa/__va macros
    6.86 - * - 0xC0100000:
    6.87 - *   change TASK_SIZE 
    6.88 - */
    6.89  #ifdef __ASSEMBLY__
    6.90  #define __PAGE_OFFSET		(0xC0000000)
    6.91  #else
     7.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/param.h	Fri Nov 19 16:20:45 2004 +0000
     7.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/param.h	Fri Nov 19 18:03:03 2004 +0000
     7.3 @@ -2,7 +2,7 @@
     7.4  #define _ASMi386_PARAM_H
     7.5  
     7.6  #ifdef __KERNEL__
     7.7 -# define HZ		100/*  0 */		/* Internal kernel timer frequency */
     7.8 +# define HZ		100		/* Internal kernel timer frequency */
     7.9  # define USER_HZ	100		/* .. some user interfaces are in "ticks" */
    7.10  # define CLOCKS_PER_SEC		(USER_HZ)	/* like times() */
    7.11  #endif
     8.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgalloc.h	Fri Nov 19 16:20:45 2004 +0000
     8.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgalloc.h	Fri Nov 19 18:03:03 2004 +0000
     8.3 @@ -17,7 +17,6 @@ static inline void pmd_populate(struct m
     8.4  		((unsigned long long)page_to_pfn(pte) <<
     8.5  			(unsigned long long) PAGE_SHIFT)));
     8.6  	flush_page_update_queue();
     8.7 -	/* XXXcl queue */
     8.8  }
     8.9  /*
    8.10   * Allocate and free page tables.
    8.11 @@ -38,7 +37,7 @@ static inline void pte_free_kernel(pte_t
    8.12  
    8.13  extern void pte_free(struct page *pte);
    8.14  
    8.15 -#define __pte_free_tlb(tlb,pte)	tlb_remove_page((tlb),(pte))
    8.16 +#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
    8.17  
    8.18  /*
    8.19   * allocating and freeing a pmd is trivial: the 1-entry pmd is
    8.20 @@ -53,15 +52,4 @@ extern void pte_free(struct page *pte);
    8.21  
    8.22  #define check_pgt_cache()	do { } while (0)
    8.23  
    8.24 -int direct_remap_area_pages(struct mm_struct *mm,
    8.25 -                            unsigned long address, 
    8.26 -                            unsigned long machine_addr,
    8.27 -                            unsigned long size, 
    8.28 -                            pgprot_t prot,
    8.29 -                            domid_t  domid);
    8.30 -int __direct_remap_area_pages(struct mm_struct *mm,
    8.31 -			      unsigned long address, 
    8.32 -			      unsigned long size, 
    8.33 -			      mmu_update_t *v);
    8.34 -
    8.35  #endif /* _I386_PGALLOC_H */
     9.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Fri Nov 19 16:20:45 2004 +0000
     9.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Fri Nov 19 18:03:03 2004 +0000
     9.3 @@ -24,7 +24,7 @@ static inline int pgd_present(pgd_t pgd)
     9.4   * hook is made available.
     9.5   */
     9.6  #define set_pte_batched(pteptr, pteval) \
     9.7 -queue_l1_entry_update(pteptr, (pteval).pte_low)
     9.8 +	queue_l1_entry_update(pteptr, (pteval).pte_low)
     9.9  #define set_pte(pteptr, pteval) (*(pteptr) = pteval)
    9.10  #define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
    9.11  /*
    9.12 @@ -60,7 +60,7 @@ static inline pte_t ptep_get_and_clear(p
    9.13  }
    9.14  
    9.15  #define pte_same(a, b)		((a).pte_low == (b).pte_low)
    9.16 -/*                                 
    9.17 +/*
    9.18   * We detect special mappings in one of two ways:
    9.19   *  1. If the MFN is an I/O page then Xen will set the m2p entry
    9.20   *     to be outside our maximum possible pseudophys range.
    9.21 @@ -82,19 +82,18 @@ static inline pte_t ptep_get_and_clear(p
    9.22   */
    9.23  #define INVALID_P2M_ENTRY (~0UL)
    9.24  #define FOREIGN_FRAME(_m) ((_m) | (1UL<<((sizeof(unsigned long)*8)-1)))
    9.25 -#define pte_pfn(_pte)                                                   \
    9.26 -({                                                                      \
    9.27 -    unsigned long mfn = (_pte).pte_low >> PAGE_SHIFT;                   \
    9.28 -    unsigned long pfn = mfn_to_pfn(mfn);                                \
    9.29 -    if ( (pfn >= max_mapnr) || (pfn_to_mfn(pfn) != mfn) )               \
    9.30 -        pfn = max_mapnr; /* special: force !pfn_valid() */              \
    9.31 -    pfn;                                                                \
    9.32 +#define pte_pfn(_pte)							\
    9.33 +({									\
    9.34 +	unsigned long mfn = (_pte).pte_low >> PAGE_SHIFT;		\
    9.35 +	unsigned long pfn = mfn_to_pfn(mfn);				\
    9.36 +	if ((pfn >= max_mapnr) || (pfn_to_mfn(pfn) != mfn))		\
    9.37 +		pfn = max_mapnr; /* special: force !pfn_valid() */	\
    9.38 +	pfn;								\
    9.39  })
    9.40  
    9.41  #define pte_page(_pte) pfn_to_page(pte_pfn(_pte))
    9.42  
    9.43  #define pte_none(x)		(!(x).pte_low)
    9.44 -
    9.45  #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
    9.46  #define pfn_pte_ma(pfn, prot)	__pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
    9.47  #define pfn_pmd(pfn, prot)	__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
    10.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Fri Nov 19 16:20:45 2004 +0000
    10.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Fri Nov 19 18:03:03 2004 +0000
    10.3 @@ -89,7 +89,7 @@ void paging_init(void);
    10.4  # define VMALLOC_END	(FIXADDR_START-2*PAGE_SIZE)
    10.5  #endif
    10.6  
    10.7 -extern void * high_memory;
    10.8 +extern void *high_memory;
    10.9  extern unsigned long vmalloc_earlyreserve;
   10.10  
   10.11  /*
   10.12 @@ -215,7 +215,7 @@ extern unsigned long pg0[];
   10.13     can temporarily clear it. */
   10.14  #define pmd_present(x)	(pmd_val(x))
   10.15  /* pmd_clear below */
   10.16 -#define	pmd_bad(x)	((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PRESENT)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
   10.17 +#define pmd_bad(x)	((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER & ~_PAGE_PRESENT)) != (_KERNPG_TABLE & ~_PAGE_PRESENT))
   10.18  
   10.19  
   10.20  #define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
   10.21 @@ -421,30 +421,19 @@ extern pte_t *lookup_address(unsigned lo
   10.22  #define update_mmu_cache(vma,address,pte) do { } while (0)
   10.23  #define  __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
   10.24  
   10.25 -#if 0
   10.26  #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
   10.27  	do {								  \
   10.28  		if (__dirty) {						  \
   10.29 -			queue_l1_entry_update((__ptep), (__entry).pte_low); \
   10.30 -			flush_tlb_page(__vma, __address);                 \
   10.31 -			xen_flush_page_update_queue();                    \
   10.32 +			if (likely(vma->vm_mm == current->mm)) {	  \
   10.33 +			    xen_flush_page_update_queue();		  \
   10.34 +			    HYPERVISOR_update_va_mapping(address>>PAGE_SHIFT, \
   10.35 +							 entry, UVMF_INVLPG); \
   10.36 +			} else {					  \
   10.37 +			    xen_l1_entry_update((__ptep), (__entry).pte_low); \
   10.38 +			    flush_tlb_page(__vma, __address);	          \
   10.39 +			}						  \
   10.40  		}							  \
   10.41  	} while (0)
   10.42 -#else
   10.43 -#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
   10.44 -	do {								  \
   10.45 -		if (__dirty) {						  \
   10.46 -		        if ( likely(vma->vm_mm == current->mm) ) {        \
   10.47 -			    xen_flush_page_update_queue();                \
   10.48 -			    HYPERVISOR_update_va_mapping(address>>PAGE_SHIFT, entry, UVMF_INVLPG); \
   10.49 -			} else {                                          \
   10.50 -                            xen_l1_entry_update((__ptep), (__entry).pte_low); \
   10.51 -			    flush_tlb_page(__vma, __address);             \
   10.52 -			}                                                 \
   10.53 -		}							  \
   10.54 -	} while (0)
   10.55 -
   10.56 -#endif
   10.57  
   10.58  #define __HAVE_ARCH_PTEP_ESTABLISH
   10.59  #define ptep_establish(__vma, __address, __ptep, __entry)		\
   10.60 @@ -455,7 +444,7 @@ do {				  					\
   10.61  #define __HAVE_ARCH_PTEP_ESTABLISH_NEW
   10.62  #define ptep_establish_new(__vma, __address, __ptep, __entry)		\
   10.63  do {				  					\
   10.64 -	if ( likely((__vma)->vm_mm == current->mm) ) {			\
   10.65 +	if (likely((__vma)->vm_mm == current->mm)) {			\
   10.66  		xen_flush_page_update_queue();				\
   10.67  		HYPERVISOR_update_va_mapping((__address)>>PAGE_SHIFT,	\
   10.68  					     __entry, 0);		\
   10.69 @@ -487,8 +476,19 @@ static inline unsigned long arbitrary_vi
   10.70  #define kern_addr_valid(addr)	(1)
   10.71  #endif /* !CONFIG_DISCONTIGMEM */
   10.72  
   10.73 -#define io_remap_page_range(vma,from,phys,size,prot)                     \
   10.74 -        direct_remap_area_pages(vma->vm_mm,from,phys,size,prot,DOMID_IO)
   10.75 +#define io_remap_page_range(vma,from,phys,size,prot) \
   10.76 +	direct_remap_area_pages(vma->vm_mm,from,phys,size,prot,DOMID_IO)
   10.77 +
   10.78 +int direct_remap_area_pages(struct mm_struct *mm,
   10.79 +			    unsigned long address, 
   10.80 +			    unsigned long machine_addr,
   10.81 +			    unsigned long size, 
   10.82 +			    pgprot_t prot,
   10.83 +			    domid_t  domid);
   10.84 +int __direct_remap_area_pages(struct mm_struct *mm,
   10.85 +			      unsigned long address, 
   10.86 +			      unsigned long size, 
   10.87 +			      mmu_update_t *v);
   10.88  
   10.89  #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
   10.90  #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
    11.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/system.h	Fri Nov 19 16:20:45 2004 +0000
    11.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/system.h	Fri Nov 19 18:03:03 2004 +0000
    11.3 @@ -124,10 +124,10 @@ static inline unsigned long _get_base(ch
    11.4  
    11.5  static inline void wbinvd(void)
    11.6  {
    11.7 -    mmu_update_t u;
    11.8 -    u.ptr = MMU_EXTENDED_COMMAND;
    11.9 -    u.val = MMUEXT_FLUSH_CACHE;
   11.10 -    (void)HYPERVISOR_mmu_update(&u, 1, NULL);
   11.11 +	mmu_update_t u;
   11.12 +	u.ptr = MMU_EXTENDED_COMMAND;
   11.13 +	u.val = MMUEXT_FLUSH_CACHE;
   11.14 +	(void)HYPERVISOR_mmu_update(&u, 1, NULL);
   11.15  }
   11.16  
   11.17  static inline unsigned long get_limit(unsigned long segment)
   11.18 @@ -449,66 +449,65 @@ struct alt_instr {
   11.19   * includes these barriers, for example.
   11.20   */
   11.21  
   11.22 -#define __cli()                                                               \
   11.23 -do {                                                                          \
   11.24 -    HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask = 1;              \
   11.25 -    barrier();                                                                \
   11.26 +#define __cli()								\
   11.27 +do {									\
   11.28 +	HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask = 1;	\
   11.29 +	barrier();							\
   11.30  } while (0)
   11.31  
   11.32 -#define __sti()                                                               \
   11.33 -do {                                                                          \
   11.34 -    shared_info_t *_shared = HYPERVISOR_shared_info;                          \
   11.35 -    barrier();                                                                \
   11.36 -    _shared->vcpu_data[0].evtchn_upcall_mask = 0;                             \
   11.37 -    barrier(); /* unmask then check (avoid races) */                          \
   11.38 -    if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )              \
   11.39 -        force_evtchn_callback();                                              \
   11.40 +#define __sti()								\
   11.41 +do {									\
   11.42 +	shared_info_t *_shared = HYPERVISOR_shared_info;		\
   11.43 +	barrier();							\
   11.44 +	_shared->vcpu_data[0].evtchn_upcall_mask = 0;			\
   11.45 +	barrier(); /* unmask then check (avoid races) */		\
   11.46 +	if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )	\
   11.47 +	force_evtchn_callback();					\
   11.48  } while (0)
   11.49  
   11.50 -#define __save_flags(x)                                                       \
   11.51 -do {                                                                          \
   11.52 -    (x) = HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask;            \
   11.53 +#define __save_flags(x)							\
   11.54 +do {									\
   11.55 +	(x) = HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask;	\
   11.56  } while (0)
   11.57  
   11.58 -#define __restore_flags(x)                                                    \
   11.59 -do {                                                                          \
   11.60 -    shared_info_t *_shared = HYPERVISOR_shared_info;                          \
   11.61 -    barrier();                                                                \
   11.62 -    if ( (_shared->vcpu_data[0].evtchn_upcall_mask = (x)) == 0 ) {            \
   11.63 -        barrier(); /* unmask then check (avoid races) */                      \
   11.64 -        if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )          \
   11.65 -            force_evtchn_callback();                                          \
   11.66 -    }                                                                         \
   11.67 +#define __restore_flags(x)						\
   11.68 +do {									\
   11.69 +	shared_info_t *_shared = HYPERVISOR_shared_info;		\
   11.70 +	barrier();							\
   11.71 +	if ( (_shared->vcpu_data[0].evtchn_upcall_mask = (x)) == 0 ) {	\
   11.72 +	barrier(); /* unmask then check (avoid races) */		\
   11.73 +	if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )	\
   11.74 +	    force_evtchn_callback();					\
   11.75 +	}								\
   11.76  } while (0)
   11.77  
   11.78 -#define safe_halt()             ((void)0)
   11.79 +#define safe_halt()	     ((void)0)
   11.80  
   11.81 -#define __save_and_cli(x)                                                     \
   11.82 -do {                                                                          \
   11.83 -    (x) = HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask;            \
   11.84 -    HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask = 1;              \
   11.85 -    barrier();                                                                \
   11.86 +#define __save_and_cli(x)						\
   11.87 +do {									\
   11.88 +	(x) = HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask;	\
   11.89 +	HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask = 1;	\
   11.90 +	barrier();							\
   11.91  } while (0)
   11.92  
   11.93 -#define __save_and_sti(x)                                                     \
   11.94 -do {                                                                          \
   11.95 -    shared_info_t *_shared = HYPERVISOR_shared_info;                          \
   11.96 -    barrier();                                                                \
   11.97 -    (x) = _shared->vcpu_data[0].evtchn_upcall_mask;                           \
   11.98 -    _shared->vcpu_data[0].evtchn_upcall_mask = 0;                             \
   11.99 -    barrier(); /* unmask then check (avoid races) */                          \
  11.100 -    if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )              \
  11.101 -        force_evtchn_callback();                                              \
  11.102 +#define __save_and_sti(x)						\
  11.103 +do {									\
  11.104 +	shared_info_t *_shared = HYPERVISOR_shared_info;		\
  11.105 +	barrier();							\
  11.106 +	(x) = _shared->vcpu_data[0].evtchn_upcall_mask;			\
  11.107 +	_shared->vcpu_data[0].evtchn_upcall_mask = 0;			\
  11.108 +	barrier(); /* unmask then check (avoid races) */		\
  11.109 +	if ( unlikely(_shared->vcpu_data[0].evtchn_upcall_pending) )	\
  11.110 +	force_evtchn_callback();					\
  11.111  } while (0)
  11.112  
  11.113  #define local_irq_save(x)	__save_and_cli(x)
  11.114 -#define local_irq_restore(x)    __restore_flags(x)
  11.115 -#define local_save_flags(x)     __save_flags(x)
  11.116 -#define local_irq_disable()     __cli()
  11.117 -#define local_irq_enable()      __sti()
  11.118 +#define local_irq_restore(x)	__restore_flags(x)
  11.119 +#define local_save_flags(x)	__save_flags(x)
  11.120 +#define local_irq_disable()	__cli()
  11.121 +#define local_irq_enable()	__sti()
  11.122  
  11.123 -#define irqs_disabled()			\
  11.124 -	HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask
  11.125 +#define irqs_disabled() HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_mask
  11.126  
  11.127  /*
  11.128   * disable hlt during certain critical i/o operations
    12.1 --- a/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/tlbflush.h	Fri Nov 19 16:20:45 2004 +0000
    12.2 +++ b/linux-2.6.10-rc2-xen-sparse/include/asm-xen/asm-i386/tlbflush.h	Fri Nov 19 18:03:03 2004 +0000
    12.3 @@ -5,18 +5,13 @@
    12.4  #include <linux/mm.h>
    12.5  #include <asm/processor.h>
    12.6  
    12.7 -#define __flush_tlb() do {						\
    12.8 -	xen_tlb_flush();						\
    12.9 -} while (/*CONSTCOND*/0)
   12.10 +#define __flush_tlb() xen_tlb_flush()
   12.11  
   12.12  /*
   12.13   * Global pages have to be flushed a bit differently. Not a real
   12.14   * performance problem because this does not happen often.
   12.15   */
   12.16 -#define __flush_tlb_global()						\
   12.17 -	do {								\
   12.18 -		xen_tlb_flush();					\
   12.19 -	} while (0)
   12.20 +#define __flush_tlb_global() xen_tlb_flush()
   12.21  
   12.22  extern unsigned long pgkern_mask;
   12.23  
   12.24 @@ -30,11 +25,9 @@ extern unsigned long pgkern_mask;
   12.25  
   12.26  #define cpu_has_invlpg	(boot_cpu_data.x86 > 3)
   12.27  
   12.28 -#define __flush_tlb_single(addr) do {					\
   12.29 -	xen_invlpg(addr);						\
   12.30 -} while (/* CONSTCOND */0)
   12.31 +#define __flush_tlb_single(addr) xen_invlpg(addr)
   12.32  
   12.33 -# define __flush_tlb_one(addr) __flush_tlb_single(addr)
   12.34 +#define __flush_tlb_one(addr) __flush_tlb_single(addr)
   12.35  
   12.36  /*
   12.37   * TLB flushing:
    13.1 --- a/linux-2.6.10-rc2-xen-sparse/net/core/skbuff.c	Fri Nov 19 16:20:45 2004 +0000
    13.2 +++ b/linux-2.6.10-rc2-xen-sparse/net/core/skbuff.c	Fri Nov 19 18:03:03 2004 +0000
    13.3 @@ -166,7 +166,7 @@ nodata:
    13.4  /**
    13.5   *	alloc_skb_from_cache	-	allocate a network buffer
    13.6   *	@cp: kmem_cache from which to allocate the data area
    13.7 - *           (object size must be big enough for @size bytes + skb overheads)
    13.8 + *	     (object size must be big enough for @size bytes + skb overheads)
    13.9   *	@size: size to allocate
   13.10   *	@gfp_mask: allocation mask
   13.11   *