ia64/xen-unstable

changeset 10112:33b2ae024663

Merged.
author emellor@leeni.uk.xensource.com
date Fri May 19 16:21:49 2006 +0100 (2006-05-19)
parents ea609f28ec01 d714f923b7cf
children 224e9878c6d4
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri May 19 16:21:43 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Fri May 19 16:21:49 2006 +0100
     1.3 @@ -1045,8 +1045,6 @@ static void network_connect(struct net_d
     1.4  	notify_remote_via_irq(np->irq);
     1.5  	network_tx_buf_gc(dev);
     1.6  
     1.7 -	network_maybe_wake_tx(dev);
     1.8 -
     1.9  	spin_unlock(&np->rx_lock);
    1.10  	spin_unlock_irq(&np->tx_lock);
    1.11  }
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri May 19 16:21:43 2006 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri May 19 16:21:49 2006 +0100
     2.3 @@ -1264,7 +1264,7 @@ class XendDomainInfo:
     2.4              m = self.image.getDomainMemory(self.info['memory'] * 1024)
     2.5              balloon.free(m)
     2.6              xc.domain_setmaxmem(self.domid, m)
     2.7 -            xc.domain_memory_increase_reservation(self.domid, m, 0, 0)
     2.8 +            xc.domain_memory_increase_reservation(self.domid, self.info['memory'] * 1024, 0, 0)
     2.9  
    2.10              self.createChannels()
    2.11  
     3.1 --- a/tools/python/xen/xend/image.py	Fri May 19 16:21:43 2006 +0100
     3.2 +++ b/tools/python/xen/xend/image.py	Fri May 19 16:21:49 2006 +0100
     3.3 @@ -19,6 +19,7 @@
     3.4  
     3.5  import os, string
     3.6  import re
     3.7 +import math
     3.8  
     3.9  import xen.lowlevel.xc
    3.10  from xen.xend import sxp
    3.11 @@ -141,11 +142,13 @@ class ImageHandler:
    3.12                            % (self.ostype, self.vm.getDomid(), str(result)))
    3.13  
    3.14  
    3.15 -    def getDomainMemory(self, mem):
    3.16 +    def getDomainMemory(self, mem_kb):
    3.17          """@return The memory required, in KiB, by the domain to store the
    3.18 -        given amount, also in KiB.  This is normally just mem, but HVM domains
    3.19 -        have overheads to account for."""
    3.20 -        return mem
    3.21 +        given amount, also in KiB.  This is normally just mem, but if HVM is
    3.22 +        supported, keep a little extra free."""
    3.23 +        if 'hvm' in xc.xeninfo()['xen_caps']:
    3.24 +            mem_kb += 4*1024;
    3.25 +        return mem_kb
    3.26  
    3.27      def buildDomain(self):
    3.28          """Build the domain. Define in subclass."""
    3.29 @@ -377,15 +380,20 @@ class HVMImageHandler(ImageHandler):
    3.30          os.waitpid(self.pid, 0)
    3.31          self.pid = 0
    3.32  
    3.33 -    def getDomainMemory(self, mem):
    3.34 +    def getDomainMemory(self, mem_kb):
    3.35          """@see ImageHandler.getDomainMemory"""
    3.36 -        page_kb = 4
    3.37 -        extra_pages = 0
    3.38          if os.uname()[4] == 'ia64':
    3.39              page_kb = 16
    3.40              # ROM size for guest firmware, ioreq page and xenstore page
    3.41              extra_pages = 1024 + 2
    3.42 -        return mem + extra_pages * page_kb
    3.43 +        else:
    3.44 +            page_kb = 4
    3.45 +            # This was derived emperically:
    3.46 +            #   2.4 MB overhead per 1024 MB RAM + 8 MB constant
    3.47 +            #   + 4 to avoid low-memory condition
    3.48 +            extra_mb = (2.4/1024) * (mem_kb/1024.0) + 12;
    3.49 +            extra_pages = int( math.ceil( extra_mb*1024 / page_kb ))
    3.50 +        return mem_kb + extra_pages * page_kb
    3.51  
    3.52      def register_shutdown_watch(self):
    3.53          """ add xen store watch on control/shutdown """
     4.1 --- a/tools/xm-test/tests/network/03_network_local_tcp_pos.py	Fri May 19 16:21:43 2006 +0100
     4.2 +++ b/tools/xm-test/tests/network/03_network_local_tcp_pos.py	Fri May 19 16:21:49 2006 +0100
     4.3 @@ -44,7 +44,7 @@ try:
     4.4      lofails=""
     4.5      for size in trysizes:
     4.6          out = console.runCmd("hping2 127.0.0.1 -E /dev/urandom -q -c 20 " 
     4.7 -              + "--fast -d " + str(size))
     4.8 +              + "--fast -d " + str(size) + " -N " + str(size))
     4.9          if out["return"]:
    4.10              lofails += " " + str(size)
    4.11  
    4.12 @@ -54,7 +54,7 @@ try:
    4.13      ip = netdev.getNetDevIP()
    4.14      for size in trysizes:
    4.15          out = console.runCmd("hping2 " + ip + " -E /dev/urandom -q -c 20 "
    4.16 -              + "--fast -d "+ str(size))
    4.17 +              + "--fast -d "+ str(size) + " -N " + str(size))
    4.18          if out["return"]:
    4.19              eth0fails += " " + str(size) 
    4.20  except ConsoleError, e:
     5.1 --- a/tools/xm-test/tests/network/04_network_local_udp_pos.py	Fri May 19 16:21:43 2006 +0100
     5.2 +++ b/tools/xm-test/tests/network/04_network_local_udp_pos.py	Fri May 19 16:21:49 2006 +0100
     5.3 @@ -43,7 +43,7 @@ try:
     5.4      lofails=""
     5.5      for size in trysizes:
     5.6          out = console.runCmd("hping2 127.0.0.1 -E /dev/urandom -2 -q -c 20 "
     5.7 -              + "--fast -d " + str(size))
     5.8 +              + "--fast -d " + str(size) + " -N " + str(size))
     5.9          if out["return"]:
    5.10              lofails += " " + str(size)
    5.11              print out["output"]
    5.12 @@ -54,7 +54,7 @@ try:
    5.13      ip = netdev.getNetDevIP()
    5.14      for size in trysizes:
    5.15          out = console.runCmd("hping2 " + ip + " -E /dev/urandom -2 -q -c 20 "
    5.16 -              + "--fast -d " + str(size))
    5.17 +              + "--fast -d " + str(size) + " -N " + str(size))
    5.18          if out["return"]:
    5.19              eth0fails += " " + str(size) 
    5.20              print out["output"]
     6.1 --- a/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py	Fri May 19 16:21:43 2006 +0100
     6.2 +++ b/tools/xm-test/tests/network/06_network_dom0_tcp_pos.py	Fri May 19 16:21:49 2006 +0100
     6.3 @@ -44,7 +44,7 @@ try:
     6.4      dom0ip = netdev.getDom0AliasIP()
     6.5      for size in trysizes:
     6.6          out = console.runCmd("hping2 " + dom0ip + " -E /dev/urandom -q -c 20 "
     6.7 -              + "--fast -d " + str(size))
     6.8 +              + "--fast -d " + str(size) + " -N " + str(size))
     6.9          if out["return"]:
    6.10              fails += " " + str(size) 
    6.11              print out["output"]
     7.1 --- a/tools/xm-test/tests/network/07_network_dom0_udp_pos.py	Fri May 19 16:21:43 2006 +0100
     7.2 +++ b/tools/xm-test/tests/network/07_network_dom0_udp_pos.py	Fri May 19 16:21:49 2006 +0100
     7.3 @@ -43,7 +43,7 @@ try:
     7.4      dom0ip = netdev.getDom0AliasIP()
     7.5      for size in trysizes:
     7.6          out = console.runCmd("hping2 " + dom0ip + " -E /dev/urandom -2 -q -c 20"
     7.7 -             + " --fast -d " + str(size))
     7.8 +             + " --fast -d " + str(size) + " -N " + str(size))
     7.9          if out["return"]:
    7.10              fails += " " + str(size) 
    7.11              print out["output"]
     8.1 --- a/tools/xm-test/tests/network/12_network_domU_tcp_pos.py	Fri May 19 16:21:43 2006 +0100
     8.2 +++ b/tools/xm-test/tests/network/12_network_domU_tcp_pos.py	Fri May 19 16:21:49 2006 +0100
     8.3 @@ -50,7 +50,7 @@ try:
     8.4      ip2 = dst_netdev.getNetDevIP()
     8.5      for size in pingsizes:
     8.6          out = src_console.runCmd("hping2 " + ip2 + " -E /dev/urandom -q -c 20 "
     8.7 -              + "--fast -d " + str(size))
     8.8 +              + "--fast -d " + str(size) + " -N " + str(size))
     8.9          if out["return"]:
    8.10              fails += " " + str(size) 
    8.11              print out["output"]
     9.1 --- a/tools/xm-test/tests/network/13_network_domU_udp_pos.py	Fri May 19 16:21:43 2006 +0100
     9.2 +++ b/tools/xm-test/tests/network/13_network_domU_udp_pos.py	Fri May 19 16:21:49 2006 +0100
     9.3 @@ -50,7 +50,7 @@ try:
     9.4      ip2 = dst_netdev.getNetDevIP()
     9.5      for size in pingsizes:
     9.6          out = src_console.runCmd("hping2 " + ip2 + " -E /dev/urandom -2 -q "
     9.7 -              + "-c 20 --fast -d " + str(size))
     9.8 +              + "-c 20 --fast -d " + str(size) + " -N " + str(size))
     9.9          if out["return"]:
    9.10              fails += " " + str(size) 
    9.11              print out["output"]
    10.1 --- a/xen/arch/x86/hvm/hvm.c	Fri May 19 16:21:43 2006 +0100
    10.2 +++ b/xen/arch/x86/hvm/hvm.c	Fri May 19 16:21:49 2006 +0100
    10.3 @@ -189,7 +189,11 @@ void hvm_setup_platform(struct domain* d
    10.4      if ( !hvm_guest(current) || (current->vcpu_id != 0) )
    10.5          return;
    10.6  
    10.7 -    shadow_direct_map_init(d);
    10.8 +    if ( shadow_direct_map_init(d) == 0 )
    10.9 +    {
   10.10 +        printk("Can not allocate shadow direct map for HVM domain.\n");
   10.11 +        domain_crash_synchronous();
   10.12 +    }
   10.13  
   10.14      hvm_map_io_shared_page(d);
   10.15      hvm_get_info(d);
    11.1 --- a/xen/arch/x86/hvm/svm/svm.c	Fri May 19 16:21:43 2006 +0100
    11.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Fri May 19 16:21:49 2006 +0100
    11.3 @@ -458,6 +458,9 @@ int start_svm(void)
    11.4      
    11.5      if (!(test_bit(X86_FEATURE_SVME, &boot_cpu_data.x86_capability)))
    11.6          return 0;
    11.7 +    svm_globals[cpu].hsa = alloc_host_save_area();
    11.8 +    if (! svm_globals[cpu].hsa)
    11.9 +        return 0;
   11.10      
   11.11      rdmsr(MSR_EFER, eax, edx);
   11.12      eax |= EFER_SVME;
   11.13 @@ -466,7 +469,6 @@ int start_svm(void)
   11.14      printk("AMD SVM Extension is enabled for cpu %d.\n", cpu );
   11.15  
   11.16      /* Initialize the HSA for this core */
   11.17 -    svm_globals[cpu].hsa = alloc_host_save_area();
   11.18      phys_hsa = (u64) virt_to_maddr( svm_globals[cpu].hsa ); 
   11.19      phys_hsa_lo = (u32) phys_hsa;
   11.20      phys_hsa_hi = (u32) (phys_hsa >> 32);    
    12.1 --- a/xen/arch/x86/hvm/svm/vmcb.c	Fri May 19 16:21:43 2006 +0100
    12.2 +++ b/xen/arch/x86/hvm/svm/vmcb.c	Fri May 19 16:21:49 2006 +0100
    12.3 @@ -139,18 +139,21 @@ static int construct_vmcb_controls(struc
    12.4  
    12.5      /* The following is for I/O and MSR permision map */
    12.6      iopm = alloc_xenheap_pages(get_order_from_bytes(IOPM_SIZE));
    12.7 -
    12.8 -    ASSERT(iopm);
    12.9 -    memset(iopm, 0xff, IOPM_SIZE);
   12.10 -    clear_bit(PC_DEBUG_PORT, iopm);
   12.11 +    if (iopm)
   12.12 +    {
   12.13 +        memset(iopm, 0xff, IOPM_SIZE);
   12.14 +        clear_bit(PC_DEBUG_PORT, iopm);
   12.15 +    }
   12.16      msrpm = alloc_xenheap_pages(get_order_from_bytes(MSRPM_SIZE));
   12.17 -
   12.18 -    ASSERT(msrpm);
   12.19 -    memset(msrpm, 0xff, MSRPM_SIZE);
   12.20 +    if (msrpm)
   12.21 +        memset(msrpm, 0xff, MSRPM_SIZE);
   12.22  
   12.23      arch_svm->iopm = iopm;
   12.24      arch_svm->msrpm = msrpm;
   12.25  
   12.26 +    if (! iopm || ! msrpm)
   12.27 +        return 1;
   12.28 +
   12.29      vmcb->iopm_base_pa = (u64) virt_to_maddr(iopm);
   12.30      vmcb->msrpm_base_pa = (u64) virt_to_maddr(msrpm);
   12.31