Skip to content

Commit 8d75f7b

Browse files
spandruvadajwrdegoede
authored andcommitted
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: dbce412 ("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>
1 parent e5483b4 commit 8d75f7b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ static int __init intel_uncore_init(void)
212212
const struct x86_cpu_id *id;
213213
int ret;
214214

215+
if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
216+
return -ENODEV;
217+
215218
id = x86_match_cpu(intel_uncore_cpu_ids);
216219
if (!id)
217220
return -ENODEV;

0 commit comments

Comments
 (0)