Skip to contentSkip to conversation

qemuarm64.conf: change the cpu model to max

PATCH In review Yu, Mingli 3 participants 4 messages Jul 7, 2021 – Jul 20, 2021

lore
Share & tools
lore

Yu, Mingli

author
#0 lore raw

PATCH 1/1 qemuarm64.conf: change the cpu model to max

From: Mingli Yu <[email protected]>

After rng-tools upgraded to 6.13, the below logic introduced. 9070a04 Add support for ARM v8.5A "rndr" instruction

It means there is another entropy source rndr added for arm64, so modify the cpu model to max [1] to make the rndr entropy source function available and also used to silence the below failed message when start rngd service on qemuarm64.
"[rndr ]: Initialization Failed"

Before the patch:

 $ systemctl status rngd
 [snip]
 Jul 05 07:15:47 qemuarm64 systemd[1]: Started Hardware RNG Entropy Gatherer Daemon.
 Jul 05 07:15:48 qemuarm64 rngd[152]: Initializing available sources
 Jul 05 07:15:48 qemuarm64 rngd[152]: [hwrng ]: Initialized
 Jul 05 07:15:48 qemuarm64 rngd[152]: [rndr ]: No HW SUPPORT
 Jul 05 07:15:48 qemuarm64 rngd[152]: [rndr ]: Initialization Failed
 Jul 05 07:15:48 qemuarm64 rngd[152]: [jitter]: Initializing AES buffer
 Jul 05 07:16:14 qemuarm64 rngd[152]: [jitter]: Enabling JITTER rng support
 Jul 05 07:16:14 qemuarm64 rngd[152]: [jitter]: Initialized

After the patch:

 $ systemctl status rngd
 [snip]
 Jul 07 08:48:30 qemuarm64 systemd[1]: Started Hardware RNG Entropy Gatherer Daemon.
 Jul 07 08:48:34 qemuarm64 rngd[164]: Initializing available sources
 Jul 07 08:48:34 qemuarm64 rngd[164]: [hwrng ]: Initialized
 Jul 07 08:48:34 qemuarm64 rngd[164]: [rndr  ]: Enabling aarch64 RNDR rng support
 Jul 07 08:48:34 qemuarm64 rngd[164]: [rndr  ]: Initialized
 Jul 07 08:48:35 qemuarm64 rngd[164]: [jitter]: Initializing AES buffer

[1] https://github.com/nhorman/rng-tools/pull/128

---
 meta/conf/machine/qemuarm64.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/machine/qemuarm64.conf +1 -1
index 150a0744eb..a792dc32e6 100644
@@ -15,7 +15,7 @@ SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-aarch64"
 QB_MACHINE = "-machine virt"
-QB_CPU = "-cpu cortex-a57"
+QB_CPU = "-cpu max"
 QB_SMP = "-smp 4"
 QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
Signature · 1 line
2.17.1
#1 lore raw

'max' implies that it's not stable and will change depending on qemu version and build settings. Can you set it to a specific model?

Alex

Quoted 65 lines · Mingli

From: Mingli Yu <[email protected]>

After rng-tools upgraded to 6.13, the below logic introduced. 9070a04 Add support for ARM v8.5A "rndr" instruction

It means there is another entropy source rndr added for arm64, so modify the cpu model to max [1] to make the rndr entropy source function available and also used to silence the below failed message when start rngd service on qemuarm64.
"[rndr ]: Initialization Failed"

Before the patch:

 $ systemctl status rngd
 [snip]
 Jul 05 07:15:47 qemuarm64 systemd[1]: Started Hardware RNG Entropy
Gatherer Daemon.
 Jul 05 07:15:48 qemuarm64 rngd[152]: Initializing available sources
 Jul 05 07:15:48 qemuarm64 rngd[152]: [hwrng ]: Initialized
 Jul 05 07:15:48 qemuarm64 rngd[152]: [rndr ]: No HW SUPPORT
 Jul 05 07:15:48 qemuarm64 rngd[152]: [rndr ]: Initialization Failed
 Jul 05 07:15:48 qemuarm64 rngd[152]: [jitter]: Initializing AES buffer
 Jul 05 07:16:14 qemuarm64 rngd[152]: [jitter]: Enabling JITTER rng support
 Jul 05 07:16:14 qemuarm64 rngd[152]: [jitter]: Initialized

After the patch:

 $ systemctl status rngd
 [snip]
 Jul 07 08:48:30 qemuarm64 systemd[1]: Started Hardware RNG Entropy
Gatherer Daemon.
 Jul 07 08:48:34 qemuarm64 rngd[164]: Initializing available sources
 Jul 07 08:48:34 qemuarm64 rngd[164]: [hwrng ]: Initialized
 Jul 07 08:48:34 qemuarm64 rngd[164]: [rndr  ]: Enabling aarch64 RNDR rng
support
 Jul 07 08:48:34 qemuarm64 rngd[164]: [rndr  ]: Initialized
 Jul 07 08:48:35 qemuarm64 rngd[164]: [jitter]: Initializing AES buffer

[1] https://github.com/nhorman/rng-tools/pull/128

---
 meta/conf/machine/qemuarm64.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/machine/qemuarm64.conf +1 -1
index 150a0744eb..a792dc32e6 100644
@@ -15,7 +15,7 @@ SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-aarch64"
 QB_MACHINE = "-machine virt"
-QB_CPU = "-cpu cortex-a57"
+QB_CPU = "-cpu max"
 QB_SMP = "-smp 4"
 QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # For graphics to work we need to define the VGA device as well as the

necessary USB devices
--
2.17.1

#2 lore raw
Quoted 3 lines · Alexander Kanavin

'max' implies that it's not stable and will change depending on qemu version and build settings. Can you set it to a specific model?

I don't see stability an issue here as max is stable, A potential issue is that it will now depend on host cpu features which can then have result variance
so perhaps you should be able to add it as cpu feature attribute via -cpu <cpu>,feature1,feature2 etc. perhaps and also ensure that these features are
commonly available on ARM build hosts.

Quoted 66 lines

Alex

Quoted 60 lines · Mingli

From: Mingli Yu <[email protected]>

After rng-tools upgraded to 6.13, the below logic introduced. 9070a04 Add support for ARM v8.5A "rndr" instruction

It means there is another entropy source rndr added for arm64, so modify the cpu model to max [1] to make the rndr entropy source function available and also used to silence the below failed message when start rngd service on qemuarm64.
"[rndr ]: Initialization Failed"

Before the patch:

 $ systemctl status rngd
 [snip]
 Jul 05 07:15:47 qemuarm64 systemd[1]: Started Hardware RNG Entropy Gatherer Daemon.
 Jul 05 07:15:48 qemuarm64 rngd[152]: Initializing available sources
 Jul 05 07:15:48 qemuarm64 rngd[152]: [hwrng ]: Initialized
 Jul 05 07:15:48 qemuarm64 rngd[152]: [rndr ]: No HW SUPPORT
 Jul 05 07:15:48 qemuarm64 rngd[152]: [rndr ]: Initialization Failed
 Jul 05 07:15:48 qemuarm64 rngd[152]: [jitter]: Initializing AES buffer
 Jul 05 07:16:14 qemuarm64 rngd[152]: [jitter]: Enabling JITTER rng support
 Jul 05 07:16:14 qemuarm64 rngd[152]: [jitter]: Initialized

After the patch:

 $ systemctl status rngd
 [snip]
 Jul 07 08:48:30 qemuarm64 systemd[1]: Started Hardware RNG Entropy Gatherer Daemon.
 Jul 07 08:48:34 qemuarm64 rngd[164]: Initializing available sources
 Jul 07 08:48:34 qemuarm64 rngd[164]: [hwrng ]: Initialized
 Jul 07 08:48:34 qemuarm64 rngd[164]: [rndr  ]: Enabling aarch64 RNDR rng support
 Jul 07 08:48:34 qemuarm64 rngd[164]: [rndr  ]: Initialized
 Jul 07 08:48:35 qemuarm64 rngd[164]: [jitter]: Initializing AES buffer

[1] https://github.com/nhorman/rng-tools/pull/128

---
 meta/conf/machine/qemuarm64.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/machine/qemuarm64.conf +1 -2
index 150a0744eb..a792dc32e6 100644
@@ -15,7 +15,7 @@ SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
 # For runqemu
 QB_SYSTEM_NAME = "qemu-system-aarch64"
 QB_MACHINE = "-machine virt"
-QB_CPU = "-cpu cortex-a57"
+QB_CPU = "-cpu max"
 QB_SMP = "-smp 4"
 QB_CPU_KVM = "-cpu host -machine gic-version=3"
 # For graphics to work we need to define the VGA device as well as the necessary USB devices
--

2.17.1

author
#3 lore raw

PATCH v2 1/1 parselogs.py: ignore rndr initialization failure

From: Mingli Yu <[email protected]>

After rng-tools upgraded to 6.13, the RNDR instruction added as an entropy source [1]. But for some cpu which doesn't support rndr, there comes below warning message:

 # systemctl status rngd
 [snip]
 Jul 20 06:48:07 qemuarm64 rngd[163]: [rndr  ]: No HW SUPPORT
 Jul 20 06:48:07 qemuarm64 rngd[163]: [rndr  ]: Initialization Failed
 [snip]

Actually the failed message doesn't matter as it only indicates
one entropy source rndr fails to initialize and won't affect rngd
function, so ignore the failure message to fix below error during
do_testimage.
NOTE: ======================================================================
NOTE: FAIL: test_parselogs (parselogs.ParseLogsTest)
NOTE: ----------------------------------------------------------------------
NOTE: Traceback (most recent call last):
File "/build/layers/oe-core/meta/lib/oeqa/core/decorator/__init__.py", line 36, in wrapped_f
return func(*args, **kwargs)
File "/build/layers/oe-core/meta/lib/oeqa/runtime/cases/parselogs.py", line 382, in test_parselogs
self.assertEqual(errcount, 0, msg=self.msg)
AssertionError: 1 != 0 : Log: /build/tmp/work/qemuarm64-wrs-linux/wrlinux-image-std/1.0-r5/target_logs/daemon.log
-----------------------
Central error: 2021-06-23T20:44:18.374494+00:00 qemuarm64 rngd[162]: [rndr ]: Initialization Failed

---
 meta/lib/oeqa/runtime/cases/parselogs.py | 1 +
 1 file changed, 1 insertion(+)
meta/lib/oeqa/runtime/cases/parselogs.py +1 -0
index 1bb0425521..73243c3659 100644
@@ -59,6 +59,7 @@ common_errors = [
     "Failed to process device, ignoring: Device or resource busy",
     "Cannot find a map file",
     "[rdrand]: Initialization Failed",
+    "[rndr  ]: Initialization Failed",
     "[pulseaudio] authkey.c: Failed to open cookie file",
     "[pulseaudio] authkey.c: Failed to load authentication key",
     ]
Signature · 1 line
2.17.1