Re: [PATCH v4 04/11] x86/bhi: Make clear_bhb_loop() effective on newer CPUs

Jim Mattson
2026-03-09T23:06:09Z

On Mon, Mar 9, 2026 at 3:29 PM Pawan Gupta
<pawan.kumar.gupta@linux.intel.com> wrote:
> > Is it reasonable to assume that without the presence of BHI_CTRL, the
> > non-Linux OS we've been discussing will (ironically) only use the long
> > sequence if the hypervisor advertises BHB_CLEAR_SEQ_S_SUPPORT? That
> > is, without BHB_CLEAR_SEQ_S_SUPPORT, does it assume the short sequence
> > is adequate?
>
> I don't know. But, it doesn't seem logical to assume short sequence is
> adequate when the guest can't ensure that VMM would do BHI_DIS_S for it. It
> should be the other way around.

Assuming BHI_NO is clear...

If the hypervisor offers to enable BHI_DIS_S for you, then the
migration pool may contain SPR+, so you need the long sequence if
you're going to clear the BHB in software rather than accept the
hypervisor's offer.
You are saying that if the hypervisor does not offer to enable
BHI_DIS_S for you, then you know nothing, so you need the long
sequence.

How would a guest that refuses BHI_DIS_S ever be able to use the short sequence?