ia64/xen-unstable

changeset 3130:643ec6da4416

bitkeeper revision 1.1159.187.10 (41a5ee7fINP79uJ4FyQF72a79xTHLQ)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Thu Nov 25 14:38:55 2004 +0000 (2004-11-25)
parents 24c20fcb48b8 7827d8db3729
children f52ac722d9c7
files linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h linux-2.6.9-xen-sparse/drivers/xen/blkfront/vbd.c tools/python/xen/xend/XendDomainInfo.py xen/arch/x86/extable.c xen/arch/x86/setup.c xen/include/asm-x86/x86_32/uaccess.h
line diff
     1.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S	Thu Nov 25 14:38:33 2004 +0000
     1.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S	Thu Nov 25 14:38:55 2004 +0000
     1.3 @@ -102,10 +102,9 @@ VM_MASK		= 0x00020000
     1.4  	pushl %edx; \
     1.5  	pushl %ecx; \
     1.6  	pushl %ebx; \
     1.7 -	movl $(__KERNEL_DS), %edx; \
     1.8 +	movl $(__USER_DS), %edx; \
     1.9  	movl %edx, %ds; \
    1.10  	movl %edx, %es;
    1.11 -	# XXXcl USER?
    1.12  
    1.13  #define RESTORE_INT_REGS \
    1.14  	popl %ebx;	\
     2.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h	Thu Nov 25 14:38:33 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/block.h	Thu Nov 25 14:38:55 2004 +0000
     2.3 @@ -64,6 +64,7 @@
     2.4  
     2.5  struct xlbd_type_info {
     2.6  	int partn_shift;
     2.7 +	int partn_per_major;
     2.8  	int devs_per_major;
     2.9  	int hardsect_size;
    2.10  	int max_sectors;
    2.11 @@ -77,8 +78,8 @@ struct xlbd_type_info {
    2.12   */
    2.13  struct xlbd_major_info {
    2.14  	int major;
    2.15 +	int index;
    2.16  	int usage;
    2.17 -	int xd_device;
    2.18  	struct xlbd_type_info *type;
    2.19  };
    2.20  
     3.1 --- a/linux-2.6.9-xen-sparse/drivers/xen/blkfront/vbd.c	Thu Nov 25 14:38:33 2004 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/drivers/xen/blkfront/vbd.c	Thu Nov 25 14:38:55 2004 +0000
     3.3 @@ -44,6 +44,7 @@
     3.4  
     3.5  static struct xlbd_type_info xlbd_ide_type = {
     3.6  	.partn_shift = 6,
     3.7 +	.partn_per_major = 2,
     3.8  	// XXXcl todo blksize_size[major]  = 1024;
     3.9  	.hardsect_size = 512,
    3.10  	.max_sectors = 128,  /* 'hwif->rqsize' if we knew it */
    3.11 @@ -53,6 +54,7 @@ static struct xlbd_type_info xlbd_ide_ty
    3.12  
    3.13  static struct xlbd_type_info xlbd_scsi_type = {
    3.14  	.partn_shift = 4,
    3.15 +	.partn_per_major = 16,
    3.16  	// XXXcl todo blksize_size[major]  = 1024; /* XXX 512; */
    3.17  	.hardsect_size = 512,
    3.18  	.max_sectors = 128*8, /* XXX 128; */
    3.19 @@ -62,6 +64,7 @@ static struct xlbd_type_info xlbd_scsi_t
    3.20  
    3.21  static struct xlbd_type_info xlbd_vbd_type = {
    3.22  	.partn_shift = 4,
    3.23 +	.partn_per_major = 16,
    3.24  	// XXXcl todo blksize_size[major]  = 512;
    3.25  	.hardsect_size = 512,
    3.26  	.max_sectors = 128,
    3.27 @@ -167,13 +170,17 @@ static struct xlbd_major_info *xlbd_get_
    3.28  	switch (mi_idx) {
    3.29  	case 0 ... (NUM_IDE_MAJORS - 1):
    3.30  		major_info[mi_idx]->type = &xlbd_ide_type;
    3.31 +		major_info[mi_idx]->index = mi_idx;
    3.32  		break;
    3.33  	case NUM_IDE_MAJORS ... (NUM_IDE_MAJORS + NUM_SCSI_MAJORS - 1):
    3.34  		major_info[mi_idx]->type = &xlbd_scsi_type;
    3.35 +		major_info[mi_idx]->index = mi_idx - NUM_IDE_MAJORS;
    3.36  		break;
    3.37  	case (NUM_IDE_MAJORS + NUM_SCSI_MAJORS) ...
    3.38  		(NUM_IDE_MAJORS + NUM_SCSI_MAJORS + NUM_VBD_MAJORS - 1):
    3.39  		major_info[mi_idx]->type = &xlbd_vbd_type;
    3.40 +		major_info[mi_idx]->index = mi_idx -
    3.41 +			(NUM_IDE_MAJORS + NUM_SCSI_MAJORS);
    3.42  		break;
    3.43  	}
    3.44  	major_info[mi_idx]->major = new_major;
    3.45 @@ -222,7 +229,8 @@ static struct gendisk *xlvbd_get_gendisk
    3.46  	gd->fops = &xlvbd_block_fops;
    3.47  	gd->private_data = di;
    3.48  	sprintf(gd->disk_name, "%s%c%d", mi->type->name,
    3.49 -	    'a' + (xd_minor >> mi->type->partn_shift),
    3.50 +	    'a' + mi->index * mi->type->partn_per_major +
    3.51 +		(xd_minor >> mi->type->partn_shift),
    3.52  	    xd_minor & ((1 << mi->type->partn_shift) - 1));
    3.53  	/*  sprintf(gd->devfs_name, "%s%s/disc%d", mi->type->name, , ); XXXdevfs */
    3.54  
     4.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 25 14:38:33 2004 +0000
     4.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 25 14:38:55 2004 +0000
     4.3 @@ -994,13 +994,13 @@ class XendDomainInfo:
     4.4  
     4.5          @return: deferred
     4.6          """
     4.7 -        if (self.get_devices("vbd") == None):
     4.8 +        if self.get_devices("vbd") == []:
     4.9              ctrl = xend.blkif_create(self.dom, recreate=self.recreate)
    4.10              back = ctrl.getBackendInterface(0)
    4.11              return back.connect(recreate=self.recreate)
    4.12          else:
    4.13              return None
    4.14 -    
    4.15 +
    4.16      def dom_construct(self, dom, config):
    4.17          """Construct a vm for an existing domain.
    4.18  
     5.1 --- a/xen/arch/x86/extable.c	Thu Nov 25 14:38:33 2004 +0000
     5.2 +++ b/xen/arch/x86/extable.c	Thu Nov 25 14:38:55 2004 +0000
     5.3 @@ -3,6 +3,36 @@
     5.4  #include <xen/spinlock.h>
     5.5  #include <asm/uaccess.h>
     5.6  
     5.7 +extern struct exception_table_entry __start___ex_table[];
     5.8 +extern struct exception_table_entry __stop___ex_table[];
     5.9 +extern struct exception_table_entry __start___pre_ex_table[];
    5.10 +extern struct exception_table_entry __stop___pre_ex_table[];
    5.11 +
    5.12 +static void sort_exception_table(struct exception_table_entry *start,
    5.13 +                                 struct exception_table_entry *end)
    5.14 +{
    5.15 +    struct exception_table_entry *p, *q, tmp;
    5.16 +
    5.17 +    for ( p = start; p < end; p++ )
    5.18 +    {
    5.19 +        for ( q = p-1; q > start; q-- )
    5.20 +            if ( p->insn > q->insn )
    5.21 +                break;
    5.22 +        if ( ++q != p )
    5.23 +        {
    5.24 +            tmp = *p;
    5.25 +            memmove(q+1, q, (p-q)*sizeof(*p));
    5.26 +            *q = tmp;
    5.27 +        }
    5.28 +    }
    5.29 +}
    5.30 +
    5.31 +void sort_exception_tables(void)
    5.32 +{
    5.33 +    sort_exception_table(__start___ex_table, __stop___ex_table);
    5.34 +    sort_exception_table(__start___pre_ex_table, __stop___pre_ex_table);
    5.35 +}
    5.36 +
    5.37  static inline unsigned long
    5.38  search_one_table(const struct exception_table_entry *first,
    5.39  		 const struct exception_table_entry *last,
    5.40 @@ -28,21 +58,15 @@ search_one_table(const struct exception_
    5.41  unsigned long
    5.42  search_exception_table(unsigned long addr)
    5.43  {
    5.44 -    extern const struct exception_table_entry __start___ex_table[];
    5.45 -    extern const struct exception_table_entry __stop___ex_table[];
    5.46      return search_one_table(
    5.47          __start___ex_table, __stop___ex_table-1, addr);
    5.48  }
    5.49  
    5.50 -#ifdef __i386__
    5.51  unsigned long
    5.52  search_pre_exception_table(unsigned long addr)
    5.53  {
    5.54 -    extern const struct exception_table_entry __start___pre_ex_table[];
    5.55 -    extern const struct exception_table_entry __stop___pre_ex_table[];
    5.56      unsigned long fixup = search_one_table(
    5.57          __start___pre_ex_table, __stop___pre_ex_table-1, addr);
    5.58      DPRINTK("Pre-exception: %08lx -> %08lx\n", addr, fixup);
    5.59      return fixup;
    5.60  }
    5.61 -#endif
     6.1 --- a/xen/arch/x86/setup.c	Thu Nov 25 14:38:33 2004 +0000
     6.2 +++ b/xen/arch/x86/setup.c	Thu Nov 25 14:38:55 2004 +0000
     6.3 @@ -326,6 +326,8 @@ void __init start_of_day(void)
     6.4      if ( opt_watchdog ) 
     6.5          nmi_watchdog = NMI_LOCAL_APIC;
     6.6  
     6.7 +    sort_exception_tables();
     6.8 +
     6.9      /* Tell the PCI layer not to allocate too close to the RAM area.. */
    6.10      low_mem_size = ((max_page << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
    6.11      if ( low_mem_size > pci_mem_start ) pci_mem_start = low_mem_size;
     7.1 --- a/xen/include/asm-x86/x86_32/uaccess.h	Thu Nov 25 14:38:33 2004 +0000
     7.2 +++ b/xen/include/asm-x86/x86_32/uaccess.h	Thu Nov 25 14:38:55 2004 +0000
     7.3 @@ -85,6 +85,7 @@ struct exception_table_entry
     7.4  };
     7.5  
     7.6  extern unsigned long search_exception_table(unsigned long);
     7.7 +extern void sort_exception_tables(void);
     7.8  
     7.9  /**
    7.10   * get_user: - Get a simple variable from user space.