Re: [PATCH v3 2/3] x86/vmscape: Replace IBPB with branch history clear on exit to userspace

From: Sean Christopherson

Date: Wed Oct 29 2025 - 18:47:56 EST


On Mon, Oct 27, 2025, Pawan Gupta wrote:
> IBPB mitigation for VMSCAPE is an overkill for 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. But, a guest
> could still poison the branch history.
>
> To mitigate that, use the recently added clear_bhb_long_loop() to isolate
> the branch history between guest and userspace. Add cmdline option
> 'vmscape=on' that automatically selects the appropriate mitigation based
> on the CPU.
>
> Acked-by: David Kaplan <david.kaplan@xxxxxxx>
> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@xxxxxxxxxxxxxxx>
> ---
> Documentation/admin-guide/hw-vuln/vmscape.rst | 8 ++++
> Documentation/admin-guide/kernel-parameters.txt | 4 +-
> arch/x86/include/asm/cpufeatures.h | 1 +
> arch/x86/include/asm/entry-common.h | 12 +++---
> arch/x86/include/asm/nospec-branch.h | 2 +-
> arch/x86/kernel/cpu/bugs.c | 53 ++++++++++++++++++-------
> arch/x86/kvm/x86.c | 5 ++-
> 7 files changed, 61 insertions(+), 24 deletions(-)

For the KVM changes,

Acked-by: Sean Christopherson <seanjc@xxxxxxxxxx>