* [PATCH 09/18] cpuidle: replace xen access to x86 pm_idle and default_idle [not found] ` <c82cf78992a66bfa7f0c82aeb20ba6922127463b.1301724243.git.len.brown@intel.com> @ 2011-04-02 6:22 ` Len Brown 2011-04-04 15:33 ` Konrad Rzeszutek Wilk 0 siblings, 1 reply; 2+ messages in thread From: Len Brown @ 2011-04-02 6:22 UTC (permalink / raw) To: linux-pm; +Cc: linux-kernel, Len Brown, xen-devel From: Len Brown <len.brown@intel.com> When a Xen Dom0 kernel boots on a hypervisor, it gets access to the raw-hardware ACPI tables. While it parses the idle tables for the hypervisor's beneift, it uses HLT for its own idle. Rather than have xen scribble on pm_idle and access default_idle, have it simply disable_cpuidle() so acpi_idle will not load and architecture default HLT will be used. cc: xen-devel@lists.xensource.com Signed-off-by: Len Brown <len.brown@intel.com> --- arch/x86/xen/setup.c | 3 ++- drivers/cpuidle/cpuidle.c | 4 ++++ include/linux/cpuidle.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletions(-) diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index a8a66a5..aa02cce 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -9,6 +9,7 @@ #include <linux/mm.h> #include <linux/pm.h> #include <linux/memblock.h> +#include <linux/cpuidle.h> #include <asm/elf.h> #include <asm/vdso.h> @@ -354,7 +355,7 @@ void __init xen_arch_setup(void) #ifdef CONFIG_X86_32 boot_cpu_data.hlt_works_ok = 1; #endif - pm_idle = default_idle; + disable_cpuidle(); boot_option_idle_override = IDLE_HALT; fiddle_vdso(); diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index faae2c3..041df0b 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -34,6 +34,10 @@ int cpuidle_disabled(void) { return off; } +void disable_cpuidle(void) +{ + off = 1; +} #if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT) static void cpuidle_kick_cpus(void) diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 36719ea..b89f67d 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -122,6 +122,7 @@ struct cpuidle_driver { }; #ifdef CONFIG_CPU_IDLE +extern void disable_cpuidle(void); extern int cpuidle_register_driver(struct cpuidle_driver *drv); struct cpuidle_driver *cpuidle_get_driver(void); @@ -135,6 +136,7 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev); extern void cpuidle_disable_device(struct cpuidle_device *dev); #else +static inline void disable_cpuidle(void) { } static inline int cpuidle_register_driver(struct cpuidle_driver *drv) {return -ENODEV; } -- 1.7.5.rc0 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 09/18] cpuidle: replace xen access to x86 pm_idle and default_idle 2011-04-02 6:22 ` [PATCH 09/18] cpuidle: replace xen access to x86 pm_idle and default_idle Len Brown @ 2011-04-04 15:33 ` Konrad Rzeszutek Wilk 0 siblings, 0 replies; 2+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-04-04 15:33 UTC (permalink / raw) To: Len Brown; +Cc: Len Brown, linux-pm, xen-devel, linux-kernel On Sat, Apr 02, 2011 at 02:22:51AM -0400, Len Brown wrote: > From: Len Brown <len.brown@intel.com> > > When a Xen Dom0 kernel boots on a hypervisor, it gets access > to the raw-hardware ACPI tables. While it parses the idle tables > for the hypervisor's beneift, it uses HLT for its own idle. > > Rather than have xen scribble on pm_idle and access default_idle, > have it simply disable_cpuidle() so acpi_idle will not load and > architecture default HLT will be used. Hey Len, Looks good to me. I've also tested this on the affected Intel machine and your patchset works fine. > > cc: xen-devel@lists.xensource.com > Signed-off-by: Len Brown <len.brown@intel.com> > --- > arch/x86/xen/setup.c | 3 ++- > drivers/cpuidle/cpuidle.c | 4 ++++ > include/linux/cpuidle.h | 2 ++ > 3 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c > index a8a66a5..aa02cce 100644 > --- a/arch/x86/xen/setup.c > +++ b/arch/x86/xen/setup.c > @@ -9,6 +9,7 @@ > #include <linux/mm.h> > #include <linux/pm.h> > #include <linux/memblock.h> > +#include <linux/cpuidle.h> > > #include <asm/elf.h> > #include <asm/vdso.h> > @@ -354,7 +355,7 @@ void __init xen_arch_setup(void) > #ifdef CONFIG_X86_32 > boot_cpu_data.hlt_works_ok = 1; > #endif > - pm_idle = default_idle; > + disable_cpuidle(); > boot_option_idle_override = IDLE_HALT; > > fiddle_vdso(); > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c > index faae2c3..041df0b 100644 > --- a/drivers/cpuidle/cpuidle.c > +++ b/drivers/cpuidle/cpuidle.c > @@ -34,6 +34,10 @@ int cpuidle_disabled(void) > { > return off; > } > +void disable_cpuidle(void) > +{ > + off = 1; > +} > > #if defined(CONFIG_ARCH_HAS_CPU_IDLE_WAIT) > static void cpuidle_kick_cpus(void) > diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h > index 36719ea..b89f67d 100644 > --- a/include/linux/cpuidle.h > +++ b/include/linux/cpuidle.h > @@ -122,6 +122,7 @@ struct cpuidle_driver { > }; > > #ifdef CONFIG_CPU_IDLE > +extern void disable_cpuidle(void); > > extern int cpuidle_register_driver(struct cpuidle_driver *drv); > struct cpuidle_driver *cpuidle_get_driver(void); > @@ -135,6 +136,7 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev); > extern void cpuidle_disable_device(struct cpuidle_device *dev); > > #else > +static inline void disable_cpuidle(void) { } > > static inline int cpuidle_register_driver(struct cpuidle_driver *drv) > {return -ENODEV; } > -- > 1.7.5.rc0 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-04 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <alpine.LFD.2.02.1104010020280.2797@x980>
[not found] ` <1301725380-10579-1-git-send-email-lenb@kernel.org>
[not found] ` <c82cf78992a66bfa7f0c82aeb20ba6922127463b.1301724243.git.len.brown@intel.com>
2011-04-02 6:22 ` [PATCH 09/18] cpuidle: replace xen access to x86 pm_idle and default_idle Len Brown
2011-04-04 15:33 ` Konrad Rzeszutek Wilk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).