From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id F11B2D800F5 for ; Mon, 1 Jul 2024 13:28:21 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=UVWtbmeCZ5rAnPVSzmTj84fpOT/RqW/frR6p+7ApoV8=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:CC:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1719840501; v=1; b=YdaYTW3pXtV6qqyuasd2QSyy34sLjapkYmeoxTdiqGRf0WiOpW3/CyMKLZulBeh7gNM1EWDH dLMQH1mHcjpSDzZ3Dtc7PgFFUPLfMnKnt763PKW1q89anKqKwx0HTI3IiVt11BUdN84qJ0o2lug HpvtZ0zkDCgCSCFCoqPC2FtN6WABDLaOECv0QeLtUmwtUGTufJPDV7lMp8fFw7VmWNpfhFCagIG mzR47SXdMqKvc+FNG1mzh0CiolYdP8WjUPMCmnLHDKzQcDSsGIs1xQw4MB3g+ehCslH+Kim4QNL hEHj98vJuEglZifmH8KKOk6VJadJQQ1iLjWFINTZ5Md1Q== X-Received: by 127.0.0.2 with SMTP id oTl6YY7687511xQ9JPVmd851; Mon, 01 Jul 2024 06:28:20 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.19712.1719840499753206377 for ; Mon, 01 Jul 2024 06:28:19 -0700 X-Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4619ntZn019563; Mon, 1 Jul 2024 13:28:19 GMT X-Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 402bejm1wj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Jul 2024 13:28:19 +0000 (GMT) X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 461DSINX004823 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 Jul 2024 13:28:18 GMT X-Received: from [10.111.143.246] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 1 Jul 2024 06:28:17 -0700 Message-ID: <9b49bd01-ef9d-4a7d-8738-138a2c6c2ebd@quicinc.com> Date: Mon, 1 Jul 2024 14:28:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/1] SbsaQemu: use FEAT_RNG for EFI_RNG_PROTOCOL To: Marcin Juszkiewicz , CC: Ard Biesheuvel References: <20240627142212.408917-1-marcin.juszkiewicz@linaro.org> <20240627142212.408917-2-marcin.juszkiewicz@linaro.org> <59847794-9dd1-4be1-b5ac-e61f22c60386@quicinc.com> <2176e4bf-dcd1-4aa5-9866-eaa852ae0fb0@linaro.org> From: "Leif Lindholm" In-Reply-To: <2176e4bf-dcd1-4aa5-9866-eaa852ae0fb0@linaro.org> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: hwB8tVySAbM8VIb6ydd4Gd6_UN1h7DVf X-Proofpoint-ORIG-GUID: hwB8tVySAbM8VIb6ydd4Gd6_UN1h7DVf X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0031df01.pphosted.com id 4619ntZn019563 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 01 Jul 2024 06:28:19 -0700 Resent-From: quic_llindhol@quicinc.com Reply-To: devel@edk2.groups.io,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: S0VmxVBiKuV7lMHddVWp8Rktx7686176AA= Content-Language: en-GB Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=YdaYTW3p; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.com (policy=none) On 2024-07-01 13:58, Marcin Juszkiewicz wrote: >>> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc=20 >>> b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc >>> index 9306986bf7c0..3463e5c7a635 100644 >>> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.dsc >>> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.dsc >>> @@ -148,7 +148,9 @@ [LibraryClasses.common] >>> =C2=A0=C2=A0=C2=A0 # >> >> Since sbsa-ref still supports processors without FEAT_RNG, this may=20 >> cause unexpected breakages for some users. >=20 > That's why I sent it as more of RFC than changes for merging. >=20 >> Could we first of all conditionalise this change: >> >> [Defines] >> ... >> =C2=A0=C2=A0 DEFINE_DEBUG_PRINT_ERROR_LEVEL =3D ... >> =C2=A0=C2=A0 DEFINE FEATRNG_ENABLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 =3D TRUE >> >> so that someone who still wishes to run tests against older cpus can=20 >> still do so through a rebuild with -D FEATRNG_ENABLE=3DFALSE >=20 > Is there a way to load both BaseRngLib and BaseRngLibTimerLib and switch > between them depending on availability of FEAT_RNG? Not without severe hackery. The library is statically linked into RngDxe. >>> diff --git a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf=20 >>> b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf >>> index b35f42e11aa4..51a1ef8519f9 100644 >>> --- a/Platform/Qemu/SbsaQemu/SbsaQemu.fdf >>> +++ b/Platform/Qemu/SbsaQemu/SbsaQemu.fdf >>> @@ -192,6 +192,7 @@ [FV.FvMain] >>> =C2=A0=C2=A0=C2=A0 INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf >>> =C2=A0=C2=A0=C2=A0 INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf >>> =C2=A0=C2=A0=C2=A0 INF MdeModulePkg/Universal/WatchdogTimerDxe/Watchdog= Timer.inf >>> +=C2=A0 INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf >> >> Second: >> What is the failure mode of running the BaseRngLib flavour on cpus=20 >> that don't support FEAT_RNG? RngDxe itself seems to do the right=20 >> thing, but do we get any warning messages or will certain operations=20 >> now fail silently? >=20 > On FEAT_RNG cores we get: >=20 > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 101FAD6879= 8 > ProtectUefiImageCommon - 0xFAD683C0 > =C2=A0 - 0x00000101FBBDB000 - 0x0000000000007000 > ArmTrngLib could not be correctly initialized. > InstallProtocolInterface: 3152BCA5-EADE-433D-862E-C01CDC291F44 101FBBE002= 0 > Loading driver B601F8C4-43B7-4784-95B1-F4226CB40CEE >=20 >=20 > On core without FEAT_RNG: >=20 > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 101FAD6879= 8 > ProtectUefiImageCommon - 0xFAD683C0 > =C2=A0 - 0x00000101FBBDB000 - 0x0000000000007000 > ArmTrngLib could not be correctly initialized. > Error: Image at 101FBBDB000 start failed: 00000001 > Loading driver B601F8C4-43B7-4784-95B1-F4226CB40CEE But it still keeps booting correctly after that? With some missing=20 functionality? > So there is some kind of information but you need to know what > to look for ;( Ard: would you be opposed to putting a DEBUG print and/or an ASSERT in=20 BaseRngLibContructor if mRndrSupported =3D=3D 0? An alternative would be to place a test and noisy warning inside=20 SbsaQemuPlatformDxe. / Leif -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119737): https://edk2.groups.io/g/devel/message/119737 Mute This Topic: https://groups.io/mt/106909459/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-