ia64/xen-unstable

changeset 903:099ae186d2cd

bitkeeper revision 1.571 (3fabc0ccIidm1y01SeueL9ZtLe3myA)

setup.c, xl_vbd.c, memory.c, process.c:
Various fixes. One to SCSI code in xenolinux, others to suspend/resume (which is still a bit broken).
author kaf24@scramble.cl.cam.ac.uk
date Fri Nov 07 15:57:00 2003 +0000 (2003-11-07)
parents 7bf6fbf9efac
children 90ae2bc0ebee
files xen/arch/i386/process.c xen/common/memory.c xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_vbd.c xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c
line diff
     1.1 --- a/xen/arch/i386/process.c	Fri Nov 07 11:34:27 2003 +0000
     1.2 +++ b/xen/arch/i386/process.c	Fri Nov 07 15:57:00 2003 +0000
     1.3 @@ -249,6 +249,8 @@ void switch_to(struct task_struct *prev_
     1.4       */
     1.5      if ( (stack_ec->cs & 3) == 0 )
     1.6          stack_ec->cs = FLAT_RING1_CS;
     1.7 +    if ( (stack_ec->ss & 3) == 0 )
     1.8 +        stack_ec->ss = FLAT_RING1_DS;
     1.9  
    1.10      unlazy_fpu(prev_p);
    1.11  
     2.1 --- a/xen/common/memory.c	Fri Nov 07 11:34:27 2003 +0000
     2.2 +++ b/xen/common/memory.c	Fri Nov 07 15:57:00 2003 +0000
     2.3 @@ -138,7 +138,7 @@
     2.4  #include <asm/uaccess.h>
     2.5  #include <asm/domain_page.h>
     2.6  
     2.7 -#if 0
     2.8 +#if 1
     2.9  #define MEM_LOG(_f, _a...) printk("DOM%d: (file=memory.c, line=%d) " _f "\n", current->domain, __LINE__, ## _a )
    2.10  #else
    2.11  #define MEM_LOG(_f, _a...) ((void)0)
    2.12 @@ -274,7 +274,6 @@ int map_ldt_shadow_page(unsigned int off
    2.13          for ( i = 0; i < 512; i++ )
    2.14              if ( unlikely(!check_descriptor(ldt_page[i*2], ldt_page[i*2+1])) )
    2.15                  goto out;
    2.16 -
    2.17          if ( unlikely(page->flags & PG_need_flush) )
    2.18          {
    2.19              perfc_incrc(need_flush_tlb_flush);
    2.20 @@ -479,7 +478,6 @@ static int get_l1_table(unsigned long pa
    2.21          if ( unlikely(ret) ) goto fail;
    2.22      }
    2.23  
    2.24 - out:
    2.25      /* Make sure we unmap the right page! */
    2.26      unmap_domain_mem(p_l1_entry-1);
    2.27      return ret;
     3.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_vbd.c	Fri Nov 07 11:34:27 2003 +0000
     3.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/drivers/block/xl_vbd.c	Fri Nov 07 15:57:00 2003 +0000
     3.3 @@ -33,7 +33,7 @@ struct gendisk *xlvbd_gendisk[XLVBD_MAX_
     3.4  #define XLIDE_PARTN_SHIFT  6    /* amount to shift minor to get 'real' minor */
     3.5  #define XLIDE_MAX_MINORS  (1 << XLIDE_PARTN_SHIFT)     /* minors per ide vbd */
     3.6  
     3.7 -#define XLSCSI_PARTN_SHIFT 6    /* amount to shift minor to get 'real' minor */
     3.8 +#define XLSCSI_PARTN_SHIFT 4    /* amount to shift minor to get 'real' minor */
     3.9  #define XLSCSI_MAX_MINORS (1 << XLSCSI_PARTN_SHIFT)   /* minors per scsi vbd */
    3.10  
    3.11  #define XLVBD_PARTN_SHIFT  6    /* amount to shift minor to get 'real' minor */
    3.12 @@ -230,11 +230,13 @@ int __init xlvbd_init(xen_disk_info_t *x
    3.13  	       hence using unit number for now but in old code was 'disk' aka 
    3.14  	       sequence number assigned by xen during probe = barfle? */
    3.15  	    ((xl_disk_t *)gd->real_devices)[minor>>gd->minor_shift].capacity =
    3.16 -	    xdi->disks[i].capacity;
    3.17 +                xdi->disks[i].capacity;
    3.18  
    3.19  	    
    3.20  	    /* remember that we've done this major */
    3.21  	    majors[major] = 1; 
    3.22 +	} else {
    3.23 +	    gd = get_gendisk(device); 
    3.24  	}
    3.25  
    3.26  	if(XD_READONLY(xdi->disks[i].info)) 
     4.1 --- a/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c	Fri Nov 07 11:34:27 2003 +0000
     4.2 +++ b/xenolinux-2.4.22-sparse/arch/xeno/kernel/setup.c	Fri Nov 07 15:57:00 2003 +0000
     4.3 @@ -1086,12 +1086,24 @@ static void stop_task(void *unused)
     4.4          pfn_to_mfn_frame_list[j++] = 
     4.5              virt_to_machine(&phys_to_machine_mapping[i]) >> PAGE_SHIFT;
     4.6  
     4.7 +    /*
     4.8 +     * NB. This is /not/ a full dev_close() as that loses route information!
     4.9 +     * Instead we do essentialy the same as dev_close() but without notifying
    4.10 +     * various registered subsystems about the NETDEV_DOWN event.
    4.11 +     */
    4.12      rtnl_lock();
    4.13      for ( i = 0; i < 10; i++ )
    4.14      {
    4.15          sprintf(name, "eth%d", i);
    4.16 -        if ( (dev = __dev_get_by_name(name)) != NULL )
    4.17 -            dev_close(dev);
    4.18 +        if ( ((dev = __dev_get_by_name(name)) != NULL) &&
    4.19 +             (dev->flags & IFF_UP) )
    4.20 +        {
    4.21 +            dev_deactivate(dev);
    4.22 +            clear_bit(__LINK_STATE_START, &dev->state);
    4.23 +            if ( dev->stop != NULL )
    4.24 +                dev->stop(dev);
    4.25 +            dev->flags &= ~IFF_UP;
    4.26 +        }
    4.27      }
    4.28      rtnl_unlock();
    4.29  
    4.30 @@ -1116,12 +1128,28 @@ static void stop_task(void *unused)
    4.31  
    4.32      blkdev_resume();
    4.33  
    4.34 +    /*
    4.35 +     * We now do the opposite of the network suspend code. Basically it's
    4.36 +     * dev_open() but without notifying anyone about NETDEV_UP.
    4.37 +     */
    4.38      rtnl_lock();
    4.39      for ( i = 0; i < 10; i++ )
    4.40      {
    4.41          sprintf(name, "eth%d", i);
    4.42 -        if ( (dev = __dev_get_by_name(name)) != NULL )
    4.43 -            dev_open(dev);
    4.44 +        if ( ((dev = __dev_get_by_name(name)) != NULL) &&
    4.45 +             !(dev->flags & IFF_UP) )
    4.46 +        {
    4.47 +            set_bit(__LINK_STATE_START, &dev->state);
    4.48 +            if ( (dev->open == NULL) || (dev->open(dev) == 0) )
    4.49 +            {
    4.50 +                dev->flags |= IFF_UP;
    4.51 +                dev_activate(dev);
    4.52 +            }
    4.53 +            else
    4.54 +            {
    4.55 +                clear_bit(__LINK_STATE_START, &dev->state);
    4.56 +            } 
    4.57 +        }
    4.58      }
    4.59      rtnl_unlock();
    4.60