WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Merge

# HG changeset patch
# User iap10@xxxxxxxxxxxxxxxxxxxxx
# Node ID 00c349d5b40d269da4fec9510f1dd7c6bb3b3327
# Parent  31d86fc0a2713b3c76f79d15a2e9a4f2516ccdc5
# Parent  fad187cad5bd39eedc8fef9a9ecf4a656cb4eb17
Merge

diff -r 31d86fc0a271 -r 00c349d5b40d 
linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c
--- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c       Sat Dec  3 
19:05:39 2005
+++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c       Sat Dec  3 
19:16:04 2005
@@ -43,7 +43,7 @@
  */
 #define IO_TLB_SHIFT 11
 
-int swiotlb_force;
+static int swiotlb_force;
 static char *iotlb_virt_start;
 static unsigned long iotlb_nslabs;
 
@@ -101,10 +101,13 @@
                ++str;
        /*
          * NB. 'force' enables the swiotlb, but doesn't force its use for
-         * every DMA like it does on native Linux.
+         * every DMA like it does on native Linux. 'off' forcibly disables
+         * use of the swiotlb.
          */
        if (!strcmp(str, "force"))
                swiotlb_force = 1;
+       else if (!strcmp(str, "off"))
+               swiotlb_force = -1;
        return 1;
 }
 __setup("swiotlb=", setup_io_tlb_npages);
@@ -179,23 +182,21 @@
 swiotlb_init(void)
 {
        long ram_end;
-
-       /* The user can forcibly enable swiotlb. */
-       if (swiotlb_force)
+       size_t defsz = 64 * (1 << 20); /* 64MB default size */
+
+       if (swiotlb_force == 1) {
                swiotlb = 1;
-
-       /*
-         * Otherwise, enable for domain 0 if the machine has 'lots of memory',
-         * which we take to mean more than 2GB.
-         */
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       } else if ((swiotlb_force != -1) &&
+                  (xen_start_info->flags & SIF_INITDOMAIN)) {
+               /* Domain 0 always has a swiotlb. */
                ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
-               if (ram_end > 0x7ffff)
-                       swiotlb = 1;
+               if (ram_end <= 0x7ffff)
+                       defsz = 2 * (1 << 20); /* 2MB on <2GB on systems. */
+               swiotlb = 1;
        }
 
        if (swiotlb)
-               swiotlb_init_with_default_size(64 * (1<<20));
+               swiotlb_init_with_default_size(defsz);
        else
                printk(KERN_INFO "Software IO TLB disabled\n");
 }
diff -r 31d86fc0a271 -r 00c349d5b40d 
linux-2.6-xen-sparse/drivers/xen/blkback/interface.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c      Sat Dec  3 
19:05:39 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c      Sat Dec  3 
19:16:04 2005
@@ -123,11 +123,10 @@
        blkif_t *blkif = (blkif_t *)arg;
 
        /* Already disconnected? */
-       if (!blkif->irq)
-               return;
-
-       unbind_from_irqhandler(blkif->irq, blkif);
-       blkif->irq = 0;
+       if (blkif->irq) {
+               unbind_from_irqhandler(blkif->irq, blkif);
+               blkif->irq = 0;
+       }
 
        vbd_free(&blkif->vbd);
 
diff -r 31d86fc0a271 -r 00c349d5b40d tools/examples/vif-nat
--- a/tools/examples/vif-nat    Sat Dec  3 19:05:39 2005
+++ b/tools/examples/vif-nat    Sat Dec  3 19:16:04 2005
@@ -42,14 +42,15 @@
 fi
 
 
+domid=$(echo "$XENBUS_PATH" | sed -n 's#.*/\([0-9]*\)/[0-9]*$#\1#p')
+vifid=$(echo "$XENBUS_PATH" | sed -n 's#.*/[0-9]*/\([0-9]*\)$#\1#p')
+vifid=$(( $vifid + 1 ))
+
+
 ip_from_dom()
 {
-  local domid=$(echo "$XENBUS_PATH" | sed -n 's#.*/\([0-9]*\)/[0-9]*$#\1#p')
-  local vifid=$(echo "$XENBUS_PATH" | sed -n 's#.*/[0-9]*/\([0-9]*\)$#\1#p')
-
   local domid1=$(( $domid / 256 ))
   local domid2=$(( $domid % 256 ))
-  vifid=$(( $vifid + 1 ))
 
   echo "10.$domid1.$domid2.$vifid/16"
 }
@@ -92,10 +93,17 @@
 network=$(dotted_quad $(( $vif_int & $intmask )) )
 
 
