Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers

2018-10-05 Thread Jason A. Donenfeld
On Fri, Oct 5, 2018 at 7:29 PM Andy Lutomirski wrote: > (None of this is to say that I disagree with Jason, though -- I'm not > entirely convinced that this makes sense for Zinc. But maybe it can > be done in a way that makes everyone happy.) Zinc indeed will continue to push in the simpler and

Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers

2018-10-05 Thread Jason A. Donenfeld
Hey Andy, On Fri, Oct 5, 2018 at 7:44 PM Andy Lutomirski wrote: > I *think* the only change to Zinc per se would be that the calls like > chacha20_simd() would be static calls or patchable functions or > whatever we want to call them. And there could be a debugfs to > override the default

Re: [RFC PATCH 0/9] patchable function pointers for pluggable crypto routines

2018-10-05 Thread Jason A. Donenfeld
Hi Ard, On Fri, Oct 5, 2018 at 10:13 AM Ard Biesheuvel wrote: > At the moment, the Zinc library [1] is being proposed as a solution for that, > and while it does address the usability problems, it does a lot more than > that, and what we end up with is a lot less flexible than what we have now.

[PATCH] powerpc: PCI does not require PowerNV

2019-01-14 Thread Jason A. Donenfeld
i.o: in function `pSeries_final_fixup': pci.c:(.init.text+0x1b0): undefined reference to `pnv_npu2_init' This commit therefore wraps that line in an ifdef, so that PCI works without PowerNV. Signed-off-by: Jason A. Donenfeld Fixes: 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-12-19 Thread Jason A. Donenfeld
On Thu, Dec 19, 2019 at 1:52 PM Michael Ellerman wrote: > diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c > index f17ff1200eaa..e45cb9bba193 100644 > --- a/arch/powerpc/kernel/dbell.c > +++ b/arch/powerpc/kernel/dbell.c > @@ -63,7 +63,7 @@ int doorbell_try_core_ipi(int cpu)

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-12-20 Thread Jason A. Donenfeld
On Thu, Dec 19, 2019 at 2:08 PM Cédric Le Goater wrote:> > There is a patch for msgsndp in my tree you could try : > > https://github.com/legoater/qemu/tree/powernv-5.0 > > Currently being reviewed. I have to address some remarks from David before > it can be merged. Thanks. I've cherry-picked

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-12-19 Thread Jason A. Donenfeld
Hi folks, I'm actually still experiencing this sporadically in the WireGuard test suite, which you can see being run on https://build.wireguard.com/ . About 50% of the time the powerpc64 build will fail at a place like this: [ 65.147823] Oops: Exception in kernel mode, sig: 4 [#1] [

Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()

2019-12-19 Thread Jason A. Donenfeld
On Thu, Dec 19, 2019 at 12:13 PM Sebastian Andrzej Siewior wrote: > Based on my understanding is that the doorbell feature is part of the > architecture. It can be used to signal other siblings on the same CPU. > qemu TCG doesn't support that and does not allow to announce multiple > siblings on

[PATCH] powerpc/shared: include correct header for static key

2019-12-23 Thread Jason A. Donenfeld
] 44 | if (!static_branch_unlikely(_processor)) This commit adds the missing header. Fixes: 656c21d6af5d ("powerpc/shared: Use static key to detect shared processor") Cc: Srikar Dronamraju Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/spinlock.h | 1 + 1 file

Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-04-14 Thread Jason A. Donenfeld
On 4/13/20 3:15 PM, Waiman Long wrote: As said by Linus: A symmetric naming is only helpful if it implies symmetries in use. Otherwise it's actively misleading. In "kzalloc()", the z is meaningful and an important part of what the caller wants. In "kzfree()", the z is actively

Re: [PATCH 0/7] sha1 library cleanup

2020-05-02 Thread Jason A. Donenfeld
Thanks for this series. I like the general idea. I think it might make sense, though, to separate things out into sha1.h and sha256.h. That will be nice preparation work for when we eventually move obsolete primitives into some subdirectory.

Re: [PATCH v4 0/3] mm, treewide: Rename kzfree() to kfree_sensitive()

2020-06-16 Thread Jason A. Donenfeld
On Tue, Jun 16, 2020 at 12:54 PM Joe Perches wrote: > > On Mon, 2020-06-15 at 21:57 -0400, Waiman Long wrote: > > v4: > > - Break out the memzero_explicit() change as suggested by Dan Carpenter > > so that it can be backported to stable. > > - Drop the "crypto: Remove unnecessary

Re: [PATCH] treewide: drop CONFIG_EMBEDDED

