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
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
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.
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
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)
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
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]
[
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
]
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
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
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.
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
@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
>
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
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
: 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
, 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
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
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
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
: 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
, 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
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
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
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
: 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
, 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
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.
, 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.
-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 +-
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
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]
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
, 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
: 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
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
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/
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
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
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
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
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
-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
...@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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
> >
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
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
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
: 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
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
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
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
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
_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_
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
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)
>
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.
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
> >
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:
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:
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
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
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
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
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
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
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
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) {
> ...
>
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
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
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
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
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
> > >
> >
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
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
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
>
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
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 - 100 of 162 matches
Mail list logo