From nobody Sat Dec 21 12:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105078+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168450816653481.41869537943865; Fri, 19 May 2023 07:56:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xj51YY1788612xG3CFAfmT4b; Fri, 19 May 2023 07:56:06 -0700 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.82]) by mx.groups.io with SMTP id smtpd.web10.28522.1684508165340034624 for ; Fri, 19 May 2023 07:56:05 -0700 X-Received: from DB6P192CA0009.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::19) by AS2PR08MB10112.eurprd08.prod.outlook.com (2603:10a6:20b:64e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.18; Fri, 19 May 2023 14:56:02 +0000 X-Received: from DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::2) by DB6P192CA0009.outlook.office365.com (2603:10a6:4:b8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:56:02 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105078+1787277+3901457@groups.io; helo=mail02.groups.io; 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 DBAEUR03FT055.mail.protection.outlook.com (100.127.142.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 14:56:01 +0000 X-Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 19 May 2023 14:56:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 94fba2ee28ff5730 X-CR-MTA-TID: 64aa7808 X-Received: from 58004e3eb125.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7A664EB3-1C97-4845-98A8-A35882452E63.1; Fri, 19 May 2023 14:55:55 +0000 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 58004e3eb125.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 14:55:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U5b2NaKxDLDo8EDbuxYDzZW4ZwbN2j7Lx1JmPBTsCuE0p/CgDq0fbVun0D+F93ldgAG0EWfniLFASQsTLDICDhi/zBfX8OyRzgoJrKY6YjYMVBeIpy7Qq1rtyZph8lX0nteNoHgu29gnnh1/AO1zVk78pIXe0rda+VmXmB7+zzgQD34fszbQDavB0qduRBSJre59CrbNAwVqMDOwKqitqQ4nYIK5Iej60IeHxIHbFAk+h3Io30IGqUs0TVX26/G2Da62GHkpVx0Y5ewH9V35teiQzpnWURcnfP8//mXz24Gs6W4VbSQ19d/fIn8zGdLKkVXpBfNoLltfth4n9Iaqmg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gpfzZFKtuOzUW19xnuK8wzj5KIF1D8MGFtq78PSJ7fY=; b=UXKcSEYbhjOtxD7kwb9ZFr2PGmBZXcMytzTohSJ+WyGkORKTFU+B1W4UFteRX58Xfixt5qA+FP3xjEHffa7A/fbEh9lPxoNFpVoFIPwHXpjqXs5ZCDiFGcmIHK1QRbJGPhzcYnw7dUPb0k1TQpwqZE4ArZfXPjlKZ4cBc4wEJ8iX0XHMvghKlzlLXkAI0QgDpC/9Z9XCN4O35iLPV0oeXPwU1FDjo6x+cMgcO3BDR0nCS/u9MmidGLDAMrd9A5YqM5JPNkkmssJn8XvuwsjHALzXKBezSfzerv31kyJkopr9iT07+FwqgSnwDeL06OZ3yd3pw7iB/yXnPAp48panjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AS8PR04CA0109.eurprd04.prod.outlook.com (2603:10a6:20b:31e::24) by DU2PR08MB9992.eurprd08.prod.outlook.com (2603:10a6:10:490::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Fri, 19 May 2023 14:55:47 +0000 X-Received: from AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31e:cafe::a) by AS8PR04CA0109.outlook.office365.com (2603:10a6:20b:31e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:47 +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 AM7EUR03FT005.mail.protection.outlook.com (100.127.140.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 14:55:47 +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.23; Fri, 19 May 2023 14:55:42 +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.23; Fri, 19 May 2023 14:55:42 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 14:55:41 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v2 1/5] ArmPkg: Configure PcdEmuVariableNvModeEnable as a dynamic PCD Date: Fri, 19 May 2023 15:55:36 +0100 Message-ID: <20230519145540.46700-2-sami.mujawar@arm.com> In-Reply-To: <20230519145540.46700-1-sami.mujawar@arm.com> References: <20230519145540.46700-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT005:EE_|DU2PR08MB9992:EE_|DBAEUR03FT055:EE_|AS2PR08MB10112:EE_ X-MS-Office365-Filtering-Correlation-Id: 068646a8-c0cc-47df-6752-08db587929d4 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: ynDYP9KhBDpaeICaQDSC7MZhYF4b/8hLWBMN3ptcb8l7iIMBrorYmdHYgm2nxVjIozjUIvBNvRn75drvfIKuCy11URNbuUCGLfR9hpFpyRrON2oVaciruhQrfs1i6E7ewBiXz/1XV+vwegKidtg+WhhWrhkY/vvUdodlsbGyGwgXq9rP7sxCBuUR/zo1iau8rJyth8yED5qmhnzRsbshR8LDxUnYopzqtjIc46i0iL+tTJ3iEEAzS0U8MeeO8yiAUl9yJMvCuC/xGZDBFoJI/IVFTA7ApJAIFTGGT3ZBpIiL0X4scmlvj3v6BRtFbatZVusJWI1vC6fvFr0CfNtETk/VVmIYkbOnJ++ULA9+9jSLzKWum69KtC7ZvjybzuPO1BHbM3T3XtPsEJ8/l6MMJ9JiJUoXaiQpZrsv6bYTI7J7Eu9UaBgpffcG5eCet+QfBTLsskCkcW9CXD6vf/nShA+1OK3AK2xyw+7SbCmu8HzNFLmr7vFxP6JJplfWaIY84iPe1wFOjM6lh7gKVYOxQ+iogmQcRz/b1N4NcSI1cc6L6AAJXB+E1bEwzueyI5tJJCibMm/oa5K2A9ZbzsbNBKIIqfNbQCfV/+PyGuoKDIpOBiE3acao83WNHhQ41NAd3N7aJLW95nEJAfxe235UnX3C4nbkNhPeEfQV/0JTernSh/C2OW/90cEY6FkskDAGMW3txFuP14FyZ2bLctBzwtOGc5ykiGB+XUk2ZgQG8Ao296JOlZUpxbDb6brgT6DR 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:(13230028)(6029001)(4636009)(376002)(346002)(39850400004)(396003)(136003)(451199021)(46966006)(36840700001)(4326008)(70586007)(70206006)(478600001)(6916009)(54906003)(316002)(36756003)(86362001)(83380400001)(47076005)(26005)(2616005)(186003)(336012)(426003)(36860700001)(1076003)(5660300002)(41300700001)(8936002)(44832011)(8676002)(2906002)(7696005)(40480700001)(6666004)(82310400005)(81166007)(356005)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB9992 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0ac92978-b07d-4678-b3e7-08db58792131 X-Microsoft-Antispam-Message-Info: aaNJAL4XbzKzLearrRC48FKCSx8esVFtpMxlth4G+eaa2eSG+7W7tq4Y5n0fsVHgosnZc86CprdVKOLqSG54qtwKI96L2kExaHv6/GtCHFJgXjaCfytk/E/weStNzUleosePXzdxwu2tKDo6XeDWumFRA95d5f5yfV4125ptqWwwATNm/zlc9boH51X9ul05s9a/Ws0EzlnX4tI3KEJYyrt9544aQrLm0JpfOt1h06sM4HnLsfillqOc6xlABA3xg1dD6LrMh3MTvRThJohRaS+66gZ/J4eI1LkpeX1wm6t74jhN49b9Do9DZxZn1vRGPoTHFO9u8Abw9D2Er6QJGijhdMyv1k1k6DjrlqALunpb/Gsy8LNhMgPmnbzsMWXZwjYGBlzleiCZGRzPwrzQsCh7iAtUGImBgoDHhYXaq3Efb4TyaoB0QLGGCxgRCJF+A2OhDUjtm7Ieq8rM66tkw5b7QxiA47eIYM8wyFtcd4nEtZ7wPlRwrz45wvL5/wKOMteVJIGs0U77o0wfy51avD8MPXqHqAPjlFbliWVj8zzJu/zz+6tIcFMaMLE3UK3A79oY/CtcJ4gs31pZZss/JaEIgSIXIFdGOVyzW+Mo5g/9no2pbt5Vj95IMBRXNpvwBd2uf2doBNozQ5rh558AogtlYMGZCI0C+sIyyboZenTxkLdSGKGFbH6trH58mwSLq6LCblt874wX1GjJapACmZ5vlrzEAiSfCSeOQw/UT3d8+6I+x0uUtVRBiVoCSKtn X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 14:56:01.9130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 068646a8-c0cc-47df-6752-08db587929d4 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: DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10112 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: dWJgMpQTQZsA4XJZANAO0Fywx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684508166; bh=E9KgSJ9n093QjiWaTDOxPw7DsoMlS+0/7Y+kI4HFX14=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=msypmVglulpTm2ewTb4f17jmvTSirsAi6DeK/j9MMcwPuwnLfbnHNVj0w7JRVMjkMHL R1HEo6fql55yS8BVwMC9kI8dYlkLDcYzeK3cx3/kR8FwvTl9wzwSa8hvyYwtkulpAZIPW ULFnkiQqiIgbZNWpp1gTJJR5zNdkNd0Uiu8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684508166970100014 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The PCD gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable indicates if a variable driver will emulate the variable NV mode. This PCD is defined as [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]. Some firmware builds may define this PCD as a dynamic PCD and initialise the value at runtime. Therefore, move the PCD declaration from the [FixedPcd] section to the [Pcd] section in the platform boot manager library file PlatformBootManagerLib.inf. Without this change the build would not succeed. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.i= nf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 05ed46456cc482d735490ad4418aa75a1b331aa7..bc029be635f26fa29731a413910= 9d0f5eb177054 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -57,7 +57,6 @@ [FeaturePcd] =20 [FixedPcd] gArmTokenSpaceGuid.PcdUefiShellDefaultBootEnable - gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits @@ -68,6 +67,7 @@ [FixedPcd] [Pcd] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable =20 [Guids] gBootDiscoveryPolicyMgrFormsetGuid --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105078): https://edk2.groups.io/g/devel/message/105078 Mute This Topic: https://groups.io/mt/99013771/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Dec 21 12:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105080+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684508177756180.32172238930934; Fri, 19 May 2023 07:56:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mwYNYY1788612x18TAx4pFRK; Fri, 19 May 2023 07:56:17 -0700 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.50]) by mx.groups.io with SMTP id smtpd.web10.28527.1684508176527335903 for ; Fri, 19 May 2023 07:56:17 -0700 X-Received: from DB3PR08CA0021.eurprd08.prod.outlook.com (2603:10a6:8::34) by PA4PR08MB7594.eurprd08.prod.outlook.com (2603:10a6:102:270::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Fri, 19 May 2023 14:56:04 +0000 X-Received: from DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::e) by DB3PR08CA0021.outlook.office365.com (2603:10a6:8::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:56:04 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105080+1787277+3901457@groups.io; helo=mail02.groups.io; 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 DBAEUR03FT028.mail.protection.outlook.com (100.127.142.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Fri, 19 May 2023 14:56:04 +0000 X-Received: ("Tessian outbound 8b05220b4215:v136"); Fri, 19 May 2023 14:56:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ca8479a99b172251 X-CR-MTA-TID: 64aa7808 X-Received: from 6a0699275af1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7FC202C3-66B9-42E2-BAA0-160523A3F153.1; Fri, 19 May 2023 14:55:52 +0000 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6a0699275af1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 14:55:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CKVXRxTEpthnySMmQHIQFcQfWtXzkM8BZZ6++N706OKOKZXhfBPXuWBKqGMzQmtA1056YxI9OWAJq3uRkhb2bJMXiNUm08kPn7J7MRK3VOTQLcq1T6XXgwrO+SsggYrAhiClhDgTLKeGS8uvIgfRGxOpRbnloMYT8lq3TonroLcrs/o8l3KnyrdXBKeuyvj+MYddnVEt3G3zG0kjsUISbubD8Ow0vnRZcZysZTjRY3o9ig9O/UHoTjFKWVJYdnbM2ZzX0ojksEamWBqmnBzARjqa3nAkhcyCnNRhsm3eAWPf1u9YXvSM9jeDI5WplCh9pcSRFoGhiRZkpqNvOEqpLA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wuPsKTPSr6EpYO3aOnyOjIwA9j725Griq7G+aTvkVEo=; b=g81MfpdllYWIzmqSRZ9Hq8z+e/7DVAaDRjxocYqWeJNZZmO3V2hopLY5jLNOXT+IUIUzWCtlBq4m8p4pYWXlxx1U5/KLk6xea3sNXfciyot6hyKg0qf6WdGPY8UQbqQqfPsgjHcUmsbN7RvrE1pv1w382FiA6k2F5kZNFUENbPhl3MQtVgC4FHHWRW/AFVQPkxAX+coxFVAneCPbx4NAhDyunf29PqT8K5CVo57hR7GTMpLz1zRS1CxufJO20z0+IGp4sX/TRTMz0Sqr2OvXLR8CLzXhnhFeNTELJz+HTxqbGYGLehJ5WtJ20cF1XLrYIaicv4sMthq8jjjZYW5UyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM0PR02CA0201.eurprd02.prod.outlook.com (2603:10a6:20b:28f::8) by PAXPR08MB6464.eurprd08.prod.outlook.com (2603:10a6:102:df::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 14:55:47 +0000 X-Received: from AM7EUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:28f:cafe::c3) by AM0PR02CA0201.outlook.office365.com (2603:10a6:20b:28f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:47 +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 AM7EUR03FT056.mail.protection.outlook.com (100.127.140.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.19 via Frontend Transport; Fri, 19 May 2023 14:55:47 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.23; Fri, 19 May 2023 14:55:42 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 14:55:42 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v2 2/5] ArmVirtPkg: Define variables for emulating runtime variables Date: Fri, 19 May 2023 15:55:37 +0100 Message-ID: <20230519145540.46700-3-sami.mujawar@arm.com> In-Reply-To: <20230519145540.46700-1-sami.mujawar@arm.com> References: <20230519145540.46700-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT056:EE_|PAXPR08MB6464:EE_|DBAEUR03FT028:EE_|PA4PR08MB7594:EE_ X-MS-Office365-Filtering-Correlation-Id: 44354732-ea9d-4c9c-6ba6-08db58792b33 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: A1vHRvMn3OGUP17g0Q4QJe3KfzCc2ZNOwVCCODv0qU0OhpIWEO63MIp6YgHZjpt43jVO/VxuCZUK3qI28ZvLc1PMAaQ1HL/HlO9DnI+wMet4rDoKeR0h8BKjhqV5DQw14sEfeGPw0sXopIt0fbLQ3hH41VcaHYwu0AVrSrxQQoQv/IFt13OrKKVjdu6ZGw6J4Abr/pORm09A03Y5h1Hkb1hLHxnPmtLuG8PIECml3SIqmsUo5ClK8iaHGsGGiFaJDutAbKABCyGjHOlvr3to3+Yyn/QmszHDSKiLRyynsPJyYr6bXUuWcpad2y2yX/r5Fl9cY6aCWlIiHjqpTjprlWppE33DzoIfGfaH92UkUscyQwwxiVomAOqnSgaQVmijwyF+8ikPgoWL7C0ky39LpakkUrPtxzTdeb+/KNf9LQz5x+dgiKQyS+fd2bUyiz67ny4KHbbGYXWNAaBK8bfnPfwZeovzky8WmEClNTRF+njrB33dNqWNlsPK6muVZnNMgABxOLmGqKUXT8fmD85hMYrOFshNT0BNlyzTnzjk2WU/K/ZvBqcaD3UvCgyH0EWdSmfZMcWHdPifaRopT9TOCGBJ+g+oC1+0gRXemUijsTqEXh2NzTK/eEZy9/9S5IRqxnltCekSX7X6i/Wc5TXa6enoQ/HvnVOcivHC2BYodQHhv+2baomXmgmo1ESQy7hOfsD5a0GJdRZJWecBgpzR71Q+iFkqiy2w55ffJlEl77UeaSfyy64WoVhGIytB9dZCRY74dIH365t8UwQO2bctvQ== 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:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(7696005)(6666004)(83380400001)(478600001)(2616005)(336012)(426003)(36860700001)(40480700001)(1076003)(26005)(47076005)(36756003)(186003)(356005)(81166007)(86362001)(82310400005)(82740400003)(40460700003)(6916009)(4326008)(316002)(44832011)(70206006)(70586007)(2906002)(41300700001)(5660300002)(8936002)(8676002)(54906003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6464 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a64c4185-de12-45fe-4850-08db58792129 X-Microsoft-Antispam-Message-Info: jnXTS+ZCFDiYkFAAb+9cpEbL2YkAiwdNwaRVUswS+3Ax0AmoUvIrBu4UnnWkT3sb7d6SYLv2IFUVFSl271wslW6Ca8Oc9Zy9zjY34ONTzkCpr1tetAO8xLGUb0l/N5zmf8HQyoNlahZaSWFGOW3hbnUQ3oqdUP1o33+g+Gk0jP6quUlxolfGzHVNUY1Xg23s6gAYpUcXi7E7Xtam65oXqtmWQIjJIK3ee9sSGLf1mF0tzyb5YgJk1mLcG3yBiy0KekG+ZJZggGbIk4KwzXWnsiR1QNLztpVaWEYQGs5anrhA/NalWy8nosaDFe+ytEWiwToQLIf/HdpVvA1EAdTd+pR3YnklQkYM2ew81i8DDpf/7wk/FV1i+QGOyerIUv1cMz0dbZ1U/N0+0FlY2G1LsupOl++qwJUjlYkx8+qOwOBa20Vz0orh2rKFMU/yMxUGnxSzoIXH9jJPanYK1vGq24x4iBok+rrLeOIJP2JQpglyjCCHrrbXFxR0/ldsLmzILh1y5vEDHW3B4yFdi3csuwQ2zy3qvTr82gNn10olOFzqgGWp/s7FGWKZ3Wi+HnKLZdh4hSj/5bbEg11RxHcsXm4zPSBxvwgEyZpqu+PdD6WIf5Wuo8a58HuyX06SY2158m2UKURybIcwdcYPimM+kPrqgfD7spY2gQ799XJR72lpqf2njqhTDE5/KVmMGUjfJoepHeuEsgNBXjD47+dGMNgJRSKFwGW2LpZt90FvWijx6OACqQzDs6lCoy+6cD13 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 14:56:04.2134 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44354732-ea9d-4c9c-6ba6-08db58792b33 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: DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7594 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: 10fiSQpIxQicoBiqWoq3sqbJx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684508177; bh=MmIOvbXL/WtbyjkuRimWWUgrJ0I6Gv9wHk5MJaeTssQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=c5KeHf2Be7o9daRGtqjPqMKvpA9vj0KsG6v04+wOS0dJnKdcVy/bRwicoeyxIbC+6Zf F6yqIMFIANfR2ZGRraBW+7oPAGMjjnt2adfoK2STZMC0SBmeAtltfMqMBw5DHLzaymCcj 2vEl2GCTk79heJJn2AgkgDTzOPUgn191vFk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684508179757100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Kvmtool allows guest VMs to be launched with or without a CFI flash device. When the kvmtool option '--flash ' is used to launch a guest VM a CFI flash device maps the flash file that was specified at the command line. The NorFlash driver uses this flash as the variable storage backend. However, when the above option is not specified, a CFI flash device is not present. In such cases, the firmware can fallback to use emulated runtime variables (which uses the VMs DRAM as the storage backend). Therefore, define the PCD PcdEmuVariableNvModeEnable required to enable the emulated runtime variable support, but do not enable it by default. The firmware is expected to dynamically discover if the CFI flash is present and subsequently enable NorFlash or emulate the runtime variables. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtKvmTool.dsc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index d0afe1b49e250c554313c2077b89650d6f6d67cb..25920ab4ae3cce20fdbe8e9ff7e= 25b8696d2c851 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -1,7 +1,7 @@ # @file # Workspace file for KVMTool virtual platform. # -# Copyright (c) 2018 - 2022, ARM Limited. All rights reserved. +# Copyright (c) 2018 - 2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -219,6 +219,10 @@ [PcdsDynamicDefault.common] gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x40000 =20 + # Define PCD for emulating Runtime Variable storage when + # CFI flash is absent. + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|FALSE + ## RTC Register address in MMIO space. gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister64|0x0 gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister64|0x0 --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105080): https://edk2.groups.io/g/devel/message/105080 Mute This Topic: https://groups.io/mt/99013776/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Dec 21 12:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105075+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684508164332197.98088910355716; Fri, 19 May 2023 07:56:04 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dHaBYY1788612x3sjtcbn0hT; Fri, 19 May 2023 07:56:00 -0700 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com (EUR05-VI1-obe.outbound.protection.outlook.com [40.107.21.58]) by mx.groups.io with SMTP id smtpd.web11.28441.1684508159183533315 for ; Fri, 19 May 2023 07:55:59 -0700 X-Received: from DU2P251CA0027.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::33) by DU0PR08MB9226.eurprd08.prod.outlook.com (2603:10a6:10:419::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 14:55:53 +0000 X-Received: from DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:230:cafe::b0) by DU2P251CA0027.outlook.office365.com (2603:10a6:10:230::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:53 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105075+1787277+3901457@groups.io; helo=mail02.groups.io; 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 DBAEUR03FT043.mail.protection.outlook.com (100.127.143.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 14:55:53 +0000 X-Received: ("Tessian outbound 99a3040377ca:v136"); Fri, 19 May 2023 14:55:52 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fe9ca0d7265a8522 X-CR-MTA-TID: 64aa7808 X-Received: from b57b2aa596ad.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9B57A631-FBBF-40E5-8DF2-4AF14ACB63C6.1; Fri, 19 May 2023 14:55:45 +0000 X-Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b57b2aa596ad.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 14:55:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e6/ze9UuNP4xeteXwMbLopyw36n4QI0Bj14KEGs32eCxPMSdui19uw485Ajb1LeB0GVI8iHQVLilfyVbzGJQDPRPG1rOqgM16b4hiY6aB6cRmQn8AOvcwrAf2XH0SXBPH4bH6ckQqdZq0fngyCNExRCRuBNMchr2jgmtuwFxIJFglGnMtwO+ZB0BRZ5YTtUdn3EXkGwcrwis8aPj9B6Fztuc1i+ZtvuiQewfdT28hGBcJPbUJJSiunxaEnl/vSerPOOvN2ccDzpe/4vBnRj4oaAM8MIAZN90EMpu+Ai2lKUIE6UmjK2q0ec/m54iPiMCMLQF67nBaxO9GiiIjgmLUA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=87dNbn7Tu+DDmq8qbw5npGWOcEK7Sxh5oy6/rbNCwY0=; b=Ptybjwc5cneYYtV8/v/DCtI3svjmxSl+X92Lzt6ww+B/ABa3+m8opk6mi0LatoKlM4GZYXXhNsDK4yz89XbePmb693wHcVPUZf0SOxi8nWkq/sHPpt2JsFLrGPXUaARfs/Km5RtmHfx5iUj/jJT9azk/3z1yAKvL5AqRkng8/TlDjJTmkkE3g1BISyrlJSKvZ6xzFxWCozaG+vHItKJ+lEgidrtmY6XJWhQHiQ9CJM0YTtFhu3UGH84naOIBH7Is+j9g7D0B5dscOagjv4422yUw5kHwB2/CjLhIYIBTMZm86Y+o6/CKW4YkQZlU2hSlXPYBgHDimr9WzrkwtNJZTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DUZP191CA0028.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::24) by DB8PR08MB5354.eurprd08.prod.outlook.com (2603:10a6:10:114::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 14:55:43 +0000 X-Received: from DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4f8:cafe::4f) by DUZP191CA0028.outlook.office365.com (2603:10a6:10:4f8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:43 +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 DBAEUR03FT018.mail.protection.outlook.com (100.127.142.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 14:55:43 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 19 May 2023 14:55:43 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 14:55:42 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v2 3/5] ArmVirtPkg: Fallback to variable emulation if no CFI is found Date: Fri, 19 May 2023 15:55:38 +0100 Message-ID: <20230519145540.46700-4-sami.mujawar@arm.com> In-Reply-To: <20230519145540.46700-1-sami.mujawar@arm.com> References: <20230519145540.46700-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT018:EE_|DB8PR08MB5354:EE_|DBAEUR03FT043:EE_|DU0PR08MB9226:EE_ X-MS-Office365-Filtering-Correlation-Id: 7afbd10d-5b33-4e26-0a17-08db5879249e 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: MLkyXNQcw8xNWQPV78hpUn4vpZwsN/Yv2B+w6tSdqC5WMlXra60nHTJYRwcPzgjNbAWq56tIkF9S8APOl+5wnlaDIL0fIrCU92GQMTqWb94r3GwiCaypOpPwo843wrwm6tGhMZNrBgi0FWeUnYFQqeycyCkYdu3NvzdkB78D7CR+bmoemWgbF8b6J65NPB/VplHEAG3Pz2a2w2hVtr/olV0PNiEyV19hzKG8jPYnMvn2PtZ7T3a4nkrcTD8e2bst7OXx49If+D9VxpUzLN0sa8cAFPgunWmFqYjqfr9xesxpnPVkqX1hjeuG3eFq28A+TAlJdDVsbw0ztKLfEEGgnXt6lCpHFw9lInESR1XzejaZkRRZwkGFISH70wMNgyZ2eOk1IriKj44kXtlRL5pzehWnXK/rhs9H9zOrEt6/oh5emL8GZkVxkag2YtpLEcBn6Oe+m828OFwHHPf4PR47YvcSJ6eImOJgE6FMD0c28ua5pqDEnY+u0qBgDAyqkP6VmuPmODVSRkQbPVb0TvCBrkQiqTtpl7J0wcBn0sptiy8egZvZcNZq00DYBBooWigh8FxO3VpYCLzUiBMp1ye9Ys4CfmDpMXGSh5wOeie73D2DZhZPFQE0gKRpsQ+BxUKCiILS/k4/NPxBemZKkXTIL7jyy15Yl5HnY5aguQLKHbHNMiZ3qzN1XLRPkd3xKlYDzkOvcE5VeImci/Td6hEnfniptFrA0waUiukoydKxrOAeDHl5Hu6dFEGnSJeiU47zdys7PnugMYlKhkhPix0yyw== 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:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199021)(40470700004)(36840700001)(46966006)(70206006)(70586007)(2906002)(8936002)(8676002)(5660300002)(44832011)(6916009)(316002)(4326008)(41300700001)(86362001)(2616005)(426003)(54906003)(47076005)(40460700003)(478600001)(36756003)(6666004)(40480700001)(7696005)(26005)(186003)(336012)(1076003)(36860700001)(83380400001)(82310400005)(82740400003)(81166007)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5354 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 74fe1bbc-57c5-4871-1681-08db58791efe X-Microsoft-Antispam-Message-Info: RresOGG0gcTEPP0SOsPkKnEb5LH39BtImCnbJz3uurtLsnwxUf5kd9pIMfwVZFO0ANjQK6ilngcf7HPSxsYTp9LvdH5DIWmlnTrULjATCNGBoSJ6IhTfGdYN8itkQCC7sdJaiG9Hc+yu6BdcsstPM8441NyljUOCzQTKEoVoMb/Yp71mojtH02X6aZar7Y2wTLT0JmuGlfwI7Pgkf8KJuVtHZ/akYTFkuhHN1FbVXye4nTSLmtSWcT5YnXro+UVgiRmD5dyHGmklUqS2FBACSE8YTUj+pSMKsCwLG8+xhQPFexBrgtta1T3EX5218nWZXlYoJd9r0/6TYaSEGXDOOTVg9zrNUn1PgeW+eZaE04XsWKtx/n/zutcJbCMGkIst9yki0A/j7lSGxcd33OCqeQFQc6tgpAH0tK7QMDy14Lxh48dtZXI7p6sBzT+PtNNjAGhoLNwG/00icOIcjxdRcj08/FH5sU9llJ6ExDgMP26YxehcrcfIaR8GLPl0C6K9kVLCVI0/eWkrSzx1KJhvpe8C7iyRM55dnepxtOpYzIspPeW0tlWzOmQBqhijfRS034I3fX+4ztQDoLQwwpv7M5hcWl4Ws6eIfbD4DGmIUOynzhFn6WqsTc9UEdwjs62BBOai5XrhrGvXDmZdRHAcMR1cXkaqM48UOWULNQ2+SANJmSFSQhcCKAfPRB5nBOwxTfPCPlEXvODZe1yoWaXu2iKucQKgo/muJfZ0nO7meApwJ65gz1TC+g9MJC5FobCJ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 14:55:53.0428 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7afbd10d-5b33-4e26-0a17-08db5879249e 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: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9226 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: mGXbfulqgjwx76Ebd5JSK66hx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684508160; bh=vXhyg8GdjXooDOPk7PN8VA1rTQjeTH0v/v5i6u4EALY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Ech8QIwF7WKWonCpDQof2+pRypEHE+dbmoA8i+Y57hTRf9SBpkyec4+bN366b4jcAQK z/7ssZTfXx1ut+p5f/CAqwr75a4FDtJx06klk01gjiDLub3905LhHt4jvR/bvF3puYhbo wutEdFUDC9PCYihmnrDMkPtwNii6gML2b9M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684508164968100007 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The kvmtool option '--flash ' is used to launch a guests VM with a CFI flash device that maps the flash file specified at the command line. However, kvmtool allows guest VMs to be launched without a CFI flash device. In such scenarios the firmware can utilize the emulated variable storage for UEFI variables. To support this the PCD gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable must be set to TRUE. Therefore, update the NorFlashKvmtoolLib to fallback to variable emulation if a CFI device is not detected. Also improve the error logging. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c | 38 ++++++++= +++++++++--- ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 3 +- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c b/ArmV= irtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c index 43f5858644b1f47ada17e00fba55a670ab5862bd..2beeefdd272d6f8841f7d0b9723= 94739b745982e 100644 --- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtool.c @@ -1,7 +1,7 @@ /** @file An instance of the NorFlashPlatformLib for Kvmtool platform. =20 - Copyright (c) 2020, ARM Ltd. All rights reserved.
+ Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -228,7 +228,7 @@ NorFlashPlatformLibConstructor ( CONST CHAR8 *Label; UINT32 LabelLen; =20 - if (mNorFlashDeviceCount !=3D 0) { + if ((mNorFlashDeviceCount !=3D 0) || PcdGetBool (PcdEmuVariableNvModeEna= ble)) { return EFI_SUCCESS; } =20 @@ -337,9 +337,39 @@ NorFlashPlatformLibConstructor ( } =20 if (mNorFlashDevices[UefiVarStoreIndex].DeviceBaseAddress !=3D 0) { - return SetupVariableStore (&mNorFlashDevices[UefiVarStoreIndex]); + Status =3D SetupVariableStore (&mNorFlashDevices[UefiVarStoreIndex]); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: Failed to setup variable store, Status =3D %r\n", + Status + )); + ASSERT (0); + } + } else { + DEBUG (( + DEBUG_ERROR, + "ERROR: Invalid Flash device Base address\n" + )); + ASSERT (0); + Status =3D EFI_NOT_FOUND; + } + } else { + // No Flash device found fallback to Runtime Variable Emulation. + DEBUG (( + DEBUG_INFO, + "INFO: No Flash device found fallback to Runtime Variable Emulation.= \n" + )); + Status =3D PcdSetBoolS (PcdEmuVariableNvModeEnable, TRUE); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "ERROR: Failed to set PcdEmuVariableNvModeEnable, Status =3D %r\n", + Status + )); + ASSERT (0); } } =20 - return EFI_NOT_FOUND; + return Status; } diff --git a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf b= /ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf index b5f35d4782896761e7975a6e5c196ff0fab0d6db..fba1245e41ec4b146db79a821b8= 343247377af41 100644 --- a/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf +++ b/ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf @@ -1,7 +1,7 @@ ## @file # Nor Flash library for Kvmtool. # -# Copyright (c) 2020, ARM Ltd. All rights reserved.
+# Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -39,6 +39,7 @@ [Pcd] gArmTokenSpaceGuid.PcdFvBaseAddress gArmTokenSpaceGuid.PcdFvSize =20 + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105075): https://edk2.groups.io/g/devel/message/105075 Mute This Topic: https://groups.io/mt/99013765/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Dec 21 12:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105079+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684508174202215.12542001863346; Fri, 19 May 2023 07:56:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oDLyYY1788612xdZdeydqzxY; Fri, 19 May 2023 07:56:13 -0700 X-Received: from EUR03-DBA-obe.outbound.protection.outlook.com (EUR03-DBA-obe.outbound.protection.outlook.com [40.107.104.50]) by mx.groups.io with SMTP id smtpd.web11.28450.1684508172320645981 for ; Fri, 19 May 2023 07:56:13 -0700 X-Received: from AM3PR07CA0074.eurprd07.prod.outlook.com (2603:10a6:207:4::32) by AM8PR08MB5809.eurprd08.prod.outlook.com (2603:10a6:20b:1db::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 14:56:03 +0000 X-Received: from AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:207:4:cafe::1d) by AM3PR07CA0074.outlook.office365.com (2603:10a6:207:4::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17 via Frontend Transport; Fri, 19 May 2023 14:56:03 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105079+1787277+3901457@groups.io; helo=mail02.groups.io; 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 AM7EUR03FT040.mail.protection.outlook.com (100.127.140.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:56:03 +0000 X-Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 19 May 2023 14:56:02 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 28b8d818569d64b7 X-CR-MTA-TID: 64aa7808 X-Received: from e3da2062c218.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 09D8B471-0961-4499-BCAB-51B542201FE2.1; Fri, 19 May 2023 14:55:51 +0000 X-Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e3da2062c218.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 14:55:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JG6y50KfWQLHctMfOYh8CdF8Hw3/SV20IXDW/oakWgaONwZIaW12QDv7OA+8DcucvPd6O2rBerugWXlJjYjn7Ybulz1uL2Hmai588M/dHoDoy1rDafn6dlGYhmVJyViSQhZgdAKt0n6XJ/Qx9aT1Iz2n+Rpkm3c7CDb/PMlSB1BANy9TrHWrjJqtXaWzzdwgJswXEeYfJjDXUacmkar+l9rJCwn7xbw4KlTzd1PD/xocwUpxkqnPIqPQEr/lsToSrsmw9+WC7aI+Sy5YLVHCGRVZtskEV9rpJaSWcuoGlLqh2Dt+x/F28uDinrzYjiaxTAiQilsYKEav9UOH8yvQtA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ms8rYsbdoin2HCDXX0IUw4Xcq0Y6cxNR85E7Lq/0f5I=; b=BDMDQqrsRx29zEmdgoCngWDslc5TRjg8iQmF147V3f+jbu8DpYy4GI/2do9+466+vdEff6G0cgtdS9FamnzsBvoFI2aHlSqFWjjAM4l0Jx2j+qNWr0K0KAAiDdRCugqateg/R5wPFHlr6tcAUhEOwpc0n8ChvG+fkF9w2QR4Ts9MECQHF2XvvttxL6eOHCTcGcyO28sf6FS1Bt07c3aFkiHygbDuS4kIPe9z9omaVJyu9tf2VJfnrO5lMHCGcrXCI7Wk/QGVi9dgFYAitgo4Yaa8PulweEZTH//BkCuiZbhzHpBK6b747wEDeYhjYZviKZqQozyDzsOjtGcS7iZgng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AS8PR04CA0105.eurprd04.prod.outlook.com (2603:10a6:20b:31e::20) by PA4PR08MB7546.eurprd08.prod.outlook.com (2603:10a6:102:26c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Fri, 19 May 2023 14:55:48 +0000 X-Received: from AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31e:cafe::1d) by AS8PR04CA0105.outlook.office365.com (2603:10a6:20b:31e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:47 +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 AM7EUR03FT005.mail.protection.outlook.com (100.127.140.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 14:55:47 +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.23; Fri, 19 May 2023 14:55:44 +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.23; Fri, 19 May 2023 14:55:43 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 14:55:43 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v2 4/5] ArmVirtPkg: Dispatch variable service if variable emulation is enabled Date: Fri, 19 May 2023 15:55:39 +0100 Message-ID: <20230519145540.46700-5-sami.mujawar@arm.com> In-Reply-To: <20230519145540.46700-1-sami.mujawar@arm.com> References: <20230519145540.46700-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT005:EE_|PA4PR08MB7546:EE_|AM7EUR03FT040:EE_|AM8PR08MB5809:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d9b72ed-3da9-4796-05fe-08db58792a86 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: RoyCWuwWz9LQdXqo1WRwyPzlCNrZG1XzFa2oTZUah8nbjugrXOEcJlUTC+bPhWN+VgM+ePVGi7KsIZJiD9GvwijxMmBVXYxXrtZzZ9XizckAVdTIth4tThP0+OQl4YBUjtf/b0c8y4kXeZifOCy61fFMyZ9/tUPEJPS/bi4yxGNeCqtb0wwfIMX34NLn93MDyUIT9wiTlQ6lVpieKVjMxuBrWtqn+JS1g1dVIVRZqs9AjubPLWnqNaCSUBBG5mSTTbZ6AgmlGJyhBB7FO6vnTTEUnL9XZHAyJ3yOMubPsa2nt3FpGIDIwnUilE9IH4TTe0DYaoJiFYYk87ua4ySUvfZewUyqetB7d1vd2SCDOuQVqSa6Bm8OiKj6EgK3pBIW53BjIJdwPteuRkQr0qGqW0af76jSllnVAZNDRYbkOxWw2CFeVaGapmoJb6BxqJIt4VyfPckoamOyDbHzsPn5nVdhGCTun+WK1O9C+nAYvtsAaDlw1uDMpGoJiChUW0lfu6IhEvjmyIlVfceQU/v/Us7FoU15VIPGui1OjyW/D9Kz96kLWIgstf29qR8nbqUNvd9SxrBiMM3I44wH972aksGqy9gGZxjmLxxMyPDm+3DGRGii7kDP7Qgl8dzDtoADV6Rt/JuIDpyufW4ivfklYfu0iQevBEHVejzLprkYnYm7+ZbSWL8rHpi25KfO7W063bXbxB9Y5IAZqMxo/hat6NVjAfnBYLlF7LSzO+iFum1i2UCpyc5HSkv74u9hiZTzx+VbhtKW29DhubdTTsGuoQ== 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:(13230028)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199021)(36840700001)(40470700004)(46966006)(86362001)(36860700001)(7696005)(83380400001)(82740400003)(81166007)(82310400005)(41300700001)(356005)(40480700001)(6916009)(5660300002)(36756003)(40460700003)(316002)(70586007)(70206006)(8676002)(2906002)(4326008)(336012)(47076005)(426003)(186003)(44832011)(1076003)(26005)(8936002)(2616005)(478600001)(6666004)(54906003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7546 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c353e7b5-4ad5-4981-392e-08db58792179 X-Microsoft-Antispam-Message-Info: 5TWvfKNmmt4gTzyxlVdFfjxJeXVCPNwmF+juRm7GhaFwJ6eBQwROeRr6h+3424aGB/mGHPLJPvBFRTU0FUQ5KZLwkbhjuUHV7AIU73GKEHAUR3c+lOtTKk1TcWJwL1uyoRiGZUaDan/DIVl6hj7x64rG4G9e0qdli4pjuuQ2sWYXHty6XJDTtMvVTU/duhnr+Pw3pjQvrbZDaXTKT2cZdrnD3ezZyNz8DDb4Q+m4iorQcQaJxZ6eBao6C2KgH93tboSO3dcojU8dXZf3t0fbzydK8L2TYmnXc9lpgEp1TFLRh9VTlQyxyVyWhibH/B7+wSAkyGGWUtvxqGi2YoCaUfUajA95sVaRAkQVPUYiyvqFt7duYE8OSdKBLXPwbVDuYhYE1vWmUzZCijOUhyx4B4zPawrq2ACgGiRPcqOR0GaTi0b/hFNKySUdiOxqKLZAOklUqnls8dmDwrSknRAELGMmHgjCxbDLnSXpJsZJx5vwqzMiE6s6HosexqS35olkWEPGU3KDQ1LfNJuX2m3XiH7hIcZa8RRno7qMgjzkf5UKk4JIE4zDoQgGXAQ3FcmVBKQzTYtCr7m4w0wQt0MC4ZnufhsYoSu7VgiSRFYMJ7qbA90Ba8XNP459L0MQ1kZUFykejlgjmj363kYFfaPMmU1FUt2cSPyxgP/4XHMBSp67MQ5RwENJ9/5dYy6bwfHAWjI4tFD/inuq39mfD9B9QAPfb6sDRA/LRsxcmMA+b36TVW7sMMWpHpT9tkVUoyHh X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 14:56:03.0145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d9b72ed-3da9-4796-05fe-08db58792a86 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: AM7EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5809 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: lLc97Ad7TuAxAz30OCYuklY9x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684508173; bh=GBNTG6/YKvOPquWh/5EQ0m9BQLcn35EGNPKNLSwqqD0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=WiQs+e+imyEqjRjlNQRv+drU6sp7MM/IRCPB2Ecyv70vEcCGi3+5GRX4XZBBjahRyKV kciDEHkObGTcXQeVK4xX4IGHNIdIMYcfiCr29YFuM+Jvk/T+NUTWbruWx/G3YDGSZ4KbI XpTuC3OyulM8Z5+qaqAAwrVok9+NKt3Y8pI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684508175754100011 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The VariableRuntimeDxe links with NvVarStoreFormattedLib which is required to establish the dependency on OvmfPkg\VirtNorFlashDxe. The VirtNorFlashDxe installs the gEdkiiNvVarStoreFormattedGuid to indicate it has finished initialising the flash variable storage and that the variable service can be dispatched. However, the kvmtool guest firmware dynamically detects if CFI flash is absent and sets PcdEmuVariableNvModeEnable to TRUE indicating emulated runtime variable must be used. Therefore, in this scenario install the gEdkiiNvVarStoreFormattedGuid so that the variable service can be dispatched. Also link the NorFlashKvmtoolLib as a NULL library so that it can discover if the CFI flash is absent and setup the PCD PcdEmuVariableNvModeEnable. This is required in case the NorFlashDxe is not yet dispatched. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtKvmTool.dsc | 5 ++++- ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c | 13 ++++++++++++- ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf | 4 +++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc index 25920ab4ae3cce20fdbe8e9ff7e25b8696d2c851..4541d03d23e0d98915b3d3ada68= 8c48d979b75d2 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.dsc +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc @@ -311,7 +311,10 @@ [Components.common] # # Platform Driver # - ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf + ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf { + + NULL|ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf + } OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf diff --git a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c b/ArmVirtPk= g/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c index 3f5027fac4d65c4ae3f370c5349c6f410aae5b43..bf6fc1f1f070f32e3ce351f57da= 955c5cc849409 100644 --- a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c +++ b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.c @@ -4,7 +4,7 @@ - It decides if the firmware should expose ACPI or Device Tree-based hardware description to the operating system. =20 - Copyright (c) 2018 - 2020, ARM Limited. All rights reserved. + Copyright (c) 2018 - 2023, Arm Limited. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -75,6 +75,17 @@ KvmtoolPlatformDxeEntryPoint ( { EFI_STATUS Status; =20 + if (PcdGetBool (PcdEmuVariableNvModeEnable)) { + // The driver implementing the variable service can now be dispatched. + Status =3D gBS->InstallProtocolInterface ( + &gImageHandle, + &gEdkiiNvVarStoreFormattedGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + ASSERT_EFI_ERROR (Status); + } + Status =3D PlatformHasAcpiDt (ImageHandle); ASSERT_EFI_ERROR (Status); =20 diff --git a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf b/ArmVirt= Pkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf index c5bf798c3b2b7bf1f77e0c5ada9000f536123d6a..b0583d52058805aaeece31d7e37= 76ac498f101ad 100644 --- a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf +++ b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf @@ -3,7 +3,7 @@ # - It decides if the firmware should expose ACPI or Device Tree-based # hardware description to the operating system. # -# Copyright (c) 2018 - 2020, ARM Limited. All rights reserved. +# Copyright (c) 2018 - 2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -33,10 +33,12 @@ [LibraryClasses] UefiDriverEntryPoint =20 [Guids] + gEdkiiNvVarStoreFormattedGuid ## SOMETIMES_PRODUCES ## PROTOCOL gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL =20 [Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi =20 [Depex] --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105079): https://edk2.groups.io/g/devel/message/105079 Mute This Topic: https://groups.io/mt/99013774/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Dec 21 12:38:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105077+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=arm.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684508163862272.7877390444078; Fri, 19 May 2023 07:56:03 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id I7VWYY1788612xW3KZ9yhxWn; Fri, 19 May 2023 07:56:03 -0700 X-Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.71]) by mx.groups.io with SMTP id smtpd.web10.28516.1684508161637454227 for ; Fri, 19 May 2023 07:56:02 -0700 X-Received: from AS9PR06CA0204.eurprd06.prod.outlook.com (2603:10a6:20b:45d::30) by DB9PR08MB9778.eurprd08.prod.outlook.com (2603:10a6:10:45d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 14:55:55 +0000 X-Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45d:cafe::50) by AS9PR06CA0204.outlook.office365.com (2603:10a6:20b:45d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:54 +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 (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105077+1787277+3901457@groups.io; helo=mail02.groups.io; 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 AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Fri, 19 May 2023 14:55:54 +0000 X-Received: ("Tessian outbound 945aec65ec65:v136"); Fri, 19 May 2023 14:55:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 042d1b1901a8a3c6 X-CR-MTA-TID: 64aa7808 X-Received: from 2e7a1254c0bb.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F02006CA-A4CB-4A56-86F3-7410900AF464.1; Fri, 19 May 2023 14:55:46 +0000 X-Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2e7a1254c0bb.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 14:55:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NZ+vUBQvQZ9Ry537Ll3BqiZbWdvTqpCTTseE6FyO0ufA7hpff1ESwAJxHVbQtyRiffpAkpdQ1SJwCePNzyubFwt1B7lloPgf2UvFpgdfuwvOlKARkI6uYb1EDcUZ/LWqNRStYhnVFZ3SChQyOgTREteljK8QOfXDpBlRy77+thW3xebFAMdSoCyNWXie9y6Yu1F8nV5pokd7NuX6d8/V2vJ56ZI6TmqZLRDAIIH/iUe8NJEgeY4JZOPVfv+3VSq86VLwWtJiG7Bo2LEim3hC9lL05GNvf5rIp+dQhKngSPSZ49jFtMSlYOKNrGS7qFTCZiIRYyMaQxItwdvAIx6huw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F9ccuwKbBV9NGPNWFJsDOfL86MDC5OW2PpxJJcJjRS4=; b=mdhsxpyO6T/Vm8l6ZKbDPBYZwC0itodiT7+qivgbWS+O6+Ja1LCN5zuX6Bv/Y3+SnUy0Odp2lQW9hJ4bj38VesNBHHTpjJigGS3iglYnw0VSectHkEy/aMKEtHXKRfWZ1N43BORAjbahoS2tHa+MTZXVwYfYEIaf69nHelFX60uX1F9q0RP+E8+UBkLke0uATrdmobMWSWPqsiGk2vavjIhSf2Dj6MmY7b2qsZiCCNSRx9gWZ170dwjbFIYM8/pGwuCI6S+kmo+2C+la3MmY38FjkOGS6NLFGpEYgOenH9SGNHENdSolgPLobRFG9eRELWrpxrutCBujJKDbjRo9jA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from DUZP191CA0037.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::9) by AS8PR08MB6389.eurprd08.prod.outlook.com (2603:10a6:20b:33e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 14:55:44 +0000 X-Received: from DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4f8:cafe::1d) by DUZP191CA0037.outlook.office365.com (2603:10a6:10:4f8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:44 +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 DBAEUR03FT019.mail.protection.outlook.com (100.127.142.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 14:55:44 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 19 May 2023 14:55:44 +0000 X-Received: from E114225.Arm.com (10.1.196.36) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 14:55:43 +0000 From: "Sami Mujawar" To: CC: Sami Mujawar , , , , , , , , , , Subject: [edk2-devel] [PATCH v2 5/5] ArmVirtPkg/PrePi: Allocate separate stack for Dxe phase Date: Fri, 19 May 2023 15:55:40 +0100 Message-ID: <20230519145540.46700-6-sami.mujawar@arm.com> In-Reply-To: <20230519145540.46700-1-sami.mujawar@arm.com> References: <20230519145540.46700-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT019:EE_|AS8PR08MB6389:EE_|AM7EUR03FT022:EE_|DB9PR08MB9778:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c5a953d-3047-4c1f-69f1-08db587925a7 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: Kv+kCO/jfgf6z+cfR4/CBdW8uKIQ8xjCOpRN0KXbHmRlgPOEsflT/QPQd5H3YcRHFbrF0d3FFJyesmFArXlbpBVjJ3OaEg4oa7vGvgicsxN6P3zhhFh6POWOYnWaS3p+mHu2v3Gr0PHNHfh25nR+yK5ajWA62KegeKP+WiPbT0AflWFGf6m888AT1+QwOsGRPWszIQGOCJVZVCs01doWwnUrHM28A3AG3wUWXKFq93SMBaSy4CK5281eSlHjDZM4VGwPByz3UQFXGLpSOZNS/NcPr13P8Iod/Hl5nPuih9KOeaT07kFKxC+74GjvvDeXI+ZES3gOe3XuxCALJVqYo2wFH58cr+nVIE8I86PXEHQxVJakcxSrNLbO4InIgB5k7Ub8895kgt7N1PAej4ODr83ow0IWHYqybLPidkf0ZLcn/zbeg85dKR3EOXr9Aj4clzX+Uie9h9GAFtCzQkdwdS+SWvJxOwMWD/SDtTC5RcneU8MG77drA6titk7QcltSy+aYYGLohbcsl6NII41VBbamAt3Ru66nJ4kTbd3SzgLDXCoEp9LsvFAYYPniZWYbBNGouYpGaBpamc4K/xK17yLUVRePDQmT7WEjyCsUX9U28MH2R3FLy9+JoIENhNChq2QHlYZzO+uAzrF0gDmupQVGXkL0Np1Yz6S74b+veqndSRiDKtCFt/1jnQ41bAWJafXFrI8/h5ehKJgBJMf8srrEktFpFMIDzNbpFmI9w5GalUFRLJGGsMS4PAqZdEPcts2Hgg56R82xRO+7JPjCBQ== 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:(13230028)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(336012)(86362001)(36756003)(40480700001)(82310400005)(8936002)(26005)(8676002)(1076003)(2616005)(44832011)(426003)(5660300002)(186003)(316002)(54906003)(6916009)(70586007)(70206006)(41300700001)(4326008)(478600001)(7696005)(356005)(81166007)(82740400003)(83380400001)(47076005)(36860700001)(2906002)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6389 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 402be40a-5549-4c97-bb83-08db58791f9f X-Microsoft-Antispam-Message-Info: QoFjNWQJiwZU7ix7U4Z1r/kmPyiB5s4EA+0h7MVIuMy+qXMyuK+cdWcpD0S8XJzHMu0DMnE8ZOYbC1Y2+4mPjiLuaNeY8UMauSOFQe3DdPVO90guQ2Alig+Gi0U4O3XNS5z3YWeU4rbkCoDNlu2McHiOeCNlO0cOpWy9uNi+eAb0kcshGstbZ/8SkhRUw0lehlmzF4UrC90t/DgO+YxLMRRd22Igbf9TeyR5qpWiMwfgWJqGQHaDHvF3GzW5vVXflN1LSoMWfbPnhqZohjjYrgSjbGi8FlDoCdnPZiqiTaEZssFWMPg7Cc0wxQ268GRf+/KxZLGIuwZFpRT+n/+8/oUcLCcQsMtSL4q/Dp5N0bWLLh0uXhG6BGcdme/PVQzzsMJUsG06D9S3app84Rz0ncquYM2250MjW+EfCst3ACaCqwjGInjGAaykiMkt7a2qXboijTd7lWiMC4KqJphDTEVerd8WMT24K5DLn7R1P2cJ0Vo/9bYiypIpL+9Jqt9Zv7DjOZh2T9uMtrS5gf07b5zk1buZCQfj0rDJKcDyy1jkQiYNoFOeDdCyGZRBboTwqKzINpwB0HceqMuMWYEfecXdrgtYZakGGc1WR9m8yPPEMRcC3JypIZbsc1yxbz4rsfnEvM0syFGdjl++XndHLFYdnRPQsusw1zh4o+F/4yqZ9yrLQzlKfNdZeD9QPPGA6AQvK3BO9Vfd03O+abGqqGp0sWoT8TE4yiAqozwfMkJ1hAnbqkmT5YRadTJzfZwa X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 14:55:54.8604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c5a953d-3047-4c1f-69f1-08db587925a7 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: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9778 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sami.mujawar@arm.com X-Gm-Message-State: YxZ3qn9YcA7pPALujSyP4heUx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684508163; bh=sB3yNuqe0L0t9kAc8B1sstUj9YqKbRx39kS4wg6n6aY=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=bEP/qS6agKcOZN5beeALl903ZX1pISAyQiRTZm14Ym3DDrcXWQDvFAfg7oSJOoQIYC9 bn5nE5gBH6xpX27z5kUZvx3tWu+/UrzRAdYp+nwqABLjyzi09mIvNrgTqgnTPpJ8/VxiI sQAmxAOY/+nREjHaJ+qtQf/C99swO85RycQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684508165107100009 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The patch "f07a9df9af60 ArmVirtPkg: Enable stack guard" enabled stack overflow detection for ArmVirtPkg. Following this patch, running UEFI shell command 'dmpstore' resulted in a crash indicating a stack overflow. Invoking 'dmpstore' results in recursive calls to CascadeProcessVariables () which apparently consumes the available stack space and overflows. Normally, SEC and PEI run off the initial stack, and the DxeIpl PEIM is in charge of launching the DxeCore with a full-sized stack and remapping it non-executable as well. PrePi platforms take some shortcuts and the DXE and BDS run off the initial stack which is relatively small. It is therefore desirable to allocate 128 KiB worth of boot services data memory as the stack for the Dxe phase. The PrePiMain () in ArmVirtPkg/PrePi/PrePi.c invokes the LoadDxeCoreFromFv () to load the Dxe core and transfers control. The second parameter to LoadDxeCoreFromFv () is the stack size, which is currently set to 0. LoadDxeCoreFromFv () is implemented in PrePiLib and if the stack size is 0, it continues to use the initial stack. However, if a stack size is specified in the call to LoadDxeCoreFromFv (), memory is allocated for a new stack and the stack is switched to use the newly allocated stack for the Dxe phase. Therefore, specify 128 KiB as the stack size in the call to LoadDxeCoreFromFv () so that a separate stack is allocated and used for the Dxe phase. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmVirtPkg/PrePi/PrePi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmVirtPkg/PrePi/PrePi.c b/ArmVirtPkg/PrePi/PrePi.c index 3d943b2138d3fe8a03322262111d5f7df3e39d39..ff51a757a21a19347c78b093698= 7c9f8cc283c0f 100755 --- a/ArmVirtPkg/PrePi/PrePi.c +++ b/ArmVirtPkg/PrePi/PrePi.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* Copyright (c) 2011-2023, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -101,7 +101,7 @@ PrePiMain ( ASSERT_EFI_ERROR (Status); =20 // Load the DXE Core and transfer control to it - Status =3D LoadDxeCoreFromFv (NULL, 0); + Status =3D LoadDxeCoreFromFv (NULL, SIZE_128KB); ASSERT_EFI_ERROR (Status); } =20 --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105077): https://edk2.groups.io/g/devel/message/105077 Mute This Topic: https://groups.io/mt/99013767/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-