[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Add PAE option to HVM config file.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 991c4d62d3928720f690ebd27aa1e5cd606d0e7c
# Parent  2401f414d1ad5109e8ac5cf7636ec986b1f94fea
Add PAE option to HVM config file.
This option is disabled by default, only if we have "pae=1" in config
file, cpuid will return PAE available to VMX guest, and Linux PAE VMX
guest need this. Once the PAE VMX guest support is stable, we will
enable it by default.

Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>
Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>

diff -r 2401f414d1ad -r 991c4d62d392 tools/examples/xmexample.hvm
--- a/tools/examples/xmexample.hvm      Tue Feb 21 17:13:30 2006
+++ b/tools/examples/xmexample.hvm      Tue Feb 21 17:15:49 2006
@@ -29,6 +29,9 @@
 #-----------------------------------------------------------------------------
 # the number of cpus guest platform has, default=1
 #vcpus=1
+
+# enable/disable HVM guest PAE, default=0 (disabled)
+#pae=0
 
 # enable/disable HVM guest ACPI, default=0 (disabled)
 #acpi=0
diff -r 2401f414d1ad -r 991c4d62d392 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Tue Feb 21 17:13:30 2006
+++ b/tools/libxc/xc_hvm_build.c        Tue Feb 21 17:15:49 2006
@@ -137,7 +137,7 @@
  */
 static int set_hvm_info(int xc_handle, uint32_t dom,
                         unsigned long *pfn_list, unsigned int vcpus,
-                        unsigned int acpi, unsigned int apic)
+                        unsigned int pae, unsigned int acpi, unsigned int apic)
 {
     char *va_map;
     struct hvm_info_table *va_hvm;
@@ -159,6 +159,7 @@
     va_hvm->length       = sizeof(struct hvm_info_table);
     va_hvm->acpi_enabled = acpi;
     va_hvm->apic_enabled = apic;
+    va_hvm->pae_enabled  = pae;
     va_hvm->nr_vcpus     = vcpus;
 
     set_hvm_info_checksum(va_hvm);
@@ -176,7 +177,8 @@
                        unsigned long shared_info_frame,
                        unsigned int control_evtchn,
                        unsigned int vcpus,
-                      unsigned int acpi,
+                       unsigned int pae,
+                       unsigned int acpi,
                        unsigned int apic,
                        unsigned int store_evtchn,
                        unsigned long *store_mfn)
@@ -265,7 +267,7 @@
             goto error_out;
     }
 
-    if ( set_hvm_info(xc_handle, dom, page_array, vcpus, acpi, apic) ) {
+    if ( set_hvm_info(xc_handle, dom, page_array, vcpus, pae, acpi, apic) ) {
         fprintf(stderr, "Couldn't set hvm info for HVM guest.\n");
         goto error_out;
     }
@@ -345,7 +347,8 @@
                  const char *image_name,
                  unsigned int control_evtchn,
                  unsigned int vcpus,
-                unsigned int acpi,
+                 unsigned int pae,
+                 unsigned int acpi,
                  unsigned int apic,
                  unsigned int store_evtchn,
                  unsigned long *store_mfn)
