ia64/xen-unstable

changeset 4685:71ac8f618782

bitkeeper revision 1.1385.2.1 (4270fd13Fv84etl6vfPTPXdxld-15A)

page.h:
Revert change to pgd_val to always set the PAGE_PRESENT bit.
fixup.c:
Cleanup whitespace.
setup.c:
Whitespace cleanup.
Whitespace cleanups.
process.c:
Whitespace.
pci-dma.c:
revert part of previous for sync w/ 2.0.
g/c unused code and cleanup whitespace.
head.S:
Break __xen_guest definition up in several lines.
common.c:
whitespace cleanup.
author cl349@firebug.cl.cam.ac.uk
date Thu Apr 28 15:11:15 2005 +0000 (2005-04-28)
parents 435ff7469fc1
children b2ca9de6952a
files linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/page.h
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Wed Apr 27 10:39:11 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/cpu/common.c	Thu Apr 28 15:11:15 2005 +0000
     1.3 @@ -600,7 +600,7 @@ void __init cpu_init (void)
     1.4  	 * Set up the per-thread TLS descriptor cache:
     1.5  	 */
     1.6  	memcpy(thread->tls_array, &get_cpu_gdt_table(cpu)[GDT_ENTRY_TLS_MIN],
     1.7 -		GDT_ENTRY_TLS_ENTRIES * 8);
     1.8 +	       GDT_ENTRY_TLS_ENTRIES * 8);
     1.9  
    1.10  	cpu_gdt_init(&cpu_gdt_descr[cpu]);
    1.11  
     2.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S	Wed Apr 27 10:39:11 2005 +0000
     2.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/head.S	Thu Apr 28 15:11:15 2005 +0000
     2.3 @@ -2,7 +2,9 @@
     2.4  #include <linux/config.h>
     2.5  
     2.6  .section __xen_guest
     2.7 -	.ascii	"GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=3.0,VIRT_BASE=0xC0000000"
     2.8 +	.ascii	"GUEST_OS=linux,GUEST_VER=2.6"
     2.9 +	.ascii	",XEN_VER=3.0"
    2.10 +	.ascii	",VIRT_BASE=0xC0000000"
    2.11  	.ascii	",LOADER=generic"
    2.12  	.byte	0
    2.13  
     3.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Wed Apr 27 10:39:11 2005 +0000
     3.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Thu Apr 28 15:11:15 2005 +0000
     3.3 @@ -44,13 +44,13 @@ xen_contig_memory(unsigned long vstart, 
     3.4  
     3.5  	/* 1. Zap current PTEs, giving away the underlying pages. */
     3.6  	for (i = 0; i < (1<<order); i++) {
     3.7 -		pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
     3.8 -		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
     3.9 -		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
    3.10 -		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
    3.11 -		pfn = pte->pte_low >> PAGE_SHIFT;
    3.12 -		HYPERVISOR_update_va_mapping(
    3.13 -			vstart + (i*PAGE_SIZE), __pte_ma(0), 0);
    3.14 +		pgd = pgd_offset_k(vstart + (i*PAGE_SIZE));
    3.15 +		pud = pud_offset(pgd, vstart + (i*PAGE_SIZE));
    3.16 +		pmd = pmd_offset(pud, vstart + (i*PAGE_SIZE));
    3.17 +		pte = pte_offset_kernel(pmd, vstart + (i*PAGE_SIZE));
    3.18 +		pfn = pte_val_ma(*pte) >> PAGE_SHIFT;
    3.19 +		HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE),
    3.20 +					     __pte_ma(0), 0);
    3.21  		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
    3.22  			INVALID_P2M_ENTRY;
    3.23  		if (HYPERVISOR_dom_mem_op(MEMOP_decrease_reservation, 
    3.24 @@ -61,17 +61,10 @@ xen_contig_memory(unsigned long vstart, 
    3.25  				  &pfn, 1, order) != 1) BUG();
    3.26  	/* 3. Map the new extent in place of old pages. */
    3.27  	for (i = 0; i < (1<<order); i++) {
    3.28 -		pgd = pgd_offset_k(   (vstart + (i*PAGE_SIZE)));
    3.29 -		pud = pud_offset(pgd, (vstart + (i*PAGE_SIZE)));
    3.30 -		pmd = pmd_offset(pud, (vstart + (i*PAGE_SIZE)));
    3.31 -		pte = pte_offset_kernel(pmd, (vstart + (i*PAGE_SIZE)));
    3.32 -		HYPERVISOR_update_va_mapping(
    3.33 -			vstart + (i*PAGE_SIZE),
    3.34 +		HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE),
    3.35  			__pte_ma(((pfn+i)<<PAGE_SHIFT)|__PAGE_KERNEL), 0);
    3.36 -		xen_machphys_update(
    3.37 -			pfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
    3.38 -		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] =
    3.39 -			pfn+i;
    3.40 +		xen_machphys_update(pfn+i, (__pa(vstart)>>PAGE_SHIFT)+i);
    3.41 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = pfn+i;
    3.42  	}
    3.43  	flush_tlb_all();
    3.44  
    3.45 @@ -82,11 +75,9 @@ void *dma_alloc_coherent(struct device *
    3.46  			   dma_addr_t *dma_handle, int gfp)
    3.47  {
    3.48  	void *ret;
    3.49 +	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
    3.50  	unsigned int order = get_order(size);
    3.51  	unsigned long vstart;
    3.52 -
    3.53 -	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
    3.54 -
    3.55  	/* ignore region specifiers */
    3.56  	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
    3.57  
    3.58 @@ -108,14 +99,13 @@ void *dma_alloc_coherent(struct device *
    3.59  
    3.60  	vstart = __get_free_pages(gfp, order);
    3.61  	ret = (void *)vstart;
    3.62 -	if (ret == NULL)
    3.63 -		return ret;
    3.64  
    3.65 -	xen_contig_memory(vstart, order);
    3.66 +	if (ret != NULL) {
    3.67 +		xen_contig_memory(vstart, order);
    3.68  
    3.69 -	memset(ret, 0, size);
    3.70 -	*dma_handle = virt_to_bus(ret);
    3.71 -
    3.72 +		memset(ret, 0, size);
    3.73 +		*dma_handle = virt_to_bus(ret);
    3.74 +	}
    3.75  	return ret;
    3.76  }
    3.77  
     4.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c	Wed Apr 27 10:39:11 2005 +0000
     4.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/process.c	Thu Apr 28 15:11:15 2005 +0000
     4.3 @@ -329,7 +329,7 @@ int copy_thread(int nr, unsigned long cl
     4.4  		desc->b = LDT_entry_b(&info);
     4.5  	}
     4.6  
     4.7 -        p->thread.io_pl = current->thread.io_pl;
     4.8 +	p->thread.io_pl = current->thread.io_pl;
     4.9  
    4.10  	err = 0;
    4.11   out:
    4.12 @@ -445,7 +445,7 @@ struct task_struct fastcall * __switch_t
    4.13  	physdev_op_t iopl_op, iobmp_op;
    4.14  	multicall_entry_t _mcl[8], *mcl = _mcl;
    4.15  
    4.16 -        /* XEN NOTE: FS/GS saved in switch_mm(), not here. */
    4.17 +	/* XEN NOTE: FS/GS saved in switch_mm(), not here. */
    4.18  
    4.19  	/*
    4.20  	 * This is basically '__unlazy_fpu', except that we queue a
     5.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c	Wed Apr 27 10:39:11 2005 +0000
     5.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c	Thu Apr 28 15:11:15 2005 +0000
     5.3 @@ -40,6 +40,7 @@
     5.4  #include <linux/efi.h>
     5.5  #include <linux/init.h>
     5.6  #include <linux/edd.h>
     5.7 +#include <linux/kernel.h>
     5.8  #include <linux/percpu.h>
     5.9  #include <linux/notifier.h>
    5.10  #include <video/edid.h>
    5.11 @@ -59,15 +60,11 @@
    5.12  /* Allows setting of maximum possible memory size  */
    5.13  static unsigned long xen_override_max_pfn;
    5.14  
    5.15 -extern struct notifier_block *panic_notifier_list;
    5.16  static int xen_panic_event(struct notifier_block *, unsigned long, void *);
    5.17  static struct notifier_block xen_panic_block = {
    5.18 -	xen_panic_event,
    5.19 -        NULL,
    5.20 -        0 /* try to go last */
    5.21 +	xen_panic_event, NULL, 0 /* try to go last */
    5.22  };
    5.23  
    5.24 -
    5.25  int disable_pse __initdata = 0;
    5.26  
    5.27  /*
    5.28 @@ -901,6 +898,7 @@ efi_find_max_pfn(unsigned long start, un
    5.29  	return 0;
    5.30  }
    5.31  
    5.32 +
    5.33  /*
    5.34   * Find the highest page frame number we have available
    5.35   */
    5.36 @@ -1397,22 +1395,21 @@ static void set_mca_bus(int x) { }
    5.37   */
    5.38  void __init setup_arch(char **cmdline_p)
    5.39  {
    5.40 -	int i,j;
    5.41 +	int i, j;
    5.42  	physdev_op_t op;
    5.43  	unsigned long max_low_pfn;
    5.44  
    5.45  	/* Force a quick death if the kernel panics. */
    5.46  	extern int panic_timeout;
    5.47 -	if ( panic_timeout == 0 )
    5.48 +	if (panic_timeout == 0)
    5.49  		panic_timeout = 1;
    5.50  
    5.51  	/* Register a call for panic conditions. */
    5.52  	notifier_chain_register(&panic_notifier_list, &xen_panic_block);
    5.53  
    5.54 -	HYPERVISOR_vm_assist(
    5.55 -		VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
    5.56 -	HYPERVISOR_vm_assist(
    5.57 -		VMASST_CMD_enable, VMASST_TYPE_writable_pagetables);
    5.58 +	HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments);
    5.59 +	HYPERVISOR_vm_assist(VMASST_CMD_enable,
    5.60 +			     VMASST_TYPE_writable_pagetables);
    5.61  
    5.62  	memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
    5.63  	early_cpu_init();
    5.64 @@ -1478,7 +1475,8 @@ void __init setup_arch(char **cmdline_p)
    5.65  	init_mm.start_code = (unsigned long) _text;
    5.66  	init_mm.end_code = (unsigned long) _etext;
    5.67  	init_mm.end_data = (unsigned long) _edata;
    5.68 -	init_mm.brk = (PFN_UP(__pa(xen_start_info.pt_base)) + xen_start_info.nr_pt_frames) << PAGE_SHIFT;
    5.69 +	init_mm.brk = (PFN_UP(__pa(xen_start_info.pt_base)) +
    5.70 +		       xen_start_info.nr_pt_frames) << PAGE_SHIFT;
    5.71  
    5.72  	/* XEN: This is nonsense: kernel may not even be contiguous in RAM. */
    5.73  	/*code_resource.start = virt_to_phys(_text);*/
    5.74 @@ -1511,7 +1509,7 @@ void __init setup_arch(char **cmdline_p)
    5.75  			max_pfn * sizeof(unsigned long));
    5.76  
    5.77  		if (max_pfn > xen_start_info.nr_pages) {
    5.78 -			/* set to INVALID_P2M_ENTRY */                        
    5.79 +			/* set to INVALID_P2M_ENTRY */
    5.80  			memset(phys_to_machine_mapping, ~0,
    5.81  				max_pfn * sizeof(unsigned long));
    5.82  			memcpy(phys_to_machine_mapping,
    5.83 @@ -1617,16 +1615,14 @@ void __init setup_arch(char **cmdline_p)
    5.84  	}
    5.85  }
    5.86  
    5.87 -
    5.88  static int
    5.89  xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
    5.90  {
    5.91 -     HYPERVISOR_crash();    
    5.92 -     /* we're never actually going to get here... */
    5.93 -     return NOTIFY_DONE;
    5.94 +	HYPERVISOR_crash();    
    5.95 +	/* we're never actually going to get here... */
    5.96 +	return NOTIFY_DONE;
    5.97  }
    5.98  
    5.99 -
   5.100  #include "setup_arch_post.h"
   5.101  /*
   5.102   * Local Variables:
     6.1 --- a/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c	Wed Apr 27 10:39:11 2005 +0000
     6.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/fixup.c	Thu Apr 28 15:11:15 2005 +0000
     6.3 @@ -50,8 +50,8 @@
     6.4  
     6.5      if ( !test_and_set_bit(0, &printed) )
     6.6      {
     6.7 -        HYPERVISOR_vm_assist(
     6.8 -            VMASST_CMD_disable, VMASST_TYPE_4gb_segments_notify);
     6.9 +        HYPERVISOR_vm_assist(VMASST_CMD_disable,
    6.10 +			     VMASST_TYPE_4gb_segments_notify);
    6.11  
    6.12          DP("");
    6.13          DP("***************************************************************");
    6.14 @@ -77,8 +77,7 @@
    6.15  
    6.16  static int __init fixup_init(void)
    6.17  {
    6.18 -    HYPERVISOR_vm_assist(
    6.19 -        VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
    6.20 +    HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments_notify);
    6.21      return 0;
    6.22  }
    6.23  __initcall(fixup_init);
     7.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/page.h	Wed Apr 27 10:39:11 2005 +0000
     7.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-i386/page.h	Thu Apr 28 15:11:15 2005 +0000
     7.3 @@ -111,7 +111,7 @@ typedef struct { unsigned long pgprot; }
     7.4  static inline unsigned long pgd_val(pgd_t x)
     7.5  {
     7.6  	unsigned long ret = x.pgd;
     7.7 -	if (ret) ret = machine_to_phys(ret) | 1;
     7.8 +	if (ret) ret = machine_to_phys(ret);
     7.9  	return ret;
    7.10  }
    7.11  #define pgprot_val(x)	((x).pgprot)