ia64/xen-unstable

changeset 8219:00c349d5b40d

Merge
author iap10@freefall.cl.cam.ac.uk
date Sat Dec 03 20:16:04 2005 +0100 (2005-12-03)
parents 31d86fc0a271 fad187cad5bd
children d24ab5abf857
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Sat Dec 03 20:05:39 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Sat Dec 03 20:16:04 2005 +0100
     1.3 @@ -43,7 +43,7 @@
     1.4   */
     1.5  #define IO_TLB_SHIFT 11
     1.6  
     1.7 -int swiotlb_force;
     1.8 +static int swiotlb_force;
     1.9  static char *iotlb_virt_start;
    1.10  static unsigned long iotlb_nslabs;
    1.11  
    1.12 @@ -101,10 +101,13 @@ setup_io_tlb_npages(char *str)
    1.13  		++str;
    1.14  	/*
    1.15           * NB. 'force' enables the swiotlb, but doesn't force its use for
    1.16 -         * every DMA like it does on native Linux.
    1.17 +         * every DMA like it does on native Linux. 'off' forcibly disables
    1.18 +         * use of the swiotlb.
    1.19           */
    1.20  	if (!strcmp(str, "force"))
    1.21  		swiotlb_force = 1;
    1.22 +	else if (!strcmp(str, "off"))
    1.23 +		swiotlb_force = -1;
    1.24  	return 1;
    1.25  }
    1.26  __setup("swiotlb=", setup_io_tlb_npages);
    1.27 @@ -179,23 +182,21 @@ void
    1.28  swiotlb_init(void)
    1.29  {
    1.30  	long ram_end;
    1.31 -
    1.32 -	/* The user can forcibly enable swiotlb. */
    1.33 -	if (swiotlb_force)
    1.34 -		swiotlb = 1;
    1.35 +	size_t defsz = 64 * (1 << 20); /* 64MB default size */
    1.36  
    1.37 -	/*
    1.38 -         * Otherwise, enable for domain 0 if the machine has 'lots of memory',
    1.39 -         * which we take to mean more than 2GB.
    1.40 -         */
    1.41 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
    1.42 +	if (swiotlb_force == 1) {
    1.43 +		swiotlb = 1;
    1.44 +	} else if ((swiotlb_force != -1) &&
    1.45 +		   (xen_start_info->flags & SIF_INITDOMAIN)) {
    1.46 +		/* Domain 0 always has a swiotlb. */
    1.47  		ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
    1.48 -		if (ram_end > 0x7ffff)
    1.49 -			swiotlb = 1;
    1.50 +		if (ram_end <= 0x7ffff)
    1.51 +			defsz = 2 * (1 << 20); /* 2MB on <2GB on systems. */
    1.52 +		swiotlb = 1;
    1.53  	}
    1.54  
    1.55  	if (swiotlb)
    1.56 -		swiotlb_init_with_default_size(64 * (1<<20));
    1.57 +		swiotlb_init_with_default_size(defsz);
    1.58  	else
    1.59  		printk(KERN_INFO "Software IO TLB disabled\n");
    1.60  }
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Sat Dec 03 20:05:39 2005 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Sat Dec 03 20:16:04 2005 +0100
     2.3 @@ -123,11 +123,10 @@ static void free_blkif(void *arg)
     2.4  	blkif_t *blkif = (blkif_t *)arg;
     2.5  
     2.6  	/* Already disconnected? */
     2.7 -	if (!blkif->irq)
     2.8 -		return;
     2.9 -
    2.10 -	unbind_from_irqhandler(blkif->irq, blkif);
    2.11 -	blkif->irq = 0;
    2.12 +	if (blkif->irq) {
    2.13 +		unbind_from_irqhandler(blkif->irq, blkif);
    2.14 +		blkif->irq = 0;
    2.15 +	}
    2.16  
    2.17  	vbd_free(&blkif->vbd);
    2.18  
     3.1 --- a/tools/examples/vif-nat	Sat Dec 03 20:05:39 2005 +0100
     3.2 +++ b/tools/examples/vif-nat	Sat Dec 03 20:16:04 2005 +0100
     3.3 @@ -42,14 +42,15 @@ then
     3.4  fi
     3.5  
     3.6  
     3.7 +domid=$(echo "$XENBUS_PATH" | sed -n 's#.*/\([0-9]*\)/[0-9]*$#\1#p')
     3.8 +vifid=$(echo "$XENBUS_PATH" | sed -n 's#.*/[0-9]*/\([0-9]*\)$#\1#p')
     3.9 +vifid=$(( $vifid + 1 ))
    3.10 +
    3.11 +
    3.12  ip_from_dom()
    3.13  {
    3.14 -  local domid=$(echo "$XENBUS_PATH" | sed -n 's#.*/\([0-9]*\)/[0-9]*$#\1#p')
    3.15 -  local vifid=$(echo "$XENBUS_PATH" | sed -n 's#.*/[0-9]*/\([0-9]*\)$#\1#p')
    3.16 -
    3.17    local domid1=$(( $domid / 256 ))
    3.18    local domid2=$(( $domid % 256 ))
    3.19 -  vifid=$(( $vifid + 1 ))
    3.20  
    3.21    echo "10.$domid1.$domid2.$vifid/16"
    3.22  }
    3.23 @@ -92,10 +93,17 @@ netmask=$(dotted_quad $intmask)
    3.24  network=$(dotted_quad $(( $vif_int & $intmask )) )
    3.25  
    3.26  
    3.27 +hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
    3.28 +if [ "$vifid" != "1" ]
    3.29 +then
    3.30 +  hostname="$hostname-$vifid"
    3.31 +fi
    3.32 +
    3.33 +
    3.34  dhcp_remove_entry()
    3.35  {
    3.36    local tmpfile=$(mktemp)
    3.37 -  grep -v "host Xen-${vif/./-}" "$dhcpd_conf_file" >"$tmpfile"
    3.38 +  grep -v "host $hostname" "$dhcpd_conf_file" >"$tmpfile"
    3.39    if diff "$tmpfile" "$dhcpd_conf_file" >/dev/null
    3.40    then
    3.41      rm "$tmpfile"
    3.42 @@ -107,18 +115,21 @@ dhcp_remove_entry()
    3.43  
    3.44  dhcp_up()
    3.45  {
    3.46 +  claim_lock "vif-nat-dhcp"
    3.47    dhcp_remove_entry
    3.48    mac=$(xenstore_read "$XENBUS_PATH/mac")
    3.49    echo >>"$dhcpd_conf_file" \
    3.50 -"host Xen-${vif/./-} { hardware ethernet $mac; fixed-address $vif_ip; option routers $router_ip; }"
    3.51 -
    3.52 -  "$dhcpd_init_file" restart
    3.53 +"host $hostname { hardware ethernet $mac; fixed-address $vif_ip; option routers $router_ip; option host-name \"$hostname\"; }"
    3.54 +  release_lock "vif-nat-dhcp"
    3.55 +  "$dhcpd_init_file" restart || true
    3.56  }
    3.57  
    3.58  
    3.59  dhcp_down()
    3.60  {
    3.61 +  claim_lock "vif-nat-dhcp"
    3.62    dhcp_remove_entry
    3.63 +  release_lock "vif-nat-dhcp"
    3.64    "$dhcpd_init_file" restart || true # We need to ignore failure because
    3.65                                       # ISC dhcpd 3 borks if there is nothing
    3.66                                       # for it to do, which is the case if
     4.1 --- a/tools/ioemu/sdl.c	Sat Dec 03 20:05:39 2005 +0100
     4.2 +++ b/tools/ioemu/sdl.c	Sat Dec 03 20:16:04 2005 +0100
     4.3 @@ -358,14 +358,14 @@ static void sdl_process_key(SDL_Keyboard
     4.4  static void sdl_update_caption(void)
     4.5  {
     4.6      char buf[1024];
     4.7 -    strcpy(buf, "VTXen");
     4.8 +    strcpy(buf, domain_name);
     4.9      if (!vm_running) {
    4.10          strcat(buf, " [Stopped]");
    4.11      }
    4.12      if (gui_grab) {
    4.13          strcat(buf, " - Press Ctrl-Alt to exit grab");
    4.14      }
    4.15 -    SDL_WM_SetCaption(buf, "VTXen");
    4.16 +    SDL_WM_SetCaption(buf, domain_name);
    4.17  }
    4.18  
    4.19  static void sdl_grab_start(void)
     5.1 --- a/tools/ioemu/vl.c	Sat Dec 03 20:05:39 2005 +0100
     5.2 +++ b/tools/ioemu/vl.c	Sat Dec 03 20:16:04 2005 +0100
     5.3 @@ -125,6 +125,7 @@ static char network_script[1024];
     5.4  int pit_min_timer_count = 0;
     5.5  int nb_nics;
     5.6  char bridge[16];
     5.7 +char domain_name[1024] = { 'V', 'T', 'X', 'E', 'N', '-'};
     5.8  NetDriverState nd_table[MAX_NICS];
     5.9  QEMUTimer *gui_timer;
    5.10  QEMUTimer *polling_timer;
    5.11 @@ -2238,6 +2239,7 @@ void help(void)
    5.12             "-s              wait gdb connection to port %d\n"
    5.13             "-p port         ioreq port for xen\n"
    5.14             "-d domain       domain that we're serving\n"
    5.15 +           "-domain-namn    domain name that we're serving\n"
    5.16             "-hdachs c,h,s   force hard disk 0 geometry (usually qemu can guess it)\n"
    5.17             "-L path         set the directory for the BIOS and VGA BIOS\n"
    5.18  #ifdef USE_CODE_COPY
    5.19 @@ -2335,6 +2337,7 @@ enum {
    5.20      QEMU_OPTION_g,
    5.21      QEMU_OPTION_std_vga,
    5.22      QEMU_OPTION_monitor,
    5.23 +    QEMU_OPTION_domainname,
    5.24      QEMU_OPTION_serial,
    5.25      QEMU_OPTION_loadvm,
    5.26      QEMU_OPTION_full_screen,
    5.27 @@ -2408,6 +2411,7 @@ const QEMUOption qemu_options[] = {
    5.28      { "isa", 0, QEMU_OPTION_isa },
    5.29      { "std-vga", 0, QEMU_OPTION_std_vga },
    5.30      { "monitor", 1, QEMU_OPTION_monitor },
    5.31 +    { "domain-name", 1, QEMU_OPTION_domainname },
    5.32      { "serial", 1, QEMU_OPTION_serial },
    5.33      { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
    5.34      { "full-screen", 0, QEMU_OPTION_full_screen },
    5.35 @@ -3024,6 +3028,10 @@ int main(int argc, char **argv)
    5.36              case QEMU_OPTION_full_screen:
    5.37                  full_screen = 1;
    5.38                  break;
    5.39 +            case QEMU_OPTION_domainname:
    5.40 +                strncat(domain_name, optarg, sizeof(domain_name) - 20);
    5.41 +                break;
    5.42 +
    5.43              }
    5.44          }
    5.45      }
     6.1 --- a/tools/ioemu/vl.h	Sat Dec 03 20:05:39 2005 +0100
     6.2 +++ b/tools/ioemu/vl.h	Sat Dec 03 20:16:04 2005 +0100
     6.3 @@ -796,4 +796,5 @@ int gdbserver_start(int port);
     6.4  void update_select_wakeup_events(void);
     6.5  void tun_receive_handler();
     6.6  
     6.7 +extern char domain_name[];
     6.8  #endif /* VL_H */
     7.1 --- a/tools/ioemu/vnc.c	Sat Dec 03 20:05:39 2005 +0100
     7.2 +++ b/tools/ioemu/vnc.c	Sat Dec 03 20:16:04 2005 +0100
     7.3 @@ -526,7 +526,7 @@ void vnc_display_init(DisplayState *ds, 
     7.4  	} else
     7.5  		screen->frameBuffer = malloc(640*400*2);
     7.6  
     7.7 -	screen->desktopName = "QEMU/VNC";
     7.8 +	screen->desktopName = domain_name;
     7.9  	screen->cursor = 0;
    7.10  	screen->kbdAddEvent = vnc_process_key;
    7.11  	screen->ptrAddEvent = vnc_process_mouse;
     8.1 --- a/tools/python/xen/xend/image.py	Sat Dec 03 20:05:39 2005 +0100
     8.2 +++ b/tools/python/xen/xend/image.py	Sat Dec 03 20:16:04 2005 +0100
     8.3 @@ -238,7 +238,9 @@ class VmxImageHandler(ImageHandler):
     8.4      # xm config file
     8.5      def parseDeviceModelArgs(self, imageConfig, deviceConfig):
     8.6          dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000', 
     8.7 -                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ]
     8.8 +                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
     8.9 +                   'nics'
    8.10 +                   ]
    8.11          ret = []
    8.12          for a in dmargs:
    8.13              v = sxp.child_value(imageConfig, a)
    8.14 @@ -259,6 +261,7 @@ class VmxImageHandler(ImageHandler):
    8.15  
    8.16          # Handle disk/network related options
    8.17          mac = None
    8.18 +        ret.append("-domain-name %s" % self.vm.info['name'])
    8.19          for (name, info) in deviceConfig:
    8.20              if name == 'vbd':
    8.21                 uname = sxp.child_value(info, 'uname')
     9.1 --- a/tools/python/xen/xm/create.py	Sat Dec 03 20:05:39 2005 +0100
     9.2 +++ b/tools/python/xen/xm/create.py	Sat Dec 03 20:16:04 2005 +0100
     9.3 @@ -543,7 +543,8 @@ def configure_vmx(config_image, vals):
     9.4      """
     9.5      args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
     9.6               'localtime', 'serial', 'stdvga', 'isa', 'nographic',
     9.7 -             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic']
     9.8 +             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic',
     9.9 +             'nics']
    9.10      for a in args:
    9.11          if (vals.__dict__[a]):
    9.12              config_image.append([a, vals.__dict__[a]])
    10.1 --- a/xen/arch/x86/shadow.c	Sat Dec 03 20:05:39 2005 +0100
    10.2 +++ b/xen/arch/x86/shadow.c	Sat Dec 03 20:16:04 2005 +0100
    10.3 @@ -637,6 +637,11 @@ static void shadow_map_l1_into_current_l
    10.4          gpl1e = (guest_l1_pgentry_t *) map_domain_page(tmp_gmfn);
    10.5  
    10.6          /* If the PGT_l1_shadow has two continual pages */
    10.7 +#if CONFIG_PAGING_LEVELS >=3
    10.8 +        if (d->arch.ops->guest_paging_levels == PAGING_L2)
    10.9 +            __shadow_get_l2e(v,  va & ~((1<<L2_PAGETABLE_SHIFT_32) - 1), &tmp_sl2e);
   10.10 +        else
   10.11 +#endif
   10.12          __shadow_get_l2e(v, va, &tmp_sl2e);
   10.13          spl1e = (l1_pgentry_t *) map_domain_page(l2e_get_pfn(tmp_sl2e));
   10.14  
   10.15 @@ -1809,9 +1814,12 @@ static void sync_all(struct domain *d)
   10.16      }
   10.17  #endif
   10.18  
   10.19 -    need_flush |= resync_all(d, PGT_l2_shadow);
   10.20 -
   10.21  #if CONFIG_PAGING_LEVELS >= 3
   10.22 +    if (d->arch.ops->guest_paging_levels == PAGING_L2)
   10.23 +        need_flush |= resync_all(d, PGT_l4_shadow);
   10.24 +    else
   10.25 +        need_flush |= resync_all(d, PGT_l2_shadow);
   10.26 +
   10.27      if (d->arch.ops->guest_paging_levels >= PAGING_L3) 
   10.28      {
   10.29          need_flush |= resync_all(d, PGT_l3_shadow);
   10.30 @@ -2943,6 +2951,8 @@ validate_bl2e_change(
   10.31         sl2_p[sl2_idx + 1] =
   10.32              entry_from_pfn(sl1mfn + 1, entry_get_flags(sl2_p[sl2_idx]));
   10.33      }
   10.34 +    else
   10.35 +        sl2_p[sl2_idx + 1] = (pgentry_64_t){0};
   10.36      unmap_domain_page(sl2_p);
   10.37  
   10.38  }
   10.39 @@ -3528,9 +3538,9 @@ static void shadow_invlpg_64(struct vcpu
   10.40  
   10.41      __shadow_sync_va(v, va);
   10.42  
   10.43 -    if ( __shadow_get_l1e(v, va, &old_sl1e) )
   10.44 +    if ( shadow_mode_external(d) && __shadow_get_l1e(v, va, &old_sl1e) )
   10.45          if ( l1e_get_flags(old_sl1e) & _PAGE_PRESENT )
   10.46 -            shadow_put_page_from_l1e(old_sl1e, d);
   10.47 +            put_page_from_l1e(old_sl1e, d);
   10.48  
   10.49      sl1e = l1e_empty();
   10.50      __shadow_set_l1e(v, va, &sl1e);