projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
859a9d5
)
kselftest/arm64: Add hwcap test for RNG
author
Mark Brown
<broonie@kernel.org>
Tue, 13 Sep 2022 14:11:01 +0000
(15:11 +0100)
committer
Catalin Marinas
<catalin.marinas@arm.com>
Fri, 16 Sep 2022 11:40:58 +0000
(12:40 +0100)
Validate the RNG hwcap and make sure we don't generate a SIGILL reading
RNDR when it is reported.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link:
https://lore.kernel.org/r/20220913141101.151400-4-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
tools/testing/selftests/arm64/abi/hwcap.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/arm64/abi/hwcap.c
b/tools/testing/selftests/arm64/abi/hwcap.c
index 6c91b4a0987eaa81a8506736795d93f2e1f7b264..d173e41f21230b6ab151e7dcede485d0d663c476 100644
(file)
--- a/
tools/testing/selftests/arm64/abi/hwcap.c
+++ b/
tools/testing/selftests/arm64/abi/hwcap.c
@@
-33,6
+33,11
@@
*/
typedef void (*sigill_fn)(void);
+static void rng_sigill(void)
+{
+ asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0");
+}
+
static void sme_sigill(void)
{
/* RDSVL x0, #0 */
@@
-113,6
+118,13
@@
static const struct hwcap_data {
sigill_fn sigill_fn;
bool sigill_reliable;
} hwcaps[] = {
+ {
+ .name = "RNG",
+ .at_hwcap = AT_HWCAP2,
+ .hwcap_bit = HWCAP2_RNG,
+ .cpuinfo = "rng",
+ .sigill_fn = rng_sigill,
+ },
{
.name = "SME",
.at_hwcap = AT_HWCAP2,