2023-08-16 Thread Jason A. Donenfeld
@lists.infradead.org > Cc: Arnd Bergmann > Cc: Jason A. Donenfeld > Cc: wiregu...@lists.zx2c4.com > Cc: linux-a...@vger.kernel.org > Cc: linux-snps-...@lists.infradead.org > Cc: Vineet Gupta > Cc: Brian Cain > Cc: linux-hexa...@vger.kernel.org > Cc: Greg Ungerer >

[PATCH v6 00/17] archs/random: fallback to best raw ktime when no cycle counter

2022-04-23 Thread Jason A. Donenfeld
ibrecores.org Cc: linux-i...@vger.kernel.org Cc: linux-s...@vger.kernel.org Cc: linux-par...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Jason A. Donenfeld (17): ia64: define get_cycles macro for arch-override s390: define get_cycles macro for arch-override parisc: define get_cycles macro

[PATCH v6 05/17] powerpc: define get_cycles macro for arch-override

2022-04-27 Thread Jason A. Donenfeld
Mackerras Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/timex.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/include/asm/timex.h b/arch/powerpc/include/asm/timex.h index fa2e76e4093a..14b4489de52c 100644 --- a/arch/powerpc/include/asm/timex.h +++ b/arch/powerpc

[PATCH v2 1/2] powerpc/powernv: rename remaining rng powernv_ functions to pnv_

2022-06-24 Thread Jason A. Donenfeld
: f3eac426657 ("powerpc/powernv: wire up rng during setup_arch") Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/archrandom.h | 10 +++ arch/powerpc/kvm/book3s_hv_builtin.c | 4 +-- arch/powerpc/platforms/powernv/rng.c | 42 +-- drivers/char/hw_rand

[PATCH v2 2/2] powerpc/kvm: don't crash on missing rng, and use darn

2022-06-24 Thread Jason A. Donenfeld
, by routing H_RANDOM calls to ppc_md.get_random_seed, and doing the real mode check inside of it. Cc: sta...@vger.kernel.org # v4.1+ Cc: Michael Ellerman Fixes: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.") Signed-off-by: Jason A. Donenfeld --- arch/power

[PATCH v2 0/2] powerpc rng cleanups

2022-06-24 Thread Jason A. Donenfeld
These are two small cleanups for -next. Jason A. Donenfeld (2): powerpc/powernv: rename remaining rng powernv_ functions to pnv_ powerpc/kvm: don't crash on missing rng, and use darn arch/powerpc/include/asm/archrandom.h | 7 +-- arch/powerpc/kvm/book3s_hv_builtin.c | 7 +-- arch/powerpc

Re: [PATCH] powerpc/kvm: don't crash on missing rng, and use darn

2022-06-24 Thread Jason A. Donenfeld
Hi Fabiano, On Fri, Jun 24, 2022 at 3:43 PM Fabiano Rosas wrote: > > "Jason A. Donenfeld" writes: > > > On POWER8 systems that don't have ibm,power-rng available, a guest that > > ignores the KVM_CAP_PPC_HWRNG flag and calls H_RANDOM anyway will > > derefe

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

2022-06-21 Thread Jason A. Donenfeld
Hi Christophe, On Tue, Jun 21, 2022 at 06:33:11PM +, Christophe Leroy wrote: > Le 21/06/2022 à 16:08, 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 t

[PATCH] powerpc/powernv: rename remaining rng powernv_ functions to pnv_

2022-06-22 Thread Jason A. Donenfeld
: f3eac426657 ("powerpc/powernv: wire up rng during setup_arch") Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/archrandom.h | 10 +++ arch/powerpc/kvm/book3s_hv_builtin.c | 4 +-- arch/powerpc/platforms/powernv/rng.c | 42 +-- drivers/char/hw_rand

[PATCH] powerpc/kvm: don't crash on missing rng, and use darn

2022-06-22 Thread Jason A. Donenfeld
, by routing H_RANDOM calls to ppc_md.get_random_seed, and doing the real mode check inside of it. Cc: sta...@vger.kernel.org # v4.1+ Cc: Michael Ellerman Fixes: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.") Signed-off-by: Jason A. Donenfeld --- This

[PATCH v2] random: remove CONFIG_ARCH_RANDOM

2022-07-05 Thread Jason A. Donenfeld
Cc: H. Peter Anvin Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Signed-off-by: Jason A. Donenfeld --- arch/arm64/Kconfig| 8 arch/arm64/include/asm/archrandom.h | 10 -- arch/arm64/kernel/cpufeature.c

[PATCH v5] random: remove CONFIG_ARCH_RANDOM

