From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.9410.1597214149048725962 for ; Tue, 11 Aug 2020 23:35:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Zky+aRpH; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: hao.a.wu@intel.com) IronPort-SDR: TTMMeBn7PZQcxuOg8MVioJHb3Gmm9mIG5HLg02nuulhUcYTgT61vfg1j+1nz7BPl+pvzj0BuKh N31scDi0WAhA== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="238743297" X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="238743297" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 23:35:47 -0700 IronPort-SDR: kqNzd9pjfG9+yqeOxfRNPgRbGCc9+n6UYmlEhR3Zlk1a0rCRT6Y17en/lAfhDjdX26ATAExhGV eLQwlAjUhgng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,303,1592895600"; d="scan'208";a="327096583" Received: from orsmsx605-2.jf.intel.com (HELO ORSMSX605.amr.corp.intel.com) ([10.22.229.85]) by fmsmga002.fm.intel.com with ESMTP; 11 Aug 2020 23:35:43 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX605.amr.corp.intel.com (10.22.229.18) 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:35:28 -0700 Received: from orsmsx116.amr.corp.intel.com (10.22.240.14) by orsmsx605.amr.corp.intel.com (10.22.229.18) 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:35:28 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX116.amr.corp.intel.com (10.22.240.14) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 23:35:28 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 23:35:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dje+0ZNzQnNZiggpmFq0cy8q6blNnYL3Vu3PDHkIOz0vPaYRI9xigyHHm5TNU/jI7eGvOKoaaHkKnd56j/G3oqgcDHY7etEmCCJadIZMyXT5O4UI/36k7awMrr+zisKLE6Oy65zXtWbSVnCtIWTDv/Cofke832Bz3rxnDhCJKa3mT6HOGssTgV9YWI/y4lfR/FuZX+slofF1N4/YzXCFRDLI/iPctk8FXyRny5RDJb+jgQMF1vQeGMiyB3y2zB2c7kTVuK6JzI6gSLUaqVcSEd0ijlaPhaOTCTicOHf33XCv8XlFWX17WS3HQdyYiMxRyTH16FznuU3lcRwaCTb2jA== 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=7+ZNSYb/s3Ww6c4IKFUi7QvuxtBxQh/MTBM/UTTgH50=; b=JEP1TUiHCQTodGmbZiqnig8HIgTqLnC62B+3vSl2qfJxDzw7UbgCjwgYQhCr3vHu394Hwy4AcxuMEybW1BCCXJdmQUYdjCSsxlDWmxGbEQrv4Zjcg3l3fqubx8Qgrhf86ZbZ2LSZLQLnC1oh4hesHWnQ9v5YQ8nqs1UtuhqqR8HjW22IoAB753NrLrSSJDHmW4bNE8RIdYXFRz9DEnUAu8xBrDsm83aqMdxl+tLOTGl4FFHJlC4Q7AtcNxq8ST7x9jwIKbX8TytXvma3CvZpfdbJ84D7DKFRvle1v+J2LZFnpDfHkVGcE6ahhl6GkwQniwfiEL3037JNUZBRG/J9Ig== 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=7+ZNSYb/s3Ww6c4IKFUi7QvuxtBxQh/MTBM/UTTgH50=; b=Zky+aRpH9fgG/Y5KbT2SkqfhuYVOdF1/InoMHEyS9XfhX4/OI2lW6kw0z646EQ1b+yTjlTV46Lt3dIIljbBO97oEdyiyhr7GUrvWB7TwzyisZJCMn9uoOe1hxBkCWgj8ejNF49jy8+Oug+Z+pQo/uLMWCJlQgOTq4I14yWvZpEY= 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:35:26 +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:35:26 +0000 From: "Wu, Hao A" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Ni, Ray" , "Gary Lin" , Andrew Fish Subject: Re: [PATCH V2 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander Thread-Topic: [PATCH V2 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander Thread-Index: AQHWcEb3qECUdg++/k6LuUt5CtmXgqk0AmhA Date: Wed, 12 Aug 2020 06:35:26 +0000 Message-ID: References: <20200812012124.18220-1-zhichao.gao@intel.com> <20200812012124.18220-4-zhichao.gao@intel.com> In-Reply-To: <20200812012124.18220-4-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: intel.com; dkim=none (message not signed) header.d=none;intel.com; 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: 667fb3a3-7d8f-4eb2-ca86-08d83e89e5fb 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:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: d8muy9sYBhMSZzPwyliqEwcBSK8D+VuT/QfBFdsrOFXAlWEI5HXNwx0VbpHi5MH/8aASyW5gNgVmSkWd0Fz14vWiVlS/pTQnh8Q7RbFvLq6OBGce9iLgT4xH3pS4o0QzLJnxL2X1Prp3l5Ddvlrax46njoxfIf67RLTERX5HHWG8AA1hsTuMXUrnOnulb5VEtrv+PHlENdH3rH3JhjraRdP5ol0UQzyb7SED6DuTSncVC0pxn2h7JRYKW7f2mDOPVTvNwtMr8XJyNnIEOPa4I3uF4PIqpwQ25nftFoffGzTmbX87mIizDGEg9FoYWb4aPnSTlW7wWaZsJp+QENtnTvAgElD/8loydRIgXhRZSDjSne0tIYPs7h5bkLgCcvonfmlUyQ5Abu9W7+IQU8O9aQ== 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)(136003)(346002)(39860400002)(376002)(366004)(396003)(966005)(54906003)(2906002)(478600001)(86362001)(7696005)(55016002)(110136005)(83380400001)(71200400001)(316002)(9686003)(64756008)(52536014)(66556008)(53546011)(4326008)(8936002)(33656002)(5660300002)(6506007)(66946007)(26005)(186003)(76116006)(66446008)(66476007)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: XtqLxeK5RqZlShzQsObCKi/Jpd9AxyzAbIN/ggb6C2L6cxvGZ7XmUUy6wVAfssZTAVU//GXATP3Hfy/fnp559b3hJrtxday2kbqg0mECKUBqERumvbBhCPJvUjfq2f8XKhK+8Qe1fbPls/r483/KgpejVtTqLGwtdg3xjV7zWywchCOg2tT9mO/lVKlalkZA3pk1+nWD6X3YnqcsnWhaS07XzPSTvBoCMURXmDMSd9HyWkeaeFPm2sa1Ks80+69/ku4vIdHz7ZLC8Y/b0Q6d/jjty28HDxnUvseUVZVc8HczvEWPCADXjEqKH2qWVj0hLuHJwdv8ONAu0XL8QU7Znr+KbpKX8FwNjGZE1HgtAcBMmaTNIu3GhpzRgR/4nP1Ne6XYzKrO74jJD13aqDfAg/ThTAdMALawvk8pq9g+TGqEvQewarx8/qTTYKRo62wr6zmaSwVNtb9kPmOeLnIJw3ipLKKYs6YHRY3IzyZSnUFeAMG5B9Nz+U5RNQ4WP5y3DDCUiKoLJvU6vYRk/9UbRq+6mNPG0Og7iZRNS788G6YtMqyf2nJUzGalQ2RIeGn927ydz8wxK3vVNpMFmSp7ixFNpv81ghj/YOeXHYtY9mjTslWPqAiKPX9VqXpv5lmW1zHcRYv0ifwVLoHvHkMZgQ== 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: 667fb3a3-7d8f-4eb2-ca86-08d83e89e5fb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Aug 2020 06:35:26.1871 (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: iwmqio/ZPxF+0lhMMpWEdsVyQidjITC4o1KkqQu+rNtgcEu6kM5oSx1jbj3UtU78VYDa3XIwOoV28MB5C+/lSw== 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: 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: [PATCH V2 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA > size in child hander >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2843 >=20 > PartitionInstallChildHandle's parameters Start and End is counted by the > BlockSize, but in the implementation it uses the parent device's BlockSiz= e to > calculate the new Start, End and LastBlock. > It would cause the driver report incorrect block scope and the file syste= m > would fail to be found with right block scope. > So correct it to the right value. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Gary Lin > Cc: Andrew Fish > Signed-off-by: Zhichao Gao > Reviewed-by: Ray Ni > --- > MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > index 473e091320..f10ce7c65b 100644 > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > @@ -1149,8 +1149,8 @@ PartitionInstallChildHandle ( >=20 > Private->Signature =3D PARTITION_PRIVATE_DATA_SIGNATURE; >=20 > - Private->Start =3D MultU64x32 (Start, ParentBlockIo->Media- > >BlockSize); > - Private->End =3D MultU64x32 (End + 1, ParentBlockIo->Medi= a- > >BlockSize); > + Private->Start =3D MultU64x32 (Start, BlockSize); > + Private->End =3D MultU64x32 (End + 1, BlockSize); For function PartitionInstallChildHandle(), the input parameters 'Start' an= d 'End' (which denote the block index) should be of unit indicated by the inp= ut parameter 'BlockSize'. I checked all the callers of PartitionInstallChildHandle(), it looks to me = that GPT, MBR and UDF follow the above rule. While I am not able to get a straig= ht- forward match for the El Torito case. It seems fine with me, but I am not s= ure. Anyway, if the CDROM content can be properly identified then I think the ch= ange will be good. Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > Private->BlockSize =3D BlockSize; > Private->ParentBlockIo =3D ParentBlockIo; > @@ -1187,13 +1187,7 @@ PartitionInstallChildHandle ( >=20 > Private->Media.IoAlign =3D 0; > Private->Media.LogicalPartition =3D TRUE; > - Private->Media.LastBlock =3D DivU64x32 ( > - MultU64x32 ( > - End - Start + 1, > - ParentBlockIo->Media->BlockSize > - ), > - BlockSize > - ) - 1; > + Private->Media.LastBlock =3D End - Start; >=20 > Private->Media.BlockSize =3D (UINT32) BlockSize; >=20 > -- > 2.21.0.windows.1