]> git.ipfire.org Git - thirdparty/linux.git/commit
x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 11 Apr 2024 05:40:46 +0000 (22:40 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 11 Apr 2024 08:30:33 +0000 (10:30 +0200)
commitcb2db5bb04d7f778fbc1a1ea2507aab436f1bff3
treec5bb43333f8292d9e7be5e2db8158e33e143be21
parentdfe648903f42296866d79f10d03f8c85c9dfba30
x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES

There's no need to keep reading MSR_IA32_ARCH_CAPABILITIES over and
over.  It's even read in the BHI sysfs function which is a big no-no.
Just read it once and cache it.

Fixes: ec9404e40e8f ("x86/bhi: Add BHI mitigation knob")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/9592a18a814368e75f8f4b9d74d3883aa4fd1eaf.1712813475.git.jpoimboe@kernel.org
arch/x86/kernel/cpu/bugs.c