From nobody Mon May 6 23:58:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+77477+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77477+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1625478976; cv=none; d=zohomail.com; s=zohoarc; b=Ktr7Yx2q059SG1ik0pd0bpdCkNnfs8vncWZekN+ESNC+HsKe4VGnauB1pPa/Xy0Wq9g4e8pu9Hn/sDDiJNdAHhzcO+EXOJnWAzwc+Gdh56I2JYDtr3NNtBbe6Ra1PgBMboeLwcz4bzFVmycsq/awu1QaOYfBuJM3D1W8jl4m7Eg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625478976; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=ZTWy7OJJR7S6KdscH1FH2n61qfcVsrYEdaC1HxgQnwA=; b=aCgklckEdZkT8Z9OATK43PtOvGQainflftorHDv9aBakVm6S2QFhnKlCAQzZEdcazzfmcSWAPJC8cz84lsLFri1NepOoWXGo0oJxxWUxOOg4ZRber3albE3pGHKMJHaG3wZZvJhY+ItrlwtWPEK/bqcmTZTbMt3XuB/VBg5+Mpg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77477+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1625478976118996.8564015732917; Mon, 5 Jul 2021 02:56:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id CoFSYY1788612xDCIShGlm5b; Mon, 05 Jul 2021 02:56:15 -0700 X-Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by mx.groups.io with SMTP id smtpd.web12.8705.1625477796200397086 for ; Mon, 05 Jul 2021 02:36:36 -0700 X-Received: by mail-qk1-f176.google.com with SMTP id a4so8489205qkn.11 for ; Mon, 05 Jul 2021 02:36:36 -0700 (PDT) X-Gm-Message-State: jodDGS7Cozovm2y342cguqr7x1787277AA= X-Google-Smtp-Source: ABdhPJzYyic9+VBN1qraHaZQ0JMI5gokadK9GQxKyl09N1flmTRq9cE4Bi7RjAbDoi8OV6h8budTVg== X-Received: by 2002:a37:9986:: with SMTP id b128mr13430056qke.485.1625477795198; Mon, 05 Jul 2021 02:36:35 -0700 (PDT) X-Received: from Belldandy-Slimbook.datto.net (ool-18e49371.dyn.optonline.net. [24.228.147.113]) by smtp.gmail.com with ESMTPSA id c22sm3278906qtd.42.2021.07.05.02.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 02:36:34 -0700 (PDT) From: "Neal Gompa" To: devel@edk2.groups.io Cc: Neal Gompa , Chris Murphy , David Duncan , Lazlo Ersek , Hao A Wu , Ray Ni , Zhichao Gao Subject: [edk2-devel] [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI spec Date: Mon, 5 Jul 2021 05:36:03 -0400 Message-Id: <20210705093603.575707-1-ngompa@fedoraproject.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,ngompa13@gmail.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1625478975; bh=cPnaj8RTfOfSx2WAiN9pTgZbCqWO9tFqhQDj1gnNkqY=; h=Cc:Date:From:Reply-To:Subject:To; b=fqSkNEuQ4ATdh0qYCx33TQ5xJppVQRbVXlPFyi/ebUDka2K5HPdnSJ5QmeFEDK+Y4KS X3PSOvq0cWcmg/Orai5dN8LFcc7VU/BRDJMIG7SmFLZB1clqqKecysejL6FRq4FyV1iZh sWPaOYP+WWbiLRhg0NdydP5FgEYdxXIDXPE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1625478977452100005 Content-Type: text/plain; charset="utf-8" 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 The description for BootIndicator states the following: > 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. 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. 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. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3474 Cc: Chris Murphy Cc: David Duncan Cc: Lazlo Ersek Cc: Hao A Wu Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Neal Gompa Reviewed-by: Hao A Wu Reviewed-by: Laszlo Ersek --- MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 // for (Index =3D 0; Index < MAX_MBR_PARTITIONS; Index++) { - if (ProtectiveMbr->Partition[Index].BootIndicator =3D=3D 0x00 && - ProtectiveMbr->Partition[Index].OSIndicator =3D=3D PMBR_GPT_PARTIT= ION && + if (ProtectiveMbr->Partition[Index].OSIndicator =3D=3D PMBR_GPT_PARTIT= ION && UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) =3D=3D= 1 ) { break; --=20 2.31.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 (#77477): https://edk2.groups.io/g/devel/message/77477 Mute This Topic: https://groups.io/mt/83993973/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-