ia64/xen-unstable

changeset 16157:c5530fbbe9d0

ia64: configure VHPT size per domain: common part
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Keir Fraser <keir@xensource.com>
date Fri Oct 19 09:27:55 2007 +0100 (2007-10-19)
parents 218f054a3587
children 3ad0080ad9b5
files tools/examples/xmexample.vti tools/libxc/xc_dom_ia64.c tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendConstants.py tools/python/xen/xend/image.py tools/python/xen/xm/create.py tools/python/xen/xm/xenapi_create.py xen/include/public/domctl.h xen/include/public/hvm/params.h
line diff
     1.1 --- a/tools/examples/xmexample.vti	Thu Oct 18 16:17:53 2007 +0100
     1.2 +++ b/tools/examples/xmexample.vti	Fri Oct 19 09:27:55 2007 +0100
     1.3 @@ -35,6 +35,10 @@ name = "ExampleVTIDomain"
     1.4  #cpus = "0"        # all vcpus run on CPU0
     1.5  #cpus = "0-3,5,^1" # run on cpus 0,2,3,5
     1.6  
     1.7 +# Log2 of VHPT size, default=23 (8MB), minimum=15 (32KB).
     1.8 +# In Windows OS, smaller size shows better performance.
     1.9 +#vhpt = 23
    1.10 +
    1.11  # Optionally define mac and/or bridge for the network interfaces.
    1.12  # Random MACs are assigned if not given.
    1.13  #vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
     2.1 --- a/tools/libxc/xc_dom_ia64.c	Thu Oct 18 16:17:53 2007 +0100
     2.2 +++ b/tools/libxc/xc_dom_ia64.c	Fri Oct 19 09:27:55 2007 +0100
     2.3 @@ -260,6 +260,7 @@ int arch_setup_bootearly(struct xc_dom_i
     2.4      domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT)
     2.5          + sizeof(start_info_t);
     2.6      domctl.u.arch_setup.maxmem = dom->total_pages << PAGE_SHIFT;
     2.7 +    domctl.u.arch_setup.vhpt_size_log2 = dom->flags;
     2.8      rc = do_domctl(dom->guest_xc, &domctl);
     2.9      return rc;
    2.10  }
     3.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Oct 18 16:17:53 2007 +0100
     3.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Oct 19 09:27:55 2007 +0100
     3.3 @@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 
     3.4                          'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
     3.5                          'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
     3.6                          'vncconsole', 'vncdisplay', 'vnclisten',
     3.7 -                        'vncpasswd', 'vncunused', 'xauthority', 'pci']
     3.8 +                        'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt']
     3.9  
    3.10  # Xen API console 'other_config' keys.
    3.11  XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
     4.1 --- a/tools/python/xen/xend/XendConstants.py	Thu Oct 18 16:17:53 2007 +0100
     4.2 +++ b/tools/python/xen/xend/XendConstants.py	Fri Oct 19 09:27:55 2007 +0100
     4.3 @@ -43,6 +43,8 @@ HVM_PARAM_STORE_EVTCHN = 2
     4.4  HVM_PARAM_PAE_ENABLED  = 4
     4.5  HVM_PARAM_IOREQ_PFN    = 5
     4.6  HVM_PARAM_BUFIOREQ_PFN = 6
     4.7 +HVM_PARAM_NVRAM_FD     = 7
     4.8 +HVM_PARAM_VHPT_SIZE    = 8
     4.9  
    4.10  restart_modes = [
    4.11      "restart",
     5.1 --- a/tools/python/xen/xend/image.py	Thu Oct 18 16:17:53 2007 +0100
     5.2 +++ b/tools/python/xen/xend/image.py	Fri Oct 19 09:27:55 2007 +0100
     5.3 @@ -197,6 +197,7 @@ class ImageHandler:
     5.4  class LinuxImageHandler(ImageHandler):
     5.5  
     5.6      ostype = "linux"
     5.7 +    flags = 0
     5.8  
     5.9      def buildDomain(self):
    5.10          store_evtchn = self.vm.getStorePort()
    5.11 @@ -213,6 +214,8 @@ class LinuxImageHandler(ImageHandler):
    5.12          log.debug("ramdisk        = %s", self.ramdisk)
    5.13          log.debug("vcpus          = %d", self.vm.getVCpuCount())
    5.14          log.debug("features       = %s", self.vm.getFeatures())
    5.15 +        if arch.type == "ia64":
    5.16 +            log.debug("vhpt          = %d", self.flags)
    5.17  
    5.18          return xc.linux_build(domid          = self.vm.getDomid(),
    5.19                                memsize        = mem_mb,
    5.20 @@ -221,7 +224,8 @@ class LinuxImageHandler(ImageHandler):
    5.21                                console_evtchn = console_evtchn,
    5.22                                cmdline        = self.cmdline,
    5.23                                ramdisk        = self.ramdisk,
    5.24 -                              features       = self.vm.getFeatures())
    5.25 +                              features       = self.vm.getFeatures(),
    5.26 +                              flags          = self.flags)
    5.27  
    5.28  class PPC_LinuxImageHandler(LinuxImageHandler):
    5.29  
    5.30 @@ -500,8 +504,13 @@ class HVMImageHandler(ImageHandler):
    5.31  
    5.32  class IA64_HVM_ImageHandler(HVMImageHandler):
    5.33  
    5.34 +    def configure(self, vmConfig):
    5.35 +        HVMImageHandler.configure(self, vmConfig)
    5.36 +        self.vhpt = int(vmConfig['platform'].get('vhpt',  0))
    5.37 +
    5.38      def buildDomain(self):
    5.39          xc.nvram_init(self.vm.getName(), self.vm.getDomid())
    5.40 +        xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_VHPT_SIZE, self.vhpt)
    5.41          return HVMImageHandler.buildDomain(self)
    5.42  
    5.43      def getRequiredAvailableMemory(self, mem_kb):
    5.44 @@ -518,6 +527,16 @@ class IA64_HVM_ImageHandler(HVMImageHand
    5.45          # Explicit shadow memory is not a concept 
    5.46          return 0
    5.47  
    5.48 +class IA64_Linux_ImageHandler(LinuxImageHandler):
    5.49 +
    5.50 +    def configure(self, vmConfig):
    5.51 +        LinuxImageHandler.configure(self, vmConfig)
    5.52 +        self.vhpt = int(vmConfig['platform'].get('vhpt',  0))
    5.53 +
    5.54 +    def buildDomain(self):
    5.55 +        self.flags = self.vhpt
    5.56 +        return LinuxImageHandler.buildDomain(self)
    5.57 +
    5.58  class X86_HVM_ImageHandler(HVMImageHandler):
    5.59  
    5.60      def configure(self, vmConfig):
    5.61 @@ -562,7 +581,7 @@ class X86_Linux_ImageHandler(LinuxImageH
    5.62          "linux": PPC_LinuxImageHandler,
    5.63      },
    5.64      "ia64": {
    5.65 -        "linux": LinuxImageHandler,
    5.66 +        "linux": IA64_Linux_ImageHandler,
    5.67          "hvm": IA64_HVM_ImageHandler,
    5.68      },
    5.69      "x86": {
     6.1 --- a/tools/python/xen/xm/create.py	Thu Oct 18 16:17:53 2007 +0100
     6.2 +++ b/tools/python/xen/xm/create.py	Fri Oct 19 09:27:55 2007 +0100
     6.3 @@ -210,6 +210,10 @@ gopts.var('vcpu_avail', val='VCPUS',
     6.4            fn=set_long, default=None,
     6.5            use="Bitmask for virtual CPUs to make available immediately.")
     6.6  
     6.7 +gopts.var('vhpt', val='VHPT',
     6.8 +          fn=set_int, default=0,
     6.9 +          use="Log2 of domain VHPT size for IA64.")
    6.10 +
    6.11  gopts.var('cpu_cap', val='CAP',
    6.12            fn=set_int, default=None,
    6.13            use="""Set the maximum amount of cpu.
    6.14 @@ -555,7 +559,10 @@ def configure_image(vals):
    6.15  
    6.16      if vals.builder == 'hvm':
    6.17          configure_hvm(config_image, vals) 
    6.18 -       
    6.19 +
    6.20 +    if vals.vhpt != 0:
    6.21 +        config_image.append(['vhpt', vals.vhpt])
    6.22 +
    6.23      return config_image
    6.24      
    6.25  def configure_disks(config_devs, vals):
     7.1 --- a/tools/python/xen/xm/xenapi_create.py	Thu Oct 18 16:17:53 2007 +0100
     7.2 +++ b/tools/python/xen/xm/xenapi_create.py	Fri Oct 19 09:27:55 2007 +0100
     7.3 @@ -818,7 +818,7 @@ class sxp2xml:
     7.4  
     7.5  
     7.6      def extract_platform(self, image, document):
     7.7 -        platform_keys = ['acpi', 'apic', 'pae']
     7.8 +        platform_keys = ['acpi', 'apic', 'pae', 'vhpt']
     7.9  
    7.10          def extract_platform_key(key):
    7.11              platform = document.createElement("platform")
     8.1 --- a/xen/include/public/domctl.h	Thu Oct 18 16:17:53 2007 +0100
     8.2 +++ b/xen/include/public/domctl.h	Fri Oct 19 09:27:55 2007 +0100
     8.3 @@ -380,6 +380,7 @@ typedef struct xen_domctl_arch_setup {
     8.4      uint64_aligned_t maxmem; /* Highest memory address for MDT.  */
     8.5      uint64_aligned_t xsi_va; /* Xen shared_info area virtual address.  */
     8.6      uint32_t hypercall_imm;  /* Break imm for Xen hypercalls.  */
     8.7 +    int8_t vhpt_size_log2;   /* Log2 of VHPT size. */
     8.8  #endif
     8.9  } xen_domctl_arch_setup_t;
    8.10  DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t);
     9.1 --- a/xen/include/public/hvm/params.h	Thu Oct 18 16:17:53 2007 +0100
     9.2 +++ b/xen/include/public/hvm/params.h	Fri Oct 19 09:27:55 2007 +0100
     9.3 @@ -52,7 +52,8 @@
     9.4  
     9.5  #ifdef __ia64__
     9.6  #define HVM_PARAM_NVRAM_FD     7
     9.7 -#define HVM_NR_PARAMS          8
     9.8 +#define HVM_PARAM_VHPT_SIZE    8
     9.9 +#define HVM_NR_PARAMS          9
    9.10  #else
    9.11  #define HVM_NR_PARAMS          7
    9.12  #endif