diff options
Diffstat (limited to 'drivers/xen/xen-acpi-processor.c')
-rw-r--r-- | drivers/xen/xen-acpi-processor.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c index 23e391d3ec01..c80195e8fbd1 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c | |||
@@ -53,6 +53,8 @@ static unsigned long *acpi_ids_done; | |||
53 | static unsigned long *acpi_id_present; | 53 | static unsigned long *acpi_id_present; |
54 | /* And if there is an _CST definition (or a PBLK) for the ACPI IDs */ | 54 | /* And if there is an _CST definition (or a PBLK) for the ACPI IDs */ |
55 | static unsigned long *acpi_id_cst_present; | 55 | static unsigned long *acpi_id_cst_present; |
56 | /* Which ACPI P-State dependencies for a enumerated processor */ | ||
57 | static struct acpi_psd_package *acpi_psd; | ||
56 | 58 | ||
57 | static int push_cxx_to_hypervisor(struct acpi_processor *_pr) | 59 | static int push_cxx_to_hypervisor(struct acpi_processor *_pr) |
58 | { | 60 | { |
@@ -372,6 +374,13 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
372 | 374 | ||
373 | pr_debug("ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id, (unsigned long)pblk); | 375 | pr_debug("ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id, (unsigned long)pblk); |
374 | 376 | ||
377 | /* It has P-state dependencies */ | ||
378 | if (!acpi_processor_get_psd(handle, &acpi_psd[acpi_id])) { | ||
379 | pr_debug("ACPI CPU%u w/ PST:coord_type = %llu domain = %llu\n", | ||
380 | acpi_id, acpi_psd[acpi_id].coord_type, | ||
381 | acpi_psd[acpi_id].domain); | ||
382 | } | ||
383 | |||
375 | status = acpi_evaluate_object(handle, "_CST", NULL, &buffer); | 384 | status = acpi_evaluate_object(handle, "_CST", NULL, &buffer); |
376 | if (ACPI_FAILURE(status)) { | 385 | if (ACPI_FAILURE(status)) { |
377 | if (!pblk) | 386 | if (!pblk) |
@@ -405,6 +414,14 @@ static int check_acpi_ids(struct acpi_processor *pr_backup) | |||
405 | return -ENOMEM; | 414 | return -ENOMEM; |
406 | } | 415 | } |
407 | 416 | ||
417 | acpi_psd = kcalloc(nr_acpi_bits, sizeof(struct acpi_psd_package), | ||
418 | GFP_KERNEL); | ||
419 | if (!acpi_psd) { | ||
420 | kfree(acpi_id_present); | ||
421 | kfree(acpi_id_cst_present); | ||
422 | return -ENOMEM; | ||
423 | } | ||
424 | |||
408 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, | 425 | acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, |
409 | ACPI_UINT32_MAX, | 426 | ACPI_UINT32_MAX, |
410 | read_acpi_id, NULL, NULL, NULL); | 427 | read_acpi_id, NULL, NULL, NULL); |
@@ -417,6 +434,12 @@ upload: | |||
417 | pr_backup->acpi_id = i; | 434 | pr_backup->acpi_id = i; |
418 | /* Mask out C-states if there are no _CST or PBLK */ | 435 | /* Mask out C-states if there are no _CST or PBLK */ |
419 | pr_backup->flags.power = test_bit(i, acpi_id_cst_present); | 436 | pr_backup->flags.power = test_bit(i, acpi_id_cst_present); |
437 | /* num_entries is non-zero if we evaluated _PSD */ | ||
438 | if (acpi_psd[i].num_entries) { | ||
439 | memcpy(&pr_backup->performance->domain_info, | ||
440 | &acpi_psd[i], | ||
441 | sizeof(struct acpi_psd_package)); | ||
442 | } | ||
420 | (void)upload_pm_data(pr_backup); | 443 | (void)upload_pm_data(pr_backup); |
421 | } | 444 | } |
422 | } | 445 | } |
@@ -566,6 +589,7 @@ static void __exit xen_acpi_processor_exit(void) | |||
566 | kfree(acpi_ids_done); | 589 | kfree(acpi_ids_done); |
567 | kfree(acpi_id_present); | 590 | kfree(acpi_id_present); |
568 | kfree(acpi_id_cst_present); | 591 | kfree(acpi_id_cst_present); |
592 | kfree(acpi_psd); | ||
569 | for_each_possible_cpu(i) | 593 | for_each_possible_cpu(i) |
570 | acpi_processor_unregister_performance(i); | 594 | acpi_processor_unregister_performance(i); |
571 | 595 | ||