# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1217241834 -3600
# Node ID eb71d05f51a208bcd2e1a7f7b5ebfe813504250a
# Parent fa8a396191547a493edf9ce80a1d98aae10f2b43
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 <gang.wei@xxxxxxxxx>
---
xen/arch/x86/domain_build.c | 1 +
xen/arch/x86/setup.c | 12 +++---------
xen/include/public/xen.h | 1 +
3 files changed, 5 insertions(+), 9 deletions(-)
diff -r fa8a39619154 -r eb71d05f51a2 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c Mon Jul 28 11:40:21 2008 +0100
+++ b/xen/arch/x86/domain_build.c Mon Jul 28 11:43:54 2008 +0100
@@ -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 fa8a39619154 -r eb71d05f51a2 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c Mon Jul 28 11:40:21 2008 +0100
+++ b/xen/arch/x86/setup.c Mon Jul 28 11:43:54 2008 +0100
@@ -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 fa8a39619154 -r eb71d05f51a2 xen/include/public/xen.h
--- a/xen/include/public/xen.h Mon Jul 28 11:40:21 2008 +0100
+++ b/xen/include/public/xen.h Mon Jul 28 11:43:54 2008 +0100
@@ -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_??? */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|