From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH v4 1/1] MdePkg/BaseRngLib: Add a smoketest for RDRAND and check CPUID To: Pedro Falcato ,devel@edk2.groups.io From: "Benjamin Doron" X-Originating-Location: Richmond Hill, Ontario, CA (24.52.200.135) X-Originating-Platform: Linux Chrome 111 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 26 Apr 2023 14:54:09 -0700 References: In-Reply-To: Message-ID: <26167.1682546049698720608@groups.io> Content-Type: multipart/alternative; boundary="Gv0dJHcFhb4DQG8QiaLg" --Gv0dJHcFhb4DQG8QiaLg Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, Is there merit to removing the assert statement? When this instance of the = RngLib class is used, the platform builder says there's RNG support. Assert= s are a little easier to see than debug prints, especially when they stall = the platform. I think that leaving it in is better. If asserts don't call C= puDeadLoop() or are removed from the build entirely, then ` ArchIsRngSuppor= ted()` will ensure safe behaviour (but incorrect functionality). Also, I'm slightly concerned that the check for minimum RDRAND changes will= succeed if it returns 0s, then 1s, then 0s... Though this seems like an RD= RAND broken too conveniently, not a true errata. Regards, Benjamin --Gv0dJHcFhb4DQG8QiaLg Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi,
Is there merit to removing the assert statement? When this instanc= e of the RngLib class is used, the platform builder says there's RNG suppor= t. Asserts are a little easier to see than debug prints, especially when th= ey stall the platform. I think that leaving it in is better. If asserts don= 't call CpuDeadLoop() or are removed from the build entirely, then `ArchIsRngSupported()` will ensure safe beha= viour (but incorrect functionality).

Also, I'm slightly c= oncerned that the check for minimum RDRAND changes will succeed if it retur= ns 0s, then 1s, then 0s... Though this seems like an RDRAND broken too conv= eniently, not a true errata.

Regards,
Benjamin --Gv0dJHcFhb4DQG8QiaLg--