platform/x86: intel-uncore-freq: Prevent driver loading in guests
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 27 Apr 2022 10:03:04 +0000 (03:03 -0700)
committerHans de Goede <hdegoede@redhat.com>
Wed, 27 Apr 2022 14:50:25 +0000 (16:50 +0200)
commite769cb20c5b7c74513b88d1aed482309bcaece71
tree882567e5f01c130e49115062cd496d8270037993
parent258af41d150b2a8a2364a641bfeaa637b3ae8607
platform/x86: intel-uncore-freq: Prevent driver loading in guests

Loading this driver in guests results in unchecked MSR access error for
MSR 0x620.

There is no use of reading and modifying package/die scope uncore MSRs
in guests. So check for CPU feature X86_FEATURE_HYPERVISOR to prevent
loading of this driver in guests.

Fixes: dbce412a7733 ("platform/x86/intel-uncore-freq: Split common and enumeration part")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215870
Suggested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20220427100304.2562990-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c