[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211027121258.2501124-1-angelogioacchino.delregno@collabora.com>
Date: Wed, 27 Oct 2021 14:12:58 +0200
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: linux-integrity@...r.kernel.org
Cc: apronin@...omium.org, peterhuewe@....de, jarkko@...nel.org,
jgg@...pe.ca, linux-kernel@...r.kernel.org,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Subject: [RESEND PATCH] tpm: tpm_tis_spi_cr50: Add default RNG quality
To allow this device to fill the kernel's entropy pool at boot,
setup a default quality for the hwrng found in Cr50.
After some testing with rngtest and dieharder it was, in short,
discovered that the RNG produces fair quality randomness, giving
around 99.93% successes in rngtest FIPS140-2.
Notably, though, when testing with dieharder it was noticed that
the p-values distribution wasn't uniform in all the cases, so a
conservative quality value was chosen.
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
---
Sorry for the resend, I forgot to include linux-kernel@...r.kernel.org the
first time.
drivers/char/tpm/tpm_tis_spi_cr50.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/tpm/tpm_tis_spi_cr50.c b/drivers/char/tpm/tpm_tis_spi_cr50.c
index ea759af25634..d6195fb58036 100644
--- a/drivers/char/tpm/tpm_tis_spi_cr50.c
+++ b/drivers/char/tpm/tpm_tis_spi_cr50.c
@@ -264,6 +264,7 @@ int cr50_spi_probe(struct spi_device *spi)
phy = &cr50_phy->spi_phy;
phy->flow_control = cr50_spi_flow_control;
phy->wake_after = jiffies;
+ phy->priv.rng_quality = 700;
init_completion(&phy->ready);
cr50_phy->access_delay = CR50_NOIRQ_ACCESS_DELAY;
--
2.33.0
Powered by blists - more mailing lists