Skip to content

Commit

Permalink
cpuidle: replace xen access to x86 pm_idle and default_idle
Browse files Browse the repository at this point in the history
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
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
lenb committed Aug 3, 2011
1 parent 62027ae commit d91ee58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/xen/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -426,7 +427,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();
Expand Down
4 changes: 4 additions & 0 deletions drivers/cpuidle/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions include/linux/cpuidle.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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; }
Expand Down

0 comments on commit d91ee58

Please sign in to comment.