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] Merged.

# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 33b2ae0246632237d6b8f1893b307f2f51b0315b
# Parent  ea609f28ec01b7cc9b540481cf99173b83135863
# Parent  d714f923b7cfff705dcf9aae30a06709340059aa
Merged.
---
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c    |    2 -
 tools/python/xen/xend/XendDomainInfo.py                 |    2 -
 tools/python/xen/xend/image.py                          |   24 ++++++++++------
 tools/xm-test/tests/network/03_network_local_tcp_pos.py |    4 +-
 tools/xm-test/tests/network/04_network_local_udp_pos.py |    4 +-
 tools/xm-test/tests/network/06_network_dom0_tcp_pos.py  |    2 -
 tools/xm-test/tests/network/07_network_dom0_udp_pos.py  |    2 -
 tools/xm-test/tests/network/12_network_domU_tcp_pos.py  |    2 -
 tools/xm-test/tests/network/13_network_domU_udp_pos.py  |    2 -
 xen/arch/x86/hvm/hvm.c                                  |    6 +++-
 xen/arch/x86/hvm/svm/svm.c                              |    4 ++
 xen/arch/x86/hvm/svm/vmcb.c                             |   17 ++++++-----
 12 files changed, 43 insertions(+), 28 deletions(-)

diff -r ea609f28ec01 -r 33b2ae024663 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri May 19 
16:21:43 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri May 19 
16:21:49 2006 +0100
@@ -1045,8 +1045,6 @@ static void network_connect(struct net_d
        notify_remote_via_irq(np->irq);
        network_tx_buf_gc(dev);
 
-       network_maybe_wake_tx(dev);
-
        spin_unlock(&np->rx_lock);
        spin_unlock_irq(&np->tx_lock);
 }
diff -r ea609f28ec01 -r 33b2ae024663 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri May 19 16:21:43 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri May 19 16:21:49 2006 +0100
@@ -1264,7 +1264,7 @@ class XendDomainInfo:
             m = self.image.getDomainMemory(self.info['memory'] * 1024)
             balloon.free(m)
             xc.domain_setmaxmem(self.domid, m)
-            xc.domain_memory_increase_reservation(self.domid, m, 0, 0)
+            xc.domain_memory_increase_reservation(self.domid, 
self.info['memory'] * 1024, 0, 0)
 
             self.createChannels()
 
diff -r ea609f28ec01 -r 33b2ae024663 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Fri May 19 16:21:43 2006 +0100
+++ b/tools/python/xen/xend/image.py    Fri May 19 16:21:49 2006 +0100
@@ -19,6 +19,7 @@
 
 import os, string
 import re
+import math
 
 import xen.lowlevel.xc
 from xen.xend import sxp
@@ -141,11 +142,13 @@ class ImageHandler:
                           % (self.ostype, self.vm.getDomid(), str(result)))
 
 
