linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] x86: cpuid: improve support for broken CPUID configurations
@ 2022-06-22 14:48 Maxim Levitsky
  2022-06-22 14:48 ` [PATCH 1/4] perf/x86/intel/lbr: use setup_clear_cpu_cap instead of clear_cpu_cap Maxim Levitsky
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Maxim Levitsky @ 2022-06-22 14:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: Chang S. Bae, Jiri Olsa, linux-perf-users, Peter Zijlstra,
	H. Peter Anvin, David S. Miller, Borislav Petkov, Kees Cook,
	Mark Rutland, Alexander Shishkin, Namhyung Kim, Tim Chen,
	Maxim Levitsky, Pawan Gupta, Herbert Xu, Dave Hansen,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Jane Malalane,
	Tony Luck, Ingo Molnar, Thomas Gleixner, Arnaldo Carvalho de Melo,
	open list:CRYPTO API, Paolo Bonzini

This patch series aims to harden the cpuid code against the case when
the hypervisor exposes a broken CPUID configuration to the guest,
in the form of having a feature disabled but not features that depend on it.

This is the more generic way to fix kernel panic in aes-ni kernel driver,
which was triggered by CPUID configuration in which AVX is disabled but
not AVX2.

https://lore.kernel.org/all/20211103145231.GA4485@gondor.apana.org.au/T/

This was tested by booting a guest with AVX disabled and not AVX2,
and observing that both a warning is now printed in dmesg, and
that avx2 is gone from /proc/cpuinfo.

Best regards,
	Maxim Levitsky

Maxim Levitsky (4):
  perf/x86/intel/lbr: use setup_clear_cpu_cap instead of clear_cpu_cap
  x86/cpuid: refactor setup_clear_cpu_cap/clear_feature
  x86/cpuid: move filter_cpuid_features to cpuid-deps.c
  x86/cpuid: check for dependencies violations in CPUID and attempt to
    fix them

 arch/x86/events/intel/lbr.c       |  2 +-
 arch/x86/include/asm/cpufeature.h |  1 +
 arch/x86/kernel/cpu/common.c      | 50 +-----------------
 arch/x86/kernel/cpu/cpuid-deps.c  | 84 +++++++++++++++++++++++++++----
 4 files changed, 78 insertions(+), 59 deletions(-)

-- 
2.26.3



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-06-22 19:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-22 14:48 [PATCH 0/4] x86: cpuid: improve support for broken CPUID configurations Maxim Levitsky
2022-06-22 14:48 ` [PATCH 1/4] perf/x86/intel/lbr: use setup_clear_cpu_cap instead of clear_cpu_cap Maxim Levitsky
2022-06-22 14:58   ` Dave Hansen
2022-06-22 18:57     ` Liang, Kan
2022-06-22 19:32       ` Liang, Kan
2022-06-22 14:48 ` [PATCH 2/4] x86/cpuid: refactor setup_clear_cpu_cap/clear_feature Maxim Levitsky
2022-06-22 15:07   ` Dave Hansen
2022-06-22 15:59     ` Maxim Levitsky
2022-06-22 14:48 ` [PATCH 3/4] x86/cpuid: move filter_cpuid_features to cpuid-deps.c Maxim Levitsky
2022-06-22 15:07   ` Dave Hansen
2022-06-22 16:01     ` Maxim Levitsky
2022-06-22 14:48 ` [PATCH 4/4] x86/cpuid: check for dependencies violations in CPUID and attempt to fix them Maxim Levitsky
2022-06-22 15:32   ` Dave Hansen
2022-06-22 17:09     ` Maxim Levitsky
2022-06-22 17:18       ` Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).