MdePkg: Warn if AArch64 RNDR instruction is not supported
The BaseRngLib library constructor for AArch64 asserts if the
RNDR instruction is not supported by the CPU. This approach to
warn about the unsupported instruction may be suitable for the
host platform firmware. However, for a guest firmware the only
mechanism to discover the supported RNG interface is by probing
the processor feature registers.
The guest firmware may therefore assume that RNDR instruction
is supported and if the probe fails, fall back to an alternate
RNG source, e.g. Virtio RNG.
Therefore, replace the assert with a warning message to allow
the guest firmware to progress.
Note:
- If RNDR instruction is not supported, the GetRandomNumberXXX
functions will return FALSE to indicate that the random number
generation has failed. It is expected that the calling function
checks the status and handles this error appropriately.
- This change should not have any side effect as the behaviour
will be similar to that of release builds where the asserts
would be removed.
Signed-off-by:
Sami Mujawar <sami.mujawar@arm.com>
Loading
Please register or sign in to comment