public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-platforms v1 0/2] Enable RNG support for Juno
@ 2021-09-30 16:00 Sami Mujawar
  2021-09-30 16:00 ` [PATCH edk2-platforms v1 1/2] Platform/ARM: Add NULL instance of TRNG lib to Libraries Sami Mujawar
  2021-09-30 16:00 ` [PATCH edk2-platforms v1 2/2] Platform/ARM/Juno: Add RNG support using FW-TRNG interface Sami Mujawar
  0 siblings, 2 replies; 4+ messages in thread
From: Sami Mujawar @ 2021-09-30 16:00 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ardb+tianocore, thomas.abraham, leif, rebecca,
	Matteo.Carlini, Akanksha.Jain2, Ben.Adderson, nd

The Arm True Random Number Generator Firmware, Interface 1.0, specification
defines an interface between an Operating System (OS) executing at EL1 and
Firmware (FW) exposing a conditioned entropy source that is provided by a
TRNG back end.

The edk2 patch series at:
https://edk2.groups.io/g/devel/topic/patch_v1_0_9_add_raw/85977024
adds RawAlgorithm support to RngDxe for Arm architecture using the Arm
FW-TRNG interface:

Ref: Bugzilla: 3668 (https://bugzilla.tianocore.org/show_bug.cgi?id=3668)

FW-TRNG interface service is already supported in TF-A for Juno. Therefore,
enable RNG support for Juno. Also, flink the NULL instance of TRNG library
for platforms that do not implement the FW-TRNG interface.

The changes can be seen at:
https://github.com/samimujawar/edk2-platforms/tree/1829_arm_fw_trng_v1

Sami Mujawar (2):
  Platform/ARM: Add NULL instance of TRNG lib to Libraries
  Platform/ARM/Juno: Add RNG support using FW-TRNG interface

 Platform/ARM/JunoPkg/ArmJuno.dsc             | 10 +++++++++-
 Platform/ARM/JunoPkg/ArmJuno.fdf             |  7 ++++++-
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc |  3 ++-
 3 files changed, 17 insertions(+), 3 deletions(-)

-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH edk2-platforms v1 1/2] Platform/ARM: Add NULL instance of TRNG lib to Libraries
  2021-09-30 16:00 [PATCH edk2-platforms v1 0/2] Enable RNG support for Juno Sami Mujawar
@ 2021-09-30 16:00 ` Sami Mujawar
  2021-09-30 16:00 ` [PATCH edk2-platforms v1 2/2] Platform/ARM/Juno: Add RNG support using FW-TRNG interface Sami Mujawar
  1 sibling, 0 replies; 4+ messages in thread
From: Sami Mujawar @ 2021-09-30 16:00 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ardb+tianocore, thomas.abraham, leif, rebecca,
	Matteo.Carlini, Akanksha.Jain2, Ben.Adderson, nd

The EFI_RNG_PROTOCOL published by RngDxe has been updated to
implement the EFI_RNG_ALGORITHM_RAW using the Arm FW-TRNG
interface to provide access to entropy.

The TRNG support is implemented by the Arm FW-TRNG library
if supported by the platform. If the platform does not support
the FW-TRNG interface a NULL instance of the TRNG library is
provided.

Therefore, include the reference to the NULL instance of the
TRNG library as default. Platforms implementing the FW-TRNG
interface can override this in their respective platforms
workspaces.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index d6f31ecda42f65ecc44235c195976da8f18e9b8b..6106677b58e8212de565609e8138b3d91ee3e108 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2020, Arm Limited. All rights reserved.
+#  Copyright (c) 2011-2021, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -142,6 +142,7 @@ [LibraryClasses.common]
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
   RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