-    def getDomainMemory(self, mem):
+    def getDomainMemory(self, mem_kb):
         """@return The memory required, in KiB, by the domain to store the
-        given amount, also in KiB.  This is normally just mem, but HVM domains
-        have overheads to account for."""
-        return mem
+        given amount, also in KiB.  This is normally just mem, but if HVM is
+        supported, keep a little extra free."""
+        if 'hvm' in xc.xeninfo()['xen_caps']:
+            mem_kb += 4*1024;
+        return mem_kb
 
     def buildDomain(self):
         """Build the domain. Define in subclass."""
@@ -377,15 +380,20 @@ class HVMImageHandler(ImageHandler):
         os.waitpid(self.pid, 0)
         self.pid = 0
 
-    def getDomainMemory(self, mem):
+    def getDomainMemory(self, mem_kb):
         """@see ImageHandler.getDomainMemory"""
-        page_kb = 4
-        extra_pages = 0
         if os.uname()[4] == 'ia64':
             page_kb = 16
             # ROM size for guest firmware, ioreq page and xenstore page
             extra_pages = 1024 + 2
-        return mem + extra_pages * page_kb
+        else:
+            page_kb = 4
+            # This was derived emperically:
+            #   2.4 MB overhead per 1024 MB RAM + 8 MB constant
+            #   + 4 to avoid low-memory condition
+            extra_mb = (2.4/1024) * (mem_kb/1024.0) + 12;
+            extra_pages = int( math.ceil( extra_mb*1024 / page_kb ))
+        return mem_kb + extra_pages * page_kb
 
     def register_shutdown_watch(self):
         """ add xen store watch on control/shutdown """
diff -r ea609f28ec01 -r 33b2ae024663 
tools/xm-test/tests/network/03_network_local_tcp_pos.py
--- a/tools/xm-test/tests/network/03_network_local_tcp_pos.py   Fri May 19 
16:21:43 2006 +0100
+++ b/tools/xm-test/tests/network/03_network_local_tcp_pos.py   Fri May 19 
16:21:49 2006 +0100
@@ -44,7 +44,7 @@ try:
     lofails=""
     for size in trysizes:
         out = console.runCmd("hping2 127.0.0.1 -E /dev/urandom -q -c 20 " 
-              + "--fast -d " + str(size))
+              + "--fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             lofails += " " + str(size)
 
@@ -54,7 +54,7 @@ try:
     ip = netdev.getNetDevIP()
     for size in trysizes:
         out = console.runCmd("hping2 " + ip + " -E /dev/urandom -q -c 20 "
-              + "--fast -d "+ str(size))
+              + "--fast -d "+ str(size) + " -N " + str(size))
         if out["return"]:
             eth0fails += " " + str(size) 
 except ConsoleError, e:
diff -r ea609f28ec01 -r 33b2ae024663 
tools/xm-test/tests/network/04_network_local_udp_pos.py
--- a/tools/xm-test/tests/network/04_network_local_udp_pos.py   Fri May 19 
16:21:43 2006 +0100
+++ b/tools/xm-test/tests/network/04_network_local_udp_pos.py   Fri May 19 
16:21:49 2006 +0100
@@ -43,7 +43,7 @@ try:
     lofails=""
     for size in trysizes:
         out = console.runCmd("hping2 127.0.0.1 -E /dev/urandom -2 -q -c 20 "
-              + "--fast -d " + str(size))
+              + "--fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             lofails += " " + str(size)
             print out["output"]
@@ -54,7 +54,7 @@ try:
     ip = netdev.getNetDevIP()
     for size in trysizes:
         out = console.runCmd("hping2 " + ip + " -E /dev/urandom -2 -q -c 20 "
-              + "--fast -d " + str(size))
+              + "--fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             eth0fails += " " + str(size) 
             print out["output"]
diff -r ea609f28ec01 -r 33b2ae024663 
tools/xm-test/tests/network/06_network_dom0_tcp_pos.py
--- a/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py    Fri May 19 
16:21:43 2006 +0100
+++ b/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py    Fri May 19 
16:21:49 2006 +0100
@@ -44,7 +44,7 @@ try:
     dom0ip = netdev.getDom0AliasIP()
     for size in trysizes:
         out = console.runCmd("hping2 " + dom0ip + " -E /dev/urandom -q -c 20 "
-              + "--fast -d " + str(size))
+              + "--fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             fails += " " + str(size) 
             print out["output"]
diff -r ea609f28ec01 -r 33b2ae024663 
tools/xm-test/tests/network/07_network_dom0_udp_pos.py
--- a/tools/xm-test/tests/network/07_network_dom0_udp_pos.py    Fri May 19 
16:21:43 2006 +0100
+++ b/tools/xm-test/tests/network/07_network_dom0_udp_pos.py    Fri May 19 
16:21:49 2006 +0100
@@ -43,7 +43,7 @@ try:
     dom0ip = netdev.getDom0AliasIP()
     for size in trysizes:
         out = console.runCmd("hping2 " + dom0ip + " -E /dev/urandom -2 -q -c 
20"
-             + " --fast -d " + str(size))
+             + " --fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             fails += " " + str(size) 
             print out["output"]
diff -r ea609f28ec01 -r 33b2ae024663 
tools/xm-test/tests/network/12_network_domU_tcp_pos.py
--- a/tools/xm-test/tests/network/12_network_domU_tcp_pos.py    Fri May 19 
16:21:43 2006 +0100
+++ b/tools/xm-test/tests/network/12_network_domU_tcp_pos.py    Fri May 19 
16:21:49 2006 +0100
@@ -50,7 +50,7 @@ try:
     ip2 = dst_netdev.getNetDevIP()
     for size in pingsizes:
         out = src_console.runCmd("hping2 " + ip2 + " -E /dev/urandom -q -c 20 "
-              + "--fast -d " + str(size))
+              + "--fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             fails += " " + str(size) 
             print out["output"]
diff -r ea609f28ec01 -r 33b2ae024663 
tools/xm-test/tests/network/13_network_domU_udp_pos.py
--- a/tools/xm-test/tests/network/13_network_domU_udp_pos.py    Fri May 19 
16:21:43 2006 +0100
+++ b/tools/xm-test/tests/network/13_network_domU_udp_pos.py    Fri May 19 
16:21:49 2006 +0100
@@ -50,7 +50,7 @@ try:
     ip2 = dst_netdev.getNetDevIP()
     for size in pingsizes:
         out = src_console.runCmd("hping2 " + ip2 + " -E /dev/urandom -2 -q "
-              + "-c 20 --fast -d " + str(size))
+              + "-c 20 --fast -d " + str(size) + " -N " + str(size))
         if out["return"]:
             fails += " " + str(size) 
             print out["output"]
diff -r ea609f28ec01 -r 33b2ae024663 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Fri May 19 16:21:43 2006 +0100
+++ b/xen/arch/x86/hvm/hvm.c    Fri May 19 16:21:49 2006 +0100
@@ -189,7 +189,11 @@ void hvm_setup_platform(struct domain* d
     if ( !hvm_guest(current) || (current->vcpu_id != 0) )
         return;
 
-    shadow_direct_map_init(d);
+    if ( shadow_direct_map_init(d) == 0 )
+    {
+        printk("Can not allocate shadow direct map for HVM domain.\n");
+        domain_crash_synchronous();
+    }
 
     hvm_map_io_shared_page(d);
     hvm_get_info(d);
diff -r ea609f28ec01 -r 33b2ae024663 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c        Fri May 19 16:21:43 2006 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c        Fri May 19 16:21:49 2006 +0100
@@ -458,6 +458,9 @@ int start_svm(void)
     
     if (!(test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability)))
         return 0;
+    svm_globals[cpu].hsa = alloc_host_save_area();
+    if (! svm_globals[cpu].hsa)
+        return 0;
     
     rdmsr(MSR_EFER, eax, edx);
     eax |= EFER_SVME;
@@ -466,7 +469,6 @@ int start_svm(void)
     printk("AMD SVM Extension is enabled for cpu %d.\n", cpu );
 
     /* Initialize the HSA for this core */
-    svm_globals[cpu].hsa = alloc_host_save_area();
     phys_hsa = (u64) virt_to_maddr( svm_globals[cpu].hsa ); 
     phys_hsa_lo = (u32) phys_hsa;
     phys_hsa_hi = (u32) (phys_hsa >> 32);    
diff -r ea609f28ec01 -r 33b2ae024663 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c       Fri May 19 16:21:43 2006 +0100
+++ b/xen/arch/x86/hvm/svm/vmcb.c       Fri May 19 16:21:49 2006 +0100
@@ -139,17 +139,20 @@ static int construct_vmcb_controls(struc
 
     /* The following is for I/O and MSR permision map */
     iopm = alloc_xenheap_pages(get_order_from_bytes(IOPM_SIZE));
-
-    ASSERT(iopm);
-    memset(iopm, 0xff, IOPM_SIZE);
-    clear_bit(PC_DEBUG_PORT, iopm);
+    if (iopm)
+    {
+        memset(iopm, 0xff, IOPM_SIZE);
+        clear_bit(PC_DEBUG_PORT, iopm);
+    }
     msrpm = alloc_xenheap_pages(get_order_from_bytes(MSRPM_SIZE));
-
-    ASSERT(msrpm);
-    memset(msrpm, 0xff, MSRPM_SIZE);
+    if (msrpm)
+        memset(msrpm, 0xff, MSRPM_SIZE);
 
     arch_svm->iopm = iopm;
     arch_svm->msrpm = msrpm;
+
+    if (! iopm || ! msrpm)
+        return 1;
 
     vmcb->iopm_base_pa = (u64) virt_to_maddr(iopm);
     vmcb->msrpm_base_pa = (u64) virt_to_maddr(msrpm);

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

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