public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Set BHI_NO in guest when host is not affected by BHI
@ 2024-04-11  7:24 Alexandre Chartre
  2024-04-11  7:34 ` Nikolay Borisov
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Alexandre Chartre @ 2024-04-11  7:24 UTC (permalink / raw)
  To: x86, kvm
  Cc: linux-kernel, daniel.sneddon, pawan.kumar.gupta, tglx,
	konrad.wilk, peterz, gregkh, seanjc, andrew.cooper3, dave.hansen,
	nik.borisov, kpsingh, longman, bp, pbonzini, alexandre.chartre

When a system is not affected by the BHI bug then KVM should
configure guests with BHI_NO to ensure they won't enable any
BHI mitigation.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
---
 arch/x86/kvm/x86.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 984ea2089efc..f43d3c15a6b7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1678,6 +1678,9 @@ static u64 kvm_get_arch_capabilities(void)
 	if (!boot_cpu_has_bug(X86_BUG_GDS) || gds_ucode_mitigated())
 		data |= ARCH_CAP_GDS_NO;
 
+	if (!boot_cpu_has_bug(X86_BUG_BHI))
+		data |= ARCH_CAP_BHI_NO;
+
 	return data;
 }
 
-- 
2.39.3


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

end of thread, other threads:[~2024-04-25 20:46 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11  7:24 [PATCH] KVM: x86: Set BHI_NO in guest when host is not affected by BHI Alexandre Chartre
2024-04-11  7:34 ` Nikolay Borisov
2024-04-11  7:49   ` Alexandre Chartre
2024-04-11  7:51 ` Greg KH
2024-04-11  8:00   ` Alexandre Chartre
2024-04-11  7:51 ` Nikolay Borisov
2024-04-11  8:43 ` Andrew Cooper
2024-04-11  9:33   ` Alexandre Chartre
2024-04-11  9:38     ` Andrew Cooper
2024-04-11 11:14       ` Chao Gao
2024-04-11 13:20         ` Alexandre Chartre
2024-04-15 15:14           ` Alexandre Chartre
2024-04-15 17:17             ` Dave Hansen
2024-04-16  8:41               ` Alexandre Chartre
2024-04-25 20:45                 ` Konrad Rzeszutek Wilk
2024-04-11 13:22     ` Paolo Bonzini
2024-04-11 13:32       ` Alexandre Chartre
2024-04-11 14:13         ` Andrew Cooper
2024-04-11 14:33           ` Alexandre Chartre
2024-04-11 14:46             ` Paolo Bonzini
2024-04-11 15:12               ` Alexandre Chartre
2024-04-11 15:20                 ` Paolo Bonzini
2024-04-11 15:56                   ` Chao Gao
2024-04-11 20:50                     ` Konrad Rzeszutek Wilk
2024-04-12  3:24                       ` Chao Gao
2024-04-12 16:33                         ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox