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.web12.14404.1594624788974336293 for ; Mon, 13 Jul 2020 00:19:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=KG5G0dAT; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zhichao.gao@intel.com) IronPort-SDR: UbNldmoc3N2v6R4znKzZwEh3PbM/pKEXsMYFKsz7g9/fKTeFuBbWTojj4ZR6EqEpFDzGP++WbG t09IFaXgZemg== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="136738972" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="136738972" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 00:19:47 -0700 IronPort-SDR: jnIeMfL3f2ng/L1Vydxgec0+JpV2+Wv3BRA7BDHfXyITjphaW4F180nklpDtEiMspXcpbp0C/U qfZopkrLLsgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="429275896" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 13 Jul 2020 00:19:44 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 00:19:44 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 00:19:44 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.177) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 00:19:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IZe0pvqwU2kVvq0WxrgyPnMs5ihT06xS+X0E0dvTfySM/EhngYTeA887z8zqGMAzekoTgDmIDNHw4w4KSAu17dC1OL30aI/2ntss1A/y4DmdzW/pa7TuWCOcoCVNNTcGGWghlLU+s+bfa93EYL82hEv9Z3b3TkZc5V0E0HCY5wF9Z601/ISbWIWBY5OZpFOLZHcN/RJ/tTGyZCYjG1x03v/rnU475QhXQBQWF//wsyFcsODzshXZ1sjcfeQW1vRnEenS/eqKl19VhZHR+7r8wBjf2kpAzhfpR6WuF4U3xEq0eekM202VmnmNhsRoUASl7guMrbWLlTj7S0NgPjpjYw== 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=S4D4Is3B2Fg7xQUKng9on4pNW+YA7pldrtLT2KT/Bbo=; b=M1JQn4BfWxtySPdGl/3lh/JkF1dD7GkBhSzZaaDslUiopY+JZHoXhAdMkMwmVWBT9Aa4gTFLbV4FqtZCqgDXjFGNbnmegEhc8RLzj9nPdnkJRhI6EzR4PbwCuCzrkhK6wz7LfWeY0zrP9AZpmARigSHDvi46FImitCZUrAKv2vzd1yoA0u/ML7wDJkI5K6funJknpW8jA4kZy8yjmOjkUsG7ZOycciZe8Qrz//6aKLSE5twsK/iyFipGYt4aqRMwXLjIT1M/fc6v3tATUsokDddmS73aCK/piwXluDFz8Do6KpvZpwGCbpI2upbXs8a9A1Rf6XER7KOs/ytQJ65MQA== 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=S4D4Is3B2Fg7xQUKng9on4pNW+YA7pldrtLT2KT/Bbo=; b=KG5G0dATXeisJD7l4n9DesGcFuLW8AeguStzdFNIgsjC5v65lGtu4ghH+24UbhkieSSgD1jeO+huil/LDLCRHHG4ouonvXulAGtmOkN8nl8zLkFx09jmDYgndc87iJGSGA4WoSOTzxHaKepKoJSgWycZAtHyFv8faIs6PAylUOI= Received: from DM6PR11MB4425.namprd11.prod.outlook.com (2603:10b6:5:1d9::31) by DM6PR11MB4425.namprd11.prod.outlook.com (2603:10b6:5:1d9::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Mon, 13 Jul 2020 07:19:42 +0000 Received: from DM6PR11MB4425.namprd11.prod.outlook.com ([fe80::ad34:e1fc:2e7b:d124]) by DM6PR11MB4425.namprd11.prod.outlook.com ([fe80::ad34:e1fc:2e7b:d124%3]) with mapi id 15.20.3174.025; Mon, 13 Jul 2020 07:19:42 +0000 From: "Gao, Zhichao" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Wu, Hao A" , Laszlo Ersek Subject: Re: [PATCH V2 1/3] MdeModulePkg/PartitionDxe: Correct the MBR last block value Thread-Topic: [PATCH V2 1/3] MdeModulePkg/PartitionDxe: Correct the MBR last block value Thread-Index: AQHWVM9WbaTZGZ553kmPGz46rEGz3KkFCpaAgAAXkQA= Date: Mon, 13 Jul 2020 07:19:42 +0000 Message-ID: References: <20200708022722.27024-1-zhichao.gao@intel.com> <20200708022722.27024-2-zhichao.gao@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C611468@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C611468@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 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.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 78614f1d-84d9-4084-bec5-08d826fd1ccd x-ms-traffictypediagnostic: DM6PR11MB4425: 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:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1kMMa7FfqyTCHInWKwT5fuUELcU25gSQl8n3CljqjD9dRcxLRGbPN6UHdUUJCHRuqSoNPFnGBkIE251t4pV/TyH5ELaqS/FntvZRZj0u0HFbUNXtervCLAtXI2UpHqkSWk8q8AeO+n5WWgwwBTnSqijcianHQNvfnVnN6Th8UEHKcV+OrF3BHiWnG7RS4B6PJ3CaEw6bbHhXCTTd908Nzfhotpeh40UxJhvIZtSjgIYjOPL7f3aqR3Gs1SerLVtPl5OMe6Ct+OKGI5uW/6a55+hgcS7gPqwunLiYWdOthOrgNMjVjvz3pxbuI5zU3iHCW83Rhcf7kK7DfpMM88n0qxt9Urt66r18mvaYkYY4OxkGsoBS6y/pQHoeXaWJjohGs9WNhTtKwQMtOSsGm5Xtaw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4425.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(376002)(39860400002)(346002)(396003)(136003)(71200400001)(33656002)(2906002)(4326008)(55016002)(9686003)(54906003)(8936002)(110136005)(966005)(53546011)(8676002)(478600001)(6506007)(7696005)(316002)(76116006)(186003)(26005)(66946007)(66476007)(66556008)(66446008)(64756008)(86362001)(5660300002)(83380400001)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: J4Brzt+ZtfrdhzAhLlAjt3drWMwtTZEDpso56yNlh0dWCC5bbXcV5vGXk9so9a2glIXPGRLa4M8N3YIYGK7MPA9LGlsZQsoR8Dcg/vzQZWkMdUTp+HCga+LRRhUrgCEMtkohCx+/hOILFvn7ArEv7bekbtq+8AH3Egb8JSEnA3jxffjN1jIbjb7tmLf5c8/P4WzFGKJ3QfAEIsqrhBQ0kORdIB7HTzX4Nyl5H5cRxNFLTFHSRoppqtldKk4swAnkDLqgNQjGbFXBaR5E/pLwsMEnqhpYUW3+Al1dN7387OkElqfvjVdfQHX1jRA77Gew7gaOqOoQ1V6hzNbyKkG/CIdGejD/3yh6YaQ9bcKSvsLY3OPvG4439rycQsXf5Rs8SNrfWb0+evi3zfS10S45JrjZ90BHfyXThD9zp3IbJPyNQS9nCPk3JU+UmcVhE8Z+Hp0zdHcLYNV/vcQlNB6mxlrNl7UKUVp5Qr6Sk1Gt8VAVltepx9z4Mq5hFcJ8L48s MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4425.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78614f1d-84d9-4084-bec5-08d826fd1ccd X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2020 07:19:42.4212 (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: LAJGzATs1vjep3+JiP+dQ+xGNH5X+uglpM/0hO4L8RwubOsPQ5jI5aQxO92/LRjSrSIk0bL9tSX+Er2jwEyQRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4425 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sure. I would follow the 3 suggestion in next version patch set. Thanks, Zhichao > -----Original Message----- > From: Ni, Ray > Sent: Monday, July 13, 2020 1:59 PM > To: Gao, Zhichao ; devel@edk2.groups.io > Cc: Wu, Hao A ; Laszlo Ersek > Subject: RE: [PATCH V2 1/3] MdeModulePkg/PartitionDxe: Correct the MBR la= st > block value >=20 > 1. Can you rename LastBlock to LastSector and remove the MediaSize local > variable? > 2. Can you add comments to describe that sector size is 512? > 3. Can you explain why this fix is needed in the commit message? >=20 > Thanks, > Ray >=20 >=20 >=20 > > -----Original Message----- > > From: Gao, Zhichao > > Sent: Wednesday, July 8, 2020 10:27 AM > > To: devel@edk2.groups.io > > Cc: Wu, Hao A ; Ni, Ray ; Laszlo > > Ersek > > Subject: [PATCH V2 1/3] MdeModulePkg/PartitionDxe: Correct the MBR > > last block value > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 > > > > The MBR last block value should be sector (512 bytes) numbers. > > > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Laszlo Ersek > > Signed-off-by: Zhichao Gao > > --- > > MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > > b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > > index dac451a144..aa0b6cadcc 100644 > > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c > > @@ -137,12 +137,14 @@ PartitionInstallMbrChildHandles ( > > UINT32 MediaId; > > EFI_LBA LastBlock; > > EFI_PARTITION_INFO_PROTOCOL PartitionInfo; > > + UINT64 MediaSize; > > > > Found =3D EFI_NOT_FOUND; > > > > BlockSize =3D BlockIo->Media->BlockSize; > > MediaId =3D BlockIo->Media->MediaId; > > - LastBlock =3D BlockIo->Media->LastBlock; > > + MediaSize =3D MultU64x32 (BlockIo->Media->LastBlock + 1, BlockSize); > > + LastBlock =3D DivU64x32 (MediaSize, 512) - 1; > > > > // > > // Ensure the block size can hold the MBR > > -- > > 2.21.0.windows.1 >=20