diff options
author | Keir Fraser <keir@xensource.com> | 2007-10-19 09:27:55 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-10-19 09:27:55 +0100 |
commit | 753df0d608feee79e9e0f0e6c8e44e44e886043d (patch) | |
tree | 6da90a6330f1a9a77d7c8ba3dc673db7042269db | |
parent | c5b3b0a7f074d5df7cfd2bf0270d6d633eb99161 (diff) | |
download | xen-753df0d608feee79e9e0f0e6c8e44e44e886043d.tar.gz xen-753df0d608feee79e9e0f0e6c8e44e44e886043d.tar.bz2 xen-753df0d608feee79e9e0f0e6c8e44e44e886043d.zip |
ia64: configure VHPT size per domain: common part
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
-rw-r--r-- | tools/examples/xmexample.vti | 4 | ||||
-rw-r--r-- | tools/libxc/xc_dom_ia64.c | 1 | ||||
-rw-r--r-- | tools/python/xen/xend/XendConfig.py | 2 | ||||
-rw-r--r-- | tools/python/xen/xend/XendConstants.py | 2 | ||||
-rw-r--r-- | tools/python/xen/xend/image.py | 23 | ||||
-rw-r--r-- | tools/python/xen/xm/create.py | 9 | ||||
-rw-r--r-- | tools/python/xen/xm/xenapi_create.py | 2 | ||||
-rw-r--r-- | xen/include/public/domctl.h | 1 | ||||
-rw-r--r-- | xen/include/public/hvm/params.h | 3 |
9 files changed, 41 insertions, 6 deletions
diff --git a/tools/examples/xmexample.vti b/tools/examples/xmexample.vti index 05a7d0866f..f38d363918 100644 --- a/tools/examples/xmexample.vti +++ b/tools/examples/xmexample.vti @@ -35,6 +35,10 @@ name = "ExampleVTIDomain" #cpus = "0" # all vcpus run on CPU0 #cpus = "0-3,5,^1" # run on cpus 0,2,3,5 +# Log2 of VHPT size, default=23 (8MB), minimum=15 (32KB). +# In Windows OS, smaller size shows better performance. +#vhpt = 23 + # Optionally define mac and/or bridge for the network interfaces. # Random MACs are assigned if not given. #vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ] diff --git a/tools/libxc/xc_dom_ia64.c b/tools/libxc/xc_dom_ia64.c index dfe27e6917..1211eead52 100644 --- a/tools/libxc/xc_dom_ia64.c +++ b/tools/libxc/xc_dom_ia64.c @@ -260,6 +260,7 @@ int arch_setup_bootearly(struct xc_dom_image *dom) domctl.u.arch_setup.bp = (dom->start_info_pfn << PAGE_SHIFT) + sizeof(start_info_t); domctl.u.arch_setup.maxmem = dom->total_pages << PAGE_SHIFT; + domctl.u.arch_setup.vhpt_size_log2 = dom->flags; rc = do_domctl(dom->guest_xc, &domctl); return rc; } diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index aacf2c041d..2ca6288279 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display', 'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl', 'soundhw','stdvga', 'usb', 'usbdevice', 'vnc', 'vncconsole', 'vncdisplay', 'vnclisten', - 'vncpasswd', 'vncunused', 'xauthority', 'pci'] + 'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt'] # Xen API console 'other_config' keys. XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten', diff --git a/tools/python/xen/xend/XendConstants.py b/tools/python/xen/xend/XendConstants.py index 15dcb67b1f..751e4487f6 100644 --- a/tools/python/xen/xend/XendConstants.py +++ b/tools/python/xen/xend/XendConstants.py @@ -43,6 +43,8 @@ HVM_PARAM_STORE_EVTCHN = 2 HVM_PARAM_PAE_ENABLED = 4 HVM_PARAM_IOREQ_PFN = 5 HVM_PARAM_BUFIOREQ_PFN = 6 +HVM_PARAM_NVRAM_FD = 7 +HVM_PARAM_VHPT_SIZE = 8 restart_modes = [ "restart", diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index a537dd675c..0cd8fa4a07 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -197,6 +197,7 @@ class ImageHandler: class LinuxImageHandler(ImageHandler): ostype = "linux" + flags = 0 def buildDomain(self): store_evtchn = self.vm.getStorePort() @@ -213,6 +214,8 @@ class LinuxImageHandler(ImageHandler): log.debug("ramdisk = %s", self.ramdisk) log.debug("vcpus = %d", self.vm.getVCpuCount()) log.debug("features = %s", self.vm.getFeatures()) + if arch.type == "ia64": + log.debug("vhpt = %d", self.flags) return xc.linux_build(domid = self.vm.getDomid(), memsize = mem_mb, @@ -221,7 +224,8 @@ class LinuxImageHandler(ImageHandler): console_evtchn = console_evtchn, cmdline = self.cmdline, ramdisk = self.ramdisk, - features = self.vm.getFeatures()) + features = self.vm.getFeatures(), + flags = self.flags) class PPC_LinuxImageHandler(LinuxImageHandler): @@ -500,8 +504,13 @@ class HVMImageHandler(ImageHandler): class IA64_HVM_ImageHandler(HVMImageHandler): + def configure(self, vmConfig): + HVMImageHandler.configure(self, vmConfig) + self.vhpt = int(vmConfig['platform'].get('vhpt', 0)) + def buildDomain(self): xc.nvram_init(self.vm.getName(), self.vm.getDomid()) + xc.hvm_set_param(self.vm.getDomid(), HVM_PARAM_VHPT_SIZE, self.vhpt) return HVMImageHandler.buildDomain(self) def getRequiredAvailableMemory(self, mem_kb): @@ -518,6 +527,16 @@ class IA64_HVM_ImageHandler(HVMImageHandler): # Explicit shadow memory is not a concept return 0 +class IA64_Linux_ImageHandler(LinuxImageHandler): + + def configure(self, vmConfig): + LinuxImageHandler.configure(self, vmConfig) + self.vhpt = int(vmConfig['platform'].get('vhpt', 0)) + + def buildDomain(self): + self.flags = self.vhpt + return LinuxImageHandler.buildDomain(self) + class X86_HVM_ImageHandler(HVMImageHandler): def configure(self, vmConfig): @@ -562,7 +581,7 @@ _handlers = { "linux": PPC_LinuxImageHandler, }, "ia64": { - "linux": LinuxImageHandler, + "linux": IA64_Linux_ImageHandler, "hvm": IA64_HVM_ImageHandler, }, "x86": { diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index bcfd0c73ec..67a3c9418a 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -210,6 +210,10 @@ gopts.var('vcpu_avail', val='VCPUS', fn=set_long, default=None, use="Bitmask for virtual CPUs to make available immediately.") +gopts.var('vhpt', val='VHPT', + fn=set_int, default=0, + use="Log2 of domain VHPT size for IA64.") + gopts.var('cpu_cap', val='CAP', fn=set_int, default=None, use="""Set the maximum amount of cpu. @@ -555,7 +559,10 @@ def configure_image(vals): if vals.builder == 'hvm': configure_hvm(config_image, vals) - + + if vals.vhpt != 0: + config_image.append(['vhpt', vals.vhpt]) + return config_image def configure_disks(config_devs, vals): diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py index ac4408f4fe..8140ca35c5 100644 --- a/tools/python/xen/xm/xenapi_create.py +++ b/tools/python/xen/xm/xenapi_create.py @@ -818,7 +818,7 @@ class sxp2xml: def extract_platform(self, image, document): - platform_keys = ['acpi', 'apic', 'pae'] + platform_keys = ['acpi', 'apic', 'pae', 'vhpt'] def extract_platform_key(key): platform = document.createElement("platform") diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 4db3053afa..318b119958 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -380,6 +380,7 @@ typedef struct xen_domctl_arch_setup { uint64_aligned_t maxmem; /* Highest memory address for MDT. */ uint64_aligned_t xsi_va; /* Xen shared_info area virtual address. */ uint32_t hypercall_imm; /* Break imm for Xen hypercalls. */ + int8_t vhpt_size_log2; /* Log2 of VHPT size. */ #endif } xen_domctl_arch_setup_t; DEFINE_XEN_GUEST_HANDLE(xen_domctl_arch_setup_t); diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h index 9657654870..548b0dc63b 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -52,7 +52,8 @@ #ifdef __ia64__ #define HVM_PARAM_NVRAM_FD 7 -#define HVM_NR_PARAMS 8 +#define HVM_PARAM_VHPT_SIZE 8 +#define HVM_NR_PARAMS 9 #else #define HVM_NR_PARAMS 7 #endif |