Thread (40 messages) 40 messages, 7 authors, 2026-04-01

Re: [PATCH v8 02/10] x86/bhi: Make clear_bhb_loop() effective on newer CPUs

From: David Laight <hidden>
Date: 2026-03-26 10:46:01
Also in: bpf, kvm, linux-doc, lkml

On Thu, 26 Mar 2026 11:01:20 +0100
Borislav Petkov [off-list ref] wrote:
On Thu, Mar 26, 2026 at 01:39:34AM -0700, Pawan Gupta wrote:
quoted
I believe the equivalent for cpu_feature_enabled() in asm is the
ALTERNATIVE. Please let me know if I am missing something.  
Yes, you are.

The point is that you don't want to stick those alternative calls inside some
magic bhb_loop function but hand them in from the outside, as function
arguments.

Basically what I did.

Then you were worried about this being C code and it had to be noinstr... So
that outer function can be rewritten in asm, I think, and still keep it well
separate.

I'll try to rewrite it once I get a free minute, and see how it looks.
I think someone tried getting C code to write the values to global data
and getting the asm to read them.
That got discounted because it spilt things between two largely unrelated files.

I think the BPF code would need significant refactoring to call a C function.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help