From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.3106.1625557016760491783 for ; Tue, 06 Jul 2021 00:36:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=g8SzrpnY; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625557015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1Qp1uxrUJ6pem77uhxyo9xWS6IKNMLI5UuvOA+q/4cc=; b=g8SzrpnYrxvaqlMV1T8q6tZQ2E73K/ORGGJiipbUlA9YrMpwXUAViD7ro6/GlY9hMThD9e WxLuQ5+ljB4mtuNH0OHaEOijc7V5WB7dxzROO35xSxfqMVXOQuZp8rfmNeg03DFByTV4U6 MRuTpqn+QU/e35rUUluxnA7g07gVLN8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-522-34VM5rypNZawjgMIIhyh3g-1; Tue, 06 Jul 2021 03:36:52 -0400 X-MC-Unique: 34VM5rypNZawjgMIIhyh3g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65777362FA; Tue, 6 Jul 2021 07:36:51 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-54.ams2.redhat.com [10.36.113.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F32C1000324; Tue, 6 Jul 2021 07:36:47 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PartitionDxe: Ignore PMBR BootIndicator per UEFI spec To: devel@edk2.groups.io, ngompa13@gmail.com Cc: Neal Gompa , Chris Murphy , David Duncan , Hao A Wu , Ray Ni , Zhichao Gao References: <20210705093603.575707-1-ngompa@fedoraproject.org> From: "Laszlo Ersek" Message-ID: Date: Tue, 6 Jul 2021 09:36:46 +0200 MIME-Version: 1.0 In-Reply-To: <20210705093603.575707-1-ngompa@fedoraproject.org> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 > Cc: David Duncan > Cc: Lazlo Ersek > Cc: Hao A Wu > Cc: Ray Ni > Cc: Zhichao Gao > > Signed-off-by: Neal Gompa > --- > 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; > Merged as commit b3db0cb1f8d1, via . I fixed up the authorship meta-datum with "git commit --amend --author='Neal Gompa '", per BZ comment . Thanks Laszlo