Skip to content

Commit 6f2d9d9

Browse files
jbeulichDavid Vrabel
authored andcommitted
xen/acpi: allow xen-acpi-processor driver to load on Xen 4.7
As of Xen 4.7 PV CPUID doesn't expose either of CPUID[1].ECX[7] and CPUID[0x80000007].EDX[7] anymore, causing the driver to fail to load on both Intel and AMD systems. Doing any kind of hardware capability checks in the driver as a prerequisite was wrong anyway: With the hypervisor being in charge, all such checking should be done by it. If ACPI data gets uploaded despite some missing capability, the hypervisor is free to ignore part or all of that data. Ditch the entire check_prereq() function, and do the only valid check (xen_initial_domain()) in the caller in its place. Signed-off-by: Jan Beulich <[email protected]> Cc: <[email protected]> Signed-off-by: David Vrabel <[email protected]>
1 parent e5a7947 commit 6f2d9d9

File tree

1 file changed

+3
-32
lines changed

1 file changed

+3
-32
lines changed

drivers/xen/xen-acpi-processor.c

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -423,36 +423,7 @@ static int check_acpi_ids(struct acpi_processor *pr_backup)
423423

424424
return 0;
425425
}
426-
static 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;
439426

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-
}
456427
/* acpi_perf_data is a pointer to percpu data. */
457428
static struct acpi_processor_performance __percpu *acpi_perf_data;
458429

@@ -509,10 +480,10 @@ struct notifier_block xen_acpi_processor_resume_nb = {
509480
static int __init xen_acpi_processor_init(void)
510481
{
511482
unsigned int i;
512-
int rc = check_prereq();
483+
int rc;
513484

514-
if (rc)
515-
return rc;
485+
if (!xen_initial_domain())
486+
return -ENODEV;
516487

517488
nr_acpi_bits = get_max_acpi_id() + 1;
518489
acpi_ids_done = kcalloc(BITS_TO_LONGS(nr_acpi_bits), sizeof(unsigned long), GFP_KERNEL);

0 commit comments

Comments
 (0)