Re: [PATCH v2 5/5] bpf ppc32: Add instructions for atomic_[cmp]xchg

2022-06-11 Thread Christophe Leroy
Le 10/06/2022 à 17:55, Hari Bathini a écrit : > This adds two atomic opcodes BPF_XCHG and BPF_CMPXCHG on ppc32, both > of which include the BPF_FETCH flag. The kernel's atomic_cmpxchg > operation fundamentally has 3 operands, but we only have two register > fields. Therefore the operand we

Re: [PATCH v2 4/5] bpf ppc32: add support for BPF_ATOMIC bitwise operations

2022-06-11 Thread Christophe Leroy
Le 10/06/2022 à 17:55, Hari Bathini a écrit : > Adding instructions for ppc32 for > > atomic_and > atomic_or > atomic_xor > atomic_fetch_add > atomic_fetch_and > atomic_fetch_or > atomic_fetch_xor > > Signed-off-by: Hari Bathini > --- > > Changes in v2: > * Used an additional register

[PATCH 2/2] powerpc: Move prom_init() out of asm-prototypes.h

2022-06-11 Thread Christophe Leroy
This is the end of the work started with commit 76222808fc25 ("powerpc: Move C prototypes out of asm-prototypes.h") Now that asm/machdep.h doesn't include asm/setup.h anymore, there are no conflicts anymore with the function prom_init() defined in

[PATCH 1/2] powerpc: Don't include asm/setup.h in asm/machdep.h

2022-06-11 Thread Christophe Leroy
asm/machdep.h doesn't need asm/setup.h Remove it. Add it directly in files that needs it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/machdep.h | 2 -- arch/powerpc/kernel/pci-common.c | 1 + arch/powerpc/kernel/prom.c | 2 +-

[PATCH 2/4] scsi: cxlflash: Include missing linux/irqdomain.h

2022-06-11 Thread Christophe Leroy
powerpc's asm/prom.h brings some headers that it doesn't need itself. Once those headers are removed from asm/prom.h, the following errors occur: CC [M] drivers/scsi/cxlflash/ocxl_hw.o drivers/scsi/cxlflash/ocxl_hw.c: In function 'afu_map_irq': drivers/scsi/cxlflash/ocxl_hw.c:195:16: error:

[PATCH 1/4] video: fbdev: offb: Include missing linux/platform_device.h

2022-06-11 Thread Christophe Leroy
A lot of drivers were getting platform and of headers indirectly via headers like asm/pci.h or asm/prom.h Most of them were fixed during 5.19 cycle but a newissue was introduced by commit 52b1b46c39ae ("of: Create platform devices for OF framebuffers") Include missing platform_device.h to allow

[PATCH 4/4] powerpc: Finally remove unnecessary headers from asm/prom.h

2022-06-11 Thread Christophe Leroy
Remove all headers included from asm/prom.h which are not used by asm/prom.h itself. Declare struct device_node and struct property locally to avoid including of.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/prom.h | 12 +++- 1 file changed, 3 insertions(+), 9

[PATCH 3/4] powerpc: Remove asm/prom.h from asm/mpc52xx.h and asm/pci.h

2022-06-11 Thread Christophe Leroy
asm/pci.h and asm/mpc52xx.h don't need asm/prom.h Declare struct device_node locally to avoid including of.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mpc52xx.h | 3 ++- arch/powerpc/include/asm/pci.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH v3 3/3] powerpc/pseries: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 17:10, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

Re: [PATCH v3 2/3] powerpc/powernv: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 17:10, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

Re: [PATCH v3 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 17:10, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

[PATCH v3 3/3] powerpc/pseries: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH v3 2/3] powerpc/powernv: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH v3 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH v3 0/3] powerpc: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. This series wires that up properly on the three platforms that currently initialize the RNG from the