2022-07-07 Thread Jason A. Donenfeld
ner Cc: H. Peter Anvin Acked-by: Borislav Petkov Acked-by: Heiko Carstens Acked-by: Greg Kroah-Hartman Signed-off-by: Jason A. Donenfeld --- Changes v4->v5: - Squelch warning on ARCH=um. - Include asm-generic on arm instead of duplicating code. Changes v3->v4: - Use asm-generic

[PATCH v4 0/2] powerpc rng cleanups

2022-07-01 Thread Jason A. Donenfeld
These are two small cleanups for -next. This is meant to be atop https://lore.kernel.org/all/20220630121654.1939181-1-ja...@zx2c4.com/ which is expected to land first. v4 fixes up an inversion of thr DR flag. Jason A. Donenfeld (2): powerpc/powernv: rename remaining rng powernv_ functions

[PATCH v4 1/2] powerpc/powernv: rename remaining rng powernv_ functions to pnv_

2022-07-01 Thread Jason A. Donenfeld
: f3eac426657 ("powerpc/powernv: wire up rng during setup_arch") Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/archrandom.h | 10 +++--- arch/powerpc/kvm/book3s_hv_builtin.c | 4 +-- arch/powerpc/platforms/powernv/rng.c | 44 +-- drivers/char/hw_rand

[PATCH v4 2/2] powerpc/kvm: don't crash on missing rng, and use darn

2022-07-01 Thread Jason A. Donenfeld
, by routing H_RANDOM calls to ppc_md.get_random_seed, and doing the real mode check inside of it. Cc: sta...@vger.kernel.org # v4.1+ Cc: Michael Ellerman Fixes: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.") Signed-off-by: Jason A. Donenfeld --- arch/power

Re: [PATCH v3 0/2] powerpc rng cleanups

2022-07-01 Thread Jason A. Donenfeld
On Fri, Jul 01, 2022 at 07:24:42AM +, Christophe Leroy wrote: > When DR is set you are in virtual mode > When DR is unset you are in real mode > > Extract from documentation: > > DR Data address translation > 0 Data address translation is disabled. > 1 Data address translation is enabled.

[PATCH v5 2/2] powerpc/kvm: don't crash on missing rng, and use darn

2022-07-11 Thread Jason A. Donenfeld
, by routing H_RANDOM calls to ppc_md.get_random_seed, and doing the real mode check inside of it. Cc: sta...@vger.kernel.org # v4.1+ Cc: Michael Ellerman Tested-by: Sachin Sant Fixes: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.") Signed-off-by: Jason A.

[PATCH v5 1/2] powerpc/powernv: rename remaining rng powernv_ functions to pnv_

2022-07-11 Thread Jason A. Donenfeld
-by: Sachin Sant Fixes: f3eac426657 ("powerpc/powernv: wire up rng during setup_arch") Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/archrandom.h | 10 +++--- arch/powerpc/kvm/book3s_hv_builtin.c | 4 +-- arch/powerpc/platforms/powernv/rng.c | 44 +-

[PATCH v5 0/2] powerpc rng cleanups

2022-07-11 Thread Jason A. Donenfeld
These are two small cleanups for -next. This v5 rebases on the latest git master, as some whitespace was added that made v4 no longer apply. Jason A. Donenfeld (2): powerpc/powernv: rename remaining rng powernv_ functions to pnv_ powerpc/kvm: don't crash on missing rng, and use darn arch

Re: [next-20220629] kobject warnings during boot

2022-06-30 Thread Jason A. Donenfeld
Hi Sachin, On Thu, Jun 30, 2022 at 05:01:57PM +0530, Sachin Sant wrote: > [0.000478] kobject: '(null)' ((ptrval)): is not initialized, yet > kobject_get() is being called. > [0.002925] [c2a0fb30] [c073b0bc] kobject_get+0x8c/0x100 > (unreliable) > [0.003071]

[PATCH] powerpc/powernv: delay rng of node creation until later in boot

2022-06-30 Thread Jason A. Donenfeld
werpc/powernv: wire up rng during setup_arch") Cc: sta...@vger.kernel.org Cc: Michael Ellerman Reported-by: Sachin Sant Signed-off-by: Jason A. Donenfeld --- arch/powerpc/platforms/powernv/rng.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platfor

[PATCH v3 2/2] powerpc/kvm: don't crash on missing rng, and use darn

2022-06-30 Thread Jason A. Donenfeld
, by routing H_RANDOM calls to ppc_md.get_random_seed, and doing the real mode check inside of it. Cc: sta...@vger.kernel.org # v4.1+ Cc: Michael Ellerman Fixes: e928e9cb3601 ("KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.") Signed-off-by: Jason A. Donenfeld --- arch/power

[PATCH v3 1/2] powerpc/powernv: rename remaining rng powernv_ functions to pnv_

2022-06-30 Thread Jason A. Donenfeld
: f3eac426657 ("powerpc/powernv: wire up rng during setup_arch") Signed-off-by: Jason A. Donenfeld --- arch/powerpc/include/asm/archrandom.h | 10 +++--- arch/powerpc/kvm/book3s_hv_builtin.c | 4 +-- arch/powerpc/platforms/powernv/rng.c | 44 +-- drivers/char/hw_rand

[PATCH v3 0/2] powerpc rng cleanups

2022-06-30 Thread Jason A. Donenfeld
These are two small cleanups for -next. I'm sending this v3 because very likely https://lore.kernel.org/all/20220630121654.1939181-1-ja...@zx2c4.com/ will land first, in which case this needs a small adjustment. Jason A. Donenfeld (2): powerpc/powernv: rename remaining rng powernv_ functions

Re: [PATCH v3 0/2] powerpc rng cleanups

2022-06-30 Thread Jason A. Donenfeld
Hi Sachin, Michael, On Thu, Jun 30, 2022 at 6:12 PM Sachin Sant wrote: > > On 30-Jun-2022, at 7:31 PM, Jason A. Donenfeld wrote: > > > > These are two small cleanups for -next. > > > > I'm sending this v3 because very likely > > https://lore.kernel.org/all/

[PATCH v4] random: remove CONFIG_ARCH_RANDOM

2022-07-06 Thread Jason A. Donenfeld
ner Cc: H. Peter Anvin Acked-by: Borislav Petkov Acked-by: Heiko Carstens Acked-by: Greg Kroah-Hartman Signed-off-by: Jason A. Donenfeld --- Changes v3->v4: - Use asm-generic for fallback. Changes v2->v3: - Keep compiling on archs with no ARCH_RANDOM. Changes v1->v2: - Get rid of nord

[PATCH v3] random: remove CONFIG_ARCH_RANDOM

2022-07-06 Thread Jason A. Donenfeld
Acked-by: Greg Kroah-Hartman Signed-off-by: Jason A. Donenfeld --- Changes v2->v3: - Keep compiling on archs with no ARCH_RANDOM. Changes v1->v2: - Get rid of nordrand change for now. arch/arm64/Kconfig| 8 arch/arm64/include/asm/archrandom.h

Re: [PATCH v4 0/2] powerpc rng cleanups

2022-07-02 Thread Jason A. Donenfeld
On Sat, Jul 02, 2022 at 04:00:03PM +0530, Sachin Sant wrote: > > On 01-Jul-2022, at 2:19 PM, Jason A. Donenfeld wrote: > > > > These are two small cleanups for -next. > > > > This is meant to be atop > > https://lore.kernel.org/all/20220630121654.1939181-1-ja

Re: [PATCH] powerpc/powernv: delay rng of node creation until later in boot

2022-07-02 Thread Jason A. Donenfeld
Hi Benjamin, Paul, On Thu, Jun 30, 2022 at 07:24:05PM +0530, Sachin Sant wrote: > > On 30-Jun-2022, at 5:46 PM, Jason A. Donenfeld wrote: > > > > The of node for the rng must be created much later in boot. Otherwise it > > tries to connect to a parent that does

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

2022-06-19 Thread Jason A. Donenfeld
Hi Michael, On Sun, Jun 19, 2022 at 1:49 PM Michael Ellerman wrote: > This crashes on power8 because it's too early to call kzalloc() in > rng_create(), and it's also too early to setup the percpu variables in > there. > > I'll rework it and post a v4. Oh, darn. Sorry about that. Thanks for

[PATCH v4] powerpc/powernv: wire up rng during setup_arch

2022-06-20 Thread Jason A. Donenfeld
-cpu allocations. This commit also removes some noisy log messages that don't add much. Cc: sta...@vger.kernel.org Cc: Michael Ellerman Reviewed-by: Christophe Leroy Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for powernv") Signed-off-by: Jason A. Donenfeld

[PATCH v5] powerpc/powernv: wire up rng during setup_arch

2022-06-21 Thread Jason A. Donenfeld
...@vger.kernel.org Cc: Michael Ellerman Reviewed-by: Christophe Leroy Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for powernv") Signed-off-by: Jason A. Donenfeld --- arch/powerpc/platforms/powernv/powernv.h | 2 + arch/powerpc/platforms/powernv/rng.

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 y

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

2022-06-11 Thread Jason A. Donenfeld
t;) Signed-off-by: Jason A. Donenfeld --- arch/powerpc/platforms/microwatt/rng.c | 9 ++--- arch/powerpc/platforms/microwatt/setup.c | 8 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/platforms/microwatt/rng.c b/arch/powerpc/platforms/microwatt/r

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

2022-06-11 Thread Jason A. Donenfeld
the wrong place. Jason A. Donenfeld (3): powerpc/microwatt: wire up rng during setup_arch powerpc/powernv: wire up rng during setup_arch powerpc/pseries: wire up rng during setup_arch arch/powerpc/platforms/microwatt/rng.c | 9 ++--- arch/powerpc/platforms/microwatt/setup.c | 8

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

2022-06-11 Thread Jason A. Donenfeld
t;) Signed-off-by: Jason A. Donenfeld --- arch/powerpc/platforms/pseries/rng.c | 11 ++- arch/powerpc/platforms/pseries/setup.c | 3 +++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/platforms/pseries/rng.c b/arch/powerpc/platforms/pseries/rng.c index 62

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

2022-06-11 Thread Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld --- arch/powerpc/platforms/powernv/rng.c | 17 - arch/powerpc/platforms/powernv/setup.c | 4 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c index e3

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] powerpc/rng: wire up during setup_arch

2022-06-11 Thread Jason A. Donenfeld
this up for each of the three platforms that have an RNG. This commit also removes some noisy log messages that don't add much. Cc: sta...@vger.kernel.org Cc: Michael Ellerman Signed-off-by: Jason A. Donenfeld --- arch/powerpc/platforms/microwatt/rng.c | 9 ++--- arch/powerpc/platforms

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 t

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 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 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

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 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 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

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

2022-06-11 Thread Jason A. Donenfeld
the wrong place. Cc: Michael Ellerman Cc: Christophe Leroy Jason A. Donenfeld (3): powerpc/microwatt: wire up rng during setup_arch powerpc/powernv: wire up rng during setup_arch powerpc/pseries: wire up rng during setup_arch arch/powerpc/platforms/microwatt/microwatt.h | 7 +++ arch

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

2022-06-11 Thread Jason A. Donenfeld
this up. This commit also removes some noisy log messages that don't add much. Cc: sta...@vger.kernel.org Cc: Michael Ellerman Cc: Christophe Leroy Fixes: c25769fddaec ("powerpc/microwatt: Add support for hardware random number generator") Signed-off-by: Jason A. Donenfeld --- ar

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

2022-06-11 Thread Jason A. Donenfeld
this up. This commit also removes some noisy log messages that don't add much. Cc: sta...@vger.kernel.org Cc: Michael Ellerman Cc: Christophe Leroy Fixes: a489043f4626 ("powerpc/pseries: Implement arch_get_random_long() based on H_RANDOM") Signed-off-by: Jason A. Donenfeld --- ar

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

2022-06-11 Thread Jason A. Donenfeld
this up. This commit also removes some noisy log messages that don't add much. Cc: sta...@vger.kernel.org Cc: Michael Ellerman Cc: Christophe Leroy Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for powernv") Signed-off-by: Jason A. Donenfeld --- arch/powerpc

Re: [PATCH v5 0/2] powerpc rng cleanups

2022-07-18 Thread Jason A. Donenfeld
Hey again, On Tue, Jul 12, 2022 at 01:24:46AM +0200, Jason A. Donenfeld wrote: > These are two small cleanups for -next. This v5 rebases on the latest > git master, as some whitespace was added that made v4 no longer apply. > > Jason A. Donenfeld (2): > powerpc/powernv: renam

Re: [PATCH v5 0/2] powerpc rng cleanups

2022-07-26 Thread Jason A. Donenfeld
Hi Michael, On Mon, Jul 18, 2022 at 3:09 PM Jason A. Donenfeld wrote: > > Hey again, > > On Tue, Jul 12, 2022 at 01:24:46AM +0200, Jason A. Donenfeld wrote: > > These are two small cleanups for -next. This v5 rebases on the latest > > git master, as some whitespac

Re: [PATCH v1 0/5] convert tree to get_random_u32_{below,above,between}()

2022-10-21 Thread Jason A. Donenfeld
On Fri, Oct 21, 2022 at 10:32:42PM -0700, Jakub Kicinski wrote: > But whatever. I mean - hopefully there aren't any conflicts in the ~50 > networking files you touch. I just wish that people didn't pipe up with > the tree wide changes right after the merge window. Feels like the > worst possible

Re: [PATCH v1 0/5] convert tree to get_random_u32_{below,above,between}()

2022-10-21 Thread Jason A. Donenfeld
On Fri, Oct 21, 2022 at 08:55:22PM -0700, Jakub Kicinski wrote: > On Fri, 21 Oct 2022 21:43:58 -0400 Jason A. Donenfeld wrote: > > Since get_random_u32_below() sits in my random.git tree, these patches > > too will flow through that same tree. > > How big is it? Can you pr

Re: [PATCH v1 0/5] convert tree to get_random_u32_{below,above,between}()

2022-10-24 Thread Jason A. Donenfeld
On Sun, Oct 23, 2022 at 05:07:13PM -0400, Theodore Ts'o wrote: > On Fri, Oct 21, 2022 at 11:03:22PM -0700, Jakub Kicinski wrote: > > On Sat, 22 Oct 2022 07:47:06 +0200 Jason A. Donenfeld wrote: > > > On Fri, Oct 21, 2022 at 10:32:42PM -0700, Jakub Kicinski wrote: > >

[PATCH v2] random: do not include from random.h

2022-10-28 Thread Jason A. Donenfeld
The header is a random.c private detail, not something to be called by other code. As such, don't make it automatically available by way of random.h. Cc: Michael Ellerman Cc: Heiko Carstens Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Signed-off-by: Jason A. Donenfeld

[PATCH v1 1/2] stackprotector: move CANARY_MASK and get_random_canary() into stackprotector.h

2022-10-23 Thread Jason A. Donenfeld
stackprotector.h file where it belongs. Signed-off-by: Jason A. Donenfeld --- arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/setup_percpu.c | 2 +- arch/x86/kernel/smpboot.c | 2 +- arch/x86/xen/enlighten_pv.c| 2 +- include/linux/random.h | 19 --- include/linux

[PATCH v1 2/2] stackprotector: actually use get_random_canary()

2022-10-23 Thread Jason A. Donenfeld
stackprotector.h files is superfluous and over-complicated. Instead, we can get exactly the same thing, but better, by just calling `get_random_canary()`. Signed-off-by: Jason A. Donenfeld --- arch/arm/include/asm/stackprotector.h | 9 + arch/arm64/include/asm/stackprotector.h | 9

[PATCH v1 0/2] cleanup stackprotector canary generation

2022-10-23 Thread Jason A. Donenfeld
: linuxppc-dev@lists.ozlabs.org Cc: x...@kernel.org Jason A. Donenfeld (2): stackprotector: move CANARY_MASK and get_random_canary() into stackprotector.h stackprotector: actually use get_random_canary() arch/arm/include/asm/stackprotector.h | 9 + arch/arm64/include/asm

[PATCH v1 1/5] treewide: use get_random_u32_below() instead of deprecated function

2022-10-21 Thread Jason A. Donenfeld
This is a simple mechanical transformation done by: @@ expression E; @@ - prandom_u32_max(E) + get_random_u32_below(E) Signed-off-by: Jason A. Donenfeld --- arch/arm/kernel/process.c | 2 +- arch/arm64/kernel/process.c | 2 +- arch/loongarch/kernel

[PATCH v1 0/5] convert tree to get_random_u32_{below,above,between}()

2022-10-21 Thread Jason A. Donenfeld
Cc: loonga...@lists.linux.dev Cc: linux-m...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-...@vger.kernel.org Cc: linux-par...@vger.kernel.org Jason A. Donenfeld (5): treewide: use get_random_u32_below() instead of deprecated function prandom: remove prandom_u32_max() random

[PATCH v1 2/5] prandom: remove prandom_u32_max()

2022-10-21 Thread Jason A. Donenfeld
With no more users left, we can finally remove this function. Its replacement is get_random_u32_below(). Signed-off-by: Jason A. Donenfeld --- include/linux/prandom.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/include/linux/prandom.h b/include/linux/prandom.h index 1f4a0de7b019

[PATCH v1 5/5] treewide: use get_random_u32_between() when possible

2022-10-21 Thread Jason A. Donenfeld
These cases were done with this Coccinelle: @@ expression H; expression L; @@ - (get_random_u32_below(H) + L) + get_random_u32_between(L, H + L) And then subsequently cleaned up by hand, with several automatic cases rejected if it didn't make sense contextually. Signed-off-by: Jason

[PATCH v1 4/5] treewide: use get_random_u32_{above,below}() instead of manual loop

2022-10-21 Thread Jason A. Donenfeld
_u32_above(0); @@ expression E; identifier I; @@ - E + 1 + get_random_u32_below(U32_MAX - E) + get_random_u32_above(E) Signed-off-by: Jason A. Donenfeld --- fs/ext4/mmp.c| 8 +--- lib/test_fprobe.c| 5 + lib/test_kprobes.c | 5 + net/ipv6/output_

[PATCH v1 3/5] random: add helpers for random numbers with given floor or range

2022-10-21 Thread Jason A. Donenfeld
Now that we have get_random_u32_below(), it's trivial to make inline helpers to compute get_random_u32_above() and get_random_u32_between(), which will help clean up open coded loops and manual computations throughout the tree. Signed-off-by: Jason A. Donenfeld --- include/linux/random.h | 24

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-1 tag

2022-10-12 Thread Jason A. Donenfeld
On Wed, Oct 12, 2022 at 07:18:27AM -0700, Guenter Roeck wrote: > NIP [c0031630] .replay_soft_interrupts+0x60/0x300 > LR [c0031964] .arch_local_irq_restore+0x94/0x1c0 > Call Trace: > [c7df3870] [c0031964] .arch_local_irq_restore+0x94/0x1c0 > (unreliable) >

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-1 tag

2022-10-12 Thread Jason A. Donenfeld
On Wed, Oct 12, 2022 at 10:48:26AM -0700, Guenter Roeck wrote: > > I've also managed to not hit this bug a few times. When it triggers, > > after "kprobes: kprobe jump-optimization is enabled. All kprobes are > > optimized if possible.", there's a long hang - tens seconds before it > > continues.

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-1 tag

2022-10-12 Thread Jason A. Donenfeld
On Wed, Oct 12, 2022 at 09:44:52AM -0700, Guenter Roeck wrote: > On Wed, Oct 12, 2022 at 09:49:26AM -0600, Jason A. Donenfeld wrote: > > On Wed, Oct 12, 2022 at 07:18:27AM -0700, Guenter Roeck wrote: > > > NIP [c0031630] .replay_soft_interrupts+0x60/0x300 > >

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-1 tag

2022-10-12 Thread Jason A. Donenfeld
On Wed, Oct 12, 2022 at 09:49:26AM -0600, Jason A. Donenfeld wrote: > On Wed, Oct 12, 2022 at 07:18:27AM -0700, Guenter Roeck wrote: > > NIP [c0031630] .replay_soft_interrupts+0x60/0x300 > > LR [c0031964] .arch_local_irq_restore+0x94/0x1c0 > > Call Trace:

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.1-1 tag

2022-10-12 Thread Jason A. Donenfeld
On Thu, Oct 13, 2022 at 03:03:14PM +1000, Nicholas Piggin wrote: > On Thu Oct 13, 2022 at 10:21 AM AEST, Guenter Roeck wrote: > > On Thu, Oct 13, 2022 at 11:03:34AM +1100, Michael Ellerman wrote: > > > Guenter Roeck writes: > > > > On Wed, Oct 12, 2022 at 11:20:

Re: [PATCH v6 5/7] treewide: use get_random_u32() when possible

2022-10-13 Thread Jason A. Donenfeld
On Thu, Oct 13, 2022 at 01:40:40PM +0200, Rolf Eike Beer wrote: > Am Donnerstag, 13. Oktober 2022, 12:16:35 CEST schrieb Florian Westphal: > > Rolf Eike Beer wrote: > > > Florian, can you comment and maybe fix it? > > > > Can't comment, do not remember -- this was 5 years ago. > > > > > Or you

[PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-05 Thread Jason A. Donenfeld
The prandom_u32() function has been a deprecated inline wrapper around get_random_u32() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. Signed-off-by: Jason A. Donenfeld --- Documentation/networking

[PATCH v1 4/5] treewide: use get_random_bytes when possible

2022-10-05 Thread Jason A. Donenfeld
The prandom_bytes() function has been a deprecated inline wrapper around get_random_bytes() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. Signed-off-by: Jason A. Donenfeld --- arch/powerpc/crypto/crc

[PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-05 Thread Jason A. Donenfeld
Rather than incurring a division or requesting too many random bytes for the given range, use the prandom_u32_max() function, which only takes the minimum required bytes from the RNG and avoids divisions. Signed-off-by: Jason A. Donenfeld --- arch/x86/mm/pat/cpa-test.c| 4

[PATCH v1 2/5] treewide: use get_random_{u8,u16}() when possible

2022-10-05 Thread Jason A. Donenfeld
Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value, simply use the get_random_{u8,u16}() functions, which are faster than wasting the additional bytes from a 32-bit value. Signed-off-by: Jason A. Donenfeld --- crypto/testmgr.c | 8

[PATCH v1 5/5] prandom: remove unused functions

2022-10-05 Thread Jason A. Donenfeld
With no callers left of prandom_u32() and prandom_bytes(), remove these deprecated wrappers. Signed-off-by: Jason A. Donenfeld --- include/linux/prandom.h | 12 1 file changed, 12 deletions(-) diff --git a/include/linux/prandom.h b/include/linux/prandom.h index 78db003bc290

Re: [PATCH v1 2/5] treewide: use get_random_{u8,u16}() when possible

2022-10-06 Thread Jason A. Donenfeld
On Wed, Oct 05, 2022 at 09:38:02PM -0700, Kees Cook wrote: > > diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c > > index 56ffaa8dd3f6..0131ed2cd1bd 100644 > > --- a/lib/test_vmalloc.c > > +++ b/lib/test_vmalloc.c > > @@ -80,7 +80,7 @@ static int random_size_align_alloc_test(void) > > int

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld
On Thu, Oct 06, 2022 at 10:43:31AM +0200, Jan Kara wrote: > The code here is effectively doing the > > parent_group = prandom_u32_max(ngroups); > > Similarly here we can use prandom_u32_max(ngroups) like: > > if (qstr) { > ... >

[PATCH v3 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Jason A. Donenfeld
Reviewed-by: Jan Kara # for ext2, ext4, and sbitmap Signed-off-by: Jason A. Donenfeld --- arch/arm/kernel/process.c | 2 +- arch/loongarch/kernel/vdso.c | 2 +- arch/mips/kernel/vdso.c | 2 +- arch/parisc/kernel/vdso.c

[PATCH v3 2/5] treewide: use get_random_{u8,u16}() when possible

2022-10-06 Thread Jason A. Donenfeld
Rather than truncate a 32-bit value to a 16-bit value or an 8-bit value, simply use the get_random_{u8,u16}() functions, which are faster than wasting the additional bytes from a 32-bit value. Reviewed-by: Kees Cook Acked-by: Toke Høiland-Jørgensen # for sch_cake Signed-off-by: Jason

Re: [PATCH v1 0/5] treewide cleanup of random integer usage

2022-10-06 Thread Jason A. Donenfeld
On Wed, Oct 05, 2022 at 09:55:43PM -0700, Kees Cook wrote: > It'd be nice to capture some (all?) of the above somewhere. Perhaps just > a massive comment in the header? I'll include (something like) this in some "how to use" documentation I'm working on separately. > > I've CC'd

Re: [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld
On Thu, Oct 6, 2022 at 6:47 AM Jason Gunthorpe wrote: > > On Wed, Oct 05, 2022 at 11:48:42PM +0200, Jason A. Donenfeld wrote: > > > index 14392c942f49..499a425a3379 100644 > > --- a/drivers/infiniband/hw/cxgb4/cm.c > > +++ b/drivers/infiniband/hw/cxgb4/cm.c > &g

Re: [f2fs-dev] [PATCH v1 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld
On Thu, Oct 6, 2022 at 7:01 AM Andy Shevchenko wrote: > > On Thu, Oct 06, 2022 at 06:33:15AM -0600, Jason A. Donenfeld wrote: > > On Thu, Oct 06, 2022 at 10:43:31AM +0200, Jan Kara wrote: > > ... > > > > The code here is effectively doing the > > > > >

[PATCH v3 5/5] prandom: remove unused functions

2022-10-06 Thread Jason A. Donenfeld
With no callers left of prandom_u32() and prandom_bytes(), as well as get_random_int(), remove these deprecated wrappers, in favor of get_random_u32() and get_random_bytes(). Reviewed-by: Kees Cook Signed-off-by: Jason A. Donenfeld --- drivers/char/random.c | 11 +-- include/linux

[PATCH v3 0/5] treewide cleanup of random integer usage

2022-10-06 Thread Jason A. Donenfeld
ux-r...@vger.kernel.org Cc: linux-s...@vger.kernel.org Cc: linux...@lists.infradead.org Cc: linux-...@vger.kernel.org Cc: linux-wirel...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: loonga...@lists.linux.dev Cc: net...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: x...@kernel.org J

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld
Hi Christophe, On Thu, Oct 6, 2022 at 11:21 AM Christophe Leroy wrote: > Le 06/10/2022 à 18:53, Jason A. Donenfeld a écrit : > > The prandom_u32() function has been a deprecated inline wrapper around > > get_random_u32() for several releases now, and compiles down to the >

Re: [PATCH v1 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Jason A. Donenfeld
Hi Kees, On Wed, Oct 05, 2022 at 09:16:50PM -0700, Kees Cook wrote: > On Wed, Oct 05, 2022 at 11:48:40PM +0200, Jason A. Donenfeld wrote: > > Rather than incurring a division or requesting too many random bytes for > > the given range, use the prandom_u32_max() function, w

Re: [f2fs-dev] [PATCH v1 0/5] treewide cleanup of random integer usage

2022-10-06 Thread Jason A. Donenfeld
A v2 that won't murder your mail setup is now available here: https://lore.kernel.org/lkml/20221006132510.23374-1-ja...@zx2c4.com/ Please do not (attempt to) post more replies to v1, as it kicks up a storm of angry MTAs.

  1   2   >