ia64/xen-unstable

changeset 4213:d509bef98bd9

bitkeeper revision 1.1236.32.12 (423c3be1O7_a1yKODsN2egtVDG1low)

Christian's changes for linux 2.6.10 so that it boots in shadow mode
with translation enabled.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Sat Mar 19 14:49:05 2005 +0000 (2005-03-19)
parents 7f9cdb03e7fd
children 170dd1839b49
files linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/pageattr.c linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6.10-xen-sparse/arch/xen/kernel/reboot.c linux-2.6.10-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6.10-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6.10-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6.10-xen-sparse/drivers/xen/netback/netback.c linux-2.6.10-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6.10-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/desc.h linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/fixmap.h linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/io.h linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgalloc.h linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h xen/include/public/arch-x86_32.h
line diff
     1.1 --- a/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig	Fri Mar 18 17:01:47 2005 +0000
     1.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig	Sat Mar 19 14:49:05 2005 +0000
     1.3 @@ -12,9 +12,9 @@ CONFIG_NO_IDLE_HZ=y
     1.4  #
     1.5  CONFIG_XEN_PRIVILEGED_GUEST=y
     1.6  CONFIG_XEN_PHYSDEV_ACCESS=y
     1.7 -CONFIG_XEN_BLKDEV_BACKEND=y
     1.8 +# CONFIG_XEN_BLKDEV_BACKEND is not set
     1.9  # CONFIG_XEN_BLKDEV_TAP_BE is not set
    1.10 -CONFIG_XEN_NETDEV_BACKEND=y
    1.11 +# CONFIG_XEN_NETDEV_BACKEND is not set
    1.12  CONFIG_XEN_BLKDEV_FRONTEND=y
    1.13  CONFIG_XEN_NETDEV_FRONTEND=y
    1.14  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
     2.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Fri Mar 18 17:01:47 2005 +0000
     2.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Sat Mar 19 14:49:05 2005 +0000
     2.3 @@ -512,7 +512,7 @@ void __init cpu_gdt_init(struct Xgt_desc
     2.4  	for (va = gdt_descr->address, f = 0;
     2.5  	     va < gdt_descr->address + gdt_descr->size;
     2.6  	     va += PAGE_SIZE, f++) {
     2.7 -		frames[f] = virt_to_machine(va) >> PAGE_SHIFT;
     2.8 +		frames[f] = __vms_virt_to_machine(va) >> PAGE_SHIFT;
     2.9  		make_page_readonly((void *)va);
    2.10  	}
    2.11  	flush_page_update_queue();
     3.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c	Fri Mar 18 17:01:47 2005 +0000
     3.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/ldt.c	Sat Mar 19 14:49:05 2005 +0000
     3.3 @@ -61,8 +61,10 @@ static int alloc_ldt(mm_context_t *pc, i
     3.4  		cpumask_t mask;
     3.5  		preempt_disable();
     3.6  #endif
     3.7 +#if 0
     3.8  		make_pages_readonly(pc->ldt, (pc->size * LDT_ENTRY_SIZE) /
     3.9  				    PAGE_SIZE);
    3.10 +#endif
    3.11  		load_LDT(pc);
    3.12  		flush_page_update_queue();
    3.13  #ifdef CONFIG_SMP
    3.14 @@ -73,8 +75,10 @@ static int alloc_ldt(mm_context_t *pc, i
    3.15  #endif
    3.16  	}
    3.17  	if (oldsize) {
    3.18 +#if 0
    3.19  		make_pages_writable(oldldt, (oldsize * LDT_ENTRY_SIZE) /
    3.20  			PAGE_SIZE);
    3.21 +#endif
    3.22  		flush_page_update_queue();
    3.23  		if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
    3.24  			vfree(oldldt);
    3.25 @@ -90,8 +94,10 @@ static inline int copy_ldt(mm_context_t 
    3.26  	if (err < 0)
    3.27  		return err;
    3.28  	memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
    3.29 +#if 0
    3.30  	make_pages_readonly(new->ldt, (new->size * LDT_ENTRY_SIZE) /
    3.31  			    PAGE_SIZE);
    3.32 +#endif
    3.33  	flush_page_update_queue();
    3.34  	return 0;
    3.35  }
    3.36 @@ -124,9 +130,11 @@ void destroy_context(struct mm_struct *m
    3.37  	if (mm->context.size) {
    3.38  		if (mm == current->active_mm)
    3.39  			clear_LDT();
    3.40 +#if 0
    3.41  		make_pages_writable(mm->context.ldt, 
    3.42  				    (mm->context.size * LDT_ENTRY_SIZE) /
    3.43  				    PAGE_SIZE);
    3.44 +#endif
    3.45  		flush_page_update_queue();
    3.46  		if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
    3.47  			vfree(mm->context.ldt);
    3.48 @@ -222,7 +230,7 @@ static int write_ldt(void __user * ptr, 
    3.49  	}
    3.50  
    3.51  	lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt);
    3.52 -	mach_lp = arbitrary_virt_to_machine(lp);
    3.53 +	mach_lp = arbitrary_virt_to_phys(lp);
    3.54  
    3.55     	/* Allow LDTs to be cleared by the user. */
    3.56     	if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
     4.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Fri Mar 18 17:01:47 2005 +0000
     4.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Sat Mar 19 14:49:05 2005 +0000
     4.3 @@ -30,6 +30,8 @@ struct dma_coherent_mem {
     4.4  static void
     4.5  xen_contig_memory(unsigned long vstart, unsigned int order)
     4.6  {
     4.7 +#define HACK
     4.8 +#ifndef HACK
     4.9  	/*
    4.10  	 * Ensure multi-page extents are contiguous in machine memory.
    4.11  	 * This code could be cleaned up some, and the number of
    4.12 @@ -76,6 +78,7 @@ xen_contig_memory(unsigned long vstart, 
    4.13  	xen_tlb_flush();
    4.14  
    4.15          balloon_unlock(flags);
    4.16 +#endif
    4.17  }
    4.18  
    4.19  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
     5.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c	Fri Mar 18 17:01:47 2005 +0000
     5.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/process.c	Sat Mar 19 14:49:05 2005 +0000
     5.3 @@ -518,7 +518,7 @@ struct task_struct fastcall * __switch_t
     5.4  	if (unlikely(next->tls_array[i].a != prev->tls_array[i].a ||	    \
     5.5  		     next->tls_array[i].b != prev->tls_array[i].b))	    \
     5.6  		queue_multicall3(__HYPERVISOR_update_descriptor,	    \
     5.7 -				 virt_to_machine(&get_cpu_gdt_table(cpu)    \
     5.8 +				 virt_to_phys(&get_cpu_gdt_table(cpu)       \
     5.9  						 [GDT_ENTRY_TLS_MIN + i]),  \
    5.10  				 ((u32 *)&next->tls_array[i])[0],	    \
    5.11  				 ((u32 *)&next->tls_array[i])[1]);	    \
     6.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c	Fri Mar 18 17:01:47 2005 +0000
     6.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/kernel/setup.c	Sat Mar 19 14:49:05 2005 +0000
     6.3 @@ -345,8 +345,8 @@ static void __init probe_roms(void)
     6.4  shared_info_t *HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     6.5  EXPORT_SYMBOL(HYPERVISOR_shared_info);
     6.6  
     6.7 -unsigned int *phys_to_machine_mapping, *pfn_to_mfn_frame_list;
     6.8 -EXPORT_SYMBOL(phys_to_machine_mapping);
     6.9 +unsigned int *__vms_phys_to_machine_mapping, *__vms_pfn_to_mfn_frame_list;
    6.10 +EXPORT_SYMBOL(__vms_phys_to_machine_mapping);
    6.11  
    6.12  DEFINE_PER_CPU(multicall_entry_t, multicall_list[8]);
    6.13  DEFINE_PER_CPU(int, nr_multicall_ents);
    6.14 @@ -1142,7 +1142,7 @@ static unsigned long __init setup_memory
    6.15  	}
    6.16  #endif
    6.17  
    6.18 -	phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list;
    6.19 +	__vms_phys_to_machine_mapping = (unsigned int *)xen_start_info.mfn_list;
    6.20  
    6.21  	return max_low_pfn;
    6.22  }
    6.23 @@ -1437,11 +1437,11 @@ void __init setup_arch(char **cmdline_p)
    6.24  
    6.25  	/* Make sure we have a large enough P->M table. */
    6.26  	if (max_pfn > xen_start_info.nr_pages) {
    6.27 -		phys_to_machine_mapping = alloc_bootmem_low_pages(
    6.28 +		__vms_phys_to_machine_mapping = alloc_bootmem_low_pages(
    6.29  			max_pfn * sizeof(unsigned long));
    6.30 -		memset(phys_to_machine_mapping, ~0,
    6.31 +		memset(__vms_phys_to_machine_mapping, ~0,
    6.32  			max_pfn * sizeof(unsigned long));
    6.33 -		memcpy(phys_to_machine_mapping,
    6.34 +		memcpy(__vms_phys_to_machine_mapping,
    6.35  			(unsigned long *)xen_start_info.mfn_list,
    6.36  			xen_start_info.nr_pages * sizeof(unsigned long));
    6.37  		free_bootmem(
    6.38 @@ -1450,14 +1450,14 @@ void __init setup_arch(char **cmdline_p)
    6.39  			sizeof(unsigned long))));
    6.40  	}
    6.41  
    6.42 -	pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
    6.43 +	__vms_pfn_to_mfn_frame_list = alloc_bootmem_low_pages(PAGE_SIZE);
    6.44  	for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
    6.45  	{	
    6.46 -	     pfn_to_mfn_frame_list[j] = 
    6.47 -		  virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
    6.48 +	     __vms_pfn_to_mfn_frame_list[j] = 
    6.49 +		  __vms_virt_to_machine(&__vms_phys_to_machine_mapping[i]) >> PAGE_SHIFT;
    6.50  	}
    6.51  	HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
    6.52 -	     virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
    6.53 +	     __vms_virt_to_machine(__vms_pfn_to_mfn_frame_list) >> PAGE_SHIFT;
    6.54  
    6.55  
    6.56  	/*
     7.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c	Fri Mar 18 17:01:47 2005 +0000
     7.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/fault.c	Sat Mar 19 14:49:05 2005 +0000
     7.3 @@ -458,8 +458,8 @@ no_context:
     7.4  	printk("%08lx\n", regs->eip);
     7.5  	page = ((unsigned long *) per_cpu(cur_pgd, smp_processor_id()))
     7.6  	    [address >> 22];
     7.7 -	printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n", page,
     7.8 -	       machine_to_phys(page));
     7.9 +	printk(KERN_ALERT "*pde = ma %08lx pa %08lx\n",
    7.10 +	       __vms_phys_to_machine(page), page);
    7.11  	/*
    7.12  	 * We must not directly access the pte in the highpte
    7.13  	 * case, the page table might be allocated in highmem.
    7.14 @@ -470,10 +470,9 @@ no_context:
    7.15  	if (page & 1) {
    7.16  		page &= PAGE_MASK;
    7.17  		address &= 0x003ff000;
    7.18 -		page = machine_to_phys(page);
    7.19  		page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT];
    7.20 -		printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n", page,
    7.21 -		       machine_to_phys(page));
    7.22 +		printk(KERN_ALERT "*pte = ma %08lx pa %08lx\n",
    7.23 +		       __vms_phys_to_machine(page), page);
    7.24  	}
    7.25  #endif
    7.26  	show_trace(NULL, (unsigned long *)&regs[1]);
     8.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c	Fri Mar 18 17:01:47 2005 +0000
     8.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/hypervisor.c	Sat Mar 19 14:49:05 2005 +0000
     8.3 @@ -56,7 +56,7 @@ static spinlock_t update_lock = SPIN_LOC
     8.4  #ifdef CONFIG_SMP
     8.5  #define QUEUE_SIZE 1
     8.6  #else
     8.7 -#define QUEUE_SIZE 128
     8.8 +#define QUEUE_SIZE 1
     8.9  #endif
    8.10  #endif
    8.11  
    8.12 @@ -125,14 +125,12 @@ static inline void increment_index_and_f
    8.13  
    8.14  void queue_l1_entry_update(pte_t *ptr, unsigned long val)
    8.15  {
    8.16 -    _flush_page_update_queue();
    8.17 -    *(unsigned long *)ptr = val;
    8.18 +    set_pte(ptr, __pte(val));
    8.19  }
    8.20  
    8.21  void queue_l2_entry_update(pmd_t *ptr, unsigned long val)
    8.22  {
    8.23 -    _flush_page_update_queue();
    8.24 -    *(unsigned long *)ptr = val;
    8.25 +    set_pmd(ptr, __pmd(val));
    8.26  }
    8.27  
    8.28  void queue_pt_switch(unsigned long ptr)
    8.29 @@ -142,7 +140,7 @@ void queue_pt_switch(unsigned long ptr)
    8.30      unsigned long flags;
    8.31      spin_lock_irqsave(&update_lock, flags);
    8.32      idx = per_cpu(mmu_update_queue_idx, cpu);
    8.33 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
    8.34 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
    8.35      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
    8.36      per_cpu(update_queue[idx], cpu).val  = MMUEXT_NEW_BASEPTR;
    8.37      increment_index();
    8.38 @@ -176,56 +174,56 @@ void queue_invlpg(unsigned long ptr)
    8.39      spin_unlock_irqrestore(&update_lock, flags);
    8.40  }
    8.41  
    8.42 -void queue_pgd_pin(unsigned long ptr)
    8.43 -{
    8.44 -    int cpu = smp_processor_id();
    8.45 -    int idx;
    8.46 -    unsigned long flags;
    8.47 -    spin_lock_irqsave(&update_lock, flags);
    8.48 -    idx = per_cpu(mmu_update_queue_idx, cpu);
    8.49 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
    8.50 -    per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
    8.51 -    per_cpu(update_queue[idx], cpu).val  = MMUEXT_PIN_L2_TABLE;
    8.52 -    increment_index();
    8.53 -    spin_unlock_irqrestore(&update_lock, flags);
    8.54 -}
    8.55 -
    8.56 -void queue_pgd_unpin(unsigned long ptr)
    8.57 +void __vms_queue_pgd_pin(unsigned long ptr)
    8.58  {
    8.59      int cpu = smp_processor_id();
    8.60      int idx;
    8.61      unsigned long flags;
    8.62      spin_lock_irqsave(&update_lock, flags);
    8.63      idx = per_cpu(mmu_update_queue_idx, cpu);
    8.64 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
    8.65 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
    8.66      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
    8.67 -    per_cpu(update_queue[idx], cpu).val  = MMUEXT_UNPIN_TABLE;
    8.68 +    per_cpu(update_queue[idx], cpu).val  = MMUEXT_PIN_L2_TABLE;
    8.69      increment_index();
    8.70      spin_unlock_irqrestore(&update_lock, flags);
    8.71  }
    8.72  
    8.73 -void queue_pte_pin(unsigned long ptr)
    8.74 +void __vms_queue_pgd_unpin(unsigned long ptr)
    8.75  {
    8.76      int cpu = smp_processor_id();
    8.77      int idx;
    8.78      unsigned long flags;
    8.79      spin_lock_irqsave(&update_lock, flags);
    8.80      idx = per_cpu(mmu_update_queue_idx, cpu);
    8.81 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
    8.82 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
    8.83 +    per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
    8.84 +    per_cpu(update_queue[idx], cpu).val  = MMUEXT_UNPIN_TABLE;
    8.85 +    increment_index();
    8.86 +    spin_unlock_irqrestore(&update_lock, flags);
    8.87 +}
    8.88 +
    8.89 +void __vms_queue_pte_pin(unsigned long ptr)
    8.90 +{
    8.91 +    int cpu = smp_processor_id();
    8.92 +    int idx;
    8.93 +    unsigned long flags;
    8.94 +    spin_lock_irqsave(&update_lock, flags);
    8.95 +    idx = per_cpu(mmu_update_queue_idx, cpu);
    8.96 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
    8.97      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
    8.98      per_cpu(update_queue[idx], cpu).val  = MMUEXT_PIN_L1_TABLE;
    8.99      increment_index();
   8.100      spin_unlock_irqrestore(&update_lock, flags);
   8.101  }
   8.102  
   8.103 -void queue_pte_unpin(unsigned long ptr)
   8.104 +void __vms_queue_pte_unpin(unsigned long ptr)
   8.105  {
   8.106      int cpu = smp_processor_id();
   8.107      int idx;
   8.108      unsigned long flags;
   8.109      spin_lock_irqsave(&update_lock, flags);
   8.110      idx = per_cpu(mmu_update_queue_idx, cpu);
   8.111 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
   8.112 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
   8.113      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.114      per_cpu(update_queue[idx], cpu).val  = MMUEXT_UNPIN_TABLE;
   8.115      increment_index();
   8.116 @@ -261,12 +259,12 @@ void queue_machphys_update(unsigned long
   8.117  /* queue and flush versions of the above */
   8.118  void xen_l1_entry_update(pte_t *ptr, unsigned long val)
   8.119  {
   8.120 -    *(unsigned long *)ptr = val;
   8.121 +    set_pte(ptr, __pte(val));
   8.122  }
   8.123  
   8.124  void xen_l2_entry_update(pmd_t *ptr, unsigned long val)
   8.125  {
   8.126 -    *(unsigned long *)ptr = val;
   8.127 +    set_pmd(ptr, __pmd(val));
   8.128  }
   8.129  
   8.130  void xen_pt_switch(unsigned long ptr)
   8.131 @@ -276,7 +274,7 @@ void xen_pt_switch(unsigned long ptr)
   8.132      unsigned long flags;
   8.133      spin_lock_irqsave(&update_lock, flags);
   8.134      idx = per_cpu(mmu_update_queue_idx, cpu);
   8.135 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
   8.136 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
   8.137      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.138      per_cpu(update_queue[idx], cpu).val  = MMUEXT_NEW_BASEPTR;
   8.139      increment_index_and_flush();
   8.140 @@ -310,56 +308,56 @@ void xen_invlpg(unsigned long ptr)
   8.141      spin_unlock_irqrestore(&update_lock, flags);
   8.142  }
   8.143  
   8.144 -void xen_pgd_pin(unsigned long ptr)
   8.145 -{
   8.146 -    int cpu = smp_processor_id();
   8.147 -    int idx;
   8.148 -    unsigned long flags;
   8.149 -    spin_lock_irqsave(&update_lock, flags);
   8.150 -    idx = per_cpu(mmu_update_queue_idx, cpu);
   8.151 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
   8.152 -    per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.153 -    per_cpu(update_queue[idx], cpu).val  = MMUEXT_PIN_L2_TABLE;
   8.154 -    increment_index_and_flush();
   8.155 -    spin_unlock_irqrestore(&update_lock, flags);
   8.156 -}
   8.157 -
   8.158 -void xen_pgd_unpin(unsigned long ptr)
   8.159 +void __vms_xen_pgd_pin(unsigned long ptr)
   8.160  {
   8.161      int cpu = smp_processor_id();
   8.162      int idx;
   8.163      unsigned long flags;
   8.164      spin_lock_irqsave(&update_lock, flags);
   8.165      idx = per_cpu(mmu_update_queue_idx, cpu);
   8.166 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
   8.167 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
   8.168      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.169 -    per_cpu(update_queue[idx], cpu).val  = MMUEXT_UNPIN_TABLE;
   8.170 +    per_cpu(update_queue[idx], cpu).val  = MMUEXT_PIN_L2_TABLE;
   8.171      increment_index_and_flush();
   8.172      spin_unlock_irqrestore(&update_lock, flags);
   8.173  }
   8.174  
   8.175 -void xen_pte_pin(unsigned long ptr)
   8.176 +void __vms_xen_pgd_unpin(unsigned long ptr)
   8.177  {
   8.178      int cpu = smp_processor_id();
   8.179      int idx;
   8.180      unsigned long flags;
   8.181      spin_lock_irqsave(&update_lock, flags);
   8.182      idx = per_cpu(mmu_update_queue_idx, cpu);
   8.183 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
   8.184 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
   8.185 +    per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.186 +    per_cpu(update_queue[idx], cpu).val  = MMUEXT_UNPIN_TABLE;
   8.187 +    increment_index_and_flush();
   8.188 +    spin_unlock_irqrestore(&update_lock, flags);
   8.189 +}
   8.190 +
   8.191 +void __vms_xen_pte_pin(unsigned long ptr)
   8.192 +{
   8.193 +    int cpu = smp_processor_id();
   8.194 +    int idx;
   8.195 +    unsigned long flags;
   8.196 +    spin_lock_irqsave(&update_lock, flags);
   8.197 +    idx = per_cpu(mmu_update_queue_idx, cpu);
   8.198 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
   8.199      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.200      per_cpu(update_queue[idx], cpu).val  = MMUEXT_PIN_L1_TABLE;
   8.201      increment_index_and_flush();
   8.202      spin_unlock_irqrestore(&update_lock, flags);
   8.203  }
   8.204  
   8.205 -void xen_pte_unpin(unsigned long ptr)
   8.206 +void __vms_xen_pte_unpin(unsigned long ptr)
   8.207  {
   8.208      int cpu = smp_processor_id();
   8.209      int idx;
   8.210      unsigned long flags;
   8.211      spin_lock_irqsave(&update_lock, flags);
   8.212      idx = per_cpu(mmu_update_queue_idx, cpu);
   8.213 -    per_cpu(update_queue[idx], cpu).ptr  = phys_to_machine(ptr);
   8.214 +    per_cpu(update_queue[idx], cpu).ptr  = __vms_phys_to_machine(ptr);
   8.215      per_cpu(update_queue[idx], cpu).ptr |= MMU_EXTENDED_COMMAND;
   8.216      per_cpu(update_queue[idx], cpu).val  = MMUEXT_UNPIN_TABLE;
   8.217      increment_index_and_flush();
   8.218 @@ -421,7 +419,7 @@ unsigned long allocate_empty_lowmem_regi
   8.219          pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE))); 
   8.220          pfn_array[i] = pte->pte_low >> PAGE_SHIFT;
   8.221          queue_l1_entry_update(pte, 0);
   8.222 -        phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = INVALID_P2M_ENTRY;
   8.223 +        __vms_phys_to_machine_mapping[__pa(vstart)>>PAGE_SHIFT] = INVALID_P2M_ENTRY;
   8.224      }
   8.225  
   8.226      /* Flush updates through and flush the TLB. */
     9.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c	Fri Mar 18 17:01:47 2005 +0000
     9.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c	Sat Mar 19 14:49:05 2005 +0000
     9.3 @@ -349,12 +349,9 @@ static void __init pagetable_init (void)
     9.4  	 * it. We clean up by write-enabling and then freeing the old page dir.
     9.5  	 */
     9.6  	memcpy(new_pgd, old_pgd, PTRS_PER_PGD_NO_HV*sizeof(pgd_t));
     9.7 -	//make_page_readonly(new_pgd);
     9.8 -	queue_pgd_pin(__pa(new_pgd));
     9.9  	load_cr3(new_pgd);
    9.10 -	queue_pgd_unpin(__pa(old_pgd));
    9.11  	__flush_tlb_all(); /* implicit flush */
    9.12 -	make_page_writable(old_pgd);
    9.13 +	//make_page_writable(old_pgd);
    9.14  	flush_page_update_queue();
    9.15  	free_bootmem(__pa(old_pgd), PAGE_SIZE);
    9.16  
    9.17 @@ -562,7 +559,8 @@ void __init paging_init(void)
    9.18  
    9.19  	/* Switch to the real shared_info page, and clear the dummy page. */
    9.20  	flush_page_update_queue();
    9.21 -	set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info);
    9.22 +        printk("xen_start_info.shared_info=%x\n", xen_start_info.shared_info);
    9.23 +	set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info);
    9.24  	HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
    9.25  	memset(empty_zero_page, 0, sizeof(empty_zero_page));
    9.26  
    9.27 @@ -570,10 +568,10 @@ void __init paging_init(void)
    9.28  	/* Setup mapping of lower 1st MB */
    9.29  	for (i = 0; i < NR_FIX_ISAMAPS; i++)
    9.30  		if (xen_start_info.flags & SIF_PRIVILEGED)
    9.31 -			set_fixmap_ma(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
    9.32 +			__vms_set_fixmap_ma(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
    9.33  		else
    9.34 -			set_fixmap_ma_ro(FIX_ISAMAP_BEGIN - i,
    9.35 -					 virt_to_machine(empty_zero_page));
    9.36 +			__vms_set_fixmap_ma_ro(FIX_ISAMAP_BEGIN - i,
    9.37 +					 __vms_virt_to_machine(empty_zero_page));
    9.38  #endif
    9.39  }
    9.40  
    10.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c	Fri Mar 18 17:01:47 2005 +0000
    10.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/ioremap.c	Sat Mar 19 14:49:05 2005 +0000
    10.3 @@ -56,9 +56,8 @@ void __init bt_iounmap(void *addr, unsig
    10.4  static inline int is_local_lowmem(unsigned long address)
    10.5  {
    10.6  	extern unsigned long max_low_pfn;
    10.7 -	unsigned long mfn = address >> PAGE_SHIFT;
    10.8 -	unsigned long pfn = mfn_to_pfn(mfn);
    10.9 -	return ((pfn < max_low_pfn) && (pfn_to_mfn(pfn) == mfn));
   10.10 +	unsigned long pfn = address >> PAGE_SHIFT;
   10.11 +	return (pfn < max_low_pfn);
   10.12  }
   10.13  
   10.14  /*
   10.15 @@ -97,6 +96,7 @@ void __iomem * __ioremap(unsigned long p
   10.16  	/*
   10.17  	 * Don't allow anybody to remap normal RAM that we're using..
   10.18  	 */
   10.19 +#if 0
   10.20  	if (is_local_lowmem(phys_addr)) {
   10.21  		char *t_addr, *t_end;
   10.22  		struct page *page;
   10.23 @@ -110,6 +110,7 @@ void __iomem * __ioremap(unsigned long p
   10.24  
   10.25  		domid = DOMID_LOCAL;
   10.26  	}
   10.27 +#endif
   10.28  
   10.29  	/*
   10.30  	 * Mappings have to be page-aligned
   10.31 @@ -255,7 +256,7 @@ void __init *bt_ioremap(unsigned long ph
   10.32  	 */
   10.33  	idx = FIX_BTMAP_BEGIN;
   10.34  	while (nrpages > 0) {
   10.35 -		set_fixmap_ma(idx, phys_addr);
   10.36 +		__vms_set_fixmap_ma(idx, phys_addr);
   10.37  		phys_addr += PAGE_SIZE;
   10.38  		--idx;
   10.39  		--nrpages;
   10.40 @@ -312,7 +313,7 @@ static inline void direct_remap_area_pte
   10.41  		BUG();
   10.42  
   10.43  	do {
   10.44 -		(*v)->ptr = virt_to_machine(pte);
   10.45 +		(*v)->ptr = __vms_virt_to_machine(pte);
   10.46  		(*v)++;
   10.47  		address += PAGE_SIZE;
   10.48  		pte++;
   10.49 @@ -386,7 +387,7 @@ int direct_remap_area_pages(struct mm_st
   10.50  	mmu_update_t u[MAX_DIRECTMAP_MMU_QUEUE], *w, *v;
   10.51  
   10.52  	v = w = &u[0];
   10.53 -	if (domid != DOMID_LOCAL) {
   10.54 +	if (0 && domid != DOMID_LOCAL) {
   10.55  		u[0].ptr  = MMU_EXTENDED_COMMAND;
   10.56  		u[0].val  = MMUEXT_SET_FOREIGNDOM;
   10.57  		u[0].val |= (unsigned long)domid << 16;
   10.58 @@ -415,8 +416,19 @@ int direct_remap_area_pages(struct mm_st
   10.59  		 * Fill in the machine address: PTE ptr is done later by
   10.60  		 * __direct_remap_area_pages(). 
   10.61  		 */
   10.62 -		v->val = (machine_addr & PAGE_MASK) | pgprot_val(prot);
   10.63 +        {
   10.64 +            mmu_update_t update;
   10.65 +            int success = 0;
   10.66 +            unsigned long ppfn;
   10.67  
   10.68 +            update.ptr = (machine_addr & PAGE_MASK) | MMU_MACHPHYS_UPDATE;
   10.69 +            update.val = -1;
   10.70 +            ppfn = HYPERVISOR_mmu_update(&update, 1, &success);
   10.71 +            if (! success)
   10.72 +                BUG();
   10.73 +                
   10.74 +		v->val = (ppfn << PAGE_SHIFT) | pgprot_val(prot);
   10.75 +        }
   10.76  		machine_addr += PAGE_SIZE;
   10.77  		address += PAGE_SIZE; 
   10.78  		v++;
    11.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/pageattr.c	Fri Mar 18 17:01:47 2005 +0000
    11.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/pageattr.c	Sat Mar 19 14:49:05 2005 +0000
    11.3 @@ -119,7 +119,7 @@ static int
    11.4  		if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
    11.5  			pte_t old = *kpte;
    11.6  			pte_t standard = mk_pte(page, PAGE_KERNEL); 
    11.7 -			set_pte_batched(kpte, mk_pte(page, prot)); 
    11.8 +			set_pte_atomic(kpte, mk_pte(page, prot)); 
    11.9  			if (pte_same(old,standard))
   11.10  				get_page(kpte_page);
   11.11  		} else {
   11.12 @@ -130,7 +130,7 @@ static int
   11.13  			set_pmd_pte(kpte,address,mk_pte(split, PAGE_KERNEL));
   11.14  		}	
   11.15  	} else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { 
   11.16 -		set_pte_batched(kpte, mk_pte(page, PAGE_KERNEL));
   11.17 +		set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
   11.18  		__put_page(kpte_page);
   11.19  	}
   11.20  
   11.21 @@ -171,7 +171,6 @@ int change_page_attr(struct page *page, 
   11.22  		if (err) 
   11.23  			break; 
   11.24  	} 	
   11.25 -	flush_page_update_queue();
   11.26  	spin_unlock_irqrestore(&cpa_lock, flags);
   11.27  	return err;
   11.28  }
    12.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c	Fri Mar 18 17:01:47 2005 +0000
    12.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/pgtable.c	Sat Mar 19 14:49:05 2005 +0000
    12.3 @@ -93,7 +93,7 @@ static void set_pte_pfn(unsigned long va
    12.4   * Associate a virtual page frame with a given physical page frame 
    12.5   * and protection flags for that frame.
    12.6   */ 
    12.7 -static void set_pte_pfn_ma(unsigned long vaddr, unsigned long pfn,
    12.8 +static void __vms_set_pte_pfn_ma(unsigned long vaddr, unsigned long pfn,
    12.9  			   pgprot_t flags)
   12.10  {
   12.11  	pgd_t *pgd;
   12.12 @@ -112,7 +112,18 @@ static void set_pte_pfn_ma(unsigned long
   12.13  	}
   12.14  	pte = pte_offset_kernel(pmd, vaddr);
   12.15  	/* <pfn,flags> stored as-is, to permit clearing entries */
   12.16 -	set_pte(pte, pfn_pte_ma(pfn, flags));
   12.17 +        {
   12.18 +            mmu_update_t update;
   12.19 +            int success = 0;
   12.20 +            unsigned long ppfn;
   12.21 +
   12.22 +            update.ptr = (pfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
   12.23 +            update.val = -1;
   12.24 +            ppfn = HYPERVISOR_mmu_update(&update, 1, &success);
   12.25 +            if (! success)
   12.26 +                BUG();
   12.27 +            set_pte(pte, pfn_pte(ppfn, flags));
   12.28 +        }
   12.29  
   12.30  	/*
   12.31  	 * It's enough to flush this one mapping.
   12.32 @@ -165,7 +176,7 @@ void __set_fixmap (enum fixed_addresses 
   12.33  	set_pte_pfn(address, phys >> PAGE_SHIFT, flags);
   12.34  }
   12.35  
   12.36 -void __set_fixmap_ma (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
   12.37 +void __vms___set_fixmap_ma (enum fixed_addresses idx, unsigned long phys, pgprot_t flags)
   12.38  {
   12.39  	unsigned long address = __fix_to_virt(idx);
   12.40  
   12.41 @@ -173,7 +184,7 @@ void __set_fixmap_ma (enum fixed_address
   12.42  		BUG();
   12.43  		return;
   12.44  	}
   12.45 -	set_pte_pfn_ma(address, phys >> PAGE_SHIFT, flags);
   12.46 +	__vms_set_pte_pfn_ma(address, phys >> PAGE_SHIFT, flags);
   12.47  }
   12.48  
   12.49  pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
   12.50 @@ -181,8 +192,6 @@ pte_t *pte_alloc_one_kernel(struct mm_st
   12.51  	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
   12.52  	if (pte) {
   12.53  		clear_page(pte);
   12.54 -		//make_page_readonly(pte);
   12.55 -		xen_flush_page_update_queue();
   12.56  	}
   12.57  	return pte;
   12.58  }
   12.59 @@ -194,9 +203,6 @@ void pte_ctor(void *pte, kmem_cache_t *c
   12.60  	set_page_count(page, 1);
   12.61  
   12.62  	clear_page(pte);
   12.63 -	//make_page_readonly(pte);
   12.64 -	queue_pte_pin(__pa(pte));
   12.65 -	flush_page_update_queue();
   12.66  }
   12.67  
   12.68  void pte_dtor(void *pte, kmem_cache_t *cache, unsigned long unused)
   12.69 @@ -204,9 +210,6 @@ void pte_dtor(void *pte, kmem_cache_t *c
   12.70  	struct page *page = virt_to_page(pte);
   12.71  	ClearPageForeign(page);
   12.72  
   12.73 -	queue_pte_unpin(__pa(pte));
   12.74 -	make_page_writable(pte);
   12.75 -	flush_page_update_queue();
   12.76  }
   12.77  
   12.78  struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
   12.79 @@ -239,7 +242,7 @@ void pte_free(struct page *pte)
   12.80  	if (pte < highmem_start_page)
   12.81  #endif
   12.82  		kmem_cache_free(pte_cache,
   12.83 -				phys_to_virt(page_to_pseudophys(pte)));
   12.84 +				phys_to_virt(__vms_page_to_pseudophys(pte)));
   12.85  #ifdef CONFIG_HIGHPTE
   12.86  	else
   12.87  		__free_page(pte);
   12.88 @@ -304,9 +307,7 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
   12.89  	spin_unlock_irqrestore(&pgd_lock, flags);
   12.90  	memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
   12.91   out:
   12.92 -	//make_page_readonly(pgd);
   12.93 -	queue_pgd_pin(__pa(pgd));
   12.94 -	flush_page_update_queue();
   12.95 +	;
   12.96  }
   12.97  
   12.98  /* never called when PTRS_PER_PMD > 1 */
   12.99 @@ -314,10 +315,6 @@ void pgd_dtor(void *pgd, kmem_cache_t *c
  12.100  {
  12.101  	unsigned long flags; /* can be called from interrupt context */
  12.102  
  12.103 -	queue_pgd_unpin(__pa(pgd));
  12.104 -	make_page_writable(pgd);
  12.105 -	flush_page_update_queue();
  12.106 -
  12.107  	if (PTRS_PER_PMD > 1)
  12.108  		return;
  12.109  
  12.110 @@ -383,15 +380,17 @@ void make_page_readonly(void *va)
  12.111  	pmd_t *pmd = pmd_offset(pgd, (unsigned long)va);
  12.112  	pte_t *pte = pte_offset_kernel(pmd, (unsigned long)va);
  12.113  	queue_l1_entry_update(pte, (*(unsigned long *)pte)&~_PAGE_RW);
  12.114 +#if 0
  12.115  	if ( (unsigned long)va >= (unsigned long)high_memory )
  12.116  	{
  12.117  		unsigned long phys;
  12.118 -		phys = machine_to_phys(*(unsigned long *)pte & PAGE_MASK);
  12.119 +		phys = __vms_machine_to_phys(*(unsigned long *)pte & PAGE_MASK);
  12.120  #ifdef CONFIG_HIGHMEM
  12.121  		if ( (phys >> PAGE_SHIFT) < highstart_pfn )
  12.122  #endif
  12.123  			make_lowmem_page_readonly(phys_to_virt(phys));
  12.124  	}
  12.125 +#endif
  12.126  }
  12.127  
  12.128  void make_page_writable(void *va)
  12.129 @@ -403,7 +402,7 @@ void make_page_writable(void *va)
  12.130  	if ( (unsigned long)va >= (unsigned long)high_memory )
  12.131  	{
  12.132  		unsigned long phys;
  12.133 -		phys = machine_to_phys(*(unsigned long *)pte & PAGE_MASK);
  12.134 +		phys = __vms_machine_to_phys(*(unsigned long *)pte & PAGE_MASK);
  12.135  #ifdef CONFIG_HIGHMEM
  12.136  		if ( (phys >> PAGE_SHIFT) < highstart_pfn )
  12.137  #endif
    13.1 --- a/linux-2.6.10-xen-sparse/arch/xen/kernel/reboot.c	Fri Mar 18 17:01:47 2005 +0000
    13.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/kernel/reboot.c	Sat Mar 19 14:49:05 2005 +0000
    13.3 @@ -80,7 +80,7 @@ static void __do_suspend(void)
    13.4      extern void time_suspend(void);
    13.5      extern void time_resume(void);
    13.6      extern unsigned long max_pfn;
    13.7 -    extern unsigned int *pfn_to_mfn_frame_list;
    13.8 +    extern unsigned int *__vms_pfn_to_mfn_frame_list;
    13.9  
   13.10      suspend_record = (suspend_record_t *)__get_free_page(GFP_KERNEL);
   13.11      if ( suspend_record == NULL )
   13.12 @@ -105,7 +105,7 @@ static void __do_suspend(void)
   13.13  
   13.14      memcpy(&suspend_record->resume_info, &xen_start_info, sizeof(xen_start_info));
   13.15  
   13.16 -    HYPERVISOR_suspend(virt_to_machine(suspend_record) >> PAGE_SHIFT);
   13.17 +    HYPERVISOR_suspend(__vms_virt_to_machine(suspend_record) >> PAGE_SHIFT);
   13.18  
   13.19      HYPERVISOR_vm_assist(VMASST_CMD_enable,
   13.20  			 VMASST_TYPE_4gb_segments);
   13.21 @@ -118,11 +118,7 @@ static void __do_suspend(void)
   13.22  
   13.23      memcpy(&xen_start_info, &suspend_record->resume_info, sizeof(xen_start_info));
   13.24  
   13.25 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   13.26 -    set_fixmap_ma(FIX_SHARED_INFO, xen_start_info.shared_info);
   13.27 -#else
   13.28      set_fixmap(FIX_SHARED_INFO, xen_start_info.shared_info);
   13.29 -#endif
   13.30  
   13.31      HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
   13.32  
   13.33 @@ -130,11 +126,11 @@ static void __do_suspend(void)
   13.34  
   13.35      for ( i=0, j=0; i < max_pfn; i+=(PAGE_SIZE/sizeof(unsigned long)), j++ )
   13.36      {
   13.37 -        pfn_to_mfn_frame_list[j] = 
   13.38 -            virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
   13.39 +        __vms_pfn_to_mfn_frame_list[j] = 
   13.40 +            __vms_virt_to_machine(&__vms_phys_to_machine_mapping[i]) >> PAGE_SHIFT;
   13.41      }
   13.42      HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list =
   13.43 -        virt_to_machine(pfn_to_mfn_frame_list) >> PAGE_SHIFT;
   13.44 +        __vms_virt_to_machine(__vms_pfn_to_mfn_frame_list) >> PAGE_SHIFT;
   13.45  
   13.46  
   13.47      irq_resume();
    14.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/balloon/balloon.c	Fri Mar 18 17:01:47 2005 +0000
    14.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/balloon/balloon.c	Sat Mar 19 14:49:05 2005 +0000
    14.3 @@ -206,11 +206,11 @@ static void balloon_process(void *unused
    14.4                  BUG();
    14.5  
    14.6              pfn = page - mem_map;
    14.7 -            if ( phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY )
    14.8 +            if ( __vms_phys_to_machine_mapping[pfn] != INVALID_P2M_ENTRY )
    14.9                  BUG();
   14.10  
   14.11              /* Update P->M and M->P tables. */
   14.12 -            phys_to_machine_mapping[pfn] = mfn_list[i];
   14.13 +            __vms_phys_to_machine_mapping[pfn] = mfn_list[i];
   14.14              queue_machphys_update(mfn_list[i], pfn);
   14.15              
   14.16              /* Link back into the page tables if it's not a highmem page. */
   14.17 @@ -244,8 +244,8 @@ static void balloon_process(void *unused
   14.18              }
   14.19  
   14.20              pfn = page - mem_map;
   14.21 -            mfn_list[i] = phys_to_machine_mapping[pfn];
   14.22 -            phys_to_machine_mapping[pfn] = INVALID_P2M_ENTRY;
   14.23 +            mfn_list[i] = __vms_phys_to_machine_mapping[pfn];
   14.24 +            __vms_phys_to_machine_mapping[pfn] = INVALID_P2M_ENTRY;
   14.25  
   14.26              if ( !PageHighMem(page) )
   14.27              {
    15.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/blkback/blkback.c	Fri Mar 18 17:01:47 2005 +0000
    15.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/blkback/blkback.c	Sat Mar 19 14:49:05 2005 +0000
    15.3 @@ -444,7 +444,7 @@ static void dispatch_rw_block_io(blkif_t
    15.4  #else
    15.5          mcl[i].args[3] = blkif->domid;
    15.6  #endif
    15.7 -        phys_to_machine_mapping[__pa(MMAP_VADDR(pending_idx, i))>>PAGE_SHIFT] =
    15.8 +        __vms_phys_to_machine_mapping[__pa(MMAP_VADDR(pending_idx, i))>>PAGE_SHIFT] =
    15.9              FOREIGN_FRAME(phys_seg[i].buffer >> PAGE_SHIFT);
   15.10      }
   15.11  
    16.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Mar 18 17:01:47 2005 +0000
    16.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/blkfront/blkfront.c	Sat Mar 19 14:49:05 2005 +0000
    16.3 @@ -129,7 +129,7 @@ static inline void translate_req_to_pfn(
    16.4      xreq->sector_number = req->sector_number;
    16.5  
    16.6      for ( i = 0; i < req->nr_segments; i++ )
    16.7 -        xreq->frame_and_sects[i] = machine_to_phys(req->frame_and_sects[i]);
    16.8 +        xreq->frame_and_sects[i] = __vms_machine_to_phys(req->frame_and_sects[i]);
    16.9  }
   16.10  
   16.11  static inline void translate_req_to_mfn(blkif_request_t *xreq,
   16.12 @@ -144,7 +144,7 @@ static inline void translate_req_to_mfn(
   16.13      xreq->sector_number = req->sector_number;
   16.14  
   16.15      for ( i = 0; i < req->nr_segments; i++ )
   16.16 -        xreq->frame_and_sects[i] = phys_to_machine(req->frame_and_sects[i]);
   16.17 +        xreq->frame_and_sects[i] = __vms_phys_to_machine(req->frame_and_sects[i]);
   16.18  }
   16.19  
   16.20  
   16.21 @@ -1091,7 +1091,7 @@ static void blkif_send_interface_connect
   16.22      blkif_fe_interface_connect_t *msg = (void*)cmsg.msg;
   16.23      
   16.24      msg->handle      = 0;
   16.25 -    msg->shmem_frame = (virt_to_machine(blk_ring.sring) >> PAGE_SHIFT);
   16.26 +    msg->shmem_frame = (__vms_virt_to_machine(blk_ring.sring) >> PAGE_SHIFT);
   16.27      
   16.28      ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
   16.29  }
   16.30 @@ -1401,7 +1401,7 @@ void blkif_completion(blkif_request_t *r
   16.31          for ( i = 0; i < req->nr_segments; i++ )
   16.32          {
   16.33              unsigned long pfn = req->frame_and_sects[i] >> PAGE_SHIFT;
   16.34 -            unsigned long mfn = phys_to_machine_mapping[pfn];
   16.35 +            unsigned long mfn = __vms_phys_to_machine_mapping[pfn];
   16.36              xen_machphys_update(mfn, pfn);
   16.37          }
   16.38          break;
    17.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/blkfront/vbd.c	Fri Mar 18 17:01:47 2005 +0000
    17.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/blkfront/vbd.c	Sat Mar 19 14:49:05 2005 +0000
    17.3 @@ -112,7 +112,7 @@ static int xlvbd_get_vbd_info(vdisk_t *d
    17.4      memset(&req, 0, sizeof(req));
    17.5      req.operation   = BLKIF_OP_PROBE;
    17.6      req.nr_segments = 1;
    17.7 -    req.frame_and_sects[0] = virt_to_machine(buf) | 7;
    17.8 +    req.frame_and_sects[0] = __vms_virt_to_machine(buf) | 7;
    17.9  
   17.10      blkif_control_send(&req, &rsp);
   17.11  
    18.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/netback/netback.c	Fri Mar 18 17:01:47 2005 +0000
    18.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/netback/netback.c	Sat Mar 19 14:49:05 2005 +0000
    18.3 @@ -207,7 +207,7 @@ static void net_rx_action(unsigned long 
    18.4      {
    18.5          netif   = netdev_priv(skb->dev);
    18.6          vdata   = (unsigned long)skb->data;
    18.7 -        mdata   = virt_to_machine(vdata);
    18.8 +        mdata   = __vms_virt_to_machine(vdata);
    18.9  
   18.10          /* Memory squeeze? Back off for an arbitrary while. */
   18.11          if ( (new_mfn = alloc_mfn()) == 0 )
   18.12 @@ -223,7 +223,7 @@ static void net_rx_action(unsigned long 
   18.13           * Set the new P2M table entry before reassigning the old data page.
   18.14           * Heed the comment in pgtable-2level.h:pte_page(). :-)
   18.15           */
   18.16 -        phys_to_machine_mapping[__pa(skb->data) >> PAGE_SHIFT] = new_mfn;
   18.17 +        __vms_phys_to_machine_mapping[__pa(skb->data) >> PAGE_SHIFT] = new_mfn;
   18.18          
   18.19          mmu[0].ptr  = (new_mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE;
   18.20          mmu[0].val  = __pa(vdata) >> PAGE_SHIFT;  
   18.21 @@ -590,7 +590,7 @@ static void net_tx_action(unsigned long 
   18.22              continue;
   18.23          }
   18.24  
   18.25 -        phys_to_machine_mapping[__pa(MMAP_VADDR(pending_idx)) >> PAGE_SHIFT] =
   18.26 +        __vms_phys_to_machine_mapping[__pa(MMAP_VADDR(pending_idx)) >> PAGE_SHIFT] =
   18.27              FOREIGN_FRAME(txreq.addr >> PAGE_SHIFT);
   18.28  
   18.29          data_len = (txreq.size > PKT_PROT_LEN) ? PKT_PROT_LEN : txreq.size;
    19.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/netfront/netfront.c	Fri Mar 18 17:01:47 2005 +0000
    19.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/netfront/netfront.c	Sat Mar 19 14:49:05 2005 +0000
    19.3 @@ -375,10 +375,10 @@ static void network_alloc_rx_buffers(str
    19.4          
    19.5          np->rx->ring[MASK_NETIF_RX_IDX(req_prod + i)].req.id = id;
    19.6          
    19.7 -        rx_pfn_array[i] = virt_to_machine(skb->head) >> PAGE_SHIFT;
    19.8 +        rx_pfn_array[i] = __vms_virt_to_machine(skb->head) >> PAGE_SHIFT;
    19.9  
   19.10  	/* Remove this page from pseudo phys map before passing back to Xen. */
   19.11 -	phys_to_machine_mapping[__pa(skb->head) >> PAGE_SHIFT] 
   19.12 +	__vms_phys_to_machine_mapping[__pa(skb->head) >> PAGE_SHIFT] 
   19.13  	    = INVALID_P2M_ENTRY;
   19.14  
   19.15          rx_mcl[i].op = __HYPERVISOR_update_va_mapping;
   19.16 @@ -464,7 +464,7 @@ static int network_start_xmit(struct sk_
   19.17      tx = &np->tx->ring[MASK_NETIF_TX_IDX(i)].req;
   19.18  
   19.19      tx->id   = id;
   19.20 -    tx->addr = virt_to_machine(skb->data);
   19.21 +    tx->addr = __vms_virt_to_machine(skb->data);
   19.22      tx->size = skb->len;
   19.23  
   19.24      wmb(); /* Ensure that backend will see the request. */
   19.25 @@ -579,7 +579,7 @@ static int netif_poll(struct net_device 
   19.26          mcl->args[2] = 0;
   19.27          mcl++;
   19.28  
   19.29 -        phys_to_machine_mapping[__pa(skb->head) >> PAGE_SHIFT] = 
   19.30 +        __vms_phys_to_machine_mapping[__pa(skb->head) >> PAGE_SHIFT] = 
   19.31              rx->addr >> PAGE_SHIFT;
   19.32  
   19.33          __skb_queue_tail(&rxq, skb);
   19.34 @@ -736,7 +736,7 @@ static void network_connect(struct net_d
   19.35                  tx = &np->tx->ring[requeue_idx++].req;
   19.36                  
   19.37                  tx->id   = i;
   19.38 -                tx->addr = virt_to_machine(skb->data);
   19.39 +                tx->addr = __vms_virt_to_machine(skb->data);
   19.40                  tx->size = skb->len;
   19.41                  
   19.42                  np->stats.tx_bytes += skb->len;
   19.43 @@ -799,8 +799,8 @@ static void send_interface_connect(struc
   19.44      netif_fe_interface_connect_t *msg = (void*)cmsg.msg;
   19.45  
   19.46      msg->handle = np->handle;
   19.47 -    msg->tx_shmem_frame = (virt_to_machine(np->tx) >> PAGE_SHIFT);
   19.48 -    msg->rx_shmem_frame = (virt_to_machine(np->rx) >> PAGE_SHIFT);
   19.49 +    msg->tx_shmem_frame = (__vms_virt_to_machine(np->tx) >> PAGE_SHIFT);
   19.50 +    msg->rx_shmem_frame = (__vms_virt_to_machine(np->rx) >> PAGE_SHIFT);
   19.51          
   19.52      ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
   19.53  }
    20.1 --- a/linux-2.6.10-xen-sparse/drivers/xen/privcmd/privcmd.c	Fri Mar 18 17:01:47 2005 +0000
    20.2 +++ b/linux-2.6.10-xen-sparse/drivers/xen/privcmd/privcmd.c	Sat Mar 19 14:49:05 2005 +0000
    20.3 @@ -174,7 +174,7 @@ static int privcmd_ioctl(struct inode *i
    20.4  
    20.5      case IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN:
    20.6      {
    20.7 -        unsigned long m2pv = (unsigned long)machine_to_phys_mapping;
    20.8 +        unsigned long m2pv = (unsigned long)__vms_machine_to_phys_mapping;
    20.9          pgd_t *pgd = pgd_offset_k(m2pv);
   20.10          pmd_t *pmd = pmd_offset(pgd, m2pv);
   20.11          unsigned long m2p_start_mfn = pmd_val(*pmd) >> PAGE_SHIFT;
    21.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/desc.h	Fri Mar 18 17:01:47 2005 +0000
    21.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/desc.h	Sat Mar 19 14:49:05 2005 +0000
    21.3 @@ -89,7 +89,7 @@ static inline void set_ldt_desc(unsigned
    21.4  
    21.5  static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
    21.6  {
    21.7 -#define C(i) HYPERVISOR_update_descriptor(virt_to_machine(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]), ((u32 *)&t->tls_array[i])[0], ((u32 *)&t->tls_array[i])[1])
    21.8 +#define C(i) HYPERVISOR_update_descriptor(__pa(&get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN + i]), ((u32 *)&t->tls_array[i])[0], ((u32 *)&t->tls_array[i])[1])
    21.9  	C(0); C(1); C(2);
   21.10  #undef C
   21.11  }
    22.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/fixmap.h	Fri Mar 18 17:01:47 2005 +0000
    22.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/fixmap.h	Sat Mar 19 14:49:05 2005 +0000
    22.3 @@ -101,15 +101,15 @@ enum fixed_addresses {
    22.4  
    22.5  extern void __set_fixmap (enum fixed_addresses idx,
    22.6  					unsigned long phys, pgprot_t flags);
    22.7 -extern void __set_fixmap_ma (enum fixed_addresses idx,
    22.8 +extern void __vms___set_fixmap_ma (enum fixed_addresses idx,
    22.9  					unsigned long mach, pgprot_t flags);
   22.10  
   22.11  #define set_fixmap(idx, phys) \
   22.12  		__set_fixmap(idx, phys, PAGE_KERNEL)
   22.13 -#define set_fixmap_ma(idx, phys) \
   22.14 -		__set_fixmap_ma(idx, phys, PAGE_KERNEL)
   22.15 -#define set_fixmap_ma_ro(idx, phys) \
   22.16 -		__set_fixmap_ma(idx, phys, PAGE_KERNEL_RO)
   22.17 +#define __vms_set_fixmap_ma(idx, phys) \
   22.18 +		__vms___set_fixmap_ma(idx, phys, PAGE_KERNEL)
   22.19 +#define __vms_set_fixmap_ma_ro(idx, phys) \
   22.20 +		__vms___set_fixmap_ma(idx, phys, PAGE_KERNEL_RO)
   22.21  /*
   22.22   * Some hardware wants to get fixmapped without caching.
   22.23   */
    23.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/io.h	Fri Mar 18 17:01:47 2005 +0000
    23.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/io.h	Sat Mar 19 14:49:05 2005 +0000
    23.3 @@ -89,18 +89,21 @@ static inline void * phys_to_virt(unsign
    23.4  /*
    23.5   * Change "struct page" to physical address.
    23.6   */
    23.7 -#define page_to_pseudophys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
    23.8 -#define page_to_phys(page)	 (phys_to_machine(page_to_pseudophys(page)))
    23.9 +#define __vms_page_to_pseudophys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
   23.10 +#define __vms_page_to_machphys(page) (__vms_phys_to_machine(__vms_page_to_pseudophys(page)))
   23.11 +#define page_to_phys(page)	 (__vms_page_to_machphys(page))
   23.12  
   23.13 -#define bio_to_pseudophys(bio)	 (page_to_pseudophys(bio_page((bio))) + \
   23.14 +#define __vms_bio_to_pseudophys(bio)	 (__vms_page_to_pseudophys(bio_page((bio))) + \
   23.15  				  (unsigned long) bio_offset((bio)))
   23.16 -#define bvec_to_pseudophys(bv)	 (page_to_pseudophys((bv)->bv_page) + \
   23.17 +#define __vms_bvec_to_pseudophys(bv)	 (__vms_page_to_pseudophys((bv)->bv_page) + \
   23.18 +				  (unsigned long) (bv)->bv_offset)
   23.19 +#define __vms_bvec_to_machphys(bv)	 (__vms_page_to_machphys((bv)->bv_page) + \
   23.20  				  (unsigned long) (bv)->bv_offset)
   23.21  
   23.22  #define BIOVEC_PHYS_MERGEABLE(vec1, vec2)	\
   23.23  	(((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) && \
   23.24 -	 ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) == \
   23.25 -	  bvec_to_pseudophys((vec2))))
   23.26 +	 ((__vms_bvec_to_machphys((vec1)) + (vec1)->bv_len) == \
   23.27 +	  __vms_bvec_to_machphys((vec2))))
   23.28  
   23.29  extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
   23.30  
   23.31 @@ -149,8 +152,8 @@ extern void bt_iounmap(void *addr, unsig
   23.32   *
   23.33   * Allow them on x86 for legacy drivers, though.
   23.34   */
   23.35 -#define virt_to_bus(_x) phys_to_machine(__pa(_x))
   23.36 -#define bus_to_virt(_x) __va(machine_to_phys(_x))
   23.37 +#define virt_to_bus(_x) __vms_phys_to_machine(__pa(_x))
   23.38 +#define bus_to_virt(_x) ({ BUG(); __va((_x)); })
   23.39  
   23.40  /*
   23.41   * readX/writeX() are used to access memory mapped devices. On some
    24.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/page.h	Fri Mar 18 17:01:47 2005 +0000
    24.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/page.h	Sat Mar 19 14:49:05 2005 +0000
    24.3 @@ -12,6 +12,10 @@
    24.4  #ifdef __KERNEL__
    24.5  #ifndef __ASSEMBLY__
    24.6  
    24.7 +#ifndef BUG
    24.8 +#include <asm/bug.h>
    24.9 +#endif
   24.10 +
   24.11  #include <linux/config.h>
   24.12  #include <linux/string.h>
   24.13  #include <linux/types.h>
   24.14 @@ -55,18 +59,18 @@
   24.15  #define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
   24.16  
   24.17  /**** MACHINE <-> PHYSICAL CONVERSION MACROS ****/
   24.18 -extern unsigned int *phys_to_machine_mapping;
   24.19 -#define pfn_to_mfn(_pfn) ((unsigned long)(phys_to_machine_mapping[(_pfn)]))
   24.20 -#define mfn_to_pfn(_mfn) ((unsigned long)(machine_to_phys_mapping[(_mfn)]))
   24.21 -static inline unsigned long phys_to_machine(unsigned long phys)
   24.22 +extern unsigned int *__vms_phys_to_machine_mapping;
   24.23 +#define __vms_pfn_to_mfn(_pfn) ((unsigned long)(__vms_phys_to_machine_mapping[(_pfn)]))
   24.24 +#define __vms_mfn_to_pfn(_mfn) ({ BUG(); ((unsigned long)(__vms_machine_to_phys_mapping[(_mfn)])); })
   24.25 +static inline unsigned long __vms_phys_to_machine(unsigned long phys)
   24.26  {
   24.27 -	unsigned long machine = pfn_to_mfn(phys >> PAGE_SHIFT);
   24.28 +	unsigned long machine = __vms_pfn_to_mfn(phys >> PAGE_SHIFT);
   24.29  	machine = (machine << PAGE_SHIFT) | (phys & ~PAGE_MASK);
   24.30  	return machine;
   24.31  }
   24.32 -static inline unsigned long machine_to_phys(unsigned long machine)
   24.33 +static inline unsigned long __vms_machine_to_phys(unsigned long machine)
   24.34  {
   24.35 -	unsigned long phys = mfn_to_pfn(machine >> PAGE_SHIFT);
   24.36 +	unsigned long phys = __vms_mfn_to_pfn(machine >> PAGE_SHIFT);
   24.37  	phys = (phys << PAGE_SHIFT) | (machine & ~PAGE_MASK);
   24.38  	return phys;
   24.39  }
   24.40 @@ -89,9 +93,8 @@ typedef struct { unsigned long pmd; } pm
   24.41  typedef struct { unsigned long pgd; } pgd_t;
   24.42  typedef struct { unsigned long pgprot; } pgprot_t;
   24.43  #define boot_pte_t pte_t /* or would you rather have a typedef */
   24.44 -#define pte_val(x)	(((x).pte_low & 1) ? machine_to_phys((x).pte_low) : \
   24.45 -			 (x).pte_low)
   24.46 -#define pte_val_ma(x)	((x).pte_low)
   24.47 +#define pte_val(x)	((x).pte_low)
   24.48 +#define __vms_pte_val_ma(x)	((x).pte_low)
   24.49  #define HPAGE_SHIFT	22
   24.50  #endif
   24.51  #define PTE_MASK	PAGE_MASK
   24.52 @@ -106,22 +109,17 @@ typedef struct { unsigned long pgprot; }
   24.53  
   24.54  static inline unsigned long pmd_val(pmd_t x)
   24.55  {
   24.56 -	unsigned long ret = x.pmd;
   24.57 -	if (ret) ret = machine_to_phys(ret);
   24.58 -	return ret;
   24.59 +	return x.pmd;
   24.60  }
   24.61  #define pgd_val(x)	({ BUG(); (unsigned long)0; })
   24.62  #define pgprot_val(x)	((x).pgprot)
   24.63  
   24.64  static inline pte_t __pte(unsigned long x)
   24.65  {
   24.66 -	if (x & 1) x = phys_to_machine(x);
   24.67  	return ((pte_t) { (x) });
   24.68  }
   24.69 -#define __pte_ma(x)	((pte_t) { (x) } )
   24.70  static inline pmd_t __pmd(unsigned long x)
   24.71  {
   24.72 -	if ((x & 1)) x = phys_to_machine(x);
   24.73  	return ((pmd_t) { (x) });
   24.74  }
   24.75  #define __pgd(x)	({ BUG(); (pgprot_t) { 0 }; })
   24.76 @@ -199,8 +197,8 @@ extern int sysctl_legacy_va_layout;
   24.77  		 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
   24.78  
   24.79  /* VIRT <-> MACHINE conversion */
   24.80 -#define virt_to_machine(_a)	(phys_to_machine(__pa(_a)))
   24.81 -#define machine_to_virt(_m)	(__va(machine_to_phys(_m)))
   24.82 +#define __vms_virt_to_machine(_a)	(__vms_phys_to_machine(__pa(_a)))
   24.83 +#define __vms_machine_to_virt(_m)	(__va(__vms_machine_to_phys(_m)))
   24.84  
   24.85  #endif /* __KERNEL__ */
   24.86  
    25.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgalloc.h	Fri Mar 18 17:01:47 2005 +0000
    25.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgalloc.h	Sat Mar 19 14:49:05 2005 +0000
    25.3 @@ -16,7 +16,6 @@ static inline void pmd_populate(struct m
    25.4  	set_pmd(pmd, __pmd(_PAGE_TABLE +
    25.5  		((unsigned long long)page_to_pfn(pte) <<
    25.6  			(unsigned long long) PAGE_SHIFT)));
    25.7 -	flush_page_update_queue();
    25.8  }
    25.9  /*
   25.10   * Allocate and free page tables.
   25.11 @@ -31,8 +30,6 @@ extern struct page *pte_alloc_one(struct
   25.12  static inline void pte_free_kernel(pte_t *pte)
   25.13  {
   25.14  	free_page((unsigned long)pte);
   25.15 -	make_page_writable(pte);
   25.16 -	flush_page_update_queue();
   25.17  }
   25.18  
   25.19  extern void pte_free(struct page *pte);
    26.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Fri Mar 18 17:01:47 2005 +0000
    26.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h	Sat Mar 19 14:49:05 2005 +0000
    26.3 @@ -43,7 +43,7 @@ do { \
    26.4   * (pmds are folded into pgds so this doesn't get actually called,
    26.5   * but the define is needed for a generic inline function.)
    26.6   */
    26.7 -#define set_pmd(pmdptr, pmdval) xen_l2_entry_update((pmdptr), (pmdval).pmd)
    26.8 +#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
    26.9  #define set_pgd(pgdptr, pgdval) ((void)0)
   26.10  
   26.11  #define pgd_page(pgd) \
   26.12 @@ -67,7 +67,7 @@ static inline pte_t ptep_get_and_clear(p
   26.13  {
   26.14  	pte_t pte = *xp;
   26.15  	if (pte.pte_low)
   26.16 -		set_pte(xp, __pte_ma(0));
   26.17 +		set_pte(xp, __pte(0));
   26.18  	return pte;
   26.19  }
   26.20  
   26.21 @@ -94,20 +94,12 @@ static inline pte_t ptep_get_and_clear(p
   26.22   */
   26.23  #define INVALID_P2M_ENTRY (~0U)
   26.24  #define FOREIGN_FRAME(_m) ((_m) | (1UL<<((sizeof(unsigned long)*8)-1)))
   26.25 -#define pte_pfn(_pte)							\
   26.26 -({									\
   26.27 -	unsigned long mfn = (_pte).pte_low >> PAGE_SHIFT;		\
   26.28 -	unsigned long pfn = mfn_to_pfn(mfn);				\
   26.29 -	if ((pfn >= max_mapnr) || (pfn_to_mfn(pfn) != mfn))		\
   26.30 -		pfn = max_mapnr; /* special: force !pfn_valid() */	\
   26.31 -	pfn;								\
   26.32 -})
   26.33 +#define pte_pfn(_pte)		((_pte).pte_low >> PAGE_SHIFT)
   26.34  
   26.35  #define pte_page(_pte) pfn_to_page(pte_pfn(_pte))
   26.36  
   26.37  #define pte_none(x)		(!(x).pte_low)
   26.38  #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
   26.39 -#define pfn_pte_ma(pfn, prot)	__pte_ma(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
   26.40  #define pfn_pmd(pfn, prot)	__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
   26.41  
   26.42  /*
    27.1 --- a/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Fri Mar 18 17:01:47 2005 +0000
    27.2 +++ b/linux-2.6.10-xen-sparse/include/asm-xen/asm-i386/pgtable.h	Sat Mar 19 14:49:05 2005 +0000
    27.3 @@ -321,7 +321,6 @@ static inline pte_t pte_modify(pte_t pte
    27.4  
    27.5  #define pmd_clear(xp)	do {					\
    27.6  	set_pmd(xp, __pmd(0));					\
    27.7 -	xen_flush_page_update_queue();				\
    27.8  } while (0)
    27.9  
   27.10  #ifndef CONFIG_DISCONTIGMEM
   27.11 @@ -460,13 +459,22 @@ void make_page_writable(void *va);
   27.12  void make_pages_readonly(void *va, unsigned int nr);
   27.13  void make_pages_writable(void *va, unsigned int nr);
   27.14  
   27.15 -#define arbitrary_virt_to_machine(__va)					\
   27.16 +#define __vms_arbitrary_virt_to_machine(__va)					\
   27.17  ({									\
   27.18  	pgd_t *__pgd = pgd_offset_k((unsigned long)(__va));		\
   27.19  	pmd_t *__pmd = pmd_offset(__pgd, (unsigned long)(__va));	\
   27.20  	pte_t *__pte = pte_offset_kernel(__pmd, (unsigned long)(__va));	\
   27.21  	unsigned long __pa = (*(unsigned long *)__pte) & PAGE_MASK;	\
   27.22 -	__pa | ((unsigned long)(__va) & (PAGE_SIZE-1));			\
   27.23 +	__vms_phys_to_machine(__pa) | ((unsigned long)(__va) & (PAGE_SIZE-1)); \
   27.24 +})
   27.25 +
   27.26 +#define arbitrary_virt_to_phys(__va)					\
   27.27 +({									\
   27.28 +	pgd_t *__pgd = pgd_offset_k((unsigned long)(__va));		\
   27.29 +	pmd_t *__pmd = pmd_offset(__pgd, (unsigned long)(__va));	\
   27.30 +	pte_t *__pte = pte_offset_kernel(__pmd, (unsigned long)(__va));	\
   27.31 +	unsigned long __pa = (*(unsigned long *)__pte) & PAGE_MASK;	\
   27.32 +	(__pa) | ((unsigned long)(__va) & (PAGE_SIZE-1));               \
   27.33  })
   27.34  
   27.35  #endif /* !__ASSEMBLY__ */
    28.1 --- a/xen/include/public/arch-x86_32.h	Fri Mar 18 17:01:47 2005 +0000
    28.2 +++ b/xen/include/public/arch-x86_32.h	Sat Mar 19 14:49:05 2005 +0000
    28.3 @@ -70,8 +70,8 @@
    28.4   * machine->physical mapping table starts at this address, read-only.
    28.5   */
    28.6  #define HYPERVISOR_VIRT_START (0xFC000000UL)
    28.7 -#ifndef machine_to_phys_mapping
    28.8 -#define machine_to_phys_mapping ((u32 *)HYPERVISOR_VIRT_START)
    28.9 +#ifndef __vms_machine_to_phys_mapping
   28.10 +#define __vms_machine_to_phys_mapping ((u32 *)HYPERVISOR_VIRT_START)
   28.11  #endif
   28.12  
   28.13  #ifndef __ASSEMBLY__