+  TrngLib|MdePkg/Library/BaseTrngLibNull/BaseTrngLibNull.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH edk2-platforms v1 2/2] Platform/ARM/Juno: Add RNG support using FW-TRNG interface
  2021-09-30 16:00 [PATCH edk2-platforms v1 0/2] Enable RNG support for Juno Sami Mujawar
  2021-09-30 16:00 ` [PATCH edk2-platforms v1 1/2] Platform/ARM: Add NULL instance of TRNG lib to Libraries Sami Mujawar
@ 2021-09-30 16:00 ` Sami Mujawar
  2021-10-01 17:44   ` [edk2-devel] " Joey Gouly
  1 sibling, 1 reply; 4+ messages in thread
From: Sami Mujawar @ 2021-09-30 16:00 UTC (permalink / raw)
  To: devel
  Cc: Sami Mujawar, ardb+tianocore, thomas.abraham, leif, rebecca,
	Matteo.Carlini, Akanksha.Jain2, Ben.Adderson, nd

TF-A for Juno has been updated to implement the Arm FW-TRNG interface
that can be used to access entropy from the TRNG hardware on Juno.

Similarly, the EFI_RNG_PROTOCOL in RngDxe has been updated to add
EFI_RNG_ALGORITHM_RAW support using the FW-TRNG interface.

Therefore, enable the EFI_RNG_PROTOCOL for Juno platform.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 10 +++++++++-
 Platform/ARM/JunoPkg/ArmJuno.fdf |  7 ++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index fdfc8cd9e20f57e4d56fc7e2712bdc9afbc7148e..47a3fab333cdc3896df789407267e2fa81cf8055 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2018, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2021, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -55,6 +55,9 @@ [LibraryClasses.common]
   LcdHwLib|ArmPlatformPkg/Library/HdLcd/HdLcd.inf
 !endif
 
+  TrngLib|ArmPkg/Library/ArmFwTrngLib/ArmFwTrngLib.inf
+  ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
+
 [LibraryClasses.common.SEC]
   PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
   ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
@@ -383,6 +386,11 @@ [Components.common]
   # SCMI Driver
   ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
 
+  #
+  # Rng Support
+  #
+  SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
+
 [Components.AARCH64]
   #
   # EBC
diff --git a/Platform/ARM/JunoPkg/ArmJuno.fdf b/Platform/ARM/JunoPkg/ArmJuno.fdf
index f70d30c6a9d9d6eb73087dc673f0c9287d23d666..f4b38da8f9e634743395fd6a2a8d30360b2710a7 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.fdf
+++ b/Platform/ARM/JunoPkg/ArmJuno.fdf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2019, Arm Limited. All rights reserved.<BR>
+#  Copyright (c) 2013-2021, Arm Limited. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -237,6 +237,11 @@ [FV.FvMain]
   # SCMI Driver
   INF ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
 
+  #
+  # Rng Support
+  #
+  INF SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
+
 !if $(ARCH) == AARCH64
   #
   # EBC
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH edk2-platforms v1 2/2] Platform/ARM/Juno: Add RNG support using FW-TRNG interface
  2021-09-30 16:00 ` [PATCH edk2-platforms v1 2/2] Platform/ARM/Juno: Add RNG support using FW-TRNG interface Sami Mujawar
@ 2021-10-01 17:44   ` Joey Gouly
  0 siblings, 0 replies; 4+ messages in thread
From: Joey Gouly @ 2021-10-01 17:44 UTC (permalink / raw)
  To: devel@edk2.groups.io, Sami Mujawar

Hi Sami,

> TF-A for Juno has been updated to implement the Arm FW-TRNG interface
> that can be used to access entropy from the TRNG hardware on Juno.
>
> Similarly, the EFI_RNG_PROTOCOL in RngDxe has been updated to add
> EFI_RNG_ALGORITHM_RAW support using the FW-TRNG interface.
>
> Therefore, enable the EFI_RNG_PROTOCOL for Juno platform.
>
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
> ---
>  Platform/ARM/JunoPkg/ArmJuno.dsc | 10 +++++++++-
>  Platform/ARM/JunoPkg/ArmJuno.fdf |  7 ++++++-
>  2 files changed, 15 insertions(+), 2 deletions(-)
>

Tested on Juno.

Tested-by: Joey Gouly <joey.gouly@arm.com>

Thanks,
Joey
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-01 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-30 16:00 [PATCH edk2-platforms v1 0/2] Enable RNG support for Juno Sami Mujawar
2021-09-30 16:00 ` [PATCH edk2-platforms v1 1/2] Platform/ARM: Add NULL instance of TRNG lib to Libraries Sami Mujawar
2021-09-30 16:00 ` [PATCH edk2-platforms v1 2/2] Platform/ARM/Juno: Add RNG support using FW-TRNG interface Sami Mujawar
2021-10-01 17:44   ` [edk2-devel] " Joey Gouly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox