ia64/xen-unstable

changeset 2584:b661254cb10b

bitkeeper revision 1.1159.96.5 (415d7a82eOLSgwgveZXrpP4GG7wGnw)

Merge ssh://xenbk@gandalf.hpl.hp.com//var/bk/xeno-unstable.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Fri Oct 01 15:40:50 2004 +0000 (2004-10-01)
parents 05ae99de2d3f 1293cc819fed
children 98bdf2c88015
files linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6.8.1-xen-sparse/drivers/xen/blkfront/blkfront.c xen/arch/x86/traps.c
line diff
     1.1 --- a/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c	Thu Sep 30 15:38:37 2004 +0000
     1.2 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c	Fri Oct 01 15:40:50 2004 +0000
     1.3 @@ -126,14 +126,14 @@ u64 processed_system_time;   /* System t
     1.4  		(_tv).tv_sec++;			\
     1.5  	}					\
     1.6  } while (0)
     1.7 -static inline void __normalize_time(time_t *sec, s64 *usec)
     1.8 +static inline void __normalize_time(time_t *sec, s64 *nsec)
     1.9  {
    1.10 -	while (*usec >= NSEC_PER_SEC) {
    1.11 -		(*usec) -= NSEC_PER_SEC;
    1.12 +	while (*nsec >= NSEC_PER_SEC) {
    1.13 +		(*nsec) -= NSEC_PER_SEC;
    1.14  		(*sec)++;
    1.15  	}
    1.16 -	while (*usec < NSEC_PER_SEC) {
    1.17 -		(*usec) += NSEC_PER_SEC;
    1.18 +	while (*nsec < 0) {
    1.19 +		(*nsec) += NSEC_PER_SEC;
    1.20  		(*sec)--;
    1.21  	}
    1.22  }
     2.1 --- a/linux-2.6.8.1-xen-sparse/drivers/xen/blkfront/blkfront.c	Thu Sep 30 15:38:37 2004 +0000
     2.2 +++ b/linux-2.6.8.1-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Oct 01 15:40:50 2004 +0000
     2.3 @@ -554,6 +554,8 @@ int blkif_ioctl(struct inode *inode, str
     2.4      struct gendisk *gd;     
     2.5      struct hd_struct *part; 
     2.6      int i;
     2.7 +    unsigned short cylinders;
     2.8 +    byte heads, sectors;
     2.9  
    2.10      /* NB. No need to check permissions. That is done for us. */
    2.11      
    2.12 @@ -598,23 +600,39 @@ int blkif_ioctl(struct inode *inode, str
    2.13          break;
    2.14  
    2.15      case HDIO_GETGEO:
    2.16 -        /* note: these values are complete garbage */
    2.17          DPRINTK_IOCTL("   HDIO_GETGEO: %x\n", HDIO_GETGEO);
    2.18          if (!argument) return -EINVAL;
    2.19 +
    2.20 +        /* We don't have real geometry info, but let's at least return
    2.21 +	   values consistent with the size of the device */
    2.22 +
    2.23 +        heads = 0xff;
    2.24 +        sectors = 0x3f; 
    2.25 +        cylinders = part->nr_sects / (heads * sectors);
    2.26 +
    2.27          if (put_user(0x00,  (unsigned long *) &geo->start)) return -EFAULT;
    2.28 -        if (put_user(0xff,  (byte *)&geo->heads)) return -EFAULT;
    2.29 -        if (put_user(0x3f,  (byte *)&geo->sectors)) return -EFAULT;
    2.30 -        if (put_user(0x106, (unsigned short *)&geo->cylinders)) return -EFAULT;
    2.31 +        if (put_user(heads,  (byte *)&geo->heads)) return -EFAULT;
    2.32 +        if (put_user(sectors,  (byte *)&geo->sectors)) return -EFAULT;
    2.33 +        if (put_user(cylinders, (unsigned short *)&geo->cylinders)) return -EFAULT;
    2.34 +
    2.35          return 0;
    2.36  
    2.37      case HDIO_GETGEO_BIG: 
    2.38 -        /* note: these values are complete garbage */
    2.39          DPRINTK_IOCTL("   HDIO_GETGEO_BIG: %x\n", HDIO_GETGEO_BIG);
    2.40          if (!argument) return -EINVAL;
    2.41 +
    2.42 +        /* We don't have real geometry info, but let's at least return
    2.43 +	   values consistent with the size of the device */
    2.44 +
    2.45 +        heads = 0xff;
    2.46 +        sectors = 0x3f; 
    2.47 +        cylinders = part->nr_sects / (heads * sectors);
    2.48 +
    2.49          if (put_user(0x00,  (unsigned long *) &geo->start))  return -EFAULT;
    2.50 -        if (put_user(0xff,  (byte *)&geo->heads))   return -EFAULT;
    2.51 -        if (put_user(0x3f,  (byte *)&geo->sectors)) return -EFAULT;
    2.52 -        if (put_user(0x106, (unsigned int *) &geo->cylinders)) return -EFAULT;
    2.53 +        if (put_user(heads,  (byte *)&geo->heads))   return -EFAULT;
    2.54 +        if (put_user(sectors,  (byte *)&geo->sectors)) return -EFAULT;
    2.55 +        if (put_user(cylinders, (unsigned int *) &geo->cylinders)) return -EFAULT;
    2.56 +
    2.57          return 0;
    2.58  
    2.59      case CDROMMULTISESSION:
     3.1 --- a/xen/arch/x86/traps.c	Thu Sep 30 15:38:37 2004 +0000
     3.2 +++ b/xen/arch/x86/traps.c	Fri Oct 01 15:40:50 2004 +0000
     3.3 @@ -344,18 +344,6 @@ asmlinkage void do_page_fault(struct pt_
     3.4  
     3.5      ASSERT_no_criticalregion();
     3.6  
     3.7 -    if ( unlikely(addr >= LDT_VIRT_START) && 
     3.8 -         (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) )
     3.9 -    {
    3.10 -        /*
    3.11 -         * Copy a mapping from the guest's LDT, if it is valid. Otherwise we
    3.12 -         * send the fault up to the guest OS to be handled.
    3.13 -         */
    3.14 -        off  = addr - LDT_VIRT_START;
    3.15 -        addr = d->mm.ldt_base + off;
    3.16 -        if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) )
    3.17 -            return; /* successfully copied the mapping */
    3.18 -    }
    3.19  
    3.20      if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
    3.21      {
    3.22 @@ -377,6 +365,19 @@ asmlinkage void do_page_fault(struct pt_
    3.23           (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
    3.24          return; /* Returns TRUE if fault was handled. */
    3.25  
    3.26 +    if ( unlikely(addr >= LDT_VIRT_START) && 
    3.27 +         (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) )
    3.28 +    {
    3.29 +        /*
    3.30 +         * Copy a mapping from the guest's LDT, if it is valid. Otherwise we
    3.31 +         * send the fault up to the guest OS to be handled.
    3.32 +         */
    3.33 +        off  = addr - LDT_VIRT_START;
    3.34 +        addr = d->mm.ldt_base + off;
    3.35 +        if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) )
    3.36 +            return; /* successfully copied the mapping */
    3.37 +    }
    3.38 +
    3.39      if ( unlikely(!(regs->xcs & 3)) )
    3.40          goto xen_fault;
    3.41