/* * Intel PMC Core platform init * Copyright (c) 2019, Google Inc. * Author - Rajat Jain * * This code instantiates platform devices for intel_pmc_core driver, only * on supported platforms that may not have the ACPI devices in the ACPI tables. * No new platforms should be added here, because we expect that new platforms * should all have the ACPI device, which is the preferred way of enumeration.
*/
/* * intel_pmc_core_platform_ids is the list of platforms where we want to * instantiate the platform_device if not already instantiated. This is * different than intel_pmc_core_ids in intel_pmc_core.c which is the * list of platforms that the driver supports for pmc_core device. The * other list may grow, but this list should not.
*/ staticconststruct x86_cpu_id intel_pmc_core_platform_ids[] = {
X86_MATCH_VFM(INTEL_SKYLAKE_L, &pmc_core_device),
X86_MATCH_VFM(INTEL_SKYLAKE, &pmc_core_device),
X86_MATCH_VFM(INTEL_KABYLAKE_L, &pmc_core_device),
X86_MATCH_VFM(INTEL_KABYLAKE, &pmc_core_device),
X86_MATCH_VFM(INTEL_CANNONLAKE_L, &pmc_core_device),
X86_MATCH_VFM(INTEL_ICELAKE_L, &pmc_core_device),
X86_MATCH_VFM(INTEL_COMETLAKE, &pmc_core_device),
X86_MATCH_VFM(INTEL_COMETLAKE_L, &pmc_core_device),
{}
};
MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);
staticint __init pmc_core_platform_init(void)
{ int retval;
/* Skip creating the platform device if ACPI already has a device */ if (acpi_dev_present("INT33A1", NULL, -1)) return -ENODEV;
/* * Skip forcefully attaching the device for VMs. Make an exception for * Xen dom0, which does have full hardware access.
*/ if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR) && !xen_initial_domain()) return -ENODEV;
if (!x86_match_cpu(intel_pmc_core_platform_ids)) return -ENODEV;
pmc_core_device = kzalloc(sizeof(*pmc_core_device), GFP_KERNEL); if (!pmc_core_device) return -ENOMEM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.