[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18b29bd6-5eb5-4344-b80f-f6a55c18b8ba@suse.com>
Date: Thu, 11 Apr 2024 10:34:15 +0300
From: Nikolay Borisov <nik.borisov@...e.com>
To: Alexandre Chartre <alexandre.chartre@...cle.com>, x86@...nel.org,
kvm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, daniel.sneddon@...ux.intel.com,
pawan.kumar.gupta@...ux.intel.com, tglx@...utronix.de,
konrad.wilk@...cle.com, peterz@...radead.org, gregkh@...uxfoundation.org,
seanjc@...gle.com, andrew.cooper3@...rix.com, dave.hansen@...ux.intel.com,
kpsingh@...nel.org, longman@...hat.com, bp@...en8.de, pbonzini@...hat.com
Subject: Re: [PATCH] KVM: x86: Set BHI_NO in guest when host is not affected
by BHI
On 11.04.24 г. 10:24 ч., Alexandre Chartre wrote:
> 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@...cle.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;
> +
But this is already handled since ARCH_CAP_BHI_NO is added to
KVM_SUPPORTED_ARCH_CAP so when the host caps are read that bit is going
to be set there, if it's set for the physical cpu of course.
> return data;
> }
>
Powered by blists - more mailing lists