Re: [PATCH bpf-next v3 08/11] bpf: Fall back to nospec for Spectre v1

2025-05-13 Thread Kumar Kartikeya Dwivedi
On Thu, 1 May 2025 at 04:00, Luis Gerhorst wrote: > > This implements the core of the series and causes the verifier to fall > back to mitigating Spectre v1 using speculation barriers. The approach > was presented at LPC'24 [1] and RAID'24 [2]. > > If we find any forbidden behavior on a speculativ

Re: [PATCH bpf-next v3 08/11] bpf: Fall back to nospec for Spectre v1

2025-05-02 Thread Luis Gerhorst
Kumar Kartikeya Dwivedi writes: > Back when all of this surfaced, compiler folks came up with another > solution, to rely on Intel's guarantee that conditional moves are not > predicted. > > if (condition) { >mask = !condition ? 0UL : ~0UL; // CMOVcc >ptr &= mask; >x = *ptr; > } > > I

Re: [PATCH bpf-next v3 08/11] bpf: Fall back to nospec for Spectre v1

2025-05-01 Thread Kumar Kartikeya Dwivedi
On Thu, 1 May 2025 at 10:00, Luis Gerhorst wrote: > > This implements the core of the series and causes the verifier to fall > back to mitigating Spectre v1 using speculation barriers. The approach > was presented at LPC'24 [1] and RAID'24 [2]. > > If we find any forbidden behavior on a speculativ

[PATCH bpf-next v3 08/11] bpf: Fall back to nospec for Spectre v1

2025-05-01 Thread Luis Gerhorst
This implements the core of the series and causes the verifier to fall back to mitigating Spectre v1 using speculation barriers. The approach was presented at LPC'24 [1] and RAID'24 [2]. If we find any forbidden behavior on a speculative path, we insert a nospec (e.g., lfence speculation barrier o