Re: [PATCH 1/2] x86/bhi: Add BHB clearing for CPUs with larger branch history

From: Jim Mattson
Date: Thu Sep 25 2025 - 13:55:15 EST


On Wed, Sep 24, 2025 at 8:09 PM Pawan Gupta
<pawan.kumar.gupta@xxxxxxxxxxxxxxx> wrote:
>
> Add a version of clear_bhb_loop() that works on CPUs with larger branch
> history table such as Alder Lake and newer. This could serve as a cheaper
> alternative to IBPB mitigation for VMSCAPE.

Yay!

Can we also use this longer loop as a BHI mitigation on (virtual)
processors with larger branch history tables that don't support
BHI_DIS_S? Today, we just use the short BHB clearing loop and call it
good.