ia64/xen-unstable

changeset 630:4fd1861ec41a

bitkeeper revision 1.350 (3f1340b73QOZFM-2eX4c17P16Nhgdw)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Mon Jul 14 23:45:59 2003 +0000 (2003-07-14)
parents a74ec9013abb 035d887bdfc7
children 63da63184f59
files xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c xenolinux-2.4.21-sparse/fs/partitions/xeno.c xenolinux-2.4.21-sparse/mm/memory.c
line diff
     1.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c	Mon Jul 14 21:54:29 2003 +0000
     1.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/kernel/i386_ksyms.c	Mon Jul 14 23:45:59 2003 +0000
     1.3 @@ -53,7 +53,6 @@ EXPORT_SYMBOL(drive_info);
     1.4  
     1.5  /* platform dependent support */
     1.6  EXPORT_SYMBOL(boot_cpu_data);
     1.7 -EXPORT_SYMBOL(__verify_write);
     1.8  EXPORT_SYMBOL(dump_thread);
     1.9  EXPORT_SYMBOL(dump_fpu);
    1.10  EXPORT_SYMBOL(dump_extended_fpu);
     2.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c	Mon Jul 14 21:54:29 2003 +0000
     2.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/mm/fault.c	Mon Jul 14 23:45:59 2003 +0000
     2.3 @@ -29,71 +29,6 @@ extern void die(const char *,struct pt_r
     2.4  
     2.5  pgd_t *cur_pgd;
     2.6  
     2.7 -/*
     2.8 - * Ugly, ugly, but the goto's result in better assembly..
     2.9 - */
    2.10 -int __verify_write(const void * addr, unsigned long size)
    2.11 -{
    2.12 -	struct vm_area_struct * vma;
    2.13 -	unsigned long start = (unsigned long) addr;
    2.14 -
    2.15 -	if (!size)
    2.16 -		return 1;
    2.17 -
    2.18 -	vma = find_vma(current->mm, start);
    2.19 -	if (!vma)
    2.20 -		goto bad_area;
    2.21 -	if (vma->vm_start > start)
    2.22 -		goto check_stack;
    2.23 -
    2.24 -good_area:
    2.25 -	if (!(vma->vm_flags & VM_WRITE))
    2.26 -		goto bad_area;
    2.27 -	size--;
    2.28 -	size += start & ~PAGE_MASK;
    2.29 -	size >>= PAGE_SHIFT;
    2.30 -	start &= PAGE_MASK;
    2.31 -
    2.32 -	for (;;) {
    2.33 -	survive:
    2.34 -		{
    2.35 -			int fault = handle_mm_fault(current->mm, vma, start, 1);
    2.36 -			if (!fault)
    2.37 -				goto bad_area;
    2.38 -			if (fault < 0)
    2.39 -				goto out_of_memory;
    2.40 -		}
    2.41 -		if (!size)
    2.42 -			break;
    2.43 -		size--;
    2.44 -		start += PAGE_SIZE;
    2.45 -		if (start < vma->vm_end)
    2.46 -			continue;
    2.47 -		vma = vma->vm_next;
    2.48 -		if (!vma || vma->vm_start != start)
    2.49 -			goto bad_area;
    2.50 -		if (!(vma->vm_flags & VM_WRITE))
    2.51 -			goto bad_area;;
    2.52 -	}
    2.53 -	return 1;
    2.54 -
    2.55 -check_stack:
    2.56 -	if (!(vma->vm_flags & VM_GROWSDOWN))
    2.57 -		goto bad_area;
    2.58 -	if (expand_stack(vma, start) == 0)
    2.59 -		goto good_area;
    2.60 -
    2.61 -bad_area:
    2.62 -	return 0;
    2.63 -
    2.64 -out_of_memory:
    2.65 -	if (current->pid == 1) {
    2.66 -		yield();
    2.67 -		goto survive;
    2.68 -	}
    2.69 -	goto bad_area;
    2.70 -}
    2.71 -
    2.72  extern spinlock_t timerlist_lock;
    2.73  
    2.74  /*
     3.1 --- a/xenolinux-2.4.21-sparse/fs/partitions/xeno.c	Mon Jul 14 21:54:29 2003 +0000
     3.2 +++ b/xenolinux-2.4.21-sparse/fs/partitions/xeno.c	Mon Jul 14 23:45:59 2003 +0000
     3.3 @@ -3,6 +3,7 @@
     3.4  #include <linux/kernel.h>
     3.5  #include <asm/hypervisor.h>
     3.6  #include <linux/fs.h>
     3.7 +#include <linux/blk.h>
     3.8  #include <linux/slab.h>
     3.9  #include <linux/genhd.h>
    3.10  #include <asm/hypervisor-ifs/block.h>
    3.11 @@ -21,57 +22,57 @@ int xeno_partition(struct gendisk *hd,
    3.12  		   int first_part_minor)
    3.13  {
    3.14      physdisk_probebuf_t *buf;
    3.15 -    int i;
    3.16 -    int minor;
    3.17 -    int count;
    3.18 +    int i, minor;
    3.19      
    3.20 -    buf = kmalloc(sizeof(*buf), GFP_KERNEL);
    3.21 -    if (!buf)
    3.22 +    /* Privileged domains can read partition info themselves. */
    3.23 +    if (start_info.flags & SIF_PRIVILEGED)
    3.24 +        return 0;
    3.25 +
    3.26 +    /* This only deals with raw/direct devices (IDE & SCSI). */
    3.27 +    switch ( xldev_to_physdev(bdev->bd_dev) & XENDEV_TYPE_MASK )
    3.28 +    {
    3.29 +    case XENDEV_IDE:
    3.30 +    case XENDEV_SCSI:
    3.31 +        break;
    3.32 +    default:
    3.33 +        return 0;
    3.34 +    }
    3.35 +
    3.36 +    if ( (buf = kmalloc(sizeof(*buf), GFP_KERNEL)) == NULL )
    3.37          return -ENOMEM;
    3.38 +
    3.39      buf->domain = start_info.dom_id;
    3.40      buf->start_ind = 0;
    3.41      buf->n_aces = PHYSDISK_MAX_ACES_PER_REQUEST;
    3.42  
    3.43      xenolinux_control_msg(XEN_BLOCK_PHYSDEV_PROBE, (char *)buf,
    3.44  			  sizeof(*buf));
    3.45 -    if (buf->n_aces == 0) {
    3.46 -        kfree(buf);
    3.47 -	return 0;
    3.48 -    }
    3.49  
    3.50 -    if (buf->n_aces == PHYSDISK_MAX_ACES_PER_REQUEST) {
    3.51 -        kfree(buf);
    3.52 -	return 0;
    3.53 -    }
    3.54 -
    3.55 -    count = 0;
    3.56 +    if ( buf->n_aces == PHYSDISK_MAX_ACES_PER_REQUEST )
    3.57 +        printk(KERN_ALERT "Too many returns for xeno partition parser\n");
    3.58  
    3.59 -    for (i = 0; i < buf->n_aces; i++) {
    3.60 -        if (buf->entries[i].partition == 0) {
    3.61 +    for ( i = 0; i < buf->n_aces; i++ )
    3.62 +    {
    3.63 +        if (buf->entries[i].partition == 0)
    3.64 +	    continue;
    3.65 +	if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev))
    3.66  	    continue;
    3.67 -	}
    3.68 -	/* Make sure the partition is actually supposed to be on this
    3.69 -	   disk. */
    3.70 -	if (buf->entries[i].device != xldev_to_physdev(bdev->bd_dev)) {
    3.71 -	    continue;
    3.72 -	}
    3.73 -	/* This is a bit of a hack - the partition numbers are
    3.74 -	   specified by the hypervisor, and if we want them to match
    3.75 -	   up, this is what we need to do. */
    3.76 -	count ++;
    3.77 +        if (!(buf->entries[i].mode & PHYSDISK_MODE_W))
    3.78 +        {
    3.79 +            if (!(buf->entries[i].mode & PHYSDISK_MODE_R))
    3.80 +                continue;
    3.81 +            set_device_ro(bdev->bd_dev, 1);
    3.82 +        }
    3.83  	minor = buf->entries[i].partition + first_part_minor - 1;
    3.84  	add_gd_partition(hd,
    3.85  			 minor,
    3.86  			 buf->entries[i].start_sect,
    3.87  			 buf->entries[i].n_sectors);
    3.88      }  
    3.89 +
    3.90      kfree(buf);
    3.91  
    3.92 -    /* If we didn't find any suitable Xeno partitions, try the other
    3.93 -       types. */
    3.94 -    if (!count)
    3.95 -        return 0;
    3.96 +    printk("\n");
    3.97  
    3.98 -    printk("\n");
    3.99      return 1;
   3.100  }
     4.1 --- a/xenolinux-2.4.21-sparse/mm/memory.c	Mon Jul 14 21:54:29 2003 +0000
     4.2 +++ b/xenolinux-2.4.21-sparse/mm/memory.c	Mon Jul 14 23:45:59 2003 +0000
     4.3 @@ -1381,15 +1381,6 @@ int handle_mm_fault(struct mm_struct *mm
     4.4  	pgd_t *pgd;
     4.5  	pmd_t *pmd;
     4.6  
     4.7 -#if defined(CONFIG_XENO_PRIV)
     4.8 -	/* Take care of I/O mappings right here. */
     4.9 -	if (vma->vm_flags & VM_IO) {
    4.10 -		if (write_access && !(vma->vm_flags & VM_WRITE))
    4.11 -			return -1;
    4.12 -		return 1;
    4.13 -	}
    4.14 -#endif
    4.15 -
    4.16  	current->state = TASK_RUNNING;
    4.17  	pgd = pgd_offset(mm, address);
    4.18