diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-11-20 17:29:39 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-11-20 17:29:39 +0300 |
commit | b3c39b1a96a67a7e246d562f44d04ce6f9ef878f (patch) | |
tree | 6874debfde448db313bd7c53c3aca59687038c1f /drivers/platform/x86/intel/pmc/pltdrv.c | |
parent | 63a3bf5e8d9e79ce456c8f73d4395a5a51d841b1 (diff) | |
parent | 77c51ba552a1c4f73228766e43ae37c4101b3758 (diff) | |
download | linux-b3c39b1a96a67a7e246d562f44d04ce6f9ef878f.tar.xz |
Merge remote-tracking branch 'torvalds/master' into perf/core
To pick up fixes and check if libraries used that comes from other trees
continue to work with tools/perf, such as tools/lib/bpf.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'drivers/platform/x86/intel/pmc/pltdrv.c')
-rw-r--r-- | drivers/platform/x86/intel/pmc/pltdrv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel/pmc/pltdrv.c b/drivers/platform/x86/intel/pmc/pltdrv.c index 15ca8afdd973..ddfba38c2104 100644 --- a/drivers/platform/x86/intel/pmc/pltdrv.c +++ b/drivers/platform/x86/intel/pmc/pltdrv.c @@ -18,6 +18,8 @@ #include <asm/cpu_device_id.h> #include <asm/intel-family.h> +#include <xen/xen.h> + static void intel_pmc_core_release(struct device *dev) { kfree(dev); @@ -53,6 +55,13 @@ static int __init pmc_core_platform_init(void) 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; |