From nobody Sun Apr 28 19:39:54 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+82248+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=pass(p=none dis=none) header.from=groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1634587945956558.0204045283684; Mon, 18 Oct 2021 13:12:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NhK1YY1788612xuMDgdK1TLY; Mon, 18 Oct 2021 13:12:25 -0700 X-Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.57]) by mx.groups.io with SMTP id smtpd.web11.485.1634587944560366328 for ; Mon, 18 Oct 2021 13:12:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=caTxL8ZePMT3DKyUKvqYU2saqAFIfR5A5UQRTq4iNHHiiWZvvACOUDUtxCt3QePG/OcD6BzEYT8mNirvD1+CkZPQc2Y3vFi9OTwxJRBlRMIqlRPcQa5jzTHSK236G5+nBnMjLJObePwcsYqkfi2F+H6rbdcIjRIuj61L0FQ59z/9B4ajbaOIACLK/S2vmgqne041vD1bs2TvNthERsI1OvCBJ+QJPAq93AqydB+rwV1Kd4aHOJLZJdsVHkcfHebEgToB5tLL7bjoTL6qKdT6NH12nXyv1jg9Xz/wsac+HTEqTdGT3Zk0K71rf+FXqtZKX8ygRN4I0PgVVJeZTcLkpg== 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=AHakxzK2bCslPg9yyuiKIF4V6r05mErDvfKx+5KDGHk=; b=cln5iy+jfK7sH2IClJzLRWFwinA6jAHIuljYWXAmGGcHlnkbLgpW16Yzhq81kC7xXZvoEdduv1ul/+iTTe+EI84qjx45xvJUqArpM36LwlCN0B3x/chyZZdm+Otl3/xANzugKzGfen7lS2VYvsTGmV7GDiLopDJ7WHQGhum4kus6tn9bW2v8kJCxee6Z+9ZsryHZkfKwSKJUZtzT1Tdp0EzYVYdCjTCzfM2EYSf73dZ9CLEidY7/xhtNnCgL5wh7d4tElV++22LmliVVbWAIDfVyXME+De/DzmEbPJo3YKoIkGZWj/4bdP0yIy/OeZpc+42FLv/hY6Emo1SO4nIF4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) smtp.rcpttodomain=byosoft.com.cn smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from DM6PR02CA0143.namprd02.prod.outlook.com (2603:10b6:5:332::10) by DM5PR12MB1307.namprd12.prod.outlook.com (2603:10b6:3:79::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Mon, 18 Oct 2021 20:12:22 +0000 X-Received: from DM6NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::bf) by DM6PR02CA0143.outlook.office365.com (2603:10b6:5:332::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 20:12:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) smtp.mailfrom=nvidia.com; byosoft.com.cn; dkim=none (message not signed) header.d=none;byosoft.com.cn; dmarc=pass action=none header.from=nvidia.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+82248+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; X-Received: from mail.nvidia.com (216.228.112.36) by DM6NAM11FT046.mail.protection.outlook.com (10.13.172.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Mon, 18 Oct 2021 20:12:22 +0000 X-Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 18 Oct 2021 20:12:21 +0000 X-Received: from localhost.localdomain (172.20.187.6) by mail.nvidia.com (172.20.187.12) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 18 Oct 2021 20:12:21 +0000 From: "Bob Morgan via groups.io" To: CC: Bob Morgan , Jian J Wang , "Liming Gao" , Guomin Jiang Subject: [edk2-devel] [PATCH] MdeModulePkg/DxeCapsuleLibFmp: Capsule on Disk file name capsule Date: Mon, 18 Oct 2021 14:11:57 -0600 Message-ID: <40287570ea45e6e5724c00657a7f9ef99f8693d0.1634587878.git.bobm@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7224112e-80b2-4344-92e2-08d99273982c X-MS-TrafficTypeDiagnostic: DM5PR12MB1307: X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True X-MS-Oob-TLC-OOBClassifiers: OLM:83; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: IdKZIQzM/OWlSmS5dUJrgDanZ7bGXtKzhxf62KciMXRhMHw3jtT0VaLPn6z/2pwgEPtnBsJ5eFGejn79Fy/Ostpxwz/C0ZKBVpgB6/Ez7a60IzVGfWTQd8W9SeF3obF/ktupY3wtCCddErEsbndiXeq97WXLGz7cHEYlm7YPxU9e0unxY3X0qP0DAuqLeNd3uJA5yrJhW9/xtZYXKdLJNxb44RhFkzqgH8cgKGsXDrvc+A0DafNf98Nif5EkZV+5ezvfje25l55EhIOyFN26W1Vp2cqkhnQjrcLlCODhRDS//7U5EP3AuteHjcI4nUEIObiet2J6BBxEp2EIxeORJUicFXDe1lchoziSnCB0OwaQB8xEE+OfbSDg9NhnoYNg+zhqu3uTpabZnLF/eT2bjahd0vkGtu7r+1qIXGh9RUCzuvlpPLcqOQsAkMLZxUMLnk59ax0PIG/HHsN3JbZcluUtn743E1kYMefHVWvmds0rXzuCNMdcBKmequSl1Rhilw5GKh6UbODiTRJVjrMYEYBNWkOKN509+4nBxyC8aRNKfCueiOsXHR1zy0ozIIwMHv5w05DZBSkzmlF4zNbfb5hxXbFrAFSbD5i3LqsD1zsSMaFtlZE5eZYpl+T9bTnURu1Z7+XzZ9JN3XN4Kc3BzK/ebujUZMgM9M2GYaP6z4hcLhdOhETJmBP1mKrzEKAJOIxcqLEs4bhI4FCR3VHk5w== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2021 20:12:22.0248 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7224112e-80b2-4344-92e2-08d99273982c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.36];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1307 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,bobm@nvidia.com X-Gm-Message-State: F9caTUnFs0T7M6bNvLZpXhcsx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634587945; bh=5mo8ax2LxuDD4yJJXeD3D+8tw/0Yyb1zcIeciN2iEVQ=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=wuDFy1tVMBPKpmQtFhpb1OI44UxvDYw7SF9HytqzaJp+V53IU8mJWXIAF3hg2mHTK0Y wV1Y8J3J6Zbi8Ch+aV9St3b87yFz1fQbzMLzAPu3WpXs5VsX9GWyy6sQll3Tpyz42O8RS xX21Ql7loOmWI1GCK8QKCSAOM5sXtM5fF8I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634587947374100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enhance RelocateCapsuleToRam() to skip creation of the Capsule on Disk file name capsule if PcdSupportUpdateCapsuleReset feature is not enabled. This avoids an EFI_UNSUPPORTED return status from UpdateCapsule() when the file name capsule is encountered and PcdSupportUpdateCapsuleReset is FALSE. Cc: Jian J Wang Cc: Liming Gao Cc: Guomin Jiang Signed-off-by: Bob Morgan --- .../Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c b/MdeMod= ulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c index 4c32c6cdcf..e65e335585 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c @@ -1739,6 +1739,7 @@ RelocateCapsuleToRam ( UINT8 *StringBuf; UINTN StringSize; UINTN TotalStringSize; + UINTN CapsulesToProcess; =20 CapsuleOnDiskBuf =3D NULL; BlockDescriptors =3D NULL; @@ -1778,6 +1779,13 @@ RelocateCapsuleToRam ( TotalStringSize +=3D StrSize (CapsuleOnDiskBuf[Index].FileInfo->FileNa= me); } =20 + // If Persist Across Reset isn't supported, skip the file name strings c= apsule + if (!FeaturePcdGet (PcdSupportUpdateCapsuleReset)) { + CapsulesToProcess =3D CapsuleOnDiskNum; + goto BuildSg; + } + CapsulesToProcess =3D CapsuleOnDiskNum + 1; + FileNameCapsule =3D AllocateZeroPool (sizeof (EFI_CAPSULE_HEADER) + Tota= lStringSize); if (FileNameCapsule =3D=3D NULL) { DEBUG ((DEBUG_ERROR, "Fail to allocate memory for name capsule.\n")); @@ -1804,18 +1812,23 @@ RelocateCapsuleToRam ( // // 3. Build Gather list for the capsules // - Status =3D BuildGatherList (CapsuleBuffer, CapsuleSize, CapsuleOnDiskNum= + 1, &BlockDescriptors); +BuildSg: + Status =3D BuildGatherList (CapsuleBuffer, CapsuleSize, CapsulesToProces= s, &BlockDescriptors); if (EFI_ERROR (Status) || BlockDescriptors =3D=3D NULL) { FreePool (CapsuleBuffer); FreePool (CapsuleSize); - FreePool (FileNameCapsule); + if (FileNameCapsule !=3D NULL) { + FreePool (FileNameCapsule); + } return EFI_OUT_OF_RESOURCES; } =20 // // 4. Call UpdateCapsule() service // - Status =3D gRT->UpdateCapsule((EFI_CAPSULE_HEADER **) CapsuleBuffer, Cap= suleOnDiskNum + 1, (UINTN) BlockDescriptors); + Status =3D gRT->UpdateCapsule ((EFI_CAPSULE_HEADER **) CapsuleBuffer, + CapsulesToProcess, + (UINTN) BlockDescriptors); =20 return Status; } --=20 2.17.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 (#82248): https://edk2.groups.io/g/devel/message/82248 Mute This Topic: https://groups.io/mt/86424126/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-