[PATCH powerpc/next 02/17] powerpc/bpf: Emit a single branch instruction for known short branch ranges

2022-02-14 Thread Naveen N. Rao
PPC_BCC() emits two instructions to accommodate scenarios where we need to branch outside the range of a conditional branch. PPC_BCC_SHORT() emits a single branch instruction and can be used when the branch is known to be within a conditional branch range. Convert some of the uses of PPC_BCC() in

[PATCH powerpc/next 01/17] powerpc/bpf: Skip branch range validation during first pass

2022-02-14 Thread Naveen N. Rao
During the first pass, addrs[] is still being populated. So, all branches to following instructions will appear to be going to the start of the JIT program. Ignore branch range validation for such instructions and assume those to be in range. Branch range validation will happen during the second

[PATCH powerpc/next 00/17] powerpc/bpf: Some updates and cleanups

2022-02-14 Thread Naveen N. Rao
This is a follow-up series with the pending patches from: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=279602=* Patches 1-5 and 8 are unchanged. Patch 6 is new and patch 7 has changes based on discussion from the last series. Patch 9 has a small change to not skip the toc load

Re: [PATCH v3 12/12] lkdtm: Add a test for function descriptors protection

2022-02-14 Thread Christophe Leroy
Le 11/02/2022 à 02:09, Kees Cook a écrit : > On Sun, Oct 17, 2021 at 02:38:25PM +0200, Christophe Leroy wrote: >> Add WRITE_OPD to check that you can't modify function >> descriptors. >> >> Gives the following result when function descriptors are >> not protected: >> >> lkdtm: Performing

Re: [PATCH v3 08/12] asm-generic: Refactor dereference_[kernel]_function_descriptor()

2022-02-14 Thread Christophe Leroy
Le 11/02/2022 à 01:56, Kees Cook a écrit : > On Thu, Feb 10, 2022 at 09:30:43PM +1100, Michael Ellerman wrote: >> Christophe Leroy writes: >>> diff --git a/kernel/extable.c b/kernel/extable.c >>> index b0ea5eb0c3b4..1ef13789bea9 100644 >>> --- a/kernel/extable.c >>> +++ b/kernel/extable.c >>>

Re: [PATCH v3 04/12] powerpc: Prepare func_desc_t for refactorisation

2022-02-14 Thread Christophe Leroy
Le 11/02/2022 à 01:54, Kees Cook a écrit : > On Sun, Oct 17, 2021 at 02:38:17PM +0200, Christophe Leroy wrote: >> In preparation of making func_desc_t generic, change the ELFv2 >> version to a struct containing 'addr' element. >> >> This allows using single helpers common to ELFv1 and ELFv2. >>

Re: Build regressions/improvements in v5.17-rc4

2022-02-14 Thread Geert Uytterhoeven
On Mon, 14 Feb 2022, Geert Uytterhoeven wrote: JFYI, when comparing v5.17-rc4[1] to v5.17-rc3[3], the summaries are: - build errors: +1/-0 + error: arch/powerpc/kvm/book3s_64_entry.o: relocation truncated to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common' defined in .text

Re: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256

2022-02-14 Thread Christophe Leroy
Le 14/02/2022 à 10:35, Peter Zijlstra a écrit : > On Sun, Feb 13, 2022 at 12:05:50AM +0100, Paul Menzel wrote: > >> [0.012154][T1] BUG: sleeping function called from invalid context at > >> [0.022443][T1] [c84837d0] [c0961aac] > >> dump_stack_lvl+0xa0/0xec

Re: No Linux logs when doing `ppc64_cpu --smt=off/8`

2022-02-14 Thread Michal Suchánek
Hello, On Mon, Feb 14, 2022 at 07:08:07AM +0100, Paul Menzel wrote: > Dear PPC folks, > > > On the POWER8 server IBM S822LC running `ppc64_cpu --smt=off` or `ppc64_cpu > --smt=8`, Linux 5.17-rc4 does not log anything. I would have expected a > message about the change in number of processing

Re: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256

2022-02-14 Thread Peter Zijlstra
On Sun, Feb 13, 2022 at 12:05:50AM +0100, Paul Menzel wrote: > [0.012154][T1] BUG: sleeping function called from invalid context at > [0.022443][T1] [c84837d0] [c0961aac] > > dump_stack_lvl+0xa0/0xec (unreliable) > [0.023356][T1] [c8483820]

Re: [PATCH] net: Remove branch in csum_shift()

2022-02-14 Thread Segher Boessenkool
On Sun, Feb 13, 2022 at 05:47:52PM +, David Laight wrote: > From: Segher Boessenkool > > Sent: 13 February 2022 09:16 > > In an ideal world the compiler could choose the optimal code sequences > > everywhere. But that won't ever happen, the search space is way too > > big. So compilers just

Re: [PATCH v5 3/6] mm: make alloc_contig_range work at pageblock granularity

2022-02-14 Thread Christophe Leroy
Le 11/02/2022 à 17:41, Zi Yan a écrit : > From: Zi Yan > > alloc_contig_range() worked at MAX_ORDER-1 granularity to avoid merging > pageblocks with different migratetypes. It might unnecessarily convert > extra pageblocks at the beginning and at the end of the range. Change >

<    1   2