From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail03.groups.io (mail03.groups.io [45.79.227.220]) by spool.mail.gandi.net (Postfix) with ESMTPS id C14A77803D0 for ; Fri, 12 Apr 2024 14:34:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=b+TY7IG7DxjUDJ3BO+HqhbE/y7Q9qDITPopFBUllb40=; c=relaxed/simple; d=groups.io; h=Received-SPF:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:NoDisclaimer:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1712932448; v=1; b=TlgOlrsVF/QRLVVcHNN/ChWw0SORk3VqDBp8cPMMDepmcCtgD/SYCEyGSkbWIoO0Oc4M2Jvc M/A3++6XpKEWm5MjFx/SvmZVAzbpTV5TljkPvodtznt1/54QKRiq3JASJBmoct6KemG/U4I1HLZ 7fDAdCeDArRKd4RWs7FKqPwDJ7g9k3baB0QT7SDQ7IsDv7gjW90k3CkXYTvmGLF4EbVEB2n3SAm mQlENElvE9eePP3LaJuRLzOrn1yg0kWBesXGjelVYyEA4iaX+/RLGhj4qBv/TMm5CY8Sfx3l+GC FTkbZ9k4LZZRZOW1Oje/4WKpmaNcYKQIurQPKJWIT+32A== X-Received: by 127.0.0.2 with SMTP id klSZYY7687511xQS6u07e2Bh; Fri, 12 Apr 2024 07:34:08 -0700 X-Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.77]) by mx.groups.io with SMTP id smtpd.web10.48545.1712932439090151272 for ; Fri, 12 Apr 2024 07:33:59 -0700 X-Received: from DU2PR04CA0219.eurprd04.prod.outlook.com (2603:10a6:10:2b1::14) by GV1PR08MB10855.eurprd08.prod.outlook.com (2603:10a6:150:161::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Fri, 12 Apr 2024 14:33:55 +0000 X-Received: from DB5PEPF00014B9C.eurprd02.prod.outlook.com (2603:10a6:10:2b1:cafe::31) by DU2PR04CA0219.outlook.office365.com (2603:10a6:10:2b1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26 via Frontend Transport; Fri, 12 Apr 2024 14:33:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;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; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5PEPF00014B9C.mail.protection.outlook.com (10.167.8.170) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Fri, 12 Apr 2024 14:33:55 +0000 X-Received: ("Tessian outbound caed45120527:v313"); Fri, 12 Apr 2024 14:33:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 61542396dcda1260 X-CR-MTA-TID: 64aa7808 X-Received: from 980df46140d7.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2BF90EB7-3270-4B5B-9504-FE7F296187B6.1; Fri, 12 Apr 2024 14:33:48 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 980df46140d7.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Apr 2024 14:33:47 +0000 X-Received: from DUZPR01CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::18) by PAWPR08MB8984.eurprd08.prod.outlook.com (2603:10a6:102:341::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Fri, 12 Apr 2024 14:33:45 +0000 X-Received: from DU2PEPF00028D01.eurprd03.prod.outlook.com (2603:10a6:10:3c3:cafe::e7) by DUZPR01CA0015.outlook.office365.com (2603:10a6:10:3c3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26 via Frontend Transport; Fri, 12 Apr 2024 14:33:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C X-Received: from nebula.arm.com (40.67.248.234) by DU2PEPF00028D01.mail.protection.outlook.com (10.167.242.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 12 Apr 2024 14:33:45 +0000 X-Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 14:33:40 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Apr 2024 14:33:40 +0000 X-Received: from E114225.Arm.com (10.1.196.56) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 12 Apr 2024 14:33:40 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , Subject: [edk2-devel] [PATCH v2 29/45] ArmVirtPkg: Kvmtool: Switch to use BaseRng for AArch64 Date: Fri, 12 Apr 2024 15:33:06 +0100 Message-ID: <20240412143322.5244-30-sami.mujawar@arm.com> In-Reply-To: <20240412143322.5244-1-sami.mujawar@arm.com> References: <20240412143322.5244-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF00028D01:EE_|PAWPR08MB8984:EE_|DB5PEPF00014B9C:EE_|GV1PR08MB10855:EE_ X-MS-Office365-Filtering-Correlation-Id: f7050c9c-4661-45e1-540b-08dc5afd9530 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6V6t6EntnKeQU7/ZhZrCv0KoY7euhcN+z4rEm5XA2K0Wc6IDiGadE9x3TkL1Dajqiq65jDB3BoJrvxh3syNsHrTzP3u/JoGF3Hu/twgt593eJ5T7OYEyT84c2K34PZD1WbYPgAAqAMJFSSx24BeZ+PiYLEHq/JK2EecBBCJ2OqEDhVE9M3tVgiWvcQZC7hGc/Y0kAOjf6dxKviPW75XMKmxoXXPqcZ3NlT0vy2212GFMBRKfdOsWH09uJw1iWXpx413HPxbDjSafbDA06cKaL8FKG4Z0zowbuZM1QtT5q4aghkxQ9Gyxr081eDe/T6Yz0azvj8E42+QfC+RRyjaG3nWVa10UCIchMiWwisIhwGYlxGU65xi+oA5d2UNzwLn1S4k/MBAVN2hGFCHT7k+agtUDbdOs1hMkUFfFSsVHOt92ExCv/fr3yMqU5BXe3vei+qvCtaZNdgIwTEnJsMYevvYfByDfmfddAMS8FpDwmQGcnumMHHtvRvzfAa200K7FVfMen61XMKgRUp6WPzWlIx9+od8i9Yg7U4F6CEAaUgK2xF53Lz45G8DBER5LU+dIZaubJVW2Nr20/4ZWRSbqJBF+yiQaD3lUAWcqCwcGmKksGiEIVbK4Zo410PBQtcNXZ/ClotM88Ma/x/ySGTkmcYP5kAOgbF2TJpaWyYMS6ls05+6rA8LqIhVv4Pd97LXSxoD33i7NASd93qU8b6nJCOAgmb8uftoJEQ06B/O+HH8AzogG3IFeq1DXhbHyS0CZ X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(1800799015)(82310400014)(36860700004)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8984 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B9C.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2910a9e7-2ab4-4ea6-6310-08dc5afd8ef3 X-Microsoft-Antispam-Message-Info: Ln5L73HfbGWIMkn2uC3LrKfR6gHGMIUDMDV7ZgCotedEsntC2Ig+RbfphQEDrwwoqJ4xBLRkknz7Wo6uK2dAeO7eApNDzTfLNoTp3HGPbrdPgzspiABbEv9G717a5kJp5JKihNY5O9WcoqYFheRtv9E0U96hdPzuaIMMFQcmElkf8PnPgosuEJsLirsEyRjFVjzYU6Y2nwD+xIOPJy/RDuF87gWw4E2Kht58S1QIbw5SySxnJK1G9GNt4RN97GQ9CW2EqGrNNGqbwGpSHkpEjF/Q/o+2thYQWeEUbiWEpw8wqc9H0BloAvBTZwxy1IS3OoG9ojlGot9HfVorFRGKhtyl5jfHxi4sXbSBJhoFG+nkNsTCZScuGRKM32T5yTt1xQ+o78uHyz7BOa8xBzHYUu6ElD/NSeu2bY6DLagc3VcPuBIvpdPpM8xSV8WJuzd1+opfSxGxMJ1nwbUb4ZiXf6fGx3x+CjCCCXFmu1+7S7CUDDz/qNZ98b1huRF7hVmlBDGX0IbL9LwQEfMsl8ktoFc2QVOsi4BF38s4hzrYeikWVQ9zbpABb9VwqsW75hUVx5f5OIvRQPQ1Re02o7ypEeLGt+dBi89g9VmumbMPQ4lBNTF6UBP4iUQuYRgnIzXmAsT8HS4bd4iR0QVVLwwavsHAyfuIkXecNEF2ZvJuulXZEGQTb77BowTSYunrOT9K+ufjNbMvVcQe4DtTqZUAqkUCHRPjDChfBz5FfSuq6x5lcuuaqlztagsPBawithoS X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2024 14:33:55.5653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f7050c9c-4661-45e1-540b-08dc5afd9530 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: DB5PEPF00014B9C.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10855 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: Fri, 12 Apr 2024 07:33:59 -0700 Resent-From: sami.mujawar@arm.com Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Wzo3VQ0l0vXFSUAG8bEojvyXx7686176AA= Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=TlgOlrsV; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.227.220 as permitted sender) smtp.mailfrom=bounce@groups.io The kvmtool guest firmware is using the default RNG library defined in ArmVirtPkg.dsc.inc which is BaseRngLibTimerLib. BaseRngLibTimerLib is only present to use for test purposes on platforms that do not have a suitable RNG source and must not be used for production purposes. Armv8.5 introduces random number instructions (e.g., RNDR) which return a 64-bit random number. Although, this feature is optional, it can be assumed that most modern platforms will implement this support. This feature i.e. FEAT_RNG can be discovered by examining the processor feature registers. It is therefore desirable to use the RNDR instructions instead of using the default BaseRngLibTimerLib which is unsafe. The BaseRngLib in MdePkg already implements the RNG support using RNDR. However, it is worth noting that FEAT_RNG is supported in AArch64 state only. Therefore, switch to using the BaseRngLib instance for AArch64 firmware builds. The AArch32 firmware builds will continue to use BaseRngLibTimerLib. Note: The guest firmware already supports Virtio RNG. So, should the processor not implement FEAT_RNG, the guest firmware can fall back to use Virtio RNG. Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Gerd Hoffmann Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirtKvmTool.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index c358b0a55daea8f8231b037cc63005cc86fe9a18..835e4f1a5a618537d885682322a288f12b8ce8dd 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -90,6 +90,7 @@ [LibraryClasses.common] [LibraryClasses.AARCH64] ArmCcaLib|ArmVirtPkg/Library/ArmCcaLib/ArmCcaLib.inf ArmCcaRsiLib|ArmVirtPkg/Library/ArmCcaRsiLib/ArmCcaRsiLib.inf + RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf [LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM] PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117692): https://edk2.groups.io/g/devel/message/117692 Mute This Topic: https://groups.io/mt/105483431/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-