From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web09.2199.1583442917030650833 for ; Thu, 05 Mar 2020 13:15:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RqNG57yI; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583442916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8MdMBceigCTcN3DEMfhmRvkypBILGKDxoFnc/cgZ5VQ=; b=RqNG57yIQAvE94ECAslpttgP5XOc+cnxXoOb6G9kFP9n2keXvmlnupg4zT83imBhKe7RxT bDX9UgJsxJo98P6YvvbLd7LSdJQU+qdbnm+wk8xZmcgzwx7Nh+PLc6mcuO27qy6SBOumHA NhnNmmvMlrvSxJJkGEImzxxgMLHvMyo= 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-3-Z7BF6n3IO9Kie3vQscX5yQ-1; Thu, 05 Mar 2020 16:15:11 -0500 X-MC-Unique: Z7BF6n3IO9Kie3vQscX5yQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A66D4801E66; Thu, 5 Mar 2020 21:15:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-216.ams2.redhat.com [10.36.117.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAD0B60C99; Thu, 5 Mar 2020 21:15:09 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v3 12/14] OvmfPkg/PlatformBootManagerLib: switch to QemuLoadImageLib To: devel@edk2.groups.io, ard.biesheuvel@linaro.org References: <20200305134607.20125-1-ard.biesheuvel@linaro.org> <20200305134607.20125-13-ard.biesheuvel@linaro.org> From: "Laszlo Ersek" Message-ID: <5c7e3e2d-d47c-200a-f489-569abec4547d@redhat.com> Date: Thu, 5 Mar 2020 22:15:09 +0100 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: <20200305134607.20125-13-ard.biesheuvel@linaro.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Hi Ard, On 03/05/20 14:46, Ard Biesheuvel wrote: > Replace the open coded sequence to load Linux on x86 with a short and > generic sequence invoking QemuLoadImageLib, which can be provided by > a generic version that only supports the LoadImage and StartImage boot > services, and one that incorporates the entire legacy loading sequence > as well. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2566 > Signed-off-by: Ard Biesheuvel > Reviewed-by: Laszlo Ersek > --- > OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 2 +- > OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c | 144 ++------------------ > 2 files changed, 14 insertions(+), 132 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > index c479f113b92b..e470b9a6a3e5 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > @@ -49,7 +49,7 @@ [LibraryClasses] > NvVarsFileLib > QemuFwCfgLib > QemuFwCfgS3Lib > - LoadLinuxLib > + QemuLoadImageLib > QemuBootOrderLib > ReportStatusCodeLib > UefiLib This hunk (in commit 859b55443a42) seems to break the OvmfXen platform build: Active Platform = OvmfPkg/OvmfXen.dsc build.py... OvmfPkg/OvmfXen.dsc(...): error 4000: Instance of library class [QemuLoadImageLib] is not found in [OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf] [X64] consumed by module [MdeModulePkg/Universal/BdsDxe/BdsDxe.inf] Can you please send a patch? I think resolving the lib class to the generic instance suffices. gBS->LoadImage() will return EFI_NOT_FOUND from QemuLoadKernelImage(), because OvmfPkg/QemuKernelLoaderFsDxe is not included in the Xen platform. An alternative fix that's larger in source code, but lighter in binary code, would be to add a Null instance of QemuLoadImageLib, and use that in the Xen platform. For the future, please include OvmfXen.dsc in your build / CI scripts. Thanks! Laszlo