From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, ngompa13@gmail.com
Cc: Neal Gompa <ngompa@fedoraproject.org>,
Chris Murphy <chrismurphy@fedoraproject.org>,
David Duncan <davdunc@amazon.com>, Hao A Wu <hao.a.wu@intel.com>,
Ray Ni <ray.ni@intel.com>, Zhichao Gao <zhichao.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI spec
Date: Mon, 5 Jul 2021 11:59:55 +0200 [thread overview]
Message-ID: <4bf2269b-51ab-9616-b83f-7643fa23b9c4@redhat.com> (raw)
In-Reply-To: <20210705093603.575707-1-ngompa@fedoraproject.org>
On 07/05/21 11:36, Neal Gompa wrote:
> 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=3474
>
> Cc: Chris Murphy <chrismurphy@fedoraproject.org>
> Cc: David Duncan <davdunc@amazon.com>
> Cc: Lazlo Ersek <lersek@redhat.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
>
> Signed-off-by: Neal Gompa <ngompa@fedoraproject.org>
> ---
> 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 = 0; Index < MAX_MBR_PARTITIONS; Index++) {
> - if (ProtectiveMbr->Partition[Index].BootIndicator == 0x00 &&
> - ProtectiveMbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION &&
> + if (ProtectiveMbr->Partition[Index].OSIndicator == PMBR_GPT_PARTITION &&
> UNPACK_UINT32 (ProtectiveMbr->Partition[Index].StartingLBA) == 1
> ) {
> break;
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks
Laszlo
next prev parent reply other threads:[~2021-07-05 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 9:36 [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI spec Neal Gompa
2021-07-05 9:59 ` Laszlo Ersek [this message]
2021-07-06 1:36 ` Wu, Hao A
2021-07-06 7:36 ` [edk2-devel] " Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4bf2269b-51ab-9616-b83f-7643fa23b9c4@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox