From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.550.1625535402065076296 for ; Mon, 05 Jul 2021 18:36:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kyaThelI; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: hao.a.wu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10036"; a="188720038" X-IronPort-AV: E=Sophos;i="5.83,327,1616482800"; d="scan'208";a="188720038" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 18:36:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,327,1616482800"; d="scan'208";a="644488151" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 05 Jul 2021 18:36:38 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 5 Jul 2021 18:36:37 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 5 Jul 2021 18:36:37 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Mon, 5 Jul 2021 18:36:36 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.107) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Mon, 5 Jul 2021 18:36:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TYoxmQ3MyRQoxyy8SptJlSs/taJK/6RYS9l7gpdu64zdvjU/JhkznYH100BFcG3mlzBnh30vRCD5P8IgNSyrcFOdhP8CwFvqwXYN2vyUQOak0R9w/bh8zDIq4Av/eGlhjvTy9XZfOVnj/ZJkzp7FkRH2HKRb/D//G7O4cpdq6rcmLZtcddDX3ACiAvLhz60PY6pX71CGr1hc59O66xJ4UmmheWmjbStgGdmlKlVSEgdERz+JmkgJprDanCbU12ZYuPPHxtnNxltS5Ct9bkmX+mrUBwzVl1xL4BX3/j6hlObDgDpvLN4G9uX/g2fqu0IXXVi10ETTbkF0T0t6cdN77A== 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=xAO9tx/R4+Ey3aMMCC/e5V5EIu3IVy5whplJoc19pck=; b=CEubLc7rWRAv3voVHrFuKlo0CAB8NDfQogjyMJtzCVkShwPfD4r02uuawdTVVdWP+cw1O6t/H3njQ5fLAWRYQPAmtJ7wrmXTg3GIIv9dNf7WQPZkAuzdUhRChOPjiqcujwTf5Z9RUSljIqw6N+pZhEGBzit+4hdLSx+ttMU50Bt9jXA7euqJ44HBAZmPhV31Qj6SRZozF3JNFpEhTxUb07MMoz5Sb02wBn0WAxqtE0RPoncgR59GqWIG38/3i9zXSctAIycb5FWKlOKnDfEJCG6HoUypBqMVLugPsTGkyT0ZqXW6fHYTDtjKTPANLCgMD6EKTMxphMrNdVclhpAGfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xAO9tx/R4+Ey3aMMCC/e5V5EIu3IVy5whplJoc19pck=; b=kyaThelIVt7+WFIzk5FRGxd8OX81sG1xTh07x3f1JTGvuqrtva7zxVL0R1InM87LJPD9Y+X+F3JsULdR6y/vTObxxoM8FrAxfNNcDjzac+n211vLvbEB+Gqc13MxN/aehGiMjAfbisNT9wHuuvNAU0FYUPQESqMELPzJtSBCp/s= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN8PR11MB3779.namprd11.prod.outlook.com (2603:10b6:408:8a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.23; Tue, 6 Jul 2021 01:36:34 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::cd58:25ce:5017:619d%5]) with mapi id 15.20.4287.033; Tue, 6 Jul 2021 01:36:34 +0000 From: "Wu, Hao A" To: Neal Gompa , "devel@edk2.groups.io" CC: Chris Murphy , David Duncan , Lazlo Ersek , "Ni, Ray" , "Gao, Zhichao" Subject: Re: [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI spec Thread-Topic: [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI spec Thread-Index: AQHXcYFDrV4owB2rfUmFx2G/Z4kFr6s1K4aQ Date: Tue, 6 Jul 2021 01:36:34 +0000 Message-ID: References: <20210705093603.575707-1-ngompa@fedoraproject.org> In-Reply-To: <20210705093603.575707-1-ngompa@fedoraproject.org> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: fedoraproject.org; dkim=none (message not signed) header.d=none;fedoraproject.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.142.16] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ba3807ad-baf5-45a4-760b-08d9401e7d30 x-ms-traffictypediagnostic: BN8PR11MB3779: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8l3liCqoy8WZihGpf3x9xHHnPaE8RevS6jJjKtu+Yac6c7wqZBr5WD5oJ4L92jabwzZnvtuqd518S0SGwEZLYfpsP/6MyH8prLqgnUx5yqcOek+HAA70PVDcR0f+Rv7TEPQ4wGouamRCxb/FHPmm1cCoU95L2CrytImoZ0DWZSKjW7nnEXkE0f8gZWuzlAyTHcnxBUgZjGyMq0hKz0GQA5aoKPXgOL2TgCQEjQTSDK2CRkilU5RRxS0R2321+3oCiIRAXpwBtUM2s77ydYfJfA0NKSuBYozlGcyuJjQtUTrcp+jbo8ficMZOV0QgHNMGXIpTRidcu58EYjXhyN9AN7kUkFjo2BN+rNi/Up06fDdL68ag6VWBIm7/d4r3cT2DQclBBfbctkbiKDEph26s1ooVtdOMi1DyOHM9I4UXXN+Bvx3WY7LMXfeJGDefUVrWAHejMtBqoZIbSIGPXfu/8F7+S4dq4pGVG5XVXksN0iT5CXymyDw8vgOKLLaqtueg2MJh2wh0IzhO1Weyf6y4XcoJwdxgugShCH5FhO4iVw48f6WtRhaKYeC09yivO8qbMTbhQE6XhNL8g+aHe+azYNvjP74r3FD7kc1mYGwDMgChfsNLn+5Ugxrj/GRZBUuIqZ9KUtBZVRtW4INDp7zsq6EEwlAc9Jd94owYCzvF59VwS6z/+cHHuQwewOJJY1pKQPP6gR0ChWaI3dL/dOREnjeS93lDhW1ffli5DVDaB4k= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(136003)(39860400002)(366004)(346002)(376002)(38100700002)(316002)(110136005)(122000001)(86362001)(5660300002)(478600001)(54906003)(186003)(55016002)(8936002)(52536014)(4326008)(2906002)(9686003)(26005)(6506007)(76116006)(66446008)(66476007)(66556008)(64756008)(71200400001)(33656002)(8676002)(53546011)(107886003)(966005)(7696005)(83380400001)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xmrkEkYlS7XdHGJqg+xkHv2zufx9Dp8wLE3l67Uw9eAP/tTE0vxv4pauGD1t?= =?us-ascii?Q?eaaISSXAKhVAWt/7xYqVTiwEnky9TY9GbCtfZ4MERVI8HvZ6m7LnTK1PxGR6?= =?us-ascii?Q?/cc9PRSbcpJ/3v3nWzyoPKuhOz6b2Y6mawcg36za0T1IyId5fwBx5rOypnK+?= =?us-ascii?Q?EG9YgHgHb4BM3Plx5MS2YUSElJruIzosuyhR8HRe7At8r6aFwKcsjscqvHoJ?= =?us-ascii?Q?NwbpFskHGk6FYWnuc+UeIs/u0BrZlvUDZ08Gxk1OBtmyLDGqBWtgQYLdnj9Q?= =?us-ascii?Q?agEnBi4DAFfiJfJ8SMU9oaZmnyB9OuNEh+AlDao0BnZChOJcleZ7IqJ1Avht?= =?us-ascii?Q?AP24JVTwdwqEfwxfznSEnYbkmWUtAt5xkPdHvuBZG6lvwTbJ4p01Z69b2aty?= =?us-ascii?Q?yO3N0DGmUBTIw1T+eac1r6aKOHPwyZxBlUzPDIhwC/1bxXI/cXfN62weNusM?= =?us-ascii?Q?i5hHE0Jb9+ou752oCEAlqS9mONn61z6VF2mCKATWD3fjf6zTjCWsN8nC5vsC?= =?us-ascii?Q?Vg1lkrWcDN+KuHP+kZrMexaqkQkRc1W/h6EMxyqAYKKMU5XGUqY6R5Gg7mbr?= =?us-ascii?Q?TihQXDSZ4oqZRdQJRXNHS60xlLKMlCiVONueFm+Vrm+cs38FUXb/IqNVE5SB?= =?us-ascii?Q?RQGnqvpKBWlF5udcT4HF/7yyL3yU3UAe3KOC21T558OS0RN1LW2Ol1WyEh7h?= =?us-ascii?Q?lXoPQvt5YriVviHK8jRDZJi0Oc32BAu4udfhye6sPJsc76x7DjwlmNgDuewy?= =?us-ascii?Q?T9mIWP98sXZPGMzawIwjZOMKm9Pd/aJm4U/XTd9wDDiRMOG8bpcpBcOD7z4U?= =?us-ascii?Q?iWBdQ1412WAGFeV1qNPkPFI4dKXgf4ffUwHPtG6c71whyCIWy47NYQj+1DE7?= =?us-ascii?Q?u5n+meUckoAjAOy0ci/igPYuF+V9MN3APFvP47rTRfF0M8zZBgznkTUP50ir?= =?us-ascii?Q?d4Jbx5BPeSVkwtkam1LTBQ81A1loo/63QCav+i3w51jvJBDYqCnm/qiavtQg?= =?us-ascii?Q?yxTXmRpI3Ky2gvYckuqvGhk/GkOdXcMyWBB29J1ywM6dS57wmO/QVsFTr/nX?= =?us-ascii?Q?0yqcOT+PMuw9PWrEyybmg//0/w8IWDbhjM48WQSUz6D7Y7Z9N9NEqzjrkBCx?= =?us-ascii?Q?te2ECDkObmZ9Yo2W2mkk9KHbZXpRaKxbbFbzYsDDHhtqVf08HAoEzL+Quys1?= =?us-ascii?Q?SbLdECZi8M9Blpy6CajOBzFcjKrWunBH4alW1R4xFIkqgGqyWrlBctrir1g6?= =?us-ascii?Q?48R/QofFEvc9611xLo5SXSkJOKsHojgo2lDEHbd8k89kO2rBlLONygpbY6wT?= =?us-ascii?Q?vRVB2Ah19uBtVeqwcL75Oerc?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba3807ad-baf5-45a4-760b-08d9401e7d30 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2021 01:36:34.1831 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: C3vXf5k7b1aQ5FYPXybgln1D5Io5oY6tFdoDcamBsB39vtyg91FnwGuKYRhDM9VJRqdwbbfddvnMQoJFBbwHaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3779 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Neal Gompa > Sent: Monday, July 5, 2021 5:36 PM > To: devel@edk2.groups.io > Cc: Neal Gompa ; Chris Murphy > ; David Duncan ; > Lazlo Ersek ; Wu, Hao A ; Ni, > Ray ; Gao, Zhichao > Subject: [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator > per UEFI spec >=20 > Per UEFI Spec 2.8 (UEFI_Spec_2_8_final.pdf, page 114) > 5.2.3 Protective MBR > Table 20. Protective MBR Partition Record protecting the entire disk >=20 > The description for BootIndicator states the following: >=20 > > Set to 0x00 to indicate a non-bootable partition. If set to any > > value other than 0x00 the behavior of this flag on non-UEFI > > systems is undefined. Must be ignored by UEFI implementations. >=20 > Unfortunately, we have been incorrectly assuming that the > BootIndicator value must be 0x00, which leads to problems > when the 'pmbr_boot' flag is set on a disk containing a GPT > (such as with GNU parted). When the flag is set, the value > changes to 0x01, causing this check to fail and the system > is rendered unbootable despite it being valid from the > perspective of the UEFI spec. >=20 > To resolve this, we drop the check for the BootIndicator > so that we stop caring about the value set there, which > restores the capability to boot such disks. >=20 > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3474 >=20 > Cc: Chris Murphy > Cc: David Duncan > Cc: Lazlo Ersek > Cc: Hao A Wu > Cc: Ray Ni > Cc: Zhichao Gao >=20 > Signed-off-by: Neal Gompa > --- > MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c > b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c > index aefb2d6ecb3f..efaff5e0808f 100644 > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c > @@ -264,8 +264,7 @@ PartitionInstallGptChildHandles ( > // Verify that the Protective MBR is valid >=20 > // >=20 > for (Index =3D 0; Index < MAX_MBR_PARTITIONS; Index++) { >=20 > - if (ProtectiveMbr->Partition[Index].BootIndicator =3D=3D 0x00 && >=20 > - ProtectiveMbr->Partition[Index].OSIndicator =3D=3D PMBR_GPT_PART= ITION > && >=20 > + if (ProtectiveMbr->Partition[Index].OSIndicator =3D=3D > PMBR_GPT_PARTITION && >=20 Thanks a lot for the fix. Reviewed-by: Hao A Wu Best Regards, Hao Wu > UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) =3D= =3D 1 >=20 > ) { >=20 > break; >=20 > -- > 2.31.1