From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.9594.1597214322234943721 for ; Tue, 11 Aug 2020 23:38:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=GHdJVbIq; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: hao.a.wu@intel.com) IronPort-SDR: Vqt82Lu0o/kWDXbMuonQoHFgiscwC8GJxcZ+Z8R4n2xC+yZrdLgb42Zr5+WizEKfzXAbPiMBXD wdt2TkElDHTQ== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="141737883" X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="141737883" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 23:38:41 -0700 IronPort-SDR: DvtgXuV9m3HqjnXMxibCN7Mf7+iIOtwNuVzvlhPpOUnbK44IY01Tkn4UOPZi3XufT+w6zatR08 AFfZ3dWPuK6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="327097127" Received: from unknown (HELO fmsmsx606.amr.corp.intel.com) ([10.18.84.216]) by fmsmga002.fm.intel.com with ESMTP; 11 Aug 2020 23:38:41 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 11 Aug 2020 23:38:40 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 11 Aug 2020 23:38:40 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 23:38:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ctgXzDimRB30+5ungMFnGIaU3GemQ0ZTRo6TTdcvdim0gTmzZ/S87x529r9NZb/6HTCmbS7D2DYSRA6SGu9aXb6RclsecLmq6KgZZc3YV9Bwx6fMuHCmqNu9IVYvF6W0CQCYLcJ0IW+wP0JYr5O/jsJTvsTBHVFHT+QnzbkFKfJXWNNWzyD7ZzVgSXGnrZTRyi7pO+KIxCpYTHfXdDCc4BcmxbU1YlbXAOpztKXVV+MVSv5u60fFVYCslZpTw51Kj4i3HRmdYQc2Ue6E6mvV5T2gvEUkfaRge5HotjZqfOaV4SkAD7US7207/d3KjjkUUONFqubV8s8DN4lcxhUfVA== 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=SpsR9jOr/4vGlix4efaCEj676+5FUuctSMl+CTp5Hk8=; b=IMUM44AtUsZeMIhJI5KuZi2XBmqNNvG0GS2PRmYgc5YbceJajFbZTI+Uvh1ca8qd4RgFzyraZ+nfLfGtKUusF/2WUk2FM7nhMcq7GbsBv1q/t9SlfRGsRJhvpX6xZHhlJ9dKoC8F3+tiAwcVXOKBYvc6zxaarM4+xipP6phxTyRmylNxEY8fXHJ70YyfbgDNfY52aI/BkkEtX9HXiB/JhlA02b7Z3Irce5lVX2Jk8K02svLnGyfhr4vW5F1Tu8v6zRARAoeGLWwJ6Uy5V61EodfCRQu8GE3DxxdaSRqLg1Ww9T9dU3w5VFIUxWEa/3NdyxZ+apzHvAfPa1iCpJPV2A== 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=SpsR9jOr/4vGlix4efaCEj676+5FUuctSMl+CTp5Hk8=; b=GHdJVbIqod4nBOeeG2D5Gx6gsBMQ6EJZbKy6ikprUK7LwIqW+Sto8Ux2jENrwb1DHz5yilkMZLCMfEYhNKXeO70JWTDKTv5B0OsLD6TKvIa6YA1e3JuJh+VuxD8V3MKmNZi1IgkPJ7mVORF5nFrsY/kRn11hlbyf1ct6+5Cnat0= Received: from DM6PR11MB3673.namprd11.prod.outlook.com (2603:10b6:5:145::26) by DM6PR11MB2618.namprd11.prod.outlook.com (2603:10b6:5:c0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.15; Wed, 12 Aug 2020 06:38:38 +0000 Received: from DM6PR11MB3673.namprd11.prod.outlook.com ([fe80::5111:3ecb:21f:eeb6]) by DM6PR11MB3673.namprd11.prod.outlook.com ([fe80::5111:3ecb:21f:eeb6%7]) with mapi id 15.20.3283.015; Wed, 12 Aug 2020 06:38:38 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Gao, Zhichao" CC: "Wang, Jian J" , "Ni, Ray" , Gary Lin , Andrew Fish Subject: Re: [edk2-devel] [PATCH V2 2/3] MdeModulePkg/PartitionDxe: Revert changes for the special MBR Thread-Topic: [edk2-devel] [PATCH V2 2/3] MdeModulePkg/PartitionDxe: Revert changes for the special MBR Thread-Index: AQHWcEbwrVwqgD+tCEGOWdqexV9QV6k0Bcog Date: Wed, 12 Aug 2020 06:38:38 +0000 Message-ID: References: <20200812012124.18220-1-zhichao.gao@intel.com> <20200812012124.18220-3-zhichao.gao@intel.com> In-Reply-To: <20200812012124.18220-3-zhichao.gao@intel.com> 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: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 88289d06-49c0-45e0-20e8-08d83e8a58ac x-ms-traffictypediagnostic: DM6PR11MB2618: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MZ2Kj55xAmbiAlALNsv+h1yYQvKC93ec1eFc72HSodqVsiAjwQCT9cr3ZtbQgHkDIYgtOw3e3Eo6hvqdV79ngkVLQuwzCP3TM902wzMttYN6V2JcjnLsStO2gDrRCyd+x1WqusRzC4uizyk5gufNLxtDFLgvVZ6MfzzRmXMemaNR3Iu3IASunP23WtbUVd2p9x2xtAhjt+C2Fy6XXZlrtPKBd80EFkZDmd+pjjyBkZXbvRcL1Wvqrb8XF5EJsgy1tm5Lsd/ogz6ewpSzJA8sBTuXQMLwauux5aerOZ89W1gp+NabJm7obTwW+2YaWxs5TdDQwJJGdwC3pRrXyyc9Q0m2deKEJ81fTm/UMLcJYDhY+Bt0+m4JMrdom4NZpWcr0VYZOmNNnMmeCWbBaPsxaityT6w/ohexSM6V/ldxdBj2l4hI90QzIs6tep1YdByYNN0kNS7CMvL9/aBripvk7g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3673.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(8936002)(33656002)(66556008)(53546011)(52536014)(64756008)(4326008)(76116006)(66446008)(6636002)(26005)(186003)(8676002)(66476007)(5660300002)(6506007)(66946007)(2906002)(478600001)(86362001)(54906003)(966005)(71200400001)(316002)(9686003)(83380400001)(55016002)(110136005)(7696005)(562404015);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: a3Sk0sZxkU+kXEQhVDAVdJ/8S+qSYo5CElFWPHrFKHSeqpODcPZ9y8msg7deciw4ePciJ3kwIGQ+P6TCrpiloE72qC2t1kGZv7Dwoh1V0xCjQlKTX1/ynGUqwDhD7SM6U7hwnxVDOqDwbT85DgXpTJIHJ5EBHiMOwWAAkM9SdyOzZXqeOdgqQ374YQ8EG4oFmo3eHGcQfA39IEVJvzFgCgGT6K2XDIe1OSwR3qlLs3Aq+50W6oxLVZ2VXBd9OMe6oHlLv3dGvwVF93wIft6Ly0sl5zEcGKGDyWln8PA+34Y5bWuRnGFGjQ7X1LEvMHYCYPKXYDgQHALUy/AAgecQADecWgktECmc6qtL46ijgSgt5rDDyGxBmo5HgDi3WEQxDKFZmrP91VaJKDmzNZiUuk9foBssX7FNiEM1ykbYe6koQu2OT7oA9MaV3C79h2LdlLhihGbcsSOvfj05Rdkmes2IUBr4fhHmd5C02lpORrVJUugW79HOH3twNjyKVkui0GrK2RLORVnKATACOZ3MBgxVpbSipgKdytW/V0RxNgHawdVpqiuQbF3t28PnuodzhH6Zx2+31tf++hxIAsgMzLEAYMbFCCwdL02PWUQhJn8HXau/HIJS0KsH2EoB07RhoUm8KhIx/AYCRXbsBPB+qw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3673.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88289d06-49c0-45e0-20e8-08d83e8a58ac X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Aug 2020 06:38:38.6050 (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: xLQJJ6qz+TahDv6pDFsrQyYv0vUPiyag3dsPXMNeZ/P2GfzPqiRX4hGCsWv0ngXt6K8E+wsvQW8nAk7mpUZnag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2618 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: devel@edk2.groups.io On Behalf Of Gao, > Zhichao > Sent: Wednesday, August 12, 2020 9:21 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A > ; Ni, Ray ; Gary Lin > ; Andrew Fish > Subject: [edk2-devel] [PATCH V2 2/3] MdeModulePkg/PartitionDxe: Revert > changes for the special MBR >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 >=20 > Revert "MdeModulePkg/PartitionDxe: Skip the MBR that add for CD-ROM" >=20 > Follow the spec definition, the ISO 9660 (and UDF) would be checked befo= re > the MBR. So it is not required to skip such MBR talbe that contian the e= ntire > block device. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Gary Lin > Cc: Andrew Fish > Signed-off-by: Zhichao Gao > --- > .../Universal/Disk/PartitionDxe/Mbr.c | 37 +++---------------- > 1 file changed, 6 insertions(+), 31 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > index 3830af1ea7..f0c92aa09a 100644 > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > @@ -39,7 +39,6 @@ PartitionValidMbr ( > UINT32 StartingLBA; > UINT32 EndingLBA; > UINT32 NewEndingLBA; > - UINT32 SizeInLBA; > INTN Index1; > INTN Index2; > BOOLEAN MbrValid; > @@ -52,34 +51,13 @@ PartitionValidMbr ( > // > MbrValid =3D FALSE; > for (Index1 =3D 0; Index1 < MAX_MBR_PARTITIONS; Index1++) { > - StartingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA); > - SizeInLBA =3D UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA); > - > - // > - // If the MBR with partition entry covering the ENTIRE disk, i.e. s= tart at > LBA0 > - // with whole disk size, we treat it as an invalid MBR partition. > - // > - if ((StartingLBA =3D=3D 0) && > - (SizeInLBA =3D=3D (LastLba + 1))) { > - // > - // Refer to the > http://manpages.ubuntu.com/manpages/bionic/man8/mkudffs.8.html > - // "WHOLE DISK VS PARTITION" > - // Some linux ISOs may put the MBR table in the first 512 bytes f= or > compatibility reasons with Windows. > - // Linux kernel ignores MBR table if contains partition which s= tarts at > sector 0. > - // Skip it because we don't have the partition check for UDF(El T= orito > compatible). > - // It would continue to do the whole disk check in the UDF routin= e. > - // > - DEBUG ((DEBUG_INFO, "PartitionValidMbr: MBR table has partition > entry covering the ENTIRE disk. Don't treat it as a valid MBR.\n")); > - > - return FALSE; > - } > - > - if (Mbr->Partition[Index1].OSIndicator =3D=3D 0x00 || SizeInLBA =3D= = =3D 0) { > + if (Mbr->Partition[Index1].OSIndicator =3D=3D 0x00 || UNPACK_UINT32 > + (Mbr->Partition[Index1].SizeInLBA) =3D=3D 0) { > continue; > } >=20 > MbrValid =3D TRUE; > - EndingLBA =3D StartingLBA + SizeInLBA - 1; > + StartingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA); > + EndingLBA =3D StartingLBA + UNPACK_UINT32 (Mbr- > >Partition[Index1].SizeInLBA) - 1; > if (EndingLBA > LastLba) { > // > // Compatibility Errata: > @@ -99,15 +77,12 @@ PartitionValidMbr ( > } >=20 > for (Index2 =3D Index1 + 1; Index2 < MAX_MBR_PARTITIONS; Index2++) = { > - StartingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA= ); > - SizeInLBA =3D UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA); > - > - if (Mbr->Partition[Index2].OSIndicator =3D=3D 0x00 || SizeInLBA = =3D=3D 0) { > + if (Mbr->Partition[Index2].OSIndicator =3D=3D 0x00 || UNPACK_UINT= 32 > + (Mbr->Partition[Index2].SizeInLBA) =3D=3D 0) { > continue; > } >=20 > - NewEndingLBA =3D StartingLBA + SizeInLBA - 1; > - if (NewEndingLBA >=3D StartingLBA && StartingLBA <=3D EndingLBA) = { > + NewEndingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index2].StartingLB= A) > + UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA) - 1; > + if (NewEndingLBA >=3D StartingLBA && UNPACK_UINT32 > + (Mbr->Partition[Index2].StartingLBA) <=3D EndingLBA) { > // > // This region overlaps with the Index1'th region > // > -- > 2.21.0.windows.1 >=20 >=20 >=20