Move xen-pm options from dom0 cmdline option to start info.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 28 Jul 2008 10:43:54 +0000 (11:43 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 28 Jul 2008 10:43:54 +0000 (11:43 +0100)
Thus to avoid xen-pm being manually enforced by end user in dom0
cmdline but without enabling them in xen.

signed-off-by: Wei Gang <gang.wei@intel.com>

xen/arch/x86/domain_build.c
xen/arch/x86/setup.c
xen/include/public/xen.h

index 73233357f29aff50b8526334424576bbb40b51b2..8bb24c9dd6cd1cffb7bdf0a3c20b71b36c466a01 100644 (file)
@@ -757,6 +757,7 @@ int __init construct_dom0(
     si->shared_info = virt_to_maddr(d->shared_info);
 
     si->flags        = SIF_PRIVILEGED | SIF_INITDOMAIN;
+    si->flags       |= (xen_processor_pmbits << 8) & SIF_PM_MASK;
     si->pt_base      = vpt_start + 2 * PAGE_SIZE * !!is_pv_32on64_domain(d);
     si->nr_pt_frames = nr_pt_pages;
     si->mfn_list     = vphysmap_start;
index cd0c892a86f4e21c2ea6ae3fc42bb8bf91fad9f0..c1a264252887031a66969c523f7c95dbaa789a14 100644 (file)
@@ -997,7 +997,6 @@ void __init __start_xen(unsigned long mbi_p)
     if ( (cmdline != NULL) || (kextra != NULL) )
     {
         static char dom0_cmdline[MAX_GUEST_CMDLINE];
-        char xen_pm_param[32];
 
         cmdline = cmdline_cook(cmdline);
         safe_strcpy(dom0_cmdline, cmdline);
@@ -1022,14 +1021,6 @@ void __init __start_xen(unsigned long mbi_p)
             safe_strcat(dom0_cmdline, " acpi=");
             safe_strcat(dom0_cmdline, acpi_param);
         }
-        if ( xen_cpuidle )
-            xen_processor_pmbits |= XEN_PROCESSOR_PM_CX;
-
-        snprintf(xen_pm_param, sizeof(xen_pm_param), 
-            " xen_processor_pmbits=%d", xen_processor_pmbits);
-
-        if ( !strstr(dom0_cmdline, "xen_processor_pmbits=") )
-            safe_strcat(dom0_cmdline, xen_pm_param);
 
         cmdline = dom0_cmdline;
     }
@@ -1041,6 +1032,9 @@ void __init __start_xen(unsigned long mbi_p)
         _initrd_len   = mod[initrdidx].mod_end - mod[initrdidx].mod_start;
     }
 
+    if ( xen_cpuidle )
+        xen_processor_pmbits |= XEN_PROCESSOR_PM_CX;
+
     /*
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
index f310fe8d12fdab4b3f6bbf7e85081b10f512e1af..4b444b4c71d51bfc97dce5c33a2133d15f43ae8b 100644 (file)
@@ -554,6 +554,7 @@ typedef struct start_info start_info_t;
 /* These flags are passed in the 'flags' field of start_info_t. */
 #define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
+#define SIF_PM_MASK       (0xFF<<8) /* reserve 1 byte for xen-pm options */
 
 typedef struct dom0_vga_console_info {
     uint8_t video_type; /* DOM0_VGA_CONSOLE_??? */