@@ -400,7 +403,7 @@
     ctxt->flags = VGCF_HVM_GUEST;
     if ( setup_guest(xc_handle, domid, memsize, image, image_size, nr_pages,
                      ctxt, op.u.getdomaininfo.shared_info_frame, 
control_evtchn,
-                     vcpus, acpi, apic, store_evtchn, store_mfn) < 0)
+                     vcpus, pae, acpi, apic, store_evtchn, store_mfn) < 0)
     {
         ERROR("Error constructing guest OS");
         goto error_out;
diff -r 2401f414d1ad -r 991c4d62d392 tools/libxc/xc_ia64_stubs.c
--- a/tools/libxc/xc_ia64_stubs.c       Tue Feb 21 17:13:30 2006
+++ b/tools/libxc/xc_ia64_stubs.c       Tue Feb 21 17:15:49 2006
@@ -626,9 +626,10 @@
                  int memsize,
                  const char *image_name,
                  unsigned int control_evtchn,
-                 unsigned int lapic,
                  unsigned int vcpus,
+                 unsigned int pae,
                  unsigned int acpi,
+                 unsigned int apic,
                  unsigned int store_evtchn,
                  unsigned long *store_mfn)
 {
diff -r 2401f414d1ad -r 991c4d62d392 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h    Tue Feb 21 17:13:30 2006
+++ b/tools/libxc/xenguest.h    Tue Feb 21 17:15:49 2006
@@ -40,7 +40,7 @@
 int xc_linux_restore(int xc_handle, int io_fd, uint32_t dom, 
                      unsigned long nr_pfns, unsigned int store_evtchn, 
                      unsigned long *store_mfn, unsigned int console_evtchn,
-                    unsigned long *console_mfn);
+                     unsigned long *console_mfn);
 
 int xc_linux_build(int xc_handle,
                    uint32_t domid,
@@ -59,6 +59,7 @@
                  const char *image_name,
                  unsigned int control_evtchn,
                  unsigned int vcpus,
+                 unsigned int pae,
                  unsigned int acpi,
                  unsigned int apic,
                  unsigned int store_evtchn,
diff -r 2401f414d1ad -r 991c4d62d392 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Tue Feb 21 17:13:30 2006
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Feb 21 17:15:49 2006
@@ -366,20 +366,21 @@
     int control_evtchn, store_evtchn;
     int memsize;
     int vcpus = 1;
+    int pae  = 0;
     int acpi = 0;
     int apic = 0;
     unsigned long store_mfn = 0;
 
     static char *kwd_list[] = { "dom", "control_evtchn", "store_evtchn",
-                               "memsize", "image", "vcpus", "acpi", "apic",
+                               "memsize", "image", "vcpus", "pae", "acpi", 
"apic",
                                NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiisiii", kwd_list,
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiisiiii", kwd_list,
                                       &dom, &control_evtchn, &store_evtchn,
-                                     &memsize, &image, &vcpus, &acpi, &apic) )
+                                     &memsize, &image, &vcpus, &pae, &acpi, 
&apic) )
         return NULL;
 
     if ( xc_hvm_build(self->xc_handle, dom, memsize, image, control_evtchn,
-                     vcpus, acpi, apic, store_evtchn, &store_mfn) != 0 )
+                     vcpus, pae, acpi, apic, store_evtchn, &store_mfn) != 0 )
         return PyErr_SetFromErrno(xc_error);
 
     return Py_BuildValue("{s:i}", "store_mfn", store_mfn);
diff -r 2401f414d1ad -r 991c4d62d392 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Tue Feb 21 17:13:30 2006
+++ b/tools/python/xen/xend/image.py    Tue Feb 21 17:15:49 2006
@@ -191,8 +191,8 @@
         ImageHandler.configure(self, imageConfig, deviceConfig)
 
         info = xc.xeninfo()
-       if not 'hvm' in info['xen_caps']:
-           raise VmError("Not an HVM capable platform, we stop creating!")
+        if not 'hvm' in info['xen_caps']:
+            raise VmError("Not an HVM capable platform, we stop creating!")
 
         self.dmargs = self.parseDeviceModelArgs(imageConfig, deviceConfig)
         self.device_model = sxp.child_value(imageConfig, 'device_model')
@@ -210,6 +210,8 @@
 
         self.dmargs += self.configVNC(imageConfig)
 
+        self.pae  = int(sxp.child_value(imageConfig, 'pae', 0))
+
         self.acpi = int(sxp.child_value(imageConfig, 'acpi', 0))
         self.apic = int(sxp.child_value(imageConfig, 'apic', 0))
 
@@ -227,6 +229,7 @@
         log.debug("store_evtchn   = %d", store_evtchn)
         log.debug("memsize        = %d", self.vm.getMemoryTarget() / 1024)
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
+        log.debug("pae            = %d", self.pae)
         log.debug("acpi           = %d", self.acpi)
         log.debug("apic           = %d", self.apic)
 
@@ -238,6 +241,7 @@
                             store_evtchn   = store_evtchn,
                             memsize        = self.vm.getMemoryTarget() / 1024,
                             vcpus          = self.vm.getVCpuCount(),
+                            pae            = self.pae,
                             acpi           = self.acpi,
                             apic           = self.apic)
 
diff -r 2401f414d1ad -r 991c4d62d392 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Tue Feb 21 17:13:30 2006
+++ b/tools/python/xen/xm/create.py     Tue Feb 21 17:15:49 2006
@@ -160,6 +160,10 @@
 gopts.var('cpus', val='CPUS',
           fn=set_int, default=None,
           use="CPUS to run the domain on.")
+
+gopts.var('pae', val='PAE',
+          fn=set_int, default=0,
+          use="Disable or enable PAE of HVM domain.")
 
 gopts.var('acpi', val='ACPI',
           fn=set_int, default=0,
@@ -545,7 +549,7 @@
 def configure_hvm(config_image, vals):
     """Create the config for HVM devices.
     """
-    args = [ 'device_model', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
+    args = [ 'device_model', 'pae', 'vcpus', 'cdrom', 'boot', 'fda', 'fdb',
              'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'audio',
              'vnc', 'vncviewer', 'sdl', 'display', 'ne2000', 'acpi', 'apic',
              'xauthority' ]
diff -r 2401f414d1ad -r 991c4d62d392 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c    Tue Feb 21 17:13:30 2006
+++ b/xen/arch/x86/hvm/hvm.c    Tue Feb 21 17:15:49 2006
@@ -175,10 +175,12 @@
     if ( validate_hvm_info(t) ) {
         d->arch.hvm_domain.nr_vcpus = t->nr_vcpus;
         d->arch.hvm_domain.apic_enabled = t->apic_enabled;
+        d->arch.hvm_domain.pae_enabled = t->pae_enabled;
     } else {
         printk("Bad hvm info table\n");
         d->arch.hvm_domain.nr_vcpus = 1;
         d->arch.hvm_domain.apic_enabled = 0;
+        d->arch.hvm_domain.pae_enabled = 0;
     }
 
     unmap_domain_page(p);
diff -r 2401f414d1ad -r 991c4d62d392 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue Feb 21 17:13:30 2006
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Tue Feb 21 17:15:49 2006
@@ -662,19 +662,21 @@
 
     cpuid(input, &eax, &ebx, &ecx, &edx);
 
-    if (input == 1)
+    if ( input == 1 )
     {
         if ( hvm_apic_support(v->domain) &&
                 !vlapic_global_enabled((VLAPIC(v))) )
             clear_bit(X86_FEATURE_APIC, &edx);
 
 #if CONFIG_PAGING_LEVELS < 3
+        clear_bit(X86_FEATURE_PAE, &edx);
         clear_bit(X86_FEATURE_PSE, &edx);
-        clear_bit(X86_FEATURE_PAE, &edx);
         clear_bit(X86_FEATURE_PSE36, &edx);
 #else
         if ( v->domain->arch.ops->guest_paging_levels == PAGING_L2 )
         {
+            if ( !v->domain->arch.hvm_domain.pae_enabled )
+                clear_bit(X86_FEATURE_PAE, &edx);
             clear_bit(X86_FEATURE_PSE, &edx);
             clear_bit(X86_FEATURE_PSE36, &edx);
         }
diff -r 2401f414d1ad -r 991c4d62d392 xen/include/asm-x86/hvm/domain.h
--- a/xen/include/asm-x86/hvm/domain.h  Tue Feb 21 17:13:30 2006
+++ b/xen/include/asm-x86/hvm/domain.h  Tue Feb 21 17:15:49 2006
@@ -34,6 +34,7 @@
     unsigned long          shared_page_va;
     unsigned int           nr_vcpus;
     unsigned int           apic_enabled;
+    unsigned int           pae_enabled;
 
     struct hvm_virpit      vpit;
     struct hvm_virpic      vpic;
diff -r 2401f414d1ad -r 991c4d62d392 xen/include/public/hvm/hvm_info_table.h
--- a/xen/include/public/hvm/hvm_info_table.h   Tue Feb 21 17:13:30 2006
+++ b/xen/include/public/hvm/hvm_info_table.h   Tue Feb 21 17:15:49 2006
@@ -17,7 +17,7 @@
     uint8_t     checksum;
     uint8_t     acpi_enabled;
     uint8_t     apic_enabled;
-    uint8_t     pad[1];
+    uint8_t     pae_enabled;
     uint32_t    nr_vcpus;
 };
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.