Move xen-pm options from dom0 cmdline option to start info. 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 diff -r 37fae02cc335 xen/arch/x86/domain_build.c --- a/xen/arch/x86/domain_build.c Fri Jul 25 15:03:03 2008 +0100 +++ b/xen/arch/x86/domain_build.c Mon Jul 28 16:27:57 2008 +0800 @@ -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; diff -r 37fae02cc335 xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Fri Jul 25 15:03:03 2008 +0100 +++ b/xen/arch/x86/setup.c Mon Jul 28 16:27:57 2008 +0800 @@ -997,7 +997,6 @@ void __init __start_xen(unsigned long mb 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 mb 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; } @@ -1040,6 +1031,9 @@ void __init __start_xen(unsigned long mb (mod[initrdidx].mod_start - mod[0].mod_start); _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 diff -r 37fae02cc335 xen/include/public/xen.h --- a/xen/include/public/xen.h Fri Jul 25 15:03:03 2008 +0100 +++ b/xen/include/public/xen.h Mon Jul 28 16:27:57 2008 +0800 @@ -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_??? */