From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.92.22.101]) by mx.groups.io with SMTP id smtpd.web10.455.1596663633085282798 for ; Wed, 05 Aug 2020 14:40:33 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=qObLT9v0; spf=pass (domain: outlook.com, ip: 40.92.22.101, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q535265enKuoWqg69Q6bc+SUoWn5a1iKIoM8PcwWDbpxUNYogdS11jz9SQXyTNXxQ8DkrNkWXzqRQhb0heITCqqCkm7AyCAXMlZRVF9FRDgMtVc3gmqKf/qeqfs+QkUfmbueDD9+MUldVkRq6txdQQAB7wgYEFtqqJhQo0EZvkNwEf2PQNkjfLd4Pn+Umq+3PBrEBI0hSNQq1El4iL10kbA6xxG1xSYh0clh2Y0aFbCkXrVPRmf4+beWu88CCPS78xd03dcZUjW1nYbC+hGFQ16KoVWZv+uPwaXEXWqkodpXGzs23i7qcGQEBmfXQM9qDHqtofPiGZo52dk9B+X3fw== 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-SenderADCheck; bh=j00j/RL7AV15Ud4JV/kjFNfrgBQgO6W38N6eHp2y6to=; b=NLanUx904UgaOy8eEWlEr86HVzY0rMGGLqVV1aEY6HaQt5FqevKxSBfiHIydB7zBMgNmcFX+mqVYzhhfRreRfLQFofl1IL292AVAsJyXN+8Faij+CoR5jPUnQqroOJECIQg3Iap4SPAbi35BL2RFzvYBqHNRLPIEJUspNedA1PGVOGHvApS+rtmSjQsYPoERK1Mi4tXZsmM+1caACbATEBhBmTcP3ztUTyALv/1ChiA90AYNhj/6t87GnkJ7EjOOOsyK4VQTlkJzIfJ7+Xgvmvfe8Pp9xySwFCXLJUC9boKsnP7xZz44rkouTTP385xlCwnmPH9lRkSaBm51Z/jU7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j00j/RL7AV15Ud4JV/kjFNfrgBQgO6W38N6eHp2y6to=; b=qObLT9v0JSHO93jmUOYbSGLhVJ1PEa+3xj9oDvmUVK+/y7cTPmsC0w/X44pmoAe0P3NyGHqkCYG/3B4gjw5xrkpUeDCQzqaDWZfXGy4/Qec498D4aWVu8pVpNJCkxH7mdUz6Ts/Ah9D8bseY83YkGmZe8w7+MKVLrhS20lpGWmgCCEzV/1M23IzkZO7T74bunJqwEqs8LW4YzS64PjJ3wH5o1Y9amHzGrmoSMpG+/2SSKIGWvFyGTY0sxKtvKlH7YSPc3eDJELEVHBZ6m+KEka38G7Zt+ezDL57jzv1F3p5Geu7QC3ixi7gT7s3dNYr15Fmd22KoHOsPVBcOtAX6yw== Received: from MW2NAM12FT045.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::40) by MW2NAM12HT072.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc65::433) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.10; Wed, 5 Aug 2020 21:40:32 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:fc65::42) by MW2NAM12FT045.mail.protection.outlook.com (2a01:111:e400:fc65::268) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.10 via Frontend Transport; Wed, 5 Aug 2020 21:40:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:65B2CD60AF79873865F2F8E7990193949C88642975853FFA6750F51990C5FFAB;UpperCasedChecksum:D0F4F3CDF25516F6EFFDBDF9016209027869D95A17BA128572B7887AFDE734BA;SizeAsReceived:7810;Count:49 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::9856:570e:1735:974e]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::9856:570e:1735:974e%7]) with mapi id 15.20.3239.022; Wed, 5 Aug 2020 21:40:32 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io CC: Liming Gao , Michael D Kinney , Guomin Jiang , Wei6 Xu Subject: [PATCH v2 5/7] FmpDevicePkg/FmpDxe: Better warn of potential ImageTypeId misconfig Date: Wed, 5 Aug 2020 14:39:42 -0700 Message-ID: X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200805213944.1811-1-michael.kubacki@outlook.com> References: <20200805213944.1811-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR2001CA0014.namprd20.prod.outlook.com (2603:10b6:301:15::24) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200805213944.1811-6-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:a:f5bb:f844:3092:4e93) by MWHPR2001CA0014.namprd20.prod.outlook.com (2603:10b6:301:15::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.17 via Frontend Transport; Wed, 5 Aug 2020 21:40:31 +0000 X-Mailer: git-send-email 2.27.0.windows.1 X-Microsoft-Original-Message-ID: <20200805213944.1811-6-michael.kubacki@outlook.com> X-TMN: [ulH88a4VgYlVYPuv1HUaphm62HZajUPZ+w8EvgYugWwweZRr+SDxMuokok1DG4eB] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 21a358ba-392d-4f87-1227-08d839882db5 X-MS-TrafficTypeDiagnostic: MW2NAM12HT072: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qlr+i3Hzm0YYXjdiYlEHh9vHupITsGbEEnPdvAMjctV/wIi0iwzG8h/w0ehulsGb+PBnxFTrBVGRd0Gdpgrt95m4LGE/9/S7v4JPoRlirzbXgkazyNyxWV/CZ91MLnfObPkm3RnPePF186YHmdupxC5/InHPAxj09e25CdMsiYvOr0JTbmIUQRCKD7Kd3+Ie8cgxMQKIv5fjpsbgegtBBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR07MB3440.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: 2oDSeCUOUv8hFNqqy7szgdS95baKOyG2qmSaJGWJto2quibyFcfRLqoJUl+stlWnLYkkE+7h48IHhM0Go/vWOkYRuPs1MJItenoVYydvB17yIxFrn+8PvYaZqT/q1T4eqaH+mipWYiOLPihD/olEQrfJqCHftFKbopRm60KCQv67kVLXuxZVQz0w3+mjeGPd1RbXz5pEFAdwG71WGWzgZg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21a358ba-392d-4f87-1227-08d839882db5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2020 21:40:31.9901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT045.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM12HT072 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Michael Kubacki A user may fall through to the case they depend on the PcdFmpDeviceImageTypeIdGuid value to get the ImageTypeId GUID value. The default PCD value is 0 (NULL) so the code would further fall back on the gEfiCallerIdGuid value. This change modifies the print error level for the message that indicates this occurred to DEBUG_WARN from DEBUG_INFO to better warn the user that this occurred. Cc: Liming Gao Cc: Michael D Kinney Cc: Guomin Jiang Cc: Wei6 Xu Signed-off-by: Michael Kubacki Reviewed-by: Michael D Kinney Reviewed-by: Guomin Jiang Reviewed-by: Wei6 Xu --- Notes: The PCD documentation indicates it is valid behavior for the user to fall back to gEfiCallerIdGuid. Is that really expected? =20 Would an ASSERT be appropriate? FmpDevicePkg/FmpDxe/FmpDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c index 58841774fee0..14994ce4ee0e 100644 --- a/FmpDevicePkg/FmpDxe/FmpDxe.c +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c @@ -3,7 +3,7 @@ image stored in a firmware device with platform and firmware device spec= ific information provided through PCDs and libraries. =20 - Copyright (c) 2016, Microsoft Corporation. All rights reserved.
+ Copyright (c) Microsoft Corporation.
Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -179,7 +179,7 @@ GetImageTypeIdGuid ( if (ImageTypeIdGuidSize =3D=3D sizeof (EFI_GUID)) { FmpDeviceLibGuid =3D (EFI_GUID *)PcdGetPtr (PcdFmpDeviceImageTypeIdG= uid); } else { - DEBUG ((DEBUG_INFO, "FmpDxe(%s): Fall back to ImageTypeIdGuid of gEf= iCallerIdGuid\n", mImageIdName)); + DEBUG ((DEBUG_WARN, "FmpDxe(%s): Fall back to ImageTypeIdGuid of gEf= iCallerIdGuid\n", mImageIdName)); FmpDeviceLibGuid =3D &gEfiCallerIdGuid; } } --=20 2.27.0.windows.1