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-ia64-devel

[Xen-devel] [PATCH 1/2][IA64] configure VHPT size per domain: common par

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/2][IA64] configure VHPT size per domain: common part
From: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Date: Fri, 19 Oct 2007 14:52:25 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Alex Williamson <alex.williamson@xxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 18 Oct 2007 22:54:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C33A431D.16E8A%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7kzlyjtw98.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx> <C33A431D.16E8A%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
common part.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

# HG changeset patch
# User Kouya Shimura <kouya@xxxxxxxxxxxxxx>
# Date 1192770562 -32400
# Node ID 4b8752eccee77c2a3ef20f58bcc1c935dd80865a
# Parent  b4278beaf3549f410a5a6086dbd8af93c495aeac
common part.

diff -r b4278beaf354 -r 4b8752eccee7 tools/examples/xmexample.vti
--- a/tools/examples/xmexample.vti      Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/examples/xmexample.vti      Fri Oct 19 14:09:22 2007 +0900
@@ -34,6 +34,10 @@ name = "ExampleVTIDomain"
 #cpus = ""         # leave to Xen to pick
 #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.
diff -r b4278beaf354 -r 4b8752eccee7 tools/libxc/xc_dom_ia64.c
--- a/tools/libxc/xc_dom_ia64.c Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/libxc/xc_dom_ia64.c Fri Oct 19 14:09:22 2007 +0900
@@ -260,6 +260,7 @@ int arch_setup_bootearly(struct xc_dom_i
     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 -r b4278beaf354 -r 4b8752eccee7 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Fri Oct 19 14:09:22 2007 +0900
@@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 
                         '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 -r b4278beaf354 -r 4b8752eccee7 tools/python/xen/xend/XendConstants.py
--- a/tools/python/xen/xend/XendConstants.py    Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/python/xen/xend/XendConstants.py    Fri Oct 19 14:09:22 2007 +0900
@@ -43,6 +43,8 @@ HVM_PARAM_PAE_ENABLED  = 4
 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 -r b4278beaf354 -r 4b8752eccee7 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/python/xen/xend/image.py    Fri Oct 19 14:09:22 2007 +0900
@@ -197,6 +197,7 @@ class LinuxImageHandler(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):
@@ -517,6 +526,16 @@ class IA64_HVM_ImageHandler(HVMImageHand
     def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
         # 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):
 
@@ -562,7 +581,7 @@ _handlers = {
         "linux": PPC_LinuxImageHandler,
     },
     "ia64": {
-        "linux": LinuxImageHandler,
+        "linux": IA64_Linux_ImageHandler,
         "hvm": IA64_HVM_ImageHandler,
     },
     "x86": {
diff -r b4278beaf354 -r 4b8752eccee7 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/python/xen/xm/create.py     Fri Oct 19 14:09:22 2007 +0900
@@ -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 -r b4278beaf354 -r 4b8752eccee7 tools/python/xen/xm/xenapi_create.py
--- a/tools/python/xen/xm/xenapi_create.py      Wed Oct 17 13:12:03 2007 +0100
+++ b/tools/python/xen/xm/xenapi_create.py      Fri Oct 19 14:09:22 2007 +0900
@@ -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 -r b4278beaf354 -r 4b8752eccee7 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h       Wed Oct 17 13:12:03 2007 +0100
+++ b/xen/include/public/domctl.h       Fri Oct 19 14:09:22 2007 +0900
@@ -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 -r b4278beaf354 -r 4b8752eccee7 xen/include/public/hvm/params.h
--- a/xen/include/public/hvm/params.h   Wed Oct 17 13:12:03 2007 +0100
+++ b/xen/include/public/hvm/params.h   Fri Oct 19 14:09:22 2007 +0900
@@ -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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel