Re: [PATCH 07/14] x86/ibt: Clean up is_endbr()
From: Peter Zijlstra
Date: Sat Sep 28 2024 - 09:09:05 EST
On Fri, Sep 27, 2024 at 05:04:44PM -0700, Josh Poimboeuf wrote:
> On Fri, Sep 27, 2024 at 09:49:03PM +0200, Peter Zijlstra wrote:
> > Pretty much every caller of is_endbr() actually wants to test something at an
> > address and ends up doing get_kernel_nofault(). Fold the lot into a more
> > convenient helper.
> >
> > Note: this effectively reverts commit a8497506cd2c ("bpf: Avoid
> > get_kernel_nofault() to fetch kprobe entry IP") which was entirely the
> > wrong way to go about doing things. The right solution is to optimize
> > get_kernel_nofault() itself, it really doesn't need STAC/CLAC nor the
> > speculation barrier. Using __get_user is a historical hack, not a
> > requirement.
>
> But these patches don't actually optimize get_kernel_nofault()?
No, I figured there was enough there already. Also, given the state I
was in, I'd probably get it wrong.
I have it on a todo list somewhere though. It shouldn't be too hard.