From nobody Mon Feb 9 23:57:45 2026 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+82038+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+82038+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634225455; cv=none; d=zohomail.com; s=zohoarc; b=Jhi88o+c3SDyF02sXEfyTSQclC78XCC+uBrQkI1jdsFfIJEH9qicvcNji1MXP0MLPUHcZtdjW2Meq4V9x9GmzXondRjnSJfftKzaKU2PU9IWfRW8uy2qjAx8BAtla017mAIr/fxfdU59iV7E/zHxrqkln5zHh7cKuf36M6bCqs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634225455; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=be5z4XWg/MZMMfuoDJpVz0ciVVL4WBZiWg90L0Rm6x8=; b=fSIibluuhNiFQx8mkEqtnk/iBTVb80B3HwowZHeYiuufCo1eKDjAQpOO1O6e1zh/R+AjvQK6S4TMk2w178XcDxrNq8vF7ybfxX6BroJgCoJEHP85xFAwKqC4fQCqXAdadFro8GASSAluIXscYFiYkO1merOtcT9mBvv2C5ibGPw= ARC-Authentication-Results: i=1; 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+82038+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1634225455468568.897065924736; Thu, 14 Oct 2021 08:30:55 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id zmHDYY1788612x5kIZSM9Efm; Thu, 14 Oct 2021 08:30:54 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.11069.1634225453187013473 for ; Thu, 14 Oct 2021 08:30:53 -0700 X-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-479-2NpGEK2vMeaZFKf0axkAmg-1; Thu, 14 Oct 2021 11:30:46 -0400 X-MC-Unique: 2NpGEK2vMeaZFKf0axkAmg-1 X-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 078F9100C610; Thu, 14 Oct 2021 15:30:45 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1DFA60FB8; Thu, 14 Oct 2021 15:30:44 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C926218009F9; Thu, 14 Oct 2021 17:30:24 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jordan Justen , Jiewen Yao , Gerd Hoffmann Subject: [edk2-devel] [PATCH 3/5] OvmfPkg/Microvm/fdt: add empty fdt Date: Thu, 14 Oct 2021 17:30:22 +0200 Message-Id: <20211014153024.2318942-4-kraxel@redhat.com> In-Reply-To: <20211014153024.2318942-1-kraxel@redhat.com> References: <20211014153024.2318942-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: 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,kraxel@redhat.com X-Gm-Message-State: PYm4wVXVio9ZQ6e0dbO1iqPgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634225454; bh=eJXhiL/ewNhiS/p702DOaoIFqG+DVSPZWWhMBL+M0tA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=rG2/PWByryuYMvIXNigzZKq+WE6ZapFbwr9VH3AHIU0iiIUqCU3PTM+XQjbDZgHODmo TYL9eq6dgrYpGkWbcy1WqO+5hMQY64zpruGr/NmlOmBCfedoHTbM1l1VXuVh/6QaKEhl3 KMFPutAF5W8nQlbmCCd5espBl3cHPu9Dr/E= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634225457557100003 Content-Type: text/plain; charset="utf-8" FdtClient is unhappy without a device tree, so add an empty fdt which we can use in case etc/fdt is not present in fw_cfg. https://bugzilla.tianocore.org/show_bug.cgi?id=3D3689 Signed-off-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/Platform.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 3c0cdba67c83..5071389c1fb4 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -16,6 +16,7 @@ // // The Library classes this module consumes // +#include #include #include #include @@ -321,6 +322,18 @@ PciExBarInitialization ( ); } =20 +static const UINT8 EmptyFdt[] =3D { + 0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x48, + 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, +}; + VOID MicrovmInitialization ( VOID @@ -335,8 +348,9 @@ MicrovmInitialization ( =20 Status =3D QemuFwCfgFindFile ("etc/fdt", &FdtItem, &FdtSize); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg\n", __FUNCTION__= )); - return; + DEBUG ((DEBUG_INFO, "%a: no etc/fdt found in fw_cfg, using dummy\n",= __FUNCTION__)); + FdtItem =3D 0; + FdtSize =3D sizeof(EmptyFdt); } =20 FdtPages =3D EFI_SIZE_TO_PAGES (FdtSize); @@ -346,8 +360,12 @@ MicrovmInitialization ( return; } =20 - QemuFwCfgSelectItem (FdtItem); - QemuFwCfgReadBytes (FdtSize, NewBase); + if (FdtItem) { + QemuFwCfgSelectItem (FdtItem); + QemuFwCfgReadBytes (FdtSize, NewBase); + } else { + CopyMem(NewBase, EmptyFdt, FdtSize); + } =20 FdtHobData =3D BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData)); if (FdtHobData =3D=3D NULL) { --=20 2.31.1 -=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 (#82038): https://edk2.groups.io/g/devel/message/82038 Mute This Topic: https://groups.io/mt/86316755/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-