# HG changeset patch # User iap10@labyrinth.cl.cam.ac.uk # Date 1096645250 0 # Node ID b661254cb10b0c8a8c76c30a1309a430dda7b2dc # Parent 05ae99de2d3f72bb83dabeed602dd8e164d17b6c# Parent 1293cc819fed210df2780b2057424c5b18a2b1ba 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 diff -r 05ae99de2d3f -r b661254cb10b linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c --- a/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c Thu Sep 30 15:38:37 2004 +0000 +++ b/linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c Fri Oct 01 15:40:50 2004 +0000 @@ -126,14 +126,14 @@ u64 processed_system_time; /* System t (_tv).tv_sec++; \ } \ } while (0) -static inline void __normalize_time(time_t *sec, s64 *usec) +static inline void __normalize_time(time_t *sec, s64 *nsec) { - while (*usec >= NSEC_PER_SEC) { - (*usec) -= NSEC_PER_SEC; + while (*nsec >= NSEC_PER_SEC) { + (*nsec) -= NSEC_PER_SEC; (*sec)++; } - while (*usec < NSEC_PER_SEC) { - (*usec) += NSEC_PER_SEC; + while (*nsec < 0) { + (*nsec) += NSEC_PER_SEC; (*sec)--; } } diff -r 05ae99de2d3f -r b661254cb10b linux-2.6.8.1-xen-sparse/drivers/xen/blkfront/blkfront.c --- a/linux-2.6.8.1-xen-sparse/drivers/xen/blkfront/blkfront.c Thu Sep 30 15:38:37 2004 +0000 +++ b/linux-2.6.8.1-xen-sparse/drivers/xen/blkfront/blkfront.c Fri Oct 01 15:40:50 2004 +0000 @@ -554,6 +554,8 @@ int blkif_ioctl(struct inode *inode, str struct gendisk *gd; struct hd_struct *part; int i; + unsigned short cylinders; + byte heads, sectors; /* NB. No need to check permissions. That is done for us. */ @@ -598,23 +600,39 @@ int blkif_ioctl(struct inode *inode, str break; case HDIO_GETGEO: - /* note: these values are complete garbage */ DPRINTK_IOCTL(" HDIO_GETGEO: %x\n", HDIO_GETGEO); if (!argument) return -EINVAL; + + /* We don't have real geometry info, but let's at least return + values consistent with the size of the device */ + + heads = 0xff; + sectors = 0x3f; + cylinders = part->nr_sects / (heads * sectors); + if (put_user(0x00, (unsigned long *) &geo->start)) return -EFAULT; - if (put_user(0xff, (byte *)&geo->heads)) return -EFAULT; - if (put_user(0x3f, (byte *)&geo->sectors)) return -EFAULT; - if (put_user(0x106, (unsigned short *)&geo->cylinders)) return -EFAULT; + if (put_user(heads, (byte *)&geo->heads)) return -EFAULT; + if (put_user(sectors, (byte *)&geo->sectors)) return -EFAULT; + if (put_user(cylinders, (unsigned short *)&geo->cylinders)) return -EFAULT; + return 0; case HDIO_GETGEO_BIG: - /* note: these values are complete garbage */ DPRINTK_IOCTL(" HDIO_GETGEO_BIG: %x\n", HDIO_GETGEO_BIG); if (!argument) return -EINVAL; + + /* We don't have real geometry info, but let's at least return + values consistent with the size of the device */ + + heads = 0xff; + sectors = 0x3f; + cylinders = part->nr_sects / (heads * sectors); + if (put_user(0x00, (unsigned long *) &geo->start)) return -EFAULT; - if (put_user(0xff, (byte *)&geo->heads)) return -EFAULT; - if (put_user(0x3f, (byte *)&geo->sectors)) return -EFAULT; - if (put_user(0x106, (unsigned int *) &geo->cylinders)) return -EFAULT; + if (put_user(heads, (byte *)&geo->heads)) return -EFAULT; + if (put_user(sectors, (byte *)&geo->sectors)) return -EFAULT; + if (put_user(cylinders, (unsigned int *) &geo->cylinders)) return -EFAULT; + return 0; case CDROMMULTISESSION: diff -r 05ae99de2d3f -r b661254cb10b xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c Thu Sep 30 15:38:37 2004 +0000 +++ b/xen/arch/x86/traps.c Fri Oct 01 15:40:50 2004 +0000 @@ -344,18 +344,6 @@ asmlinkage void do_page_fault(struct pt_ ASSERT_no_criticalregion(); - if ( unlikely(addr >= LDT_VIRT_START) && - (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) ) - { - /* - * Copy a mapping from the guest's LDT, if it is valid. Otherwise we - * send the fault up to the guest OS to be handled. - */ - off = addr - LDT_VIRT_START; - addr = d->mm.ldt_base + off; - if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) ) - return; /* successfully copied the mapping */ - } if ( likely(VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) ) { @@ -377,6 +365,19 @@ asmlinkage void do_page_fault(struct pt_ (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) ) return; /* Returns TRUE if fault was handled. */ + if ( unlikely(addr >= LDT_VIRT_START) && + (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) ) + { + /* + * Copy a mapping from the guest's LDT, if it is valid. Otherwise we + * send the fault up to the guest OS to be handled. + */ + off = addr - LDT_VIRT_START; + addr = d->mm.ldt_base + off; + if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) ) + return; /* successfully copied the mapping */ + } + if ( unlikely(!(regs->xcs & 3)) ) goto xen_fault;