[EXTERNAL] Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe


Bret Barkelew <bret.barkelew@...>
 

I vote the latter.

- Bret

From: Rebecca Cran via groups.io<mailto:rebecca@...>
Sent: Monday, April 26, 2021 2:29 PM
To: Sami Mujawar<mailto:Sami.Mujawar@...>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Samer El-Haj-Mahmoud<mailto:Samer.El-Haj-Mahmoud@...>; Ard Biesheuvel<mailto:Ard.Biesheuvel@...>; leif@...<mailto:leif@...>
Cc: rfc@edk2.groups.io<mailto:rfc@edk2.groups.io>; Yao, Jiewen<mailto:jiewen.yao@...>; Rahul Kumar<mailto:rahul1.kumar@...>; nd<mailto:nd@...>; Jose Marinho<mailto:Jose.Marinho@...>
Subject: [EXTERNAL] Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe

Hi Sami,

I've been looking through the design document again, and was wondering
if the work I previously did will just slot in?

Were you thinking the "RngLib|RNDR" would go into ArmPkg (since it's not
labeled as being in BaseRngLib)? Or would it still make sense to
refactor MdePkg/Library/BaseRngLib to support both x86 (using RDRAND)
and aarch64 (using RNDR)?

--
Rebecca Cran



On 4/22/21 3:30 AM, Sami Mujawar wrote:
Hi Rebecca,

I have been working on the following modules (See slide 11 in “EDKII -
Proposed update to RNG implementation.pdf
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0>”<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0%3e”>):

1. TrngLib|FwTrnglib (Arm Firmware TRNG)
2. DrbgLib stack – with support for DrbgAlgorithmLib|CRT_DRBG &
AesLib|ArmAesInstructionLib.

I plan to post patches for (a) in the next fortnight. Following this I
plan to update the proposal with the interface definitions for the
various library interfaces in the DrbgLib Stack.

I have not looked at RngLib|RNDR as I believe you were interested in
implementing the part. Kindly let me know if you plan to implement this
and the platform you would be using for testing. It looks like the
FVP_Base_AEMv8A-AEMv8A and the FVP-RevC models support RNDR, so these
could be used for testing as well. Please feel free to get in touch
should you need any help with the model parameters or if you face any
issues.

Regards,

Sami Mujawar

*From: *Rebecca Cran <rebecca@...>
*Date: *Tuesday, 20 April 2021 at 21:04
*To: *Sami Mujawar <Sami.Mujawar@...>, devel@edk2.groups.io
<devel@edk2.groups.io>, Samer El-Haj-Mahmoud
<Samer.El-Haj-Mahmoud@...>, Ard Biesheuvel <Ard.Biesheuvel@...>,
leif@... <leif@...>
*Cc: *rfc@edk2.groups.io <rfc@edk2.groups.io>, Jiewen Yao
<jiewen.yao@...>, Rahul Kumar <rahul1.kumar@...>, nd
<nd@...>, Jose Marinho <Jose.Marinho@...>
*Subject: *Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to
RngDxe

Hi Sami,

I was wondering if you're still collecting feedback on the design, or if
you have a plan and schedule for the implementation?

--
Rebecca Cran

On 1/15/21 7:51 PM, Sami Mujawar wrote:
> Hi All,
>
> I have shared some initial thoughts on the RNG implementation updates
at
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0>
>
> Kindly let me know your feedback or if you have any queries.
>
> Regards,
>
> Sami Mujawar
>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Rebecca Cran via groups.io
> Sent: 14 January 2021 09:05 PM
> To: Sami Mujawar <Sami.Mujawar@...>; devel@edk2.groups.io; Samer
El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>; Ard Biesheuvel
<Ard.Biesheuvel@...>; leif@...
> Cc: rfc@edk2.groups.io; Jiewen Yao <jiewen.yao@...>; Rahul
Kumar <rahul1.kumar@...>; nd <nd@...>
> Subject: Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to
RngDxe
>
> On 12/10/20 4:26 AM, Sami Mujawar wrote:
>
>> I am working on the TRNG FW API interface and will share more details
>> for the discussion soon.
>>
>> We had some thoughts about streamlining the RngDxe implementations and
>> would like to share some diagrams for the discussion.
>>
>> My diagrams are in Visio that I can export as JPG images. However, I am
>> open to switching to any other suggested tool.
>
> Hi Sami,
>
> I don't see any further discussions on this. Have you made any progress
> with sharing the design documents or scheduling a review?
>


Sami Mujawar
 

Hi Rebecca,

I agree MdePkg/Library/BaseRngLib can be refactored to support both x86 and AArch64.
BaseRngLib would then be a RngLib instance that uses CPU instructions to provide random numbers.

Regards,

Sami Mujawar

From: Bret Barkelew <Bret.Barkelew@...>
Date: Monday, 26 April 2021 at 22:45
To: devel@edk2.groups.io <devel@edk2.groups.io>, rebecca@... <rebecca@...>, Sami Mujawar <Sami.Mujawar@...>, Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>, Ard Biesheuvel <Ard.Biesheuvel@...>, leif@... <leif@...>
Cc: rfc@edk2.groups.io <rfc@edk2.groups.io>, Yao, Jiewen <jiewen.yao@...>, Rahul Kumar <rahul1.kumar@...>, nd <nd@...>, Jose Marinho <Jose.Marinho@...>
Subject: RE: [EXTERNAL] Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe
I vote the latter.

