From: Keir Fraser Date: Mon, 28 Jul 2008 10:43:54 +0000 (+0100) Subject: Move xen-pm options from dom0 cmdline option to start info. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14165^2~101 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a76bb0a4ff272ad9ac77b1f74d49e401d4e50cc6;p=xen.git 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 --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 73233357f2..8bb24c9dd6 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -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 --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index cd0c892a86..c1a2642528 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -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. diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index f310fe8d12..4b444b4c71 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -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_??? */