[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251121182935.klm43ygvtoni4y7a@desk>
Date: Fri, 21 Nov 2025 10:29:35 -0800
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: x86@...nel.org, David Kaplan <david.kaplan@....com>,
"H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Sean Christopherson <seanjc@...gle.com>,
Paolo Bonzini <pbonzini@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Asit Mallick <asit.k.mallick@...el.com>,
Tao Zhang <tao1.zhang@...el.com>
Subject: Re: [PATCH v4 09/11] x86/vmscape: Deploy BHB clearing mitigation
On Fri, Nov 21, 2025 at 04:18:09PM +0200, Nikolay Borisov wrote:
>
>
> On 11/20/25 08:19, Pawan Gupta wrote:
> > IBPB mitigation for VMSCAPE is an overkill on CPUs that are only affected
> > by the BHI variant of VMSCAPE. On such CPUs, eIBRS already provides
> > indirect branch isolation between guest and host userspace. However, branch
> > history from guest may also influence the indirect branches in host
> > userspace.
> >
> > To mitigate the BHI aspect, use clear_bhb_loop().
> >
> > Signed-off-by: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
>
> <snip>
>
> > @@ -3278,6 +3290,9 @@ static void __init vmscape_apply_mitigation(void)
> > {
> > if (vmscape_mitigation == VMSCAPE_MITIGATION_IBPB_EXIT_TO_USER)
> > static_call_update(vmscape_predictor_flush, write_ibpb);
> > + else if (vmscape_mitigation == VMSCAPE_MITIGATION_BHB_CLEAR_EXIT_TO_USER &&
> > + IS_ENABLED(CONFIG_X86_64))
>
> why the x86_64 dependency ?
BHI sequence mitigation is only supported in 64-bit mode. I will add a
comment. Looking at it again, I realized that 64-bit check should be in
vmscape_select_mitigation(), otherwise we report incorrectly on 32-bit.
> > + static_call_update(vmscape_predictor_flush, clear_bhb_loop);
> > }
> > #undef pr_fmt
> > @@ -3369,6 +3384,7 @@ void cpu_bugs_smt_update(void)
> > break;
> > case VMSCAPE_MITIGATION_IBPB_ON_VMEXIT:
> > case VMSCAPE_MITIGATION_IBPB_EXIT_TO_USER:
> > + case VMSCAPE_MITIGATION_BHB_CLEAR_EXIT_TO_USER:
> > /*
> > * Hypervisors can be attacked across-threads, warn for SMT when
> > * STIBP is not already enabled system-wide.
> >
>
Powered by blists - more mailing lists