aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-acpi-processor.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xen-acpi-processor.c')
-rw-r--r--drivers/xen/xen-acpi-processor.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index 076970a54f89..4ce10bcca18b 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -423,36 +423,7 @@ upload:
423 423
424 return 0; 424 return 0;
425} 425}
426static int __init check_prereq(void)
427{
428 struct cpuinfo_x86 *c = &cpu_data(0);
429
430 if (!xen_initial_domain())
431 return -ENODEV;
432
433 if (!acpi_gbl_FADT.smi_command)
434 return -ENODEV;
435
436 if (c->x86_vendor == X86_VENDOR_INTEL) {
437 if (!cpu_has(c, X86_FEATURE_EST))
438 return -ENODEV;
439 426
440 return 0;
441 }
442 if (c->x86_vendor == X86_VENDOR_AMD) {
443 /* Copied from powernow-k8.h, can't include ../cpufreq/powernow
444 * as we get compile warnings for the static functions.
445 */
446#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
447#define USE_HW_PSTATE 0x00000080
448 u32 eax, ebx, ecx, edx;
449 cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
450 if ((edx & USE_HW_PSTATE) != USE_HW_PSTATE)
451 return -ENODEV;
452 return 0;
453 }
454 return -ENODEV;
455}
456/* acpi_perf_data is a pointer to percpu data. */ 427/* acpi_perf_data is a pointer to percpu data. */
457static struct acpi_processor_performance __percpu *acpi_perf_data; 428static struct acpi_processor_performance __percpu *acpi_perf_data;
458 429
@@ -509,10 +480,10 @@ struct notifier_block xen_acpi_processor_resume_nb = {
509static int __init xen_acpi_processor_init(void) 480static int __init xen_acpi_processor_init(void)
510{ 481{
511 unsigned int i; 482 unsigned int i;
512 int rc = check_prereq(); 483 int rc;
513 484
514 if (rc) 485 if (!xen_initial_domain())
515 return rc; 486 return -ENODEV;
516 487
517 nr_acpi_bits = get_max_acpi_id() + 1; 488 nr_acpi_bits = get_max_acpi_id() + 1;
518 acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL); 489 acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);