From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 540C87803CD for ; Fri, 9 Aug 2024 03:15:41 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=G2TTJDLuRVtndw4kjq2uKzvmDgiHQDUv0EuJOw483Eo=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1723173341; v=1; b=TY62xNDH57oSMBp66gdixOQKVNdVpQjfzm697FB/6kC6rmuuYRWoS23n8bptrKBbIicgGhhB 92HRrFUopdbFLa9MtH9s9VRF296sUAiyiiKeg5Ltu5aIE2l7qJh6661iOEUqytb+rQk6U6NL/31 0qDEG/GYfAAh56vXtYYjix9GSc7Oh8fCGTCzPf2uGwp8tW+CKdlxOOygWWPK0mzfI0fqQgYnNf4 HOI49FDTiT5ruVxyLeml1eX/80q/WHvMsilMDT+G2J1cKq4z6jt8gQnkY2cSMjZ6fgcGvVsedle Ca8eHpTRnDgt5OPOTXWH2fNpdp83w4sjd4oN6W6Vi6lBQ== X-Received: by 127.0.0.2 with SMTP id 63bVYY7687511xz6V8cAqmb5; Thu, 08 Aug 2024 20:15:39 -0700 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.108]) by mx.groups.io with SMTP id smtpd.web11.76387.1723173333895905927 for ; Thu, 08 Aug 2024 20:15:34 -0700 X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by SJ0PR01MB6365.prod.exchangelabs.com (2603:10b6:a03:292::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Fri, 9 Aug 2024 03:15:29 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc79:e629:93aa:8b8f%3]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 03:15:29 +0000 From: "Nhi Pham via groups.io" To: devel@edk2.groups.io CC: quic_llindhol@quicinc.com, chuong@os.amperecomputing.com, rebecca@os.amperecomputing.com, nhi@os.amperecomputing.com, Tam Chi Nguyen Subject: [edk2-devel] [edk2-platforms][PATCH 1/1] AmpereAltraPkg/FlashFvbDxe: Sync up NVRAM FV with NVRAM cached Date: Fri, 9 Aug 2024 10:12:36 +0700 Message-ID: <20240809031236.1590316-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0138.apcprd02.prod.outlook.com (2603:1096:4:188::12) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|SJ0PR01MB6365:EE_ X-MS-Office365-Filtering-Correlation-Id: b90e6c9c-ee3e-4479-f99e-08dcb8218581 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?t0BSNRkpdHDPUfI7BrPPDIwRSPSY3jCYTvNGTLBrmmm38YGTlTdRgTZJB8fH?= =?us-ascii?Q?cZguVRpRw0Zfvl8LRNbkq3YVdT2cGibcw8du1j95G9IYQL4ZCzs5Bv6nVjTf?= =?us-ascii?Q?b2dpBGQPv+BIJmlO/5exC8DowB/RrpnwtLnaJaUcT+3PWoMmRUIkQPCQOZQE?= =?us-ascii?Q?w85cfd/X3tv3x7YBC7wpG1I4DJKPOlfU2vpADf7c51Hht4q7jcLJxMzOJZuP?= =?us-ascii?Q?5gGxbsYrdGIcauOPP9h5jxO4cwm0nK2TnV0nwwNml1cQwEUYK3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ErNpsW01I9+8h5QzkMM2s2VGfXXAXS9F6sbOsEskFde+RP?= =?us-ascii?Q?mUouk60jDy0OyVooTIfNgyBNCQCbAkoXuNptbtUri2CqD9RQzVaSZZkkOLIs?= =?us-ascii?Q?4FC5EfpbNoVgk1X67CAgf/qyY4JRXSiHMpPWPo65HkQ+lTC5QYZ6zXFwgIjz?= =?us-ascii?Q?jPE6lfI3L/3dIsa7v0EA1u5wE9GwcoeM9vdTqPUFyGcICuGg9spfNGRIA3nq?= =?us-ascii?Q?I7+0O0z126K7yFFDCFSD4+x96fltqSUqGSYMBVS9G/p8MZR2Hg=3D=3D?= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cvEO7NZtqxi73B/2R7gj5k8N5MJ9UoPo6UgKhNG7e6N53n8rPPdIYZqBl2FP?= =?us-ascii?Q?Y92Ph1dpGcHAF+cAPWWvc6xrxhHRSvdui3s4dHnRyOjfxUzXFvmY62R2hn7W?= =?us-ascii?Q?7f9pzhTYXV4r7eVU4AKBjzls4G48vO+h4dVXHvKUJVAyD4xdONZP6qr0VTTQ?= =?us-ascii?Q?qHgo87vOTRXnBiZzWtN2VjazgcMp8kMyqG6/IjIG57LvUq7oreiT+GxknYwi?= =?us-ascii?Q?Ew4iwsRK+VIH9yar+PCqSTOS/kzZ53fr0JKmLYS9EZSXsYGUU6q1DGsrd3tc?= =?us-ascii?Q?sxtYc/NxW4rA3JUtx0qdEsy+rNhsDNfIhthGxSqZs411zFe3U5dZs5MkogvU?= =?us-ascii?Q?7mRGriwJnQq+LwrcDR9TTCHHhf7xZsjDoBNDeFRoafSKU7WYtKS8CRWNyqdE?= =?us-ascii?Q?5DAhyTyidie+RAqZKVtMrOB2+Nt5QdxzUrYzDCQWJV6qiZZ/Q2QTgbkH6Ab0?= =?us-ascii?Q?qwZGLZDGJWVY9fbT08W5z605ad+0gwOX/3v87ze4bi+RQNvbe66DGJKTQvfq?= =?us-ascii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nZRacVQ5nv220Yrhgj8Rz0?= =?us-ascii?Q?u1xGuaYZV9nkdDXZXpALkwJ9i/BoPyG1tYdH0gKSrSB3cqN3NMqYtXIQuNE8?= =?us-ascii?Q?zh2RGeFp7j0DrwslNj17rWhs5NFJsQdTW7dkB65vqJKUzho9bGkyF2AKHMQQ?= =?us-ascii?Q?0vcxwrxT7Ho3TOAaA1YHIPqHNBSa7wHxuGfBWV9+i1EmZtdpZEdHWPKB7bQR?= =?us-ascii?Q?WxNd5g4k8OnDihJXI3MRbUo=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: b90e6c9c-ee3e-4479-f99e-08dcb8218581 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 03:15:29.3855 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DtYTdii/FIxd79fAaeXrNFxnfHZwC8YjKHVIB6ixP36aVd56i4SYJ6uHfIy0rCY3pKHf6VE8zSMlT3iQp1JCPOQ3CYAcWRUAd6lSfoUqn+E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6365 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: Thu, 08 Aug 2024 20:15:34 -0700 Resent-From: nhi@os.amperecomputing.com Reply-To: devel@edk2.groups.io,nhi@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2MKHrhgFzlhF6b3tePTEVLLMx7686176AA= Content-Transfer-Encoding: quoted-printable 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=TY62xNDH; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Tam Chi Nguyen Currently, the NVRAM FV region is only updated once at FlashPei that makes the data in NVRAM FV outdated with data in NVRAM region in SPI-NOR. It causes the duplication of the valid NV variables when the Variable Reclaim process performs. Consequently, after rebooting, system goes to an infinite loop at GetNextVariableName. It requires the data in NVRAM FV to be synced up with NVRAM cache in memory that is managed by VariableDxe. Signed-off-by: Nhi Pham --- Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf | 1 + Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.= inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf index 008fd2315ffe..5f537cf7df27 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.inf @@ -25,6 +25,7 @@ [Packages] Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec =20 [LibraryClasses] + BaseMemoryLib DebugLib FlashLib PcdLib diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.= c b/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.c index 009694703ddd..853c458e375f 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.c +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/FlashFvbDxe/FlashFvbDxe.c @@ -6,6 +6,7 @@ =20 **/ =20 +#include #include #include #include @@ -361,6 +362,8 @@ FlashFvbDxeWrite ( return EFI_DEVICE_ERROR; } =20 + CopyMem ((UINT8 *)(UINTN)mNvStorageBase + Lba * mFlashBlockSize + Offset= , Buffer, *NumBytes); + return Status; } =20 --=20 2.25.1 -=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 (#120303): https://edk2.groups.io/g/devel/message/120303 Mute This Topic: https://groups.io/mt/107802467/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-