From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by mx.groups.io with SMTP id smtpd.web12.4169.1620683594399018672 for ; Mon, 10 May 2021 14:53:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=mB/9b79x; spf=pass (domain: nuviainc.com, ip: 209.85.166.175, mailfrom: rebecca@nuviainc.com) Received: by mail-il1-f175.google.com with SMTP id w13so3269544ilv.11 for ; Mon, 10 May 2021 14:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=d1PejT3xoTL24bnb4yE/R3YkKUwos4oa1CfSZe6buxo=; b=mB/9b79x2MPVzOyDpCdvH35+jZyeeHN9RyK69Xsb/6IPOvGW95fIVUx1lPVA+jwvbp 0T6s30N13bJ42J4bES+jHtMPHRiVhi4KQ42kd+Bdyp7lgbZNlU+Bd/jGGji8e931zh0r apx3Q4S7HYjjl0mzH8A76dlzOLZ6FwrKOmFkzPFeRz6nxdEokIXALxzoeRfCs7wi+SQU pSN5vwVYriObDvb25lnbVHiG3Wzd5SEOtbsqFYulNs3St46jS3Df+YKu8vinVKe8iOcQ m+ZcZUMB09RchxOGhRhRWQJyVkb6IdJ8YGAr6F9v7ejCSKjPAdbzZ1YvAUhldccPTNCQ uQoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=d1PejT3xoTL24bnb4yE/R3YkKUwos4oa1CfSZe6buxo=; b=qtaNb/tD5CS80H5UcYz/tqP3b8Z7CFonWE3e5qlnJ6ty6FZ3YDV6FVVkLmXKH9fOGe z4iGMzBhkA8GmOltHO0nQDMMjuzrW4uUW8FqFyz7pVfr/Cp+wapiENdELBV3f+LsDeFT q0qE1xOCWKSOgLERwRtbwXVyWfu4m21htBleugHzj7tgUyX6eIzU6ucGYlV7C80O4eUW tAuaE0hEogY/F/narqHYxESV6jwoGt+DmHcTEcLqQsFubD9KiwMVbEaf364XHvldXu1q 40lVBN/Jwr4m67ObjRv5tUh5sC554slQVhAYvfIlIeBF4QyQGpR2dz/ZNBQsqAl3sl7Z yQOQ== X-Gm-Message-State: AOAM530jmiHg5GFpoJ8p7WbKrtPe+FSum9TSh3bs295zQ3pWFv1iqNVI EJZeGTXcrGlaLIQhP+3/Ween9z8uIcVlpay8KIrwKLUXt7deCCQkMKB/lSfjxquc6aDXUb6H6bU XnD+5MF7UqIPgOldGgD9nNfoQYSQo6+VfpmIkSYNVpEH6EuPywv9TUld8+u+oyWpUQMKTg9ot X-Google-Smtp-Source: ABdhPJyU5j8zpm3VwQamgFOZmDOmhaqYFN9OFTkWWDlDP6tMtJZCShO4Zo3kLxX8EYGhkp/tsx93tQ== X-Received: by 2002:a05:6e02:e81:: with SMTP id t1mr6743206ilj.228.1620683593580; Mon, 10 May 2021 14:53:13 -0700 (PDT) Return-Path: Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id s6sm6707320iob.45.2021.05.10.14.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 14:53:13 -0700 (PDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Jiewen Yao , Jian J Wang , Michael D Kinney , Liming Gao , Zhiguang Liu , Ard Biesheuvel , Sami Mujawar Cc: Rebecca Cran Subject: [PATCH v3 0/2] MdePkg,SecurityPkg: Add support to RngDxe and BaseRngLib for AARCH64 RNDR Date: Mon, 10 May 2021 15:53:06 -0600 Message-Id: <20210510215308.28745-1-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update MdePkg BaseRngLib and SecurityPkg RngDxe to add support for the AARCH64 RNDR instruction. Changes from v2 to v3: o Fixed the default value of gEfiSecurityPkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm to be an empty GUID. o Removed RNDRRS since it wasn't being used. o Fixed the commit message to remove mention of BaseLib. Rebecca Cran (2): MdePkg/BaseRngLib: Add support for ARMv8.5 RNG instructions SecurityPkg: Add support for RngDxe on AARCH64 MdePkg/MdePkg.dec | 9 +- SecurityPkg/SecurityPkg.dec | 2 + MdePkg/MdePkg.dsc | 4 +- SecurityPkg/SecurityPkg.dsc | 11 +- MdePkg/Library/BaseRngLib/BaseRngLib.inf | 23 ++- SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf | 24 ++- MdePkg/Library/BaseRngLib/AArch64/ArmRng.h | 43 +++++ MdePkg/Library/BaseRngLib/BaseRngLibInternals.h | 78 +++++++++ SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.h | 0 SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.h | 17 -- SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h | 117 ++++++++++++++ MdePkg/Library/BaseRngLib/AArch64/Rndr.c | 139 ++++++++++++++++ MdePkg/Library/BaseRngLib/BaseRng.c | 87 +++++----- MdePkg/Library/BaseRngLib/Rand/RdRand.c | 131 +++++++++++++++ SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c | 127 +++++++++++++++ SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.c | 0 SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.c | 45 +----- SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c | 146 +++++++++++++++++ SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c | 170 ++++++++------------ MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S | 31 ++++ MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm | 30 ++++ MdePkg/Library/BaseRngLib/AArch64/ArmRng.S | 37 +++++ MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm | 39 +++++ MdePkg/Library/BaseRngLib/BaseRngLib.uni | 6 +- 24 files changed, 1086 insertions(+), 230 deletions(-) create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.h create mode 100644 MdePkg/Library/BaseRngLib/BaseRngLibInternals.h rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.h (100%) rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.h (72%) create mode 100644 SecurityPkg/RandomNumberGenerator/RngDxe/RngDxeInternals.h create mode 100644 MdePkg/Library/BaseRngLib/AArch64/Rndr.c create mode 100644 MdePkg/Library/BaseRngLib/Rand/RdRand.c create mode 100644 SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/AesCore.c (100%) rename SecurityPkg/RandomNumberGenerator/RngDxe/{ => Rand}/RdRand.c (71%) create mode 100644 SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.S create mode 100644 MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm -- 2.26.2