+hostname=$(xenstore_read "$XENBUS_PATH/domain" | tr -- '_.:/+' '-----')
+if [ "$vifid" != "1" ]
+then
+  hostname="$hostname-$vifid"
+fi
+
+
 dhcp_remove_entry()
 {
   local tmpfile=$(mktemp)
-  grep -v "host Xen-${vif/./-}" "$dhcpd_conf_file" >"$tmpfile"
+  grep -v "host $hostname" "$dhcpd_conf_file" >"$tmpfile"
   if diff "$tmpfile" "$dhcpd_conf_file" >/dev/null
   then
     rm "$tmpfile"
@@ -107,18 +115,21 @@
 
 dhcp_up()
 {
+  claim_lock "vif-nat-dhcp"
   dhcp_remove_entry
   mac=$(xenstore_read "$XENBUS_PATH/mac")
   echo >>"$dhcpd_conf_file" \
-"host Xen-${vif/./-} { hardware ethernet $mac; fixed-address $vif_ip; option 
routers $router_ip; }"
-
-  "$dhcpd_init_file" restart
+"host $hostname { hardware ethernet $mac; fixed-address $vif_ip; option 
routers $router_ip; option host-name \"$hostname\"; }"
+  release_lock "vif-nat-dhcp"
+  "$dhcpd_init_file" restart || true
 }
 
 
 dhcp_down()
 {
+  claim_lock "vif-nat-dhcp"
   dhcp_remove_entry
+  release_lock "vif-nat-dhcp"
   "$dhcpd_init_file" restart || true # We need to ignore failure because
                                      # ISC dhcpd 3 borks if there is nothing
                                      # for it to do, which is the case if
diff -r 31d86fc0a271 -r 00c349d5b40d tools/ioemu/sdl.c
--- a/tools/ioemu/sdl.c Sat Dec  3 19:05:39 2005
+++ b/tools/ioemu/sdl.c Sat Dec  3 19:16:04 2005
@@ -358,14 +358,14 @@
 static void sdl_update_caption(void)
 {
     char buf[1024];
-    strcpy(buf, "VTXen");
+    strcpy(buf, domain_name);
     if (!vm_running) {
         strcat(buf, " [Stopped]");
     }
     if (gui_grab) {
         strcat(buf, " - Press Ctrl-Alt to exit grab");
     }
-    SDL_WM_SetCaption(buf, "VTXen");
+    SDL_WM_SetCaption(buf, domain_name);
 }
 
 static void sdl_grab_start(void)
diff -r 31d86fc0a271 -r 00c349d5b40d tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Sat Dec  3 19:05:39 2005
+++ b/tools/ioemu/vl.c  Sat Dec  3 19:16:04 2005
@@ -125,6 +125,7 @@
 int pit_min_timer_count = 0;
 int nb_nics;
 char bridge[16];
+char domain_name[1024] = { 'V', 'T', 'X', 'E', 'N', '-'};
 NetDriverState nd_table[MAX_NICS];
 QEMUTimer *gui_timer;
 QEMUTimer *polling_timer;
@@ -2238,6 +2239,7 @@
            "-s              wait gdb connection to port %d\n"
            "-p port         ioreq port for xen\n"
            "-d domain       domain that we're serving\n"
+           "-domain-namn    domain name that we're serving\n"
            "-hdachs c,h,s   force hard disk 0 geometry (usually qemu can guess 
it)\n"
            "-L path         set the directory for the BIOS and VGA BIOS\n"
 #ifdef USE_CODE_COPY
@@ -2335,6 +2337,7 @@
     QEMU_OPTION_g,
     QEMU_OPTION_std_vga,
     QEMU_OPTION_monitor,
+    QEMU_OPTION_domainname,
     QEMU_OPTION_serial,
     QEMU_OPTION_loadvm,
     QEMU_OPTION_full_screen,
@@ -2408,6 +2411,7 @@
     { "isa", 0, QEMU_OPTION_isa },
     { "std-vga", 0, QEMU_OPTION_std_vga },
     { "monitor", 1, QEMU_OPTION_monitor },
+    { "domain-name", 1, QEMU_OPTION_domainname },
     { "serial", 1, QEMU_OPTION_serial },
     { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
     { "full-screen", 0, QEMU_OPTION_full_screen },
@@ -3024,6 +3028,10 @@
             case QEMU_OPTION_full_screen:
                 full_screen = 1;
                 break;
+            case QEMU_OPTION_domainname:
+                strncat(domain_name, optarg, sizeof(domain_name) - 20);
+                break;
+
             }
         }
     }
diff -r 31d86fc0a271 -r 00c349d5b40d tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Sat Dec  3 19:05:39 2005
+++ b/tools/ioemu/vl.h  Sat Dec  3 19:16:04 2005
@@ -796,4 +796,5 @@
 void update_select_wakeup_events(void);
 void tun_receive_handler();
 
+extern char domain_name[];
 #endif /* VL_H */
diff -r 31d86fc0a271 -r 00c349d5b40d tools/ioemu/vnc.c
--- a/tools/ioemu/vnc.c Sat Dec  3 19:05:39 2005
+++ b/tools/ioemu/vnc.c Sat Dec  3 19:16:04 2005
@@ -526,7 +526,7 @@
        } else
                screen->frameBuffer = malloc(640*400*2);
 
-       screen->desktopName = "QEMU/VNC";
+       screen->desktopName = domain_name;
        screen->cursor = 0;
        screen->kbdAddEvent = vnc_process_key;
        screen->ptrAddEvent = vnc_process_mouse;
diff -r 31d86fc0a271 -r 00c349d5b40d tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Sat Dec  3 19:05:39 2005
+++ b/tools/python/xen/xend/image.py    Sat Dec  3 19:16:04 2005
@@ -238,7 +238,9 @@
     # xm config file
     def parseDeviceModelArgs(self, imageConfig, deviceConfig):
         dmargs = [ 'cdrom', 'boot', 'fda', 'fdb', 'ne2000', 
-                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus' ]
+                   'localtime', 'serial', 'stdvga', 'isa', 'vcpus',
+                   'nics'
+                   ]
         ret = []
         for a in dmargs:
             v = sxp.child_value(imageConfig, a)
@@ -259,6 +261,7 @@
 
         # Handle disk/network related options
         mac = None
+        ret.append("-domain-name %s" % self.vm.info['name'])
         for (name, info) in deviceConfig:
             if name == 'vbd':
                uname = sxp.child_value(info, 'uname')
diff -r 31d86fc0a271 -r 00c349d5b40d tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Sat Dec  3 19:05:39 2005
+++ b/tools/python/xen/xm/create.py     Sat Dec  3 19:16:04 2005
@@ -543,7 +543,8 @@
     """
     args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
              'localtime', 'serial', 'stdvga', 'isa', 'nographic',
-             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic']
+             'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'lapic',
+             'nics']
     for a in args:
         if (vals.__dict__[a]):
             config_image.append([a, vals.__dict__[a]])
diff -r 31d86fc0a271 -r 00c349d5b40d xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     Sat Dec  3 19:05:39 2005
+++ b/xen/arch/x86/shadow.c     Sat Dec  3 19:16:04 2005
@@ -637,6 +637,11 @@
         gpl1e = (guest_l1_pgentry_t *) map_domain_page(tmp_gmfn);
 
         /* If the PGT_l1_shadow has two continual pages */
+#if CONFIG_PAGING_LEVELS >=3
+        if (d->arch.ops->guest_paging_levels == PAGING_L2)
+            __shadow_get_l2e(v,  va & ~((1<<L2_PAGETABLE_SHIFT_32) - 1), 
&tmp_sl2e);
+        else
+#endif
         __shadow_get_l2e(v, va, &tmp_sl2e);
         spl1e = (l1_pgentry_t *) map_domain_page(l2e_get_pfn(tmp_sl2e));
 
@@ -1809,9 +1814,12 @@
     }
 #endif
 
-    need_flush |= resync_all(d, PGT_l2_shadow);
-
 #if CONFIG_PAGING_LEVELS >= 3
+    if (d->arch.ops->guest_paging_levels == PAGING_L2)
+        need_flush |= resync_all(d, PGT_l4_shadow);
+    else
+        need_flush |= resync_all(d, PGT_l2_shadow);
+
     if (d->arch.ops->guest_paging_levels >= PAGING_L3) 
     {
         need_flush |= resync_all(d, PGT_l3_shadow);
@@ -2943,6 +2951,8 @@
        sl2_p[sl2_idx + 1] =
             entry_from_pfn(sl1mfn + 1, entry_get_flags(sl2_p[sl2_idx]));
     }
+    else
+        sl2_p[sl2_idx + 1] = (pgentry_64_t){0};
     unmap_domain_page(sl2_p);
 
 }
@@ -3528,9 +3538,9 @@
 
     __shadow_sync_va(v, va);
 
-    if ( __shadow_get_l1e(v, va, &old_sl1e) )
+    if ( shadow_mode_external(d) && __shadow_get_l1e(v, va, &old_sl1e) )
         if ( l1e_get_flags(old_sl1e) & _PAGE_PRESENT )
-            shadow_put_page_from_l1e(old_sl1e, d);
+            put_page_from_l1e(old_sl1e, d);
 
     sl1e = l1e_empty();
     __shadow_set_l1e(v, va, &sl1e);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>