From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.47]) by mx.groups.io with SMTP id smtpd.web12.633.1620747179910038967 for ; Tue, 11 May 2021 08:33:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Q1/BiwSf; spf=pass (domain: arm.com, ip: 40.107.20.47, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YZJC5IxDVkuQ2Fc2/+MwcLLeCk2Ah1zKjr4za8rPSXY=; b=Q1/BiwSfgqk0i0d3Q60otIV4RUEuSJ/r3rV+Nk+O3xMm1prOp2RY18iPUW3jwGxvQnzJ34Or1LBLV4pRF0aDq9VOZrap/5bc1foAvaq2AtFdrtaNGaxVsiGeTg4dN4WfDgjv+VSUhL/T8+0nPDZQ3AkNAp3iypDRcEGcZUIgUAA= Received: from AM0PR10CA0114.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::31) by PA4PR08MB6254.eurprd08.prod.outlook.com (2603:10a6:102:f3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Tue, 11 May 2021 15:32:50 +0000 Received: from AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:e6:cafe::90) by AM0PR10CA0114.outlook.office365.com (2603:10a6:208:e6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 11 May 2021 15:32:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT030.mail.protection.outlook.com (10.152.16.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 11 May 2021 15:32:49 +0000 Received: ("Tessian outbound 6c4b4bc1cefb:v91"); Tue, 11 May 2021 15:32:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1112df86e8c87e17 X-CR-MTA-TID: 64aa7808 Received: from 1425f6616d13.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 458AD433-24BC-46EC-93F7-FB62D3575BB3.1; Tue, 11 May 2021 15:32:33 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1425f6616d13.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 11 May 2021 15:32:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XCi0dTpBQ6Uu68BuuIpkZcEuUWP/e6HhsZiIPNXkGyolf9gqqVyXkC42vn7j9nr9dgNqmZK0yQvm821aavB3yZWYTROKD1uzM4yfq5xhegm5UPOAj+UM7REW3ji9D4vF1zq3XCJbLKTnL5liRBpcz2jdufFrqm+Fd+c/RKOmdBQubYb2P+Yc32blJea8BmtU5Y9gMVEfmHUKi+j0cT0djTPNwJKWze+cuRcD1B1ZPn83cCZaWIiw75Zm/Zy2+yXAgPC53WB2YboPfnG0wQRV/agAqoxaLeSSWDpgMZi0nzIT2p7XmBmQxaOn54wN4buYjw1UZ+YlKEHFWrox5gqOqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YZJC5IxDVkuQ2Fc2/+MwcLLeCk2Ah1zKjr4za8rPSXY=; b=bk4Cau5wfIArV83/ZINcIauhsjqrifuldWZxR/dpjw4RhBMM8iC1knPIWtpC8+PlFybNTiSV40Q7a1OpbyAez7YyaN0gZvIZJ/a3Wkpr/ty4B9cOF7gUiKSjz3S2HBI/N3Qq8gIhn2PAALSmR1p3cY/+Ls1g2lhd8HdsnyD/F80AnpiSqNUVrvIoBSXR5RO83Kt8sG19ixMU9o21YJM1PFA3Nwz9Yg+vEzFmi0meN7nq8J+gLlZrDO9BL28SMKyCxsRqbbpreBT7QVhKGuFVMXpxe7dvNkLbpCwYfLZPH+jdJh8fAAyq93nCosc11grYK35+PxaeuCBKQYVrPR4yYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YZJC5IxDVkuQ2Fc2/+MwcLLeCk2Ah1zKjr4za8rPSXY=; b=Q1/BiwSfgqk0i0d3Q60otIV4RUEuSJ/r3rV+Nk+O3xMm1prOp2RY18iPUW3jwGxvQnzJ34Or1LBLV4pRF0aDq9VOZrap/5bc1foAvaq2AtFdrtaNGaxVsiGeTg4dN4WfDgjv+VSUhL/T8+0nPDZQ3AkNAp3iypDRcEGcZUIgUAA= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB4850.eurprd08.prod.outlook.com (2603:10a6:20b:d2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Tue, 11 May 2021 15:32:30 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::80cb:878d:c8f1:2688%7]) with mapi id 15.20.4108.031; Tue, 11 May 2021 15:32:30 +0000 Subject: Re: [PATCH v3 1/2] MdePkg/BaseRngLib: Add support for ARMv8.5 RNG instructions To: Rebecca Cran , devel@edk2.groups.io, Jiewen Yao , Jian J Wang , Michael D Kinney , Liming Gao , Zhiguang Liu , Ard Biesheuvel , nd@arm.com References: <20210510215308.28745-1-rebecca@nuviainc.com> <20210510215308.28745-2-rebecca@nuviainc.com> From: "Sami Mujawar" Message-ID: Date: Tue, 11 May 2021 16:32:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20210510215308.28745-2-rebecca@nuviainc.com> X-Originating-IP: [217.140.106.52] X-ClientProxiedBy: LO2P265CA0074.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::14) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.1.196.43] (217.140.106.52) by LO2P265CA0074.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 11 May 2021 15:32:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5d0cfb9-fb67-45ba-9e22-08d9149208e6 X-MS-TrafficTypeDiagnostic: AM6PR08MB4850:|PA4PR08MB6254: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HIqHCMVP/mS+8TkjlQtz3F93T0W3sLohOr+GZZyByYKTAtANoblHvJonx0fwfq02FhLj2DhY+nKdbhKlF43QVTNlRCuzP1YDcx6NKtPQRXoUXHeNCLXD6BnE0yb1nxVU3otmsanNVzkYy9Gw65X7WisyMK8Ey2DMBH+fKWTqtnyFqxb4Xzvwq3tp1qP7qyagZlLGfbyBcivye8uxb8jsG1RnndXXQ0bxUEh7dwFMbLMMpY+3NzqVImYnse/DUQwwP0+yBraDRGWXzxxpFOo7AJG82fPWMj3WFuQWkVPyb6LRdP4RnqfJueDe/xHNMjnIg/O5ph5/Bs8lOdUZHqsn1kLV2aB4ZENx5FEXIorVbi44dm8T+MNgS/RetJEb1m8HR3mS+6ezpXLfUOJ7CFze6kHPcjyW2WwQAkUgjsXb16EmqizdbmqOzF1s5VRIcHz7PZ/ntb7zLceA5yBhnkO9eCl7yicfznQahleCYJlFbXqiOgVlmIdVYgyHd7Fsz0RlsxlaIBRKDhPA1/kUCxFSFOF5y/W0Y3QIxUBHLoa/dEj5r8zpKZbGpjKLMMF58e7gg6RXKZ5NLtzxPBDgSIWtl30NXdKAWjFc511r2t/1tB4E5L14N/qY2A1Dcosc40ZWoVtQk8wE4sa6zmV0atI3gbokE+XOoL1i2F6KjRJnePZi7TxakGeWv9MwBOzyrFGayHjj4ikjCsmWMAaUbZ4b9w== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39850400004)(366004)(346002)(396003)(376002)(6486002)(6636002)(478600001)(83380400001)(2906002)(66476007)(16526019)(186003)(2616005)(52116002)(5660300002)(30864003)(86362001)(956004)(66556008)(44832011)(26005)(38100700002)(19627235002)(36756003)(53546011)(16576012)(66946007)(31696002)(316002)(31686004)(38350700002)(8676002)(110136005)(8936002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?QzNXazRxRFFGa09Ta2NDNE1TcTRuUUJSQnRDNjViaFZPQmRweXRUTjZ3L3Vr?= =?utf-8?B?OVRYTGxiaGE2eGZQUUozMy94QXNwYVdMVDBadHVYbC90RHF3cHR1d29Ca2Jt?= =?utf-8?B?UDFHMTJyc2hZRzFDSDJBcU54Ykp2MWd2amxGS2QydTQ0OUphREkyYWgwSnE5?= =?utf-8?B?aHBqanhYZmliRW1OMWVycHVqSzZMU0F0S0REb29XcHpJc1RWdHNiaEkzREE3?= =?utf-8?B?ZU5USmtmNCs3UU9pVEVxZjlDTHAwUDdMUU5EQ1pqZzNjTnd6eEJ1TTNhNlFo?= =?utf-8?B?WXVCSkpZcCtQNFlYWmpMR3hPUnAwUjRWWTBRazc3aTZkL09kK2VOL0gvUFlu?= =?utf-8?B?cVNWV01jbFY3ZGFJUXJLVGIyQzh5d1dSL3pTYThKYmlESUkyVHlQejBxTFVV?= =?utf-8?B?MzUzaFlUTWxzbGlEV0lxL0w0T1ZWNmJyMXd1NVR5Q29kRjBJU2pycVR4ZVZZ?= =?utf-8?B?MlVtZFhMSGd0UXZHaG9HWENvV3EycEF2eHl2V0I0cTFyaWx3ZSt1bDhwZ09j?= =?utf-8?B?UWdBdDVNYWRQa3ViaEpqdWJzeU1YeWdDak5rK2pqOHpJTDBocFdZYkViOUhS?= =?utf-8?B?Y3NKa01pOENqdGNDMXorTkt2RnBLUXk1VWNmTEgyL2RjSUUxaWJKNDBJblBa?= =?utf-8?B?Rkk5NmUxVHZwUWtwZVpFLzQ5cjJ1MFp0bTU4ZjB5ZU9DU0lySTRtR3lxcFd3?= =?utf-8?B?TUFDVzMvaHJNMThLNUo2M2hITHdkOTVRT0ZwYUxLYVdnalJxR1dNaWYyeGlx?= =?utf-8?B?Zlo1akJSMk1ZSmU1WkY5bGpBc2xjejIwTFBmTUJMNjkwWTRZemViRUxhSURZ?= =?utf-8?B?d2tUY0Q0b2JxblV6aFI5bmtqcERIZUJCd295bTlhYUMxdi81QStGSlc2SUZi?= =?utf-8?B?ZWQ4VXErTUs1dklSSTJIVyt4T0I4cjN1VlBrdFc1MC9Ec25yS3laTE5EVC9p?= =?utf-8?B?Z25rVkFMbHluMXNmUTM3MTBDLzlRMWErOHBIMWpjeDdsQ2diTTRsSkNMcEk5?= =?utf-8?B?ajZuOGRLbjhPaVlZQnhWc0cwQWNHWDdTcnNTMVJNeTV0amczd1dRRXF0U24v?= =?utf-8?B?Y2dsVkdQQ1NZMEs1ajZiN3NVT25YQytSUnlvYTFoWklObkhGNmlsUWhSV2pQ?= =?utf-8?B?dk8wK1p0RUptay9hOTl5QjZRbEtEc0I4bUxYSGNKaExxRHdTRlZURndvNDdV?= =?utf-8?B?aDcvb0tzRmlBKzJvcSttTDZKS21FbHNoSGFoc2pzQUhrbjdtK2xRcnJRb0RZ?= =?utf-8?B?cnh0ZUpvZWJWYjdmNi82UW9HbDQ5NVpld01VcVlMbC8wY0RYZ1hiazhRUUNV?= =?utf-8?B?dUorS2ovZ1VObFBwNllCdlV4Tmo0VFl2Sko3NkV6aDA1bWJNTUpzTWh4WkpL?= =?utf-8?B?NkVZRlNXU0o2SDdnSVdxY1pCYkZYN0ZhWHpyYUxCM1Aya25kSVYvK0d3Q1NM?= =?utf-8?B?UHd3cC9yb1ArMGtmQUpSNjk4ZjJ6SGp4UXhIZHZqM1VMTGN6VWJZNVRjdXAw?= =?utf-8?B?NGhPSS9pOUhrNEZETmIzbnVxUkJtSUxqckgySlB3b2tpMlphNDVzT0xMVHJO?= =?utf-8?B?djQxMDRPak1Wb2VReUd3WStDVFBpZ1hDcUt6b3hYbzFxSzdiaFh2VTJ4ZGRm?= =?utf-8?B?bWU5eTByUndNWUZyRlBFa3ZkOS9Fc0Vabzg1dnY4ZlJJT0NEeGZmbmFoVjBJ?= =?utf-8?B?dTBHYmcvVFFNdDN6R0M4WUtpQ09qWHp6WE9RcnFtenUyOUh0cE5LWjJNZWNS?= =?utf-8?Q?IMrALmV2fprgtPXPdnEXEPTTwXvS1XD9IsLx72G?= X-MS-Exchange-Transport-Forked: True X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4850 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c00777ac-5330-43b9-a382-08d91491fcb9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mxF5eOoIIY1dDOuuGW7YreQRnwT8Lg942swuMTG+6cRs7rzixJ7si9zLRAbFrWk6xe6ua95se784Kv1PxElnk2+opO0YUjljg0hvmCShveAHFolJ/cEiZMHXegaNi7grmmNJquPSchyxS0XdwrPtk4JiG+hsIVqmYz2MNNjfE6+ahe0QBTaWHk7R1weiAsx5NdsJ8uu2fgqEYn/Sm1LE1Q2iQczEFpQIbpS7rHWv8WES7n9BbkjJqngkTqxg9GQE6n3c1byfZTlli06LSyVbodMfS3zVsUX6WidY0g7bK1iqCY23pkxuMoMBMw6ErKrJfmunE9QWXxWTTzqbvt7W8f7MzYek7PSnuSgXt8bcZJXqj7sbVZh6pLbXBkSXWl2tcXH9V1FgUEUqb/44L59a0AmfF6saATYEbxlyld1mBi30Dnx7P6R8+KwmjDX/8LWF69C5ixtQja6wwA96Rvg0O7I+D1nV/N6rv8QFJle/OfeJKTrHsEEUUOZBv55Qj+RuvOoup0yg1nS/4rft9awY6bV0y29wXMXNmth8fq4xluDrNGlGTRS6S68/Mrh5/fG5i5jhi4uQBx4Eq+41B1uL1Pp4T71ftKkEJrqxsvSiekS8ld4E8T6bxlFZXVrxJ3hHDGtCI8CZnjBJtkYAt73lec7JsCjv3ed93qvNzwc7G7h7zEbOd8kHOLdD87tlo8kM X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(346002)(136003)(39850400004)(396003)(376002)(46966006)(36840700001)(16526019)(19627235002)(186003)(2616005)(2906002)(5660300002)(81166007)(36860700001)(956004)(26005)(47076005)(478600001)(6636002)(336012)(30864003)(8936002)(70586007)(70206006)(6486002)(8676002)(82310400003)(36756003)(16576012)(44832011)(31696002)(53546011)(83380400001)(316002)(110136005)(356005)(31686004)(86362001)(82740400003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2021 15:32:49.5928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5d0cfb9-fb67-45ba-9e22-08d9149208e6 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6254 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-GB This patch looks good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 10/05/2021 10:53 PM, Rebecca Cran wrote: > Make BaseRngLib more generic by moving x86-specific functionality into > 'Rand' and adding files under 'AArch64' to support the optional ARMv8.5 > RNG instruction RNDR that is a part of FEAT_RNG. > > Signed-off-by: Rebecca Cran > --- > MdePkg/MdePkg.dec | 9 +- > MdePkg/MdePkg.dsc | 4 +- > MdePkg/Library/BaseRngLib/BaseRngLib.inf | 23 +++- > MdePkg/Library/BaseRngLib/AArch64/ArmRng.h | 43 ++++++ > MdePkg/Library/BaseRngLib/BaseRngLibInternals.h | 78 +++++++++++ > MdePkg/Library/BaseRngLib/AArch64/Rndr.c | 139 ++++++++++++= ++++++++ > MdePkg/Library/BaseRngLib/BaseRng.c | 87 ++++++------ > MdePkg/Library/BaseRngLib/Rand/RdRand.c | 131 ++++++++++++= ++++++ > 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 +- > 13 files changed, 603 insertions(+), 54 deletions(-) > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 8965e903e093..b49f88d8e18f 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -267,6 +267,11 @@ [LibraryClasses] > # > RegisterFilterLib|Include/Library/RegisterFilterLib.h > > +[LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64] > + ## @libraryclass Provides services to generate random number. > + # > + RngLib|Include/Library/RngLib.h > + > [LibraryClasses.IA32, LibraryClasses.X64] > ## @libraryclass Abstracts both S/W SMI generation and detection. > ## > @@ -288,10 +293,6 @@ [LibraryClasses.IA32, LibraryClasses.X64] > # > SmmPeriodicSmiLib|Include/Library/SmmPeriodicSmiLib.h > > - ## @libraryclass Provides services to generate random number. > - # > - RngLib|Include/Library/RngLib.h > - > ## @libraryclass Provides services to log the SMI handler registrat= ion. > SmiHandlerProfileLib|Include/Library/SmiHandlerProfileLib.h > > diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc > index d363419006ea..a94959169b2f 100644 > --- a/MdePkg/MdePkg.dsc > +++ b/MdePkg/MdePkg.dsc > @@ -145,6 +145,9 @@ [Components.IA32, Components.X64, Components.ARM, Com= ponents.AARCH64] > MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibSmm.inf > MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibUefiShe= ll.inf > > +[Components.IA32, Components.X64, Components.AARCH64] > + MdePkg/Library/BaseRngLib/BaseRngLib.inf > + > [Components.IA32, Components.X64] > MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf > @@ -168,7 +171,6 @@ [Components.IA32, Components.X64] > MdePkg/Library/BaseS3StallLib/BaseS3StallLib.inf > MdePkg/Library/SmmMemLib/SmmMemLib.inf > MdePkg/Library/SmmIoLib/SmmIoLib.inf > - MdePkg/Library/BaseRngLib/BaseRngLib.inf > MdePkg/Library/SmmPciExpressLib/SmmPciExpressLib.inf > MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.inf > MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf > diff --git a/MdePkg/Library/BaseRngLib/BaseRngLib.inf b/MdePkg/Library/Ba= seRngLib/BaseRngLib.inf > index 31740751c69c..1fcceb941495 100644 > --- a/MdePkg/Library/BaseRngLib/BaseRngLib.inf > +++ b/MdePkg/Library/BaseRngLib/BaseRngLib.inf > @@ -1,9 +1,10 @@ > ## @file > # Instance of RNG (Random Number Generator) Library. > # > -# BaseRng Library that uses CPU RdRand instruction access to provide > -# high-quality random numbers. > +# BaseRng Library that uses CPU RNG instructions (e.g. RdRand) to > +# provide random numbers. > # > +# Copyright (c) 2021, NUVIA Inc. All rights reserved.
> # Copyright (c) 2015, Intel Corporation. All rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -22,11 +23,25 @@ [Defines] > CONSTRUCTOR =3D BaseRngLibConstructor > > # > -# VALID_ARCHITECTURES =3D IA32 X64 > +# VALID_ARCHITECTURES =3D IA32 X64 AARCH64 > # > > -[Sources.Ia32, Sources.X64] > +[Sources] > BaseRng.c > + BaseRngLibInternals.h > + > +[Sources.Ia32, Sources.X64] > + Rand/RdRand.c > + > +[Sources.AARCH64] > + AArch64/Rndr.c > + AArch64/ArmRng.h > + > + AArch64/ArmReadIdIsar0.S | GCC > + AArch64/ArmRng.S | GCC > + > + AArch64/ArmReadIdIsar0.asm | MSFT > + AArch64/ArmRng.asm | MSFT > > [Packages] > MdePkg/MdePkg.dec > diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.h b/MdePkg/Library/= BaseRngLib/AArch64/ArmRng.h > new file mode 100644 > index 000000000000..a597e98bf0d5 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.h > @@ -0,0 +1,43 @@ > +/** @file > + Random number generator service that uses the RNDR instruction > + to provide pseudorandom numbers. > + > + Copyright (c) 2021, NUVIA Inc. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef ARM_RNG_H_ > +#define ARM_RNG_H_ > + > +/** > + Generates a random number using RNDR. > + Returns TRUE on success; FALSE on failure. > + > + @param[out] Rand Buffer pointer to store the 64-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArmRndr ( > + OUT UINT64 *Rand > + ); > + > +/** > + Reads the ID_AA64ISAR0 Register. > + > + @return The contents of the ID_AA64ISAR0 register. > + > +**/ > +UINT64 > +EFIAPI > +ArmReadIdIsar0 ( > + VOID > + ); > + > +#endif /* ARM_RNG_H_ */ > + > diff --git a/MdePkg/Library/BaseRngLib/BaseRngLibInternals.h b/MdePkg/Lib= rary/BaseRngLib/BaseRngLibInternals.h > new file mode 100644 > index 000000000000..b6b4e9eef227 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/BaseRngLibInternals.h > @@ -0,0 +1,78 @@ > +/** @file > + > + Architecture specific interface to RNG functionality. > + > +Copyright (c) 2021, NUVIA Inc. All rights reserved.
> + > +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef BASE_RNGLIB_INTERNALS_H_ > + > +/** > + Generates a 16-bit random number. > + > + @param[out] Rand Buffer pointer to store the 16-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber16 ( > + OUT UINT16 *Rand > + ); > + > +/** > + Generates a 32-bit random number. > + > + @param[out] Rand Buffer pointer to store the 32-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber32 ( > + OUT UINT32 *Rand > + ); > + > +/** > + Generates a 64-bit random number. > + > + @param[out] Rand Buffer pointer to store the 64-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber64 ( > + OUT UINT64 *Rand > + ); > + > +/** > + Checks whether the RNG instruction is supported. > + > + @retval TRUE RNG instruction is supported. > + @retval FALSE RNG instruction is not supported. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchIsRngSupported ( > + VOID > + ); > + > +#if defined (MDE_CPU_AARCH64) > + > +// RNDR, Random Number > +#define RNDR S3_3_C2_C4_0 > + > +#endif > + > +#endif // BASE_RNGLIB_INTERNALS_H_ > diff --git a/MdePkg/Library/BaseRngLib/AArch64/Rndr.c b/MdePkg/Library/Ba= seRngLib/AArch64/Rndr.c > new file mode 100644 > index 000000000000..c9f8c813ed35 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/AArch64/Rndr.c > @@ -0,0 +1,139 @@ > +/** @file > + Random number generator service that uses the RNDR instruction > + to provide pseudorandom numbers. > + > + Copyright (c) 2021, NUVIA Inc. All rights reserved.
> + Copyright (c) 2015, Intel Corporation. All rights reserved.
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > + > +#include "ArmRng.h" > +#include "BaseRngLibInternals.h" > + > +STATIC BOOLEAN mRndrSupported; > + > +// > +// Bit mask used to determine if RNDR instruction is supported. > +// > +#define RNDR_MASK ((UINT64)MAX_UINT16 << 60U) > + > +/** > + The constructor function checks whether or not RNDR instruction is sup= ported > + by the host hardware. > + > + The constructor function checks whether or not RNDR instruction is sup= ported. > + It will ASSERT() if RNDR instruction is not supported. > + It will always return EFI_SUCCESS. > + > + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. > + > +**/ > +EFI_STATUS > +EFIAPI > +BaseRngLibConstructor ( > + VOID > + ) > +{ > + UINT64 Isar0; > + // > + // Determine RNDR support by examining bits 63:60 of the ISAR0 registe= r returned by > + // MSR. A non-zero value indicates that the processor supports the RND= R instruction. > + // > + Isar0 =3D ArmReadIdIsar0 (); > + ASSERT ((Isar0 & RNDR_MASK) !=3D 0); > + > + mRndrSupported =3D ((Isar0 & RNDR_MASK) !=3D 0); > + > + return EFI_SUCCESS; > +} > + > +/** > + Generates a 16-bit random number. > + > + @param[out] Rand Buffer pointer to store the 16-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber16 ( > + OUT UINT16 *Rand > + ) > +{ > + UINT64 Rand64; > + > + if (ArchGetRandomNumber64 (&Rand64)) { > + *Rand =3D Rand64 & MAX_UINT16; > + return TRUE; > + } > + > + return FALSE; > +} > + > +/** > + Generates a 32-bit random number. > + > + @param[out] Rand Buffer pointer to store the 32-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber32 ( > + OUT UINT32 *Rand > + ) > +{ > + UINT64 Rand64; > + > + if (ArchGetRandomNumber64 (&Rand64)) { > + *Rand =3D Rand64 & MAX_UINT32; > + return TRUE; > + } > + > + return FALSE; > +} > + > +/** > + Generates a 64-bit random number. > + > + @param[out] Rand Buffer pointer to store the 64-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber64 ( > + OUT UINT64 *Rand > + ) > +{ > + return ArmRndr (Rand); > +} > + > +/** > + Checks whether RNDR is supported. > + > + @retval TRUE RNDR is supported. > + @retval FALSE RNDR is not supported. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchIsRngSupported ( > + VOID > + ) > +{ > + return mRndrSupported; > +} > diff --git a/MdePkg/Library/BaseRngLib/BaseRng.c b/MdePkg/Library/BaseRng= Lib/BaseRng.c > index 7ad7aec9d38f..5b63d8f7146b 100644 > --- a/MdePkg/Library/BaseRngLib/BaseRng.c > +++ b/MdePkg/Library/BaseRngLib/BaseRng.c > @@ -1,8 +1,10 @@ > /** @file > - Random number generator services that uses RdRand instruction access > - to provide high-quality random numbers. > + Random number generator services that uses CPU RNG instructions to > + provide random numbers. > > +Copyright (c) 2021, NUVIA Inc. All rights reserved.
> Copyright (c) 2015, Intel Corporation. All rights reserved.
> + > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -10,46 +12,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include > #include > > -// > -// Bit mask used to determine if RdRand instruction is supported. > -// > -#define RDRAND_MASK BIT30 > +#include "BaseRngLibInternals.h" > > // > // Limited retry number when valid random data is returned. > // Uses the recommended value defined in Section 7.3.17 of "Intel 64 an= d IA-32 > -// Architectures Software Developer's Mannual". > +// Architectures Software Developer's Manual". > // > -#define RDRAND_RETRY_LIMIT 10 > +#define GETRANDOM_RETRY_LIMIT 10 > > -/** > - The constructor function checks whether or not RDRAND instruction is s= upported > - by the host hardware. > - > - The constructor function checks whether or not RDRAND instruction is s= upported. > - It will ASSERT() if RDRAND instruction is not supported. > - It will always return RETURN_SUCCESS. > - > - @retval RETURN_SUCCESS The constructor always returns EFI_SUCCESS. > - > -**/ > -RETURN_STATUS > -EFIAPI > -BaseRngLibConstructor ( > - VOID > - ) > -{ > - UINT32 RegEcx; > - > - // > - // Determine RDRAND support by examining bit 30 of the ECX register re= turned by > - // CPUID. A value of 1 indicates that processor support RDRAND instruc= tion. > - // > - AsmCpuid (1, 0, 0, &RegEcx, 0); > - ASSERT ((RegEcx & RDRAND_MASK) =3D=3D RDRAND_MASK); > - > - return RETURN_SUCCESS; > -} > > /** > Generates a 16-bit random number. > @@ -72,11 +43,19 @@ GetRandomNumber16 ( > > ASSERT (Rand !=3D NULL); > > + if (Rand =3D=3D NULL) { > + return FALSE; > + } > + > + if (!ArchIsRngSupported ()) { > + return FALSE; > + } > + > // > // A loop to fetch a 16 bit random value with a retry count limit. > // > - for (Index =3D 0; Index < RDRAND_RETRY_LIMIT; Index++) { > - if (AsmRdRand16 (Rand)) { > + for (Index =3D 0; Index < GETRANDOM_RETRY_LIMIT; Index++) { > + if (ArchGetRandomNumber16 (Rand)) { > return TRUE; > } > } > @@ -105,11 +84,19 @@ GetRandomNumber32 ( > > ASSERT (Rand !=3D NULL); > > + if (Rand =3D=3D NULL) { > + return FALSE; > + } > + > + if (!ArchIsRngSupported ()) { > + return FALSE; > + } > + > // > // A loop to fetch a 32 bit random value with a retry count limit. > // > - for (Index =3D 0; Index < RDRAND_RETRY_LIMIT; Index++) { > - if (AsmRdRand32 (Rand)) { > + for (Index =3D 0; Index < GETRANDOM_RETRY_LIMIT; Index++) { > + if (ArchGetRandomNumber32 (Rand)) { > return TRUE; > } > } > @@ -138,11 +125,19 @@ GetRandomNumber64 ( > > ASSERT (Rand !=3D NULL); > > + if (Rand =3D=3D NULL) { > + return FALSE; > + } > + > + if (!ArchIsRngSupported ()) { > + return FALSE; > + } > + > // > // A loop to fetch a 64 bit random value with a retry count limit. > // > - for (Index =3D 0; Index < RDRAND_RETRY_LIMIT; Index++) { > - if (AsmRdRand64 (Rand)) { > + for (Index =3D 0; Index < GETRANDOM_RETRY_LIMIT; Index++) { > + if (ArchGetRandomNumber64 (Rand)) { > return TRUE; > } > } > @@ -169,6 +164,14 @@ GetRandomNumber128 ( > { > ASSERT (Rand !=3D NULL); > > + if (Rand =3D=3D NULL) { > + return FALSE; > + } > + > + if (!ArchIsRngSupported ()) { > + return FALSE; > + } > + > // > // Read first 64 bits > // > diff --git a/MdePkg/Library/BaseRngLib/Rand/RdRand.c b/MdePkg/Library/Bas= eRngLib/Rand/RdRand.c > new file mode 100644 > index 000000000000..09fb875ac3f9 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/Rand/RdRand.c > @@ -0,0 +1,131 @@ > +/** @file > + Random number generator services that uses RdRand instruction access > + to provide high-quality random numbers. > + > +Copyright (c) 2021, NUVIA Inc. All rights reserved.
> +Copyright (c) 2015, Intel Corporation. All rights reserved.
> + > +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > + > +#include "BaseRngLibInternals.h" > + > +// > +// Bit mask used to determine if RdRand instruction is supported. > +// > +#define RDRAND_MASK BIT30 > + > + > +STATIC BOOLEAN mRdRandSupported; > + > +/** > + The constructor function checks whether or not RDRAND instruction is s= upported > + by the host hardware. > + > + The constructor function checks whether or not RDRAND instruction is s= upported. > + It will ASSERT() if RDRAND instruction is not supported. > + It will always return EFI_SUCCESS. > + > + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. > + > +**/ > +EFI_STATUS > +EFIAPI > +BaseRngLibConstructor ( > + VOID > + ) > +{ > + UINT32 RegEcx; > + > + // > + // Determine RDRAND support by examining bit 30 of the ECX register re= turned by > + // CPUID. A value of 1 indicates that processor support RDRAND instruc= tion. > + // > + AsmCpuid (1, 0, 0, &RegEcx, 0); > + ASSERT ((RegEcx & RDRAND_MASK) =3D=3D RDRAND_MASK); > + > + mRdRandSupported =3D ((RegEcx & RDRAND_MASK) =3D=3D RDRAND_MASK); > + > + return EFI_SUCCESS; > +} > + > +/** > + Generates a 16-bit random number. > + > + @param[out] Rand Buffer pointer to store the 16-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber16 ( > + OUT UINT16 *Rand > + ) > +{ > + return AsmRdRand16 (Rand); > +} > + > +/** > + Generates a 32-bit random number. > + > + @param[out] Rand Buffer pointer to store the 32-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber32 ( > + OUT UINT32 *Rand > + ) > +{ > + return AsmRdRand32 (Rand); > +} > + > +/** > + Generates a 64-bit random number. > + > + @param[out] Rand Buffer pointer to store the 64-bit random value. > + > + @retval TRUE Random number generated successfully. > + @retval FALSE Failed to generate the random number. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchGetRandomNumber64 ( > + OUT UINT64 *Rand > + ) > +{ > + return AsmRdRand64 (Rand); > +} > + > +/** > + Checks whether RDRAND is supported. > + > + @retval TRUE RDRAND is supported. > + @retval FALSE RDRAND is not supported. > + > +**/ > +BOOLEAN > +EFIAPI > +ArchIsRngSupported ( > + VOID > + ) > +{ > + /* > + Existing software depends on this always returning TRUE, so for > + now hard-code it. > + > + return mRdRandSupported; > + */ > + return TRUE; > +} > diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S b/MdePkg/= Library/BaseRngLib/AArch64/ArmReadIdIsar0.S > new file mode 100644 > index 000000000000..82a00d362212 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.S > @@ -0,0 +1,31 @@ > +#-----------------------------------------------------------------------= ------- > +# > +# ArmReadIdIsar0() for AArch64 > +# > +# Copyright (c) 2021, NUVIA Inc. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +#-----------------------------------------------------------------------= ------- > + > +.text > +.p2align 2 > +GCC_ASM_EXPORT(ArmReadIdIsar0) > + > +#/** > +# Reads the ID_AA64ISAR0 Register. > +# > +# @return The contents of the ID_AA64ISAR0 register. > +# > +#**/ > +#UINT64 > +#EFIAPI > +#ArmReadIdIsar0 ( > +# VOID > +# ); > +# > +ASM_PFX(ArmReadIdIsar0): > + mrs x0, id_aa64isar0_el1 // Read ID_AA64ISAR0 Register > + ret > + > + > diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm b/MdePk= g/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm > new file mode 100644 > index 000000000000..1d9f9a808c0c > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/AArch64/ArmReadIdIsar0.asm > @@ -0,0 +1,30 @@ > +;-----------------------------------------------------------------------= ------- > +; > +; ArmReadIdIsar0() for AArch64 > +; > +; Copyright (c) 2021, NUVIA Inc. All rights reserved.
> +; > +; SPDX-License-Identifier: BSD-2-Clause-Patent > +; > +;-----------------------------------------------------------------------= ------- > + > + EXPORT ArmReadIdIsar0 > + AREA BaseLib_LowLevel, CODE, READONLY > + > +;/** > +; Reads the ID_AA64ISAR0 Register. > +; > +; @return The contents of the ID_AA64ISAR0 register. > +; > +;**/ > +;UINT64 > +;EFIAPI > +;ArmReadIdIsar0 ( > +; VOID > +; ); > +; > +ArmReadIdIsar0 > + mrs x0, id_aa64isar0_el1 // Read ID_AA64ISAR0 Register > + ret > + > + END > diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.S b/MdePkg/Library/= BaseRngLib/AArch64/ArmRng.S > new file mode 100644 > index 000000000000..5159f467e3a6 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.S > @@ -0,0 +1,37 @@ > +#-----------------------------------------------------------------------= ------- > +# > +# ArmRndr() for AArch64 > +# > +# Copyright (c) 2021, NUVIA Inc. All rights reserved.
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +#-----------------------------------------------------------------------= ------- > + > +#include "BaseRngLibInternals.h" > + > +.text > +.p2align 2 > +GCC_ASM_EXPORT(ArmRndr) > + > +#/** > +# Generates a random number using RNDR. > +# Returns TRUE on success; FALSE on failure. > +# > +# @param[out] Rand Buffer pointer to store the 64-bit random value. > +# > +# @retval TRUE Random number generated successfully. > +# @retval FALSE Failed to generate the random number. > +# > +#**/ > +#BOOLEAN > +#EFIAPI > +#ArmRndr ( > +# OUT UINT64 *Rand > +# ); > +# > +ASM_PFX(ArmRndr): > + mrs x1, RNDR > + str x1, [x0] > + cset x0, ne // RNDR sets NZCV to 0b0100 on failure > + ret > diff --git a/MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm b/MdePkg/Librar= y/BaseRngLib/AArch64/ArmRng.asm > new file mode 100644 > index 000000000000..33144196cb54 > --- /dev/null > +++ b/MdePkg/Library/BaseRngLib/AArch64/ArmRng.asm > @@ -0,0 +1,39 @@ > +;-----------------------------------------------------------------------= ------- > +; > +; ArmRndr() for AArch64 > +; > +; Copyright (c) 2021, NUVIA Inc. All rights reserved.
> +; > +; SPDX-License-Identifier: BSD-2-Clause-Patent > +; > +;-----------------------------------------------------------------------= ------- > + > +#include "BaseRngLibInternals.h" > + > + EXPORT ArmRndr > + AREA BaseLib_LowLevel, CODE, READONLY > + > + > +;/** > +; Generates a random number using RNDR. > +; Returns TRUE on success; FALSE on failure. > +; > +; @param[out] Rand Buffer pointer to store the 64-bit random value. > +; > +; @retval TRUE Random number generated successfully. > +; @retval FALSE Failed to generate the random number. > +; > +;**/ > +;BOOLEAN > +;EFIAPI > +;ArmRndr ( > +; OUT UINT64 *Rand > +; ); > +; > +ArmRndr > + mrs x1, RNDR > + str x1, [x0] > + cset x0, ne // RNDR sets NZCV to 0b0100 on failure > + ret > + > + END > diff --git a/MdePkg/Library/BaseRngLib/BaseRngLib.uni b/MdePkg/Library/Ba= seRngLib/BaseRngLib.uni > index f3ed954c5209..de5d4f9dd869 100644 > --- a/MdePkg/Library/BaseRngLib/BaseRngLib.uni > +++ b/MdePkg/Library/BaseRngLib/BaseRngLib.uni > @@ -1,8 +1,8 @@ > // /** @file > // Instance of RNG (Random Number Generator) Library. > // > -// BaseRng Library that uses CPU RdRand instruction access to provide > -// high-quality random numbers. > +// BaseRng Library that uses CPU RNG instructions to provide > +// random numbers. > // > // Copyright (c) 2015, Intel Corporation. All rights reserved.
> // > @@ -13,5 +13,5 @@ > > #string STR_MODULE_ABSTRACT #language en-US "Instance of RN= G Library" > > -#string STR_MODULE_DESCRIPTION #language en-US "BaseRng Library= that uses CPU RdRand instruction access to provide high-quality random num= bers" > +#string STR_MODULE_DESCRIPTION #language en-US "BaseRng Library= that uses CPU RNG instructions to provide random numbers" > IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease 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.