From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.49]) by mx.groups.io with SMTP id smtpd.web11.4850.1675980154832249811 for ; Thu, 09 Feb 2023 14:02:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=btltxprr; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.95.49, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lc29GXbs8K4rDL+p+Phrtjj0+xz2dzHXVqF3SIeQ0kRsfHAfRit8qtPoUH9WleJUlt/xvaLrK03laFefySuoB7VyCsdwVWt3R3Xn3L0yKohJrwIocxyLAA9M/+q57fgPzkC9NOIjqF6aYtWsQxqjQL/rDzeffxug7G98fRndRTKbP5gSmuoEZzyzF6c7C9e8o1wSMbmCOisiY8Mabr0T5Pomz7mgT5TDlQ4IgfNBokzbgHvaPmuSQNW8Dbz2bMQCb2l43qkvQeBhZZc49+9jmN2/KUfrXlmPKwdDu3MAmLe71oXmxlIEhGZfGv+YEjCJYRynGCOlT9uXvBYnPogEyg== 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=HSmqgs0m+aIjRaceGLs8+cerPhOByrGSyetTa0L+xuo=; b=bcthP2oJd30DeBgNAnKFJ76Yw4w2F2rSvWo8CxvdbAW3L+nhqWKiiO6FK0P3EhPu/fdZYOw3deYjUVSixiuvAMn32mmpxJkZHxLdJU65InIlPk7E4OX8KogTk/m6yVoLRsUThhAak99iUQJNweLqs0KnJO3+3PAF03+MHizCKWgyCn4xaXPn0/5mjkVrC7wPNvWoAxgFiupGr/4iVgxkC7sB02oDsbtJyrJBNgcM/uTb1Vwk9eLlgzV4L/llsjwORJWCzvxdGwHvRuTUmfYbBaa4k2fVwbw6BMF/Gi1WK/75hGjdo41q//17yq9FYmlCI7zPBKQ1Xb/E6Vh1y+shyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HSmqgs0m+aIjRaceGLs8+cerPhOByrGSyetTa0L+xuo=; b=btltxprrjs/llbhvH4H2i5bHEtCSIBkCTGiqVHC9pFpK4jPQleLGXEp8miLyavv58r4YH8360FFlVqxnQq1syAtwNTs+1ujxvHsNLVTv7UoKFr5epqTcisQ6AqwKMhnOdyIzM2aKMDeN/9xPUee2jMqd10ADFIPB1Acgkm54WJV7brFZYPBLofpS2HvhhQGa+rZ+56jZ/fCezxoggi/uUQ6bFjBkq5oW5WMM9TwBpIQjkP2WM8WG7s7IaD6bEvh38CjWnTbc2uJoduju1f/ZV2HN1QF9n6rx0PQ74PvTTUzkdpujl5/RHcZRMUr8k11O9C7tvtwFc79cbnRaiOdVbw== Received: from DS7PR12MB5789.namprd12.prod.outlook.com (2603:10b6:8:74::21) by DS0PR12MB6653.namprd12.prod.outlook.com (2603:10b6:8:cf::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Thu, 9 Feb 2023 22:02:32 +0000 Received: from DS7PR12MB5789.namprd12.prod.outlook.com ([fe80::3d2e:1f83:5259:9893]) by DS7PR12MB5789.namprd12.prod.outlook.com ([fe80::3d2e:1f83:5259:9893%3]) with mapi id 15.20.6064.031; Thu, 9 Feb 2023 22:02:32 +0000 From: "Jeff Brasen" To: "miki.demeter@intel.com" CC: "devel@edk2.groups.io" Subject: FW: [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices with 0 HardwareInstance Thread-Topic: [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices with 0 HardwareInstance Thread-Index: AQHZDl/QhXMlNj8y/0e/PqccY8bHO666lZ4QgAzxmnA= Date: Thu, 9 Feb 2023 22:02:32 +0000 Message-ID: References: <3c3226e6c05a868f3f88d300181a157998c2786e.1670873141.git.jbrasen@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DS7PR12MB5789:EE_|DS0PR12MB6653:EE_ x-ms-office365-filtering-correlation-id: 58505082-20fa-4ab5-aa12-08db0ae95849 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O2Jw1d5CGXlxqChUY2jHXgbonFHem5fv+RsVToi3lbkFgE9bVNyhhty2qBk38STUJmqVDe/CvkXfK54sDhI5WTE/ftq5YBEr8YT5f3HnchcuL32fALHN9fYOcVMGj7/XwqiXq8PfjMNSSBydoHK0FOiUaUjIj7oMG9tGjpwdGBPlJj16ZpBPYCjEQ0qFjS3lx1kdVpvuVrVMAifCDFcgNlKBSMMUASIFVAbTCTrwjtreBowNbju5QRuWecCpfo0Sp8S7Cgdes8wO5omRasZFj87x1V/ZAYuoV4Un8RM9LIiAnCnQTieZepwag1Ru/Ue/ayydmjELzQSGaYzTtyhqP321WPV00tp86n34zEhR+HKOFgs1QH4k8I/2RpQI5278kHWbzltihsxGO4chigf6Kuer/udsYw5rcPzG3pzWD+tGXkPiZnVfaHQ/K+dWsPtR2XZIBo1jFiZG1IOAw8LbxjdAS+TscjvBgbvA6H8sDNrqslr7/N1L4RcRe/AsJURA/ycydrPJY/u2Tv98VXZZsgjijTv/kI3JBbHS79Cy/wOSXwP05Sri8cBtm0uQoraVAcfXiOaWXx6A6e3ChpLksS9up2DpLKqCYPVbRekmK8svBoOcltOp+n+EBapCu1cgLm2m4HYsEVDueOrw8rg+pUnjry8g42A7ZD7Kp+x1xReeol0YNjC497BpeZYMy2aDYjbSIpdeX/6ub/vKYgOoeQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB5789.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(376002)(396003)(366004)(346002)(39860400002)(451199018)(38070700005)(26005)(53546011)(186003)(6506007)(9686003)(86362001)(478600001)(83380400001)(122000001)(52536014)(8936002)(5660300002)(4326008)(6916009)(41300700001)(2906002)(8676002)(7696005)(71200400001)(66556008)(64756008)(66476007)(66446008)(38100700002)(316002)(76116006)(55016003)(66946007)(33656002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VNlouVmDuxEo50Veq+/7YKKkRuy5v5fjzhSYnJ1m5RUMK+7zi2l1eWxU5kOX?= =?us-ascii?Q?hhKdiXqDafUKVUhKp0yW0o9GNZpDutGjd32lypGW0r5SyGc+WGIg3UFi24XT?= =?us-ascii?Q?SGY3fLs0w2MaUq0EU/eUpyc7fDoAJ8hDjJCSeSgjBl40hEhETAvT5jIYvsEA?= =?us-ascii?Q?nzjxjgyeWwr7SOraRL3r1uONDsPu+vRS7HsTjYD1g0dQRyDnSpFmYbQP7DuR?= =?us-ascii?Q?6qFCI+J+ALsVNWRY0WB0TsOSccZySrCTm+B97ohq2kmLxN3kGnwq+vayi9J1?= =?us-ascii?Q?nzob5Ql2LvvA1+ktGnG+Q3rWdMMATkCSWCO9l7iv5ERbIG2qA7h7tO3nOhCB?= =?us-ascii?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3eRQfv3H5V5Hh?= =?us-ascii?Q?o+GerhJMXI5KYFE/NCUcRog1N59MVx9pYcm11hL13Il8Xrh26wrxoRcT+2s3?= =?us-ascii?Q?BWOogp04GefbieliewnLE8w+8RcxJroPngrJgrU4lLHJOd6wJeZQ/vAO1R8t?= =?us-ascii?Q?xGamQK9N6lI1cTdsCo4e0fsVK2KV5QA4NZ5/qo9w0Wu/zllOcuL3bQxqHxGz?= =?us-ascii?Q?PFPYstIsbx40BTx/xyBB7Op7v05BDOkIfYC2be+rGa+CRJ4IgtsJsJPguNhK?= =?us-ascii?Q?QR6zH9EORrwv5SiQiBBV9Xm9Wa5HP767VgiBrRGOVIlL3/FXKUHhNF8Msnko?= =?us-ascii?Q?PfMb5MnRgQa8ZyW1pOvfinfI8qlrDb92g8YfFqCt?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB5789.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58505082-20fa-4ab5-aa12-08db0ae95849 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2023 22:02:32.7625 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: eN+s7qUWvPVEkR7ar4Be1CJcEwKhgPcYXoXL/SmzztYe2gDjJORz/NbJgFE40e40xrPV42Bt93NG73q5MT2r6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6653 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Here is a patch that has been pending for a bit Thanks, Jeff -----Original Message----- From: Jeff Brasen=20 Sent: Wednesday, February 1, 2023 9:21 AM To: devel@edk2.groups.io Cc: jian.j.wang@intel.com; gaoliming@byosoft.com.cn; guomin.jiang@intel.com Subject: RE: [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices w= ith 0 HardwareInstance Any updates on this would be great to get this in for the next stable relea= se if possible. > -----Original Message----- > From: Jeff Brasen > Sent: Monday, December 12, 2022 12:27 PM > To: devel@edk2.groups.io > Cc: jian.j.wang@intel.com; gaoliming@byosoft.com.cn;=20 > guomin.jiang@intel.com; Jeff Brasen > Subject: [PATCH v2] MdeModulePkg/EsrtFmpDxe: Support multiple devices=20 > with 0 HardwareInstance >=20 > Skip error check if HardwareInstance is 0 as this either means that=20 > FmpVersion < 3 and not supported or, "A zero means the FMP provider is=20 > not able to determine a unique hardware instance number or a hardware=20 > instance number is not needed." per UEFI specification. >=20 > As the FmpInstances are merged and HardwareInstance is not used remove=20 > error check in this case. >=20 >=20 > Signed-off-by: Jeff Brasen > --- > MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 22 ++++++++++++------ > --- > 1 file changed, 13 insertions(+), 9 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > index 4f47c55cce..5bc627461d 100644 > --- a/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > +++ b/MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c > @@ -153,16 +153,20 @@ CreateEsrtEntry ( >=20 > // > // Check to see of FmpImageInfoBuf GUID/HardwareInstance is unique > + // Skip if HardwareInstance is 0 as this is the case if FmpVersion=20 > + < > + 3 // or the device can not create a unique ID per UEFI=20 > + specification > // > - for (Index =3D 0; Index < *NumberOfDescriptors; Index++) { > - if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid, > &FmpImageInfoBuf->ImageTypeId)) { > - if (HardwareInstances[Index].HardwareInstance =3D=3D > FmpHardwareInstance) { > - DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image > descriptor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf- > >ImageTypeId, FmpHardwareInstance)); > - ASSERT ( > - !CompareGuid (&HardwareInstances[Index].ImageTypeGuid, > &FmpImageInfoBuf->ImageTypeId) || > - HardwareInstances[Index].HardwareInstance !=3D > FmpHardwareInstance > - ); > - return EFI_UNSUPPORTED; > + if (FmpHardwareInstance !=3D 0) { > + for (Index =3D 0; Index < *NumberOfDescriptors; Index++) { > + if (CompareGuid (&HardwareInstances[Index].ImageTypeGuid, > &FmpImageInfoBuf->ImageTypeId)) { > + if (HardwareInstances[Index].HardwareInstance =3D=3D > FmpHardwareInstance) { > + DEBUG ((DEBUG_ERROR, "EsrtFmpDxe: Duplicate firmware image > descriptor with GUID %g HardwareInstance:0x%x\n", &FmpImageInfoBuf- > >ImageTypeId, FmpHardwareInstance)); > + ASSERT ( > + !CompareGuid (&HardwareInstances[Index].ImageTypeGuid, > &FmpImageInfoBuf->ImageTypeId) || > + HardwareInstances[Index].HardwareInstance !=3D > FmpHardwareInstance > + ); > + return EFI_UNSUPPORTED; > + } > } > } > } > -- > 2.25.1