Re: [PATCH v2 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 4:49 PM Christophe Leroy wrote: > Then you have: > > arch/powerpc/platforms/powernv/powernv.h > arch/powerpc/platforms/pseries/pseries.h > > and you can add > > arch/powerpc/platforms/microwatt/microwatt.h Oh, terrific, thanks. I'll do that. Jason

Re: [PATCH v2 3/3] powerpc/pseries: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 4:45 PM Christophe Leroy wrote: > > There must be a empty line between declarations and code. Ack. > Prototype has to go in a header file Already voiced disagreement about this in the other thread. > and should be pSeries maybe > allthough camelCase in

Re: [PATCH v2 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 16:46, Jason A. Donenfeld a écrit : > Hi again, > > On Sat, Jun 11, 2022 at 04:41:58PM +0200, Jason A. Donenfeld wrote: >> Hi Christophe, >> >> On Sat, Jun 11, 2022 at 4:40 PM Christophe Leroy >> wrote: +__init void microwatt_rng_init(void); >>> >>> This prototype

Re: [PATCH v2 2/3] powerpc/powernv: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 4:42 PM Christophe Leroy wrote: > Same here, the prototype should go in a header file., should be 'void > __init' (and indeed the __init is pointless in the prototype, only > matters in the function definition). I'll change the order, but I don't see a

Re: [PATCH v2 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi again, On Sat, Jun 11, 2022 at 04:41:58PM +0200, Jason A. Donenfeld wrote: > Hi Christophe, > > On Sat, Jun 11, 2022 at 4:40 PM Christophe Leroy > wrote: > > > > > > +__init void microwatt_rng_init(void); > > > > This prototype should be declared in a header file, for instance asm/setup.h >

Re: [PATCH v2 3/3] powerpc/pseries: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 12:04, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

Re: [PATCH v2 2/3] powerpc/powernv: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 12:04, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

Re: [PATCH v2 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 4:40 PM Christophe Leroy wrote: > > > > +__init void microwatt_rng_init(void); > > This prototype should be declared in a header file, for instance asm/setup.h Alright. > And I think the __init keyword usually goes after the type, so should be > 'void

Re: [PATCH v2 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 12:04, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

[PATCH v4.19] powerpc/32: Fix overread/overwrite of thread_struct via ptrace

2022-06-11 Thread Michael Ellerman
commit 8e127846fc97778a5e5c99bca1ce0bbc5ec9 upstream. The ptrace PEEKUSR/POKEUSR (aka PEEKUSER/POKEUSER) API allows a process to read/write registers of another process. To get/set a register, the API takes an index into an imaginary address space called the "USER area", where the registers

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 11:58, Jason A. Donenfeld a écrit : > Hi Christophe, > > On Sat, Jun 11, 2022 at 09:27:43AM +, Christophe Leroy wrote: >> Le 11/06/2022 à 11:22, Jason A. Donenfeld a écrit : >>> Hi Christophe, >>> >>> On Sat, Jun 11, 2022 at 11:17:23AM +0200, Christophe Leroy wrote:

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hey again, On Sat, Jun 11, 2022 at 11:58:23AM +0200, Jason A. Donenfeld wrote: > Anyway, sure, I'll do that and send a v2 series. This is now done here: https://lore.kernel.org/lkml/20220611100447.5066-1-ja...@zx2c4.com/ Jason

[PATCH v2 3/3] powerpc/pseries: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH v2 2/3] powerpc/powernv: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH v2 1/3] powerpc/microwatt: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH v2 0/3] powerpc: wire up rng during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. This series wires that up properly on the three platforms that currently initialize the RNG from the

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 09:27:43AM +, Christophe Leroy wrote: > Le 11/06/2022 à 11:22, Jason A. Donenfeld a écrit : > > Hi Christophe, > > > > On Sat, Jun 11, 2022 at 11:17:23AM +0200, Christophe Leroy wrote: > >> Also, you copied stable. Should you add a Fixes: tag so that we

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 11:22, Jason A. Donenfeld a écrit : > Hi Christophe, > > On Sat, Jun 11, 2022 at 11:17:23AM +0200, Christophe Leroy wrote: >> Also, you copied stable. Should you add a Fixes: tag so that we know >> what it fixes ? > > I suppose the fixes tag would be whatever introduced those

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 11:20, Jason A. Donenfeld a écrit : > Hi Christophe, > > On Sat, Jun 11, 2022 at 09:16:24AM +, Christophe Leroy wrote: >> Le 11/06/2022 à 10:11, Jason A. Donenfeld a écrit : >>> The platform's RNG must be available before random_init() in order to be >>> useful for initial

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 11:17:23AM +0200, Christophe Leroy wrote: > Also, you copied stable. Should you add a Fixes: tag so that we know > what it fixes ? I suppose the fixes tag would be whatever introduced those files in the first place, so not all together useful. But if you

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Jason A. Donenfeld
Hi Christophe, On Sat, Jun 11, 2022 at 09:16:24AM +, Christophe Leroy wrote: > Le 11/06/2022 à 10:11, Jason A. Donenfeld a écrit : > > The platform's RNG must be available before random_init() in order to be > > useful for initial seeding, which in turn means that it needs to be > > called

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 11:16, Christophe Leroy a écrit : Le 11/06/2022 à 10:11, Jason A. Donenfeld a écrit : The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an

Re: [PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Christophe Leroy
Le 11/06/2022 à 10:11, Jason A. Donenfeld a écrit : > The platform's RNG must be available before random_init() in order to be > useful for initial seeding, which in turn means that it needs to be > called from setup_arch(), rather than from an init call. Fortunately, > each platform already has

Re: [PATCH] powerpc/ptrace: Fix buffer overflow when handling PTRACE_PEEKUSER and PTRACE_POKEUSER

2022-06-11 Thread Christophe Leroy
Le 09/06/2022 à 11:52, Ariel Miculas a écrit : > This fixes the gdbserver issue on PPC32 described here: > Link: > https://linuxppc-dev.ozlabs.narkive.com/C46DRek4/debug-problems-on-ppc-83xx-target-due-to-changed-struct-task-struct > > On PPC32, the user space code considers the floating point

Re: [PATCH 1/6] powerpc: Add ZERO_GPRS macros for register clears

2022-06-11 Thread Christophe Leroy
Le 10/06/2022 à 05:32, Rohan McLure a écrit : >> On 2 Jun 2022, at 2:00 am, Segher Boessenkool >> wrote: >> >> Hi! >> >> On Wed, Jun 01, 2022 at 03:48:45PM +1000, Rohan McLure wrote: >>> +.macro BINOP_REGS op, rhs, start, end >>> + .Lreg=\start >>> + .rept (\end - \start + 1) >>> + \op

[PATCH] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Jason A. Donenfeld
The platform's RNG must be available before random_init() in order to be useful for initial seeding, which in turn means that it needs to be called from setup_arch(), rather than from an init call. Fortunately, each platform already has a setup_arch function pointer, which means it's easy to wire

[PATCH] powerpc: Restore CONFIG_DEBUG_INFO in defconfigs

2022-06-11 Thread Christophe Leroy
Commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable from a choice") broke the selection of CONFIG_DEBUG_INFO by powerpc defconfigs. It is now necessary to select one of the three DEBUG_INFO_DWARF* options to get DEBUG_INFO enabled. Replace DEBUG_INFO=y by