From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web12.3046.1589365421239232243 for ; Wed, 13 May 2020 03:23:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P1TTKxmh; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589365420; 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=wP4yYNvDGRBXQo8WhlJRBf2Tz+adtKb+ouncbru9fE0=; b=P1TTKxmha7q0Rs4mZekS9fljIk5AqXqKPiiEL4AOrt5IimZfOgBseupeUv/N6jW2gXOpeB 9MNG4t9F6bVUGkQXssc2zSm++JeKYU1gvReD8hKXgMDT4s1JMRt5qsBeWltKBCyS6cyKWX cuUedKJFzS3G9PGZQjaGICOxogemsBk= 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-68-_kZEOSbLPw2EPmVMm4RpIQ-1; Wed, 13 May 2020 06:23:39 -0400 X-MC-Unique: _kZEOSbLPw2EPmVMm4RpIQ-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 A40B6460; Wed, 13 May 2020 10:23:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-95.ams2.redhat.com [10.36.115.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F60F100239A; Wed, 13 May 2020 10:23:34 +0000 (UTC) Subject: Re: [PATCH] OvmfPkg: Skip initrd command on Xcode toolchain To: Roman Bolshakov , devel@edk2.groups.io Cc: Cameron Esfahani , LAHAYE Olivier , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Ard Biesheuvel , Liming Gao , Andrew Fish References: <20200512205832.17032-1-r.bolshakov@yadro.com> From: "Laszlo Ersek" Message-ID: <54530251-0d9a-7be7-b51c-361a95a658e3@redhat.com> Date: Wed, 13 May 2020 12:23:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200512205832.17032-1-r.bolshakov@yadro.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/12/20 22:58, Roman Bolshakov wrote: > OVMF booting stops with the assert if built with Xcode on macOS: > > Loading driver at 0x0001FAB8000 EntryPoint=0x0001FABF249 LinuxInitrdDynamicShellCommand.efi > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF 1F218398 > ProtectUefiImageCommon - 0x1F218140 > - 0x000000001FAB8000 - 0x0000000000008A60 > > ASSERT_EFI_ERROR (Status = Unsupported) > ASSERT LinuxInitrdDynamicShellCommand.c(378): !EFI_ERROR (Status) > > The assert comes from InitializeHiiPackage() after an attempt to > retrieve HII package list from ImageHandle. > > Xcode still doesn't support HII resource section and > LinuxInitrdDynamicShellCommand depends on it. Likewise 277a3958d93a > ("OvmfPkg: Don't include TftpDynamicCommand in XCODE5 tool chain"), > disable initrd command if built with Xcode toolchain > > Fixes: 2632178bc683 ("OvmfPkg: add 'initrd' shell command to expose Linux initrd via device path") > Cc: Ard Biesheuvel > Cc: Liming Gao > Cc: Andrew Fish > Cc: Laszlo Ersek > Signed-off-by: Roman Bolshakov > --- > OvmfPkg/OvmfPkgIa32.fdf | 2 +- > OvmfPkg/OvmfPkgX64.fdf | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Thanks for the patch! The reference to commit 277a3958d93a is very welcome. (1) However, this patch doesn't follow commit 277a3958d93a closely enough. The present patch only conditionalizes some FDF files. We should conditionalize the DSC files too, otherwise we're still going to build LinuxInitrdDynamicShellCommand, just not include it in the firmware. (2) The "Fixes:" reference is incorrect. Technically, the issue (for XCODE5) was introduced in the commit that modified the FDF file(s). Therefore, based on "git-blame", we should have Fixes: ec41733cfd10 Now, if you look at that commit -- i.e., "OvmfPkg: add the 'initrd' dynamic shell command" --, then not only will you find the parts in the DSC files that are necessary to gate (per my point (1) above), you'll also notice my next point: (3) The present patch only covers 2 out of the 4 OvmfPkg platforms; namely, "OvmfPkgIa32X64" and "OvmfXen" are missed. Please extend the patch to those platforms as well. In total, the patch should modify 8 files: OvmfPkg/OvmfPkgIa32.dsc OvmfPkg/OvmfPkgIa32.fdf OvmfPkg/OvmfPkgIa32X64.dsc OvmfPkg/OvmfPkgIa32X64.fdf OvmfPkg/OvmfPkgX64.dsc OvmfPkg/OvmfPkgX64.fdf OvmfPkg/OvmfXen.dsc OvmfPkg/OvmfXen.fdf because they all reference "OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf". Thanks! Laszlo > > diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf > index fd81b6fa8b..e2b759aa8d 100644 > --- a/OvmfPkg/OvmfPkgIa32.fdf > +++ b/OvmfPkg/OvmfPkgIa32.fdf > @@ -290,8 +290,8 @@ INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf > > !if $(TOOL_CHAIN_TAG) != "XCODE5" > INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf > -!endif > INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf > +!endif > INF ShellPkg/Application/Shell/Shell.inf > > INF MdeModulePkg/Logo/LogoDxe.inf > diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf > index f71134a659..bfca1eff9e 100644 > --- a/OvmfPkg/OvmfPkgX64.fdf > +++ b/OvmfPkg/OvmfPkgX64.fdf > @@ -291,8 +291,8 @@ INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf > > !if $(TOOL_CHAIN_TAG) != "XCODE5" > INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf > -!endif > INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf > +!endif > INF ShellPkg/Application/Shell/Shell.inf > > INF MdeModulePkg/Logo/LogoDxe.inf >