From nobody Fri May 17 19:24:58 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+107170+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+107170+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1690203630213713.9803084735377; Mon, 24 Jul 2023 06:00:30 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Ldn6w9RnaYS89uvS+DWZ5EA4A2qk1Wt1W2gKmxCS00A=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:ARC-Message-Signature:ARC-Authentication-Results:ARC-Seal:X-Received:From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690203629; v=1; b=J+WgdYA45ijxwnwNYv6Y8rSbjDox+ug//9tdZRdcBopDRu6vNu05XnQalm3t0Gj3B6XGXba3 zDt2dXk0BWQb55Fa/o0IXrqSOaHl/0AQp/jOXha51Syf6glY8i7hOBQACnBPnbJ4DY9370Wf9Ky 6jkbLKtEMWxSz4D3hwv8CyRA= X-Received: by 127.0.0.2 with SMTP id CfRfYY1788612xGjX0L4kdWr; Mon, 24 Jul 2023 06:00:29 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web10.46010.1690203629099870127 for ; Mon, 24 Jul 2023 06:00:29 -0700 X-Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4R8gHw3Rsfz3tDV; Mon, 24 Jul 2023 13:00:28 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R8gHw2kh3z3rw3; Mon, 24 Jul 2023 13:00:28 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690203628; 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=zY8CEgvls6eGwfVZM5ahz168ZjO+Ah9m10IXGNAsoPc=; b=wI6R6tlN85JUVctvfkdDPFu9lJKtLvqNlvvKqkNP9dr/BD2XfgcTvH2RR1VNGhPxvMFiMt nlXpG9odfB8ZzB9LCpgI6wNM9xLAYQZ1UDSwQ3ky/PY1CelJOqN+ILeqiZPwhBMHEUQ1WQ 6VqHBP7UekzmIwd8EfXvyw1K54Nv1UJC/qI24hi5g2pQt8wuXTVU3b+RngA/dJDVI4/BNd JfgQYACTxZX9CtDvRiz9rcjG8XlBZ8o3yEy6t2X/Ev5VRWpEj9tltVPuFHRanZoNNlt7K7 ys/QSv/HxgnG/vWP4wdsh38SiJmAHRlDMxvJeHs2ATzIgW3VKxaM0efN3LTmCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690203628; a=rsa-sha256; cv=none; b=o+MCnq09bdZEN4+rjWSpJz+Xz2wJnqowpa0p3u16mbtybSFjPEsWx/R6F9+6izkrAMKVEZ YgC9TfDkxDdnV6Zak9nTD1dMFJMGTvlVAedSARf7IdJtYld6yj7vIe2dp2l86GQeLFTkR3 yPfgdOcd+r4BjBW7vxMNf7sCQ0TyYGjU1ukgDAToHigKk0a1W9Y5sgrj5x96oWbOZcG47E ZEdGl1OwCn2cbwre87e5899eRqUPi0GXuPSfBzxjYTOKOzURPoaKjAgayYlO8y8y9hQKlV ouqWMKdpua9bFpW/hWc5wH2aiA/Mf4XFpkadGRGjIoG8LKftVMj9nNGgbSzkpQ== X-Received: from corvink-nb.beckhoff.com (unknown [195.226.174.194]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R8gHv2Zl2z1N55; Mon, 24 Jul 2023 13:00:27 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Rebecca Cran , Peter Grehan Subject: [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: build platform info HOB Date: Mon, 24 Jul 2023 14:59:33 +0200 Message-ID: <20230724130006.427522-2-corvink@FreeBSD.org> In-Reply-To: <20230724130006.427522-1-corvink@FreeBSD.org> References: <20230724130006.427522-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk 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,corvink@FreeBSD.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: UTpsYYiSvqdggTyykgx4PF45x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690203640755100004 Content-Type: text/plain; charset="utf-8" Copy the function BuildPlatformInfoHob() from OvmfPkg/PlatformPei. QemuFwCfgLib expect this HOB to be present, or fails to do anything. InternalQemuFwCfgIsAvailable() from QemuFwCfgPeiLib module will not check if the HOB is actually present for example and try to use a NULL pointer. Fixes: cda98df16228970dcf9a4ce2af5368219711b4b0 ("OvmfPkg/QemuFwCfgLib: rem= ove mQemuFwCfgSupported + mQemuFwCfgDmaSupported") Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Rebecca Cran Cc: Peter Grehan Reviewed-by: Rebecca Cran --- OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/Bhyve/PlatformPei/Platform.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf b/OvmfPkg/Bhyve/Plat= formPei/PlatformPei.inf index 739d63098b1e..07570d4e30ca 100644 --- a/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/Bhyve/PlatformPei/PlatformPei.inf @@ -44,6 +44,7 @@ [Packages] =20 [Guids] gEfiMemoryTypeInformationGuid + gUefiOvmfPkgPlatformInfoGuid =20 [LibraryClasses] BaseLib diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformP= ei/Platform.c index 5bfe435327c1..bdfc1614d284 100644 --- a/OvmfPkg/Bhyve/PlatformPei/Platform.c +++ b/OvmfPkg/Bhyve/PlatformPei/Platform.c @@ -17,6 +17,7 @@ // // The Library classes this module consumes // +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -534,6 +536,23 @@ MaxCpuCountInitialization ( )); } =20 +/** + * @brief Builds PlatformInfo Hob + */ +EFI_HOB_PLATFORM_INFO * +BuildPlatformInfoHob ( + VOID + ) +{ + EFI_HOB_PLATFORM_INFO PlatformInfoHob; + EFI_HOB_GUID_TYPE *GuidHob; + + ZeroMem (&PlatformInfoHob, sizeof PlatformInfoHob); + BuildGuidDataHob (&gUefiOvmfPkgPlatformInfoGuid, &PlatformInfoHob, sizeo= f (EFI_HOB_PLATFORM_INFO)); + GuidHob =3D GetFirstGuidHob (&gUefiOvmfPkgPlatformInfoGuid); + return (EFI_HOB_PLATFORM_INFO *)GET_GUID_HOB_DATA (GuidHob); +} + /** Perform Platform PEI initialization. =20 @@ -551,6 +570,7 @@ InitializePlatform ( ) { DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); + BuildPlatformInfoHob(); =20 // // Initialize Local APIC Timer hardware and disable Local APIC Timer --=20 2.41.0 -=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 (#107170): https://edk2.groups.io/g/devel/message/107170 Mute This Topic: https://groups.io/mt/100327419/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-