[PATCH v8 2/3] arm64: random: Add data to pool from setup_arch()

Mark Brown broonie at kernel.org
Wed Jan 8 09:36:54 PST 2020


On Wed, Jan 08, 2020 at 05:20:41PM +0000, Mark Rutland wrote:
> On Tue, Jan 07, 2020 at 06:35:39PM +0000, Mark Brown wrote:

> > +	/* Add multiple values to mirror the generic code. */
> > +	for (i = 0; i < 16; i++)
> > +		if (__arm64_rndr(&val))
> > +			add_device_randomness(&val, sizeof(val));
> > +}

> Given the next patch also needs to check the I reckon it is worth
> factoring the ID register check into a helper:

> /* Used on the boot CPU before the CPU feature framework is up */
> static inline bool __init __early_cpu_has_rndr(void)
> {
> 	unsigned long ftr = read_sysreg_s(SYS_ID_AA64ISAR0_EL1);
> 	return (ftr >> ID_AA64ISAR0_RNDR_SHIFT) & 0xf;
> }

There was also some suggestion about making a generic helper that takes
the register and bitfield to look at.

At some point I do also start to question if we're really winning with
all this stuff static inline...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20200108/af83516c/attachment.sig>


More information about the linux-arm-kernel mailing list