Message ID | 9c476aa64c9588205817833dbaa622f87c0e0081.1677051600.git.viresh.kumar@linaro.org (mailing list archive) |
---|---|
State | Handled Elsewhere |
Delegated to: | BPF |
Headers | show |
Series | bpf: Fix undeclared function 'barrier_nospec' warning | expand |
On Wed, Feb 22, 2023 at 9:26 AM Viresh Kumar <viresh.kumar@linaro.org> wrote: > Add the missing header for architectures that don't define > the barrier_nospec() macro. The nospec.h header is added after the > inclusion of barrier.h to avoid redefining the macro for architectures > that already define barrier_nospec() in their respective barrier.h > headers. > > Fixes: 74e19ef0ff80 ("uaccess: Add speculation barrier to copy_from_user()") > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> > --- > Linus's master branch fails currently to build for arm64 without this commit. Not just arm64 :-( http://kisskb.ellerman.id.au/kisskb/head/5b7c4cabbb65f5c469464da6c5f614cbd7f730f2 Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Gr{oetje,eeting}s, Geert
On 2/22/23 07:03, Geert Uytterhoeven wrote: > On Wed, Feb 22, 2023 at 9:26 AM Viresh Kumar <viresh.kumar@linaro.org> wrote: >> Add the missing header for architectures that don't define >> the barrier_nospec() macro. The nospec.h header is added after the >> inclusion of barrier.h to avoid redefining the macro for architectures >> that already define barrier_nospec() in their respective barrier.h >> headers. >> >> Fixes: 74e19ef0ff80 ("uaccess: Add speculation barrier to copy_from_user()") >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> >> --- >> Linus's master branch fails currently to build for arm64 without this commit. > Not just arm64
On Wed, Feb 22, 2023 at 7:33 AM Dave Hansen <dave.hansen@intel.com> wrote: > > On 2/22/23 07:03, Geert Uytterhoeven wrote: > > On Wed, Feb 22, 2023 at 9:26 AM Viresh Kumar <viresh.kumar@linaro.org> wrote: > >> Add the missing header for architectures that don't define > >> the barrier_nospec() macro. The nospec.h header is added after the > >> inclusion of barrier.h to avoid redefining the macro for architectures > >> that already define barrier_nospec() in their respective barrier.h > >> headers. > >> > >> Fixes: 74e19ef0ff80 ("uaccess: Add speculation barrier to copy_from_user()") > >> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> > >> --- > >> Linus's master branch fails currently to build for arm64 without this commit. > > Not just arm64
On Wed, Feb 22, 2023 at 8:29 AM Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote: > > Linus, > Since the blast radius is big, may be apply the fix directly ? Yup, done. Of the different patches I picked the same location you had taken so that there shouldn't be any conflicts if that ends making it to me later. Linus
On 2/22/23 9:24 AM, Viresh Kumar wrote: > Add the missing header for architectures that don't define > the barrier_nospec() macro. The nospec.h header is added after the > inclusion of barrier.h to avoid redefining the macro for architectures > that already define barrier_nospec() in their respective barrier.h > headers. > > Fixes: 74e19ef0ff80 ("uaccess: Add speculation barrier to copy_from_user()") > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> > --- > Linus's master branch fails currently to build for arm64 without this commit. > > kernel/bpf/core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > index 933869983e2a..92aeb388e422 100644 > --- a/kernel/bpf/core.c > +++ b/kernel/bpf/core.c > @@ -38,6 +38,8 @@ > #include <linux/memcontrol.h> > > #include <asm/barrier.h> > +#include <linux/nospec.h> > + nit: The asm/barrier.h include could have just been removed. linux/nospec.h internally includes asm/barrier.h already. > #include <asm/unaligned.h> > > /* Registers */ >
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 933869983e2a..92aeb388e422 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -38,6 +38,8 @@ #include <linux/memcontrol.h> #include <asm/barrier.h> +#include <linux/nospec.h> + #include <asm/unaligned.h> /* Registers */
Add the missing header for architectures that don't define the barrier_nospec() macro. The nospec.h header is added after the inclusion of barrier.h to avoid redefining the macro for architectures that already define barrier_nospec() in their respective barrier.h headers. Fixes: 74e19ef0ff80 ("uaccess: Add speculation barrier to copy_from_user()") Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- Linus's master branch fails currently to build for arm64 without this commit. kernel/bpf/core.c | 2 ++ 1 file changed, 2 insertions(+)