From nobody Sat May 4 04:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64024+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64024+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1597195291; cv=none; d=zohomail.com; s=zohoarc; b=WmLC4s/Vuql2bgUV0lYHoGTh+Kidy/Yln/AHHuh/C+KpsNa+A7/AZ72KrHiiuF0uKLGNDf3yM76K6kfaYXTQWAJMZIK0finO6dy1x1BAiJAiKVVXWgO5zb1y+X/m08M4QDf65kGBviAN7hoIN0Nwd6CLFZeDkkGhcdctYhzd1GU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597195291; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Es7pFlWBrD0OtazbiGJTrO8C8aQpmKCy5eMAJ6K36Js=; b=CD8AtzBroWyhnmqnu44skzXnq9+g1wZ1Zt0vyBS3NUybv/JvmT4jcuI7s0nHOfD6s5S4MfVI7DrPdVi9j7WqxrnvkTtUeXtsgqgv1Rc37fcbXipe1JwcFw63hL+7My3NabFMammLT6MRR+IAadpwNNEb+vrTSg0Qs4t3EDsM0qk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64024+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597195291989320.9990287001415; Tue, 11 Aug 2020 18:21:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ICQdYY1788612xM9v7fUF3ah; Tue, 11 Aug 2020 18:21:31 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.6027.1597195289387869314 for ; Tue, 11 Aug 2020 18:21:30 -0700 IronPort-SDR: F7xTnFyppBFHma/HXyFw4dUp7TkMhp30lSV/rbaaB2iqc31dXCnt5bNQnRe/0lHoRM+VXpuOhC /CgzBbeqkmng== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="171908215" X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="171908215" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 18:21:29 -0700 IronPort-SDR: GeuoxCPjaSU/i7d3bcJyJ3pTRRbXJRCeT9V96cw0/Z239YDxgC/LBgJpOEyLWsvkmCahTGd4kB fF3CHiEPL3Dg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="494868724" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.153.108]) by fmsmga006.fm.intel.com with ESMTP; 11 Aug 2020 18:21:28 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Gary Lin , Andrew Fish Subject: [edk2-devel] [PATCH V2 1/3] MdeModulePkg/PartitionDxe: Put the UDF check ahead of MBR Date: Wed, 12 Aug 2020 09:21:22 +0800 Message-Id: <20200812012124.18220-2-zhichao.gao@intel.com> In-Reply-To: <20200812012124.18220-1-zhichao.gao@intel.com> References: <20200812012124.18220-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: aygJl3So6CnXrmx4dGxBF2kXx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597195291; bh=V50Q062VMbgndbiUEZ3gYYEM8pGKePD0rnRBpnPWxQk=; h=Cc:Date:From:Reply-To:Subject:To; b=cSmKkTTVwaALNYACf7pn+yltPW1Rk3pm1ZHGvhpFXndb7EAUWrOzp/4cdqBvo6IQbK6 TtHVk5npI37ucUBaRWPcJr1vRW9KJZVV35i6fWg2+Q9c3urT0eSc5Dfbf3FVhWYL6/7cl 2MVrppwOLGzVXEjuF8bXnMbkpmWCsHGSLZE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 Refer to UEFI spec 2.8, Section 13.3.2, a block device should be scanned as below order: 1. GPT 2. ISO 9660 (El Torito) (UDF should aslo be here) 3. MBR 4. no partition found Note: UDF is using the same boot method as CD, so put it in the same priority with ISO 9660. This would also solve the issue that ISO image with MBR would be treat as MBR device instead of CD/DVD. That would make the behavior of the image boot different: If the CD/DVD's MBR be handled correctly, it would be enumerated as a bootable device with MBR path and FAT filesystem. Some Linux Distributions boot from such path (FAT with MBR path for ISO) would come into the grub console instead of the installation selection. With this change, the CD/DVD would always be enumerated with CD path. And it would always boot to the installation selection. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Gary Lin Cc: Andrew Fish Signed-off-by: Zhichao Gao Reviewed-by: Hao A Wu Reviewed-by: Ray Ni Tested-by: Gary Lin --- MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModu= lePkg/Universal/Disk/PartitionDxe/Partition.c index 6a43c3cafb..473e091320 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -35,11 +35,19 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding =3D= { =20 // // Prioritized function list to detect partition table. +// Refer to UEFI Spec 13.3.2 Partition Discovery, the block device +// should be scanned in below order: +// 1. GPT +// 2. ISO 9660 (El Torito) (or UDF) +// 3. MBR +// 4. no partiton found +// Note: UDF is using a same method as booting from CD-ROM, so put it along +// with CD-ROM check. // PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] =3D { PartitionInstallGptChildHandles, - PartitionInstallMbrChildHandles, PartitionInstallUdfChildHandles, + PartitionInstallMbrChildHandles, NULL }; =20 --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64024): https://edk2.groups.io/g/devel/message/64024 Mute This Topic: https://groups.io/mt/76139479/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 4 04:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64025+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64025+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1597195293; cv=none; d=zohomail.com; s=zohoarc; b=dCOYzLVUior1JZZBgWK5ILZpRCAcciZimi5EWx0jtLCG5A8o3OJ1bQaLrg91jlyOcMMjZ2Vw77HcX5MEVCKbK9W60t058dGVFjrMRyhDNZZORl9bd9sKia9JKQFoUaf/N3ODBv14FtvvC+jsBudAWcjPO5VUrel2yBFCdzD1fhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597195293; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IBCMXSZbyzQodMrepjJS4aSCuAebBlpgi1/7m+FttCI=; b=ESAZ3pv1Z98U/8gu+fFEIkh6i/B9NDhm48+paE5E603DhSM0T8LbvFRiE/0V7N8Zv5e8Cx9Wc9SJwwQsaLPvqTFY0o6+Sjxg+IzJkdf5/ADqv64Go6xT1XobPxZiO8WDlDw3s5Y2QdbjJyA+5T7Sx7qUPLvNHIwMFdF4TGjfBoA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64025+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15971952935381021.9153085944853; Tue, 11 Aug 2020 18:21:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NdckYY1788612x3oJXdndV1Y; Tue, 11 Aug 2020 18:21:32 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.6027.1597195289387869314 for ; Tue, 11 Aug 2020 18:21:31 -0700 IronPort-SDR: Z+2ZaVlqhmhDV0lOzsuJ1+R6lbW53YXzjP+esB3GC036fSGynlfsrupGAPOf+AkiAlCAoWvows baff9si/TNww== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="171908232" X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="171908232" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 18:21:31 -0700 IronPort-SDR: gIAnRgABSHBDrH9KzEQAI4tkOngkV+ntFWbdUciC3a08rRUqDjBiOeBfROmDIDiSE36Z0utnzp MsyJM9m24Czw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="494868732" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.153.108]) by fmsmga006.fm.intel.com with ESMTP; 11 Aug 2020 18:21:30 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Gary Lin , Andrew Fish Subject: [edk2-devel] [PATCH V2 2/3] MdeModulePkg/PartitionDxe: Revert changes for the special MBR Date: Wed, 12 Aug 2020 09:21:23 +0800 Message-Id: <20200812012124.18220-3-zhichao.gao@intel.com> In-Reply-To: <20200812012124.18220-1-zhichao.gao@intel.com> References: <20200812012124.18220-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: C9ttjDW9oaZKd9zr90woTAekx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597195292; bh=1FxebC3aIybav133opE420Vko3GCussH32Ry8ysRWmM=; h=Cc:Date:From:Reply-To:Subject:To; b=BPPWJb5crUKw6/nbHI4XMxSPk+CyKpwu7F0dxeg1vTouZURzCPyiuJkNM6Kp6WJfCys uE2fYXfBL/i0TExyT1ADq36bz9ZPPCHc9OI1RgBp5lG6J/vJFE/kzBgl4K6bouNlXnDBt VlKe7c8GNMVLETinsy0FjoYFrNCkuHDb3P8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 Revert "MdeModulePkg/PartitionDxe: Skip the MBR that add for CD-ROM" Follow the spec definition, the ISO 9660 (and UDF) would be checked before the MBR. So it is not required to skip such MBR talbe that contian the entire block device. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Gary Lin Cc: Andrew Fish Signed-off-by: Zhichao Gao Reviewed-by: Hao A Wu Reviewed-by: Ray Ni Tested-by: Gary Lin --- .../Universal/Disk/PartitionDxe/Mbr.c | 37 +++---------------- 1 file changed, 6 insertions(+), 31 deletions(-) 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. star= t 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/mkud= ffs.8.html - // "WHOLE DISK VS PARTITION" - // Some linux ISOs may put the MBR table in the first 512 bytes for = compatibility reasons with Windows. - // Linux kernel ignores MBR table if contains partition which star= ts at sector 0. - // Skip it because we don't have the partition check for UDF(El Tori= to compatible). - // It would continue to do the whole disk check in the UDF routine. - // - DEBUG ((DEBUG_INFO, "PartitionValidMbr: MBR table has partition entr= y 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 (M= br->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].Si= zeInLBA) - 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_UINT32 = (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].StartingLBA) = + UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA) - 1; + if (NewEndingLBA >=3D StartingLBA && UNPACK_UINT32 (Mbr->Partition[I= ndex2].StartingLBA) <=3D EndingLBA) { // // This region overlaps with the Index1'th region // --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64025): https://edk2.groups.io/g/devel/message/64025 Mute This Topic: https://groups.io/mt/76139483/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 4 04:27:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+64026+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64026+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1597195295; cv=none; d=zohomail.com; s=zohoarc; b=UMIdp7t7ZpiInTURai4eOfRDv9SgMfToRS+JdAGN8vCPHcrcynve5+vockFZCknYq6Blb6HY8QP7QZ+QYZVO9yRkN+smSSyU8nWzSw44IMpts5oxblE6pmR2FezymLg/cmOre6mHDIEByFA6KGWBuSGwszqXaLUU40RIdN28fow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597195295; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ANsZbv2Idnx+u3ICbWwD3aLac608GP3j0C+KYEu9WQo=; b=GjhMDivZ4KDF7l5J0qqGiDUp5U24N3UB5ToV/2dyawcwvmAoWSGQlZS7sEMaukEkLf9DH/7s7hILn1XrfR8GQUKod+sA5hSatHb4UV9/n0dXUJaPJLNQmLWGZB0kFroW5JPryXTAp8jvph+6epW+KJcYlgNctkSi6SmpZdylXnY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+64026+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1597195295881685.8369990500632; Tue, 11 Aug 2020 18:21:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Y6IIYY1788612xFHyws7aipX; Tue, 11 Aug 2020 18:21:35 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.6027.1597195289387869314 for ; Tue, 11 Aug 2020 18:21:33 -0700 IronPort-SDR: 6uC5twzN9mQKaZkAgv4N2jkvi2cBIcgZGhNAeO3f/S/LDFEkXp933M/wzbrUyMlDJhh/2fQgZ9 q0yEtiwA039g== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="171908241" X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="171908241" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 18:21:33 -0700 IronPort-SDR: MBJoWGP27o6a4j2RRHm7S7HP8LSOhgBLRPG6LLiQDSShnRx2mMuiUblvxgsQEI+l0C9BUaUvZc ljee5Yg3epbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,302,1592895600"; d="scan'208";a="494868752" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.153.108]) by fmsmga006.fm.intel.com with ESMTP; 11 Aug 2020 18:21:31 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Gary Lin , Andrew Fish Subject: [edk2-devel] [PATCH V2 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander Date: Wed, 12 Aug 2020 09:21:24 +0800 Message-Id: <20200812012124.18220-4-zhichao.gao@intel.com> In-Reply-To: <20200812012124.18220-1-zhichao.gao@intel.com> References: <20200812012124.18220-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: dga5usucHU2nZMGXdGO4hkZxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1597195295; bh=iIzRA4ntD8EWJ5CWYurBjJKVXGNQboiUBfjx3iX3YOQ=; h=Cc:Date:From:Reply-To:Subject:To; b=BzIVmOKEqZA0gtT1neb1XLfgyjtCe/zpu4hnc+491p+QAj8W2OaJGWBArRT2HhFxzN3 GKpaQhbRK8iixVx9k3JQ069B2yKyzNW3XS6UvuDQqCUBX1QMzabU5RMT3DGi7rHsXTh8e N6it4pxDQZm6EkyT51x/vJ9tDnDMJX0Jxwc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2843 PartitionInstallChildHandle's parameters Start and End is counted by the BlockSize, but in the implementation it uses the parent device's BlockSize to calculate the new Start, End and LastBlock. It would cause the driver report incorrect block scope and the file system would fail to be found with right block scope. So correct it to the right value. 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 Reviewed-by: Hao A Wu Tested-by: Gary Lin --- MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModu= lePkg/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->B= lockSize); - Private->End =3D MultU64x32 (End + 1, ParentBlockIo->Media-= >BlockSize); + Private->Start =3D MultU64x32 (Start, BlockSize); + Private->End =3D MultU64x32 (End + 1, BlockSize); =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 --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#64026): https://edk2.groups.io/g/devel/message/64026 Mute This Topic: https://groups.io/mt/76139484/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-