- Bret

From: Rebecca Cran via groups.io<mailto:rebecca@...>
Sent: Monday, April 26, 2021 2:29 PM
To: Sami Mujawar<mailto:Sami.Mujawar@...>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Samer El-Haj-Mahmoud<mailto:Samer.El-Haj-Mahmoud@...>; Ard Biesheuvel<mailto:Ard.Biesheuvel@...>; leif@...<mailto:leif@...>
Cc: rfc@edk2.groups.io<mailto:rfc@edk2.groups.io>; Yao, Jiewen<mailto:jiewen.yao@...>; Rahul Kumar<mailto:rahul1.kumar@...>; nd<mailto:nd@...>; Jose Marinho<mailto:Jose.Marinho@...>
Subject: [EXTERNAL] Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe

Hi Sami,

I've been looking through the design document again, and was wondering
if the work I previously did will just slot in?

Were you thinking the "RngLib|RNDR" would go into ArmPkg (since it's not
labeled as being in BaseRngLib)? Or would it still make sense to
refactor MdePkg/Library/BaseRngLib to support both x86 (using RDRAND)
and aarch64 (using RNDR)?

--
Rebecca Cran



On 4/22/21 3:30 AM, Sami Mujawar wrote:
Hi Rebecca,

I have been working on the following modules (See slide 11 in “EDKII -
Proposed update to RNG implementation.pdf
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0>”<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0%3e”>):

1. TrngLib|FwTrnglib (Arm Firmware TRNG)
2. DrbgLib stack – with support for DrbgAlgorithmLib|CRT_DRBG &
AesLib|ArmAesInstructionLib.

I plan to post patches for (a) in the next fortnight. Following this I
plan to update the proposal with the interface definitions for the
various library interfaces in the DrbgLib Stack.

I have not looked at RngLib|RNDR as I believe you were interested in
implementing the part. Kindly let me know if you plan to implement this
and the platform you would be using for testing. It looks like the
FVP_Base_AEMv8A-AEMv8A and the FVP-RevC models support RNDR, so these
could be used for testing as well. Please feel free to get in touch
should you need any help with the model parameters or if you face any
issues.

Regards,

Sami Mujawar

*From: *Rebecca Cran <rebecca@...>
*Date: *Tuesday, 20 April 2021 at 21:04
*To: *Sami Mujawar <Sami.Mujawar@...>, devel@edk2.groups.io
<devel@edk2.groups.io>, Samer El-Haj-Mahmoud
<Samer.El-Haj-Mahmoud@...>, Ard Biesheuvel <Ard.Biesheuvel@...>,
leif@... <leif@...>
*Cc: *rfc@edk2.groups.io <rfc@edk2.groups.io>, Jiewen Yao
<jiewen.yao@...>, Rahul Kumar <rahul1.kumar@...>, nd
<nd@...>, Jose Marinho <Jose.Marinho@...>
*Subject: *Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to
RngDxe

Hi Sami,

I was wondering if you're still collecting feedback on the design, or if
you have a plan and schedule for the implementation?

--
Rebecca Cran

On 1/15/21 7:51 PM, Sami Mujawar wrote:
> Hi All,
>
> I have shared some initial thoughts on the RNG implementation updates
at
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Ffiles%2FDesigns%2F2021%2F0116%2FEDKII%2520-%2520Proposed%2520update%2520to%2520RNG%2520implementation.pdf&;data=04%7C01%7Cbret.barkelew%40microsoft.com%7C676a9101f67845dbdc8908d908fa4cd1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637550693569385394%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Q8ka83ReO2aG8yTVrgpTAVxczJVjl2JBH3ksHo2%2BSHk%3D&amp;reserved=0>
>
> Kindly let me know your feedback or if you have any queries.
>
> Regards,
>
> Sami Mujawar
>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Rebecca Cran via groups.io
> Sent: 14 January 2021 09:05 PM
> To: Sami Mujawar <Sami.Mujawar@...>; devel@edk2.groups.io; Samer
El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>; Ard Biesheuvel
<Ard.Biesheuvel@...>; leif@...
> Cc: rfc@edk2.groups.io; Jiewen Yao <jiewen.yao@...>; Rahul
Kumar <rahul1.kumar@...>; nd <nd@...>
> Subject: Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to
RngDxe
>
> On 12/10/20 4:26 AM, Sami Mujawar wrote:
>
>> I am working on the TRNG FW API interface and will share more details
>> for the discussion soon.
>>
>> We had some thoughts about streamlining the RngDxe implementations and
>> would like to share some diagrams for the discussion.
>>
>> My diagrams are in Visio that I can export as JPG images. However, I am
>> open to switching to any other suggested tool.
>
> Hi Sami,
>
> I don't see any further discussions on this. Have you made any progress
> with sharing the design documents or scheduling a review?
>