ia64/xen-unstable

changeset 6667:8db9c5873b9b

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 06 18:29:53 2005 +0000 (2005-09-06)
parents 83bcc68aaf32 28a10ec0fd6b
children 99f12399b25a fb90dd31c6d7
files linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pci.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pci.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h tools/console/Makefile tools/console/daemon/io.c tools/console/daemon/main.c tools/console/daemon/utils.c tools/console/daemon/utils.h tools/libxc/xc_linux_build.c tools/python/xen/xend/XendDomainInfo.py tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_watch.c xen/arch/x86/domain_build.c xen/arch/x86/mm.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_64/mm.c xen/include/asm-x86/mm.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Tue Sep 06 18:29:27 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c	Tue Sep 06 18:29:53 2005 +0000
     1.3 @@ -359,7 +359,7 @@ static void __init probe_roms(void)
     1.4  shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     1.5  EXPORT_SYMBOL(HYPERVISOR_shared_info);
     1.6  
     1.7 -unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
     1.8 +unsigned long *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
     1.9  EXPORT_SYMBOL(phys_to_machine_mapping);
    1.10  
    1.11  /* Raw start-of-day parameters from the hypervisor. */
    1.12 @@ -1206,7 +1206,7 @@ void __init setup_bootmem_allocator(void
    1.13  	}
    1.14  #endif
    1.15  
    1.16 -	phys_to_machine_mapping = (unsigned int *)xen_start_info->mfn_list;
    1.17 +	phys_to_machine_mapping = (unsigned long *)xen_start_info->mfn_list;
    1.18  }
    1.19  
    1.20  /*
    1.21 @@ -1638,15 +1638,15 @@ void __init setup_arch(char **cmdline_p)
    1.22  	/* Make sure we have a correctly sized P->M table. */
    1.23  	if (max_pfn != xen_start_info->nr_pages) {
    1.24  		phys_to_machine_mapping = alloc_bootmem_low_pages(
    1.25 -			max_pfn * sizeof(unsigned int));
    1.26 +			max_pfn * sizeof(unsigned long));
    1.27  
    1.28  		if (max_pfn > xen_start_info->nr_pages) {
    1.29  			/* set to INVALID_P2M_ENTRY */
    1.30  			memset(phys_to_machine_mapping, ~0,
    1.31 -				max_pfn * sizeof(unsigned int));
    1.32 +				max_pfn * sizeof(unsigned long));
    1.33  			memcpy(phys_to_machine_mapping,
    1.34 -				(unsigned int *)xen_start_info->mfn_list,
    1.35 -				xen_start_info->nr_pages * sizeof(unsigned int));
    1.36 +				(unsigned long *)xen_start_info->mfn_list,
    1.37 +				xen_start_info->nr_pages * sizeof(unsigned long));
    1.38  		} else {
    1.39  			struct xen_memory_reservation reservation = {
    1.40  				.extent_start = (unsigned long *)xen_start_info->mfn_list + max_pfn,
    1.41 @@ -1656,9 +1656,8 @@ void __init setup_arch(char **cmdline_p)
    1.42  			};
    1.43  
    1.44  			memcpy(phys_to_machine_mapping,
    1.45 -				(unsigned int *)xen_start_info->mfn_list,
    1.46 -				max_pfn * sizeof(unsigned int));
    1.47 -			/* N.B. below relies on sizeof(int) == sizeof(long). */
    1.48 +				(unsigned long *)xen_start_info->mfn_list,
    1.49 +				max_pfn * sizeof(unsigned long));
    1.50  			BUG_ON(HYPERVISOR_memory_op(
    1.51  				XENMEM_decrease_reservation,
    1.52  				&reservation) !=
    1.53 @@ -1667,11 +1666,11 @@ void __init setup_arch(char **cmdline_p)
    1.54  		free_bootmem(
    1.55  			__pa(xen_start_info->mfn_list), 
    1.56  			PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
    1.57 -			sizeof(unsigned int))));
    1.58 +			sizeof(unsigned long))));
    1.59  	}
    1.60  
    1.61  	pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
    1.62 -	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned int)), j++ )
    1.63 +	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
    1.64  	{	
    1.65  	     pfn_to_mfn_frame_list[j] = 
    1.66  		  virt_to_mfn(&phys_to_machine_mapping[i]);
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Tue Sep 06 18:29:27 2005 +0000
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Tue Sep 06 18:29:53 2005 +0000
     2.3 @@ -51,7 +51,7 @@ static unsigned long iotlb_nslabs;
     2.4   * swiotlb_sync_single_*, to see if the memory was in fact allocated by this
     2.5   * API.
     2.6   */
     2.7 -static dma_addr_t iotlb_bus_start, iotlb_bus_mask;
     2.8 +static dma_addr_t iotlb_bus_start, iotlb_bus_end, iotlb_bus_mask;
     2.9  
    2.10  /* Does the given dma address reside within the swiotlb aperture? */
    2.11  #define in_swiotlb_aperture(a) (!(((a) ^ iotlb_bus_start) & iotlb_bus_mask))
    2.12 @@ -157,6 +157,7 @@ swiotlb_init_with_default_size (size_t d
    2.13  	io_tlb_overflow_buffer = alloc_bootmem_low(io_tlb_overflow);
    2.14  
    2.15  	iotlb_bus_start = virt_to_bus(iotlb_virt_start);
    2.16 +	iotlb_bus_end   = iotlb_bus_start + bytes;
    2.17  	iotlb_bus_mask  = ~(dma_addr_t)(bytes - 1);
    2.18  
    2.19  	printk(KERN_INFO "Software IO TLB enabled: \n"
    2.20 @@ -165,7 +166,7 @@ swiotlb_init_with_default_size (size_t d
    2.21  	       " Kernel range: 0x%016lx - 0x%016lx\n",
    2.22  	       bytes >> 20,
    2.23  	       (unsigned long)iotlb_bus_start,
    2.24 -	       (unsigned long)iotlb_bus_start + bytes,
    2.25 +	       (unsigned long)iotlb_bus_end,
    2.26  	       (unsigned long)iotlb_virt_start,
    2.27  	       (unsigned long)iotlb_virt_start + bytes);
    2.28  }
    2.29 @@ -191,6 +192,8 @@ swiotlb_init(void)
    2.30  
    2.31  	if (swiotlb)
    2.32  		swiotlb_init_with_default_size(64 * (1<<20));
    2.33 +	else
    2.34 +		printk(KERN_INFO "Software IO TLB disabled\n");
    2.35  }
    2.36  
    2.37  static void
    2.38 @@ -424,13 +427,6 @@ swiotlb_map_single(struct device *hwdev,
    2.39  	}
    2.40  
    2.41  	dev_addr = virt_to_bus(map);
    2.42 -
    2.43 -	/*
    2.44 -	 * Ensure that the address returned is DMA'ble
    2.45 -	 */
    2.46 -	if (address_needs_mapping(hwdev, dev_addr))
    2.47 -		panic("map_single: bounce buffer is not DMA'ble");
    2.48 -
    2.49  	return dev_addr;
    2.50  }
    2.51  
    2.52 @@ -632,7 +628,7 @@ swiotlb_dma_mapping_error(dma_addr_t dma
    2.53  int
    2.54  swiotlb_dma_supported (struct device *hwdev, u64 mask)
    2.55  {
    2.56 -	return (mask >= 0xffffffffUL);
    2.57 +	return (mask >= (iotlb_bus_end - 1));
    2.58  }
    2.59  
    2.60  EXPORT_SYMBOL(swiotlb_init);
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Sep 06 18:29:27 2005 +0000
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Tue Sep 06 18:29:53 2005 +0000
     3.3 @@ -81,7 +81,7 @@ static int __do_suspend(void *ignore)
     3.4      extern void time_suspend(void);
     3.5      extern void time_resume(void);
     3.6      extern unsigned long max_pfn;
     3.7 -    extern unsigned int *pfn_to_mfn_frame_list;
     3.8 +    extern unsigned long *pfn_to_mfn_frame_list;
     3.9  
    3.10  #ifdef CONFIG_SMP
    3.11      extern void smp_suspend(void);
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c	Tue Sep 06 18:29:27 2005 +0000
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c	Tue Sep 06 18:29:53 2005 +0000
     4.3 @@ -90,7 +90,7 @@ void __init x86_64_start_kernel(char * r
     4.4  {
     4.5  	int i;
     4.6  
     4.7 -        phys_to_machine_mapping = (u32 *)xen_start_info->mfn_list;
     4.8 +        phys_to_machine_mapping = (unsigned long *)xen_start_info->mfn_list;
     4.9          start_pfn = (__pa(xen_start_info->pt_base) >> PAGE_SHIFT) + 
    4.10  		xen_start_info->nr_pt_frames;
    4.11  
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c	Tue Sep 06 18:29:27 2005 +0000
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c	Tue Sep 06 18:29:53 2005 +0000
     5.3 @@ -76,7 +76,7 @@ EXPORT_SYMBOL(HYPERVISOR_shared_info);
     5.4  /* Allows setting of maximum possible memory size  */
     5.5  unsigned long xen_override_max_pfn;
     5.6  
     5.7 -u32 *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
     5.8 +unsigned long *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
     5.9  
    5.10  EXPORT_SYMBOL(phys_to_machine_mapping);
    5.11  
    5.12 @@ -734,22 +734,22 @@ void __init setup_arch(char **cmdline_p)
    5.13  		/* Make sure we have a large enough P->M table. */
    5.14  		if (end_pfn > xen_start_info->nr_pages) {
    5.15  			phys_to_machine_mapping = alloc_bootmem(
    5.16 -				end_pfn * sizeof(u32));
    5.17 +				end_pfn * sizeof(unsigned long));
    5.18  			memset(phys_to_machine_mapping, ~0,
    5.19 -			       end_pfn * sizeof(u32));
    5.20 +			       end_pfn * sizeof(unsigned long));
    5.21  			memcpy(phys_to_machine_mapping,
    5.22 -			       (u32 *)xen_start_info->mfn_list,
    5.23 -			       xen_start_info->nr_pages * sizeof(u32));
    5.24 +			       (unsigned long *)xen_start_info->mfn_list,
    5.25 +			       xen_start_info->nr_pages * sizeof(unsigned long));
    5.26  			free_bootmem(
    5.27  				__pa(xen_start_info->mfn_list), 
    5.28  				PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
    5.29 -						sizeof(u32))));
    5.30 +						sizeof(unsigned long))));
    5.31  		}
    5.32  
    5.33  		pfn_to_mfn_frame_list = alloc_bootmem(PAGE_SIZE);
    5.34  
    5.35 -		for ( i=0, j=0; i < end_pfn; i+=(PAGE_SIZE/sizeof(u32)), j++ )
    5.36 -			pfn_to_mfn_frame_list[j] = 
    5.37 +		for ( i=0, j=0; i < end_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
    5.38 +			pfn_to_mfn_frame_list[j] =
    5.39  				virt_to_mfn(&phys_to_machine_mapping[i]);
    5.40  	}
    5.41  #endif
     6.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h	Tue Sep 06 18:29:27 2005 +0000
     6.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h	Tue Sep 06 18:29:53 2005 +0000
     6.3 @@ -60,14 +60,14 @@
     6.4  #define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
     6.5  
     6.6  /**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
     6.7 -#define INVALID_P2M_ENTRY	(~0U)
     6.8 -#define FOREIGN_FRAME(m)	((m) | 0x80000000U)
     6.9 -extern unsigned int *phys_to_machine_mapping;
    6.10 +#define INVALID_P2M_ENTRY	(~0UL)
    6.11 +#define FOREIGN_FRAME(m)	((m) | (1UL<<31))
    6.12 +extern unsigned long *phys_to_machine_mapping;
    6.13  #define pfn_to_mfn(pfn)	\
    6.14 -((unsigned long)phys_to_machine_mapping[(unsigned int)(pfn)] & 0x7FFFFFFFUL)
    6.15 +(phys_to_machine_mapping[(unsigned int)(pfn)] & ~(1UL<<31))
    6.16  static inline unsigned long mfn_to_pfn(unsigned long mfn)
    6.17  {
    6.18 -	unsigned int pfn;
    6.19 +	unsigned long pfn;
    6.20  
    6.21  	/*
    6.22  	 * The array access can fail (e.g., device space beyond end of RAM).
    6.23 @@ -83,7 +83,7 @@ static inline unsigned long mfn_to_pfn(u
    6.24  		".previous"
    6.25  		: "=r" (pfn) : "m" (machine_to_phys_mapping[mfn]) );
    6.26  
    6.27 -	return (unsigned long)pfn;
    6.28 +	return pfn;
    6.29  }
    6.30  
    6.31  /* Definitions for machine and pseudophysical addresses. */
     7.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pci.h	Tue Sep 06 18:29:27 2005 +0000
     7.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/pci.h	Tue Sep 06 18:29:53 2005 +0000
     7.3 @@ -43,9 +43,33 @@ int pcibios_set_irq_routing(struct pci_d
     7.4  
     7.5  struct pci_dev;
     7.6  
     7.7 +#ifdef CONFIG_SWIOTLB
     7.8 +
     7.9 +
    7.10  /* On Xen we use SWIOTLB instead of blk-specific bounce buffers. */
    7.11  #define PCI_DMA_BUS_IS_PHYS	(0)
    7.12  
    7.13 +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)	\
    7.14 +	dma_addr_t ADDR_NAME;
    7.15 +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)		\
    7.16 +	__u32 LEN_NAME;
    7.17 +#define pci_unmap_addr(PTR, ADDR_NAME)			\
    7.18 +	((PTR)->ADDR_NAME)
    7.19 +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)		\
    7.20 +	(((PTR)->ADDR_NAME) = (VAL))
    7.21 +#define pci_unmap_len(PTR, LEN_NAME)			\
    7.22 +	((PTR)->LEN_NAME)
    7.23 +#define pci_unmap_len_set(PTR, LEN_NAME, VAL)		\
    7.24 +	(((PTR)->LEN_NAME) = (VAL))
    7.25 +
    7.26 +#else
    7.27 +
    7.28 +/* The PCI address space does equal the physical memory
    7.29 + * address space.  The networking and block device layers use
    7.30 + * this boolean for bounce buffer decisions.
    7.31 + */
    7.32 +#define PCI_DMA_BUS_IS_PHYS	(1)
    7.33 +
    7.34  /* pci_unmap_{page,single} is a nop so... */
    7.35  #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
    7.36  #define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
    7.37 @@ -54,6 +78,8 @@ struct pci_dev;
    7.38  #define pci_unmap_len(PTR, LEN_NAME)		(0)
    7.39  #define pci_unmap_len_set(PTR, LEN_NAME, VAL)	do { } while (0)
    7.40  
    7.41 +#endif
    7.42 +
    7.43  /* This is always fine. */
    7.44  #define pci_dac_dma_supported(pci_dev, mask)	(1)
    7.45  
     8.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h	Tue Sep 06 18:29:27 2005 +0000
     8.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h	Tue Sep 06 18:29:53 2005 +0000
     8.3 @@ -62,14 +62,14 @@ void copy_page(void *, void *);
     8.4  #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
     8.5  
     8.6  /**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
     8.7 -#define INVALID_P2M_ENTRY	(~0U)
     8.8 -#define FOREIGN_FRAME(m)	((m) | 0x80000000U)
     8.9 -extern u32 *phys_to_machine_mapping;
    8.10 +#define INVALID_P2M_ENTRY	(~0UL)
    8.11 +#define FOREIGN_FRAME(m)	((m) | (1UL<<63))
    8.12 +extern unsigned long *phys_to_machine_mapping;
    8.13  #define pfn_to_mfn(pfn)	\
    8.14 -((unsigned long)phys_to_machine_mapping[(unsigned int)(pfn)] & 0x7FFFFFFFUL)
    8.15 +(phys_to_machine_mapping[(unsigned int)(pfn)] & ~(1UL << 63))
    8.16  static inline unsigned long mfn_to_pfn(unsigned long mfn)
    8.17  {
    8.18 -	unsigned int pfn;
    8.19 +	unsigned long pfn;
    8.20  
    8.21  	/*
    8.22  	 * The array access can fail (e.g., device space beyond end of RAM).
    8.23 @@ -77,7 +77,7 @@ static inline unsigned long mfn_to_pfn(u
    8.24  	 * but we must handle the fault without crashing!
    8.25  	 */
    8.26  	asm (
    8.27 -		"1:	movl %1,%k0\n"
    8.28 +		"1:	movq %1,%0\n"
    8.29  		"2:\n"
    8.30  		".section __ex_table,\"a\"\n"
    8.31  		"	.align 8\n"
    8.32 @@ -85,7 +85,7 @@ static inline unsigned long mfn_to_pfn(u
    8.33  		".previous"
    8.34  		: "=r" (pfn) : "m" (machine_to_phys_mapping[mfn]) );
    8.35  
    8.36 -	return (unsigned long)pfn;
    8.37 +	return pfn;
    8.38  }
    8.39  
    8.40  /* Definitions for machine and pseudophysical addresses. */
     9.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pci.h	Tue Sep 06 18:29:27 2005 +0000
     9.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pci.h	Tue Sep 06 18:29:53 2005 +0000
     9.3 @@ -76,12 +76,29 @@ extern int iommu_sac_force;
     9.4  #define pci_unmap_len_set(PTR, LEN_NAME, VAL)		\
     9.5  	(((PTR)->LEN_NAME) = (VAL))
     9.6  
     9.7 +#elif defined(CONFIG_SWIOTLB)
     9.8 +
     9.9 +#define PCI_DMA_BUS_IS_PHYS	0
    9.10 +
    9.11 +#define pci_dac_dma_supported(pci_dev, mask)    1
    9.12 +
    9.13 +#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)	\
    9.14 +	dma_addr_t ADDR_NAME;
    9.15 +#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)		\
    9.16 +	__u32 LEN_NAME;
    9.17 +#define pci_unmap_addr(PTR, ADDR_NAME)			\
    9.18 +	((PTR)->ADDR_NAME)
    9.19 +#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL)		\
    9.20 +	(((PTR)->ADDR_NAME) = (VAL))
    9.21 +#define pci_unmap_len(PTR, LEN_NAME)			\
    9.22 +	((PTR)->LEN_NAME)
    9.23 +#define pci_unmap_len_set(PTR, LEN_NAME, VAL)		\
    9.24 +	(((PTR)->LEN_NAME) = (VAL))
    9.25 +
    9.26  #else
    9.27  /* No IOMMU */
    9.28  
    9.29 -/* On Xen we use SWIOTLB instead of blk-specific bounce buffers. */
    9.30 -#define PCI_DMA_BUS_IS_PHYS	(0)
    9.31 -
    9.32 +#define PCI_DMA_BUS_IS_PHYS	1
    9.33  #define pci_dac_dma_supported(pci_dev, mask)    1
    9.34  
    9.35  #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
    10.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Tue Sep 06 18:29:27 2005 +0000
    10.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h	Tue Sep 06 18:29:53 2005 +0000
    10.3 @@ -307,7 +307,7 @@ inline static void set_pte_at(struct mm_
    10.4  #define pte_pfn(_pte)							\
    10.5  ({									\
    10.6  	unsigned long mfn = pte_mfn(_pte);                              \
    10.7 -	unsigned pfn = mfn_to_pfn(mfn);                                 \
    10.8 +	unsigned long pfn = mfn_to_pfn(mfn);                            \
    10.9  	if ((pfn >= max_mapnr) || (phys_to_machine_mapping[pfn] != mfn))\
   10.10  		pfn = max_mapnr; /* special: force !pfn_valid() */	\
   10.11  	pfn;								\
    11.1 --- a/tools/libxc/xc_linux_build.c	Tue Sep 06 18:29:27 2005 +0000
    11.2 +++ b/tools/libxc/xc_linux_build.c	Tue Sep 06 18:29:53 2005 +0000
    11.3 @@ -348,7 +348,7 @@ static int setup_guest(int xc_handle,
    11.4  
    11.5      unsigned long nr_pt_pages;
    11.6      unsigned long physmap_pfn;
    11.7 -    u32 *physmap, *physmap_e;
    11.8 +    unsigned long *physmap, *physmap_e;
    11.9  
   11.10      struct load_funcs load_funcs;
   11.11      struct domain_setup_info dsi;
    12.1 --- a/xen/arch/x86/domain_build.c	Tue Sep 06 18:29:27 2005 +0000
    12.2 +++ b/xen/arch/x86/domain_build.c	Tue Sep 06 18:29:53 2005 +0000
    12.3 @@ -218,7 +218,7 @@ int construct_dom0(struct domain *d,
    12.4      vinitrd_start    = round_pgup(dsi.v_end);
    12.5      vinitrd_end      = vinitrd_start + initrd_len;
    12.6      vphysmap_start   = round_pgup(vinitrd_end);
    12.7 -    vphysmap_end     = vphysmap_start + (nr_pages * sizeof(u32));
    12.8 +    vphysmap_end     = vphysmap_start + (nr_pages * sizeof(unsigned long));
    12.9      vstartinfo_start = round_pgup(vphysmap_end);
   12.10      vstartinfo_end   = vstartinfo_start + PAGE_SIZE;
   12.11      vpt_start        = vstartinfo_end;
   12.12 @@ -613,7 +613,7 @@ int construct_dom0(struct domain *d,
   12.13          if ( !opt_dom0_translate && (pfn > REVERSE_START) )
   12.14              mfn = alloc_epfn - (pfn - REVERSE_START);
   12.15  #endif
   12.16 -        ((u32 *)vphysmap_start)[pfn] = mfn;
   12.17 +        ((unsigned long *)vphysmap_start)[pfn] = mfn;
   12.18          set_pfn_from_mfn(mfn, pfn);
   12.19      }
   12.20      while ( pfn < nr_pages )
   12.21 @@ -626,7 +626,7 @@ int construct_dom0(struct domain *d,
   12.22  #ifndef NDEBUG
   12.23  #define pfn (nr_pages - 1 - (pfn - (alloc_epfn - alloc_spfn)))
   12.24  #endif
   12.25 -            ((u32 *)vphysmap_start)[pfn] = mfn;
   12.26 +            ((unsigned long *)vphysmap_start)[pfn] = mfn;
   12.27              set_pfn_from_mfn(mfn, pfn);
   12.28  #undef pfn
   12.29              page++; pfn++;
    13.1 --- a/xen/arch/x86/mm.c	Tue Sep 06 18:29:27 2005 +0000
    13.2 +++ b/xen/arch/x86/mm.c	Tue Sep 06 18:29:53 2005 +0000
    13.3 @@ -1450,7 +1450,7 @@ int get_page_type(struct pfn_info *page,
    13.4                           ((type & PGT_type_mask) != PGT_l1_page_table) )
    13.5                          MEM_LOG("Bad type (saw %" PRtype_info
    13.6                                  "!= exp %" PRtype_info ") "
    13.7 -                                "for mfn %lx (pfn %x)",
    13.8 +                                "for mfn %lx (pfn %lx)",
    13.9                                  x, type, page_to_pfn(page),
   13.10                                  get_pfn_from_mfn(page_to_pfn(page)));
   13.11                      return 0;
    14.1 --- a/xen/arch/x86/x86_32/mm.c	Tue Sep 06 18:29:27 2005 +0000
    14.2 +++ b/xen/arch/x86/x86_32/mm.c	Tue Sep 06 18:29:53 2005 +0000
    14.3 @@ -95,7 +95,7 @@ void __init paging_init(void)
    14.4       * Allocate and map the machine-to-phys table and create read-only mapping 
    14.5       * of MPT for guest-OS use.
    14.6       */
    14.7 -    mpt_size  = (max_page * 4) + (1UL << L2_PAGETABLE_SHIFT) - 1UL;
    14.8 +    mpt_size  = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
    14.9      mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
   14.10      for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
   14.11      {
    15.1 --- a/xen/arch/x86/x86_64/mm.c	Tue Sep 06 18:29:27 2005 +0000
    15.2 +++ b/xen/arch/x86/x86_64/mm.c	Tue Sep 06 18:29:53 2005 +0000
    15.3 @@ -98,7 +98,7 @@ void __init paging_init(void)
    15.4       * Allocate and map the machine-to-phys table.
    15.5       * This also ensures L3 is present for fixmaps.
    15.6       */
    15.7 -    mpt_size  = (max_page * 4) + (1UL << L2_PAGETABLE_SHIFT) - 1UL;
    15.8 +    mpt_size  = (max_page * BYTES_PER_LONG) + (1UL << L2_PAGETABLE_SHIFT) - 1;
    15.9      mpt_size &= ~((1UL << L2_PAGETABLE_SHIFT) - 1UL);
   15.10      for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ )
   15.11      {
    16.1 --- a/xen/include/asm-x86/mm.h	Tue Sep 06 18:29:27 2005 +0000
    16.2 +++ b/xen/include/asm-x86/mm.h	Tue Sep 06 18:29:53 2005 +0000
    16.3 @@ -255,9 +255,9 @@ int check_descriptor(struct desc_struct 
    16.4   * contiguous (or near contiguous) physical memory.
    16.5   */
    16.6  #undef  machine_to_phys_mapping
    16.7 -#define machine_to_phys_mapping  ((u32 *)RDWR_MPT_VIRT_START)
    16.8 -#define INVALID_M2P_ENTRY        (~0U)
    16.9 -#define VALID_M2P(_e)            (!((_e) & (1U<<31)))
   16.10 +#define machine_to_phys_mapping  ((unsigned long *)RDWR_MPT_VIRT_START)
   16.11 +#define INVALID_M2P_ENTRY        (~0UL)
   16.12 +#define VALID_M2P(_e)            (!((_e) & (1UL<<(BITS_PER_LONG-1))))
   16.13  #define IS_INVALID_M2P_ENTRY(_e) (!VALID_M2P(_e))
   16.14  
   16.15  #define set_pfn_from_mfn(mfn, pfn) (machine_to_phys_mapping[(mfn)] = (pfn))
    17.1 --- a/xen/include/public/arch-x86_32.h	Tue Sep 06 18:29:27 2005 +0000
    17.2 +++ b/xen/include/public/arch-x86_32.h	Tue Sep 06 18:29:53 2005 +0000
    17.3 @@ -55,7 +55,7 @@
    17.4  # define HYPERVISOR_VIRT_START (0xFC000000UL)
    17.5  #endif
    17.6  #ifndef machine_to_phys_mapping
    17.7 -#define machine_to_phys_mapping ((u32 *)HYPERVISOR_VIRT_START)
    17.8 +#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
    17.9  #endif
   17.10  
   17.11  /* Maximum number of virtual CPUs in multi-processor guests. */
    18.1 --- a/xen/include/public/arch-x86_64.h	Tue Sep 06 18:29:27 2005 +0000
    18.2 +++ b/xen/include/public/arch-x86_64.h	Tue Sep 06 18:29:53 2005 +0000
    18.3 @@ -71,7 +71,7 @@
    18.4  
    18.5  /* The machine->physical mapping table starts at this address, read-only. */
    18.6  #ifndef machine_to_phys_mapping
    18.7 -#define machine_to_phys_mapping ((u32 *)HYPERVISOR_VIRT_START)
    18.8 +#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
    18.9  #endif
   18.10  
   18.11  /*