x86 cpuidle: check whether cpu is online in cpu idle control

We observed a 2.6.18.8 dom0 kernel crash when Xen has maxcpus < num
of physical cores (maxcpus=3D4 for a 12-core system). It appeared that
hypervisor doesn't check whether CPU is online or not. This small
patch fixed the issue.

Signed-off-by: Uwe Dannowski <uwe.dannowski@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
This commit is contained in:
Keir Fraser committed 2010-08-17 19:32:37 +01:00
1 parent f5c637a788
commit 2a9f4ae1ad
1 file changed
+3 -2
+3 -2
View File
@@ -270,9 +270,10 @@ static void menu_reflect(struct acpi_processor_power *power)
static int menu_enable_device(struct acpi_processor_power *power)
{
struct menu_device *data = &per_cpu(menu_devices, power->cpu);
if (!cpu_online(power->cpu))
return -1;
memset(data, 0, sizeof(struct menu_device));
memset(&per_cpu(menu_devices, power->cpu), 0, sizeof(struct menu_device));
return 0;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.