From nobody Sun May 5 20:33:34 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+82037+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+82037+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634225450; cv=none; d=zohomail.com; s=zohoarc; b=CTOEXBVlH0Y3SXsMTVLrmX4FXvbTcsYkGGAlFDkDNyYRZNXB53HV+16K2GkOs7qp1zmqlmRYSwVzxt7+UqKTdrlL5BEXqcHfJqqcwY7WeKMhr7LH+Tz9SBBpYGf7EHaawrZnbS5EYGmuwNhbL+DBVG9Spm9CBImN4dcZGI2joI0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634225450; 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=tt8KaEqqWHWvY5coFfxQTLsOUG34ClvrJSTmsCMjVBg=; b=nzYfG36o6ueoytUBKpYQZ7Tq1Kr6LZMoSNUWANmlpmwAbanLIFqaO/kebAwIPF3P++DxgkzU6UnH1m/FV48tc5M3lqkwcSEeTTRX+Pc8hh6o+hNGUiMpnc6MUxVMPNsVUR7JPPGKX+OpkMeRpzjG0yhjy2nUfMReaFUkHhHestQ= 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+82037+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 1634225450529689.2934966483607; Thu, 14 Oct 2021 08:30:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id V5trYY1788612xd4xytWppjw; Thu, 14 Oct 2021 08:30:50 -0700 X-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.web09.11034.1634225449171051211 for ; Thu, 14 Oct 2021 08:30:49 -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-200-EwO5VkPaPieHHddnF33FoA-1; Thu, 14 Oct 2021 11:30:44 -0400 X-MC-Unique: EwO5VkPaPieHHddnF33FoA-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 4B19B10B3942; Thu, 14 Oct 2021 15:30:43 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D50FB60E1C; Thu, 14 Oct 2021 15:30:27 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C349F180090A; 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 1/5] OvmfPkg/Microvm/fdt: add device tree support Date: Thu, 14 Oct 2021 17:30:20 +0200 Message-Id: <20211014153024.2318942-2-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: tihx5VLHpZ52QRjARjpBakDvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634225450; bh=SmriSP8XiJymBY+tCqBSGjyuSU3tRbuYn8BvVHGkPFM=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=vupwtCoS3c8ADDVdPOH8v67b09avIJSpfaNUMcHqWkq5Qn4jJOIIgRDxwXGiw+GlCF2 otbmGCn6M4QxYx7axxhaBZCI9+Rl31TMEcS9FC3oT5VycpmIWiL7V68l54wkODmK8u7fP kaE0vTHnVXdYd2uZTTuph4RV6U9Tt+as4mc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634226353766100003 Content-Type: text/plain; charset="utf-8" Add fdt parser from EmbeddedPkg (FdtLib and FdtClientDxe) to MicrovmX64. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3689 Signed-off-by: Gerd Hoffmann --- OvmfPkg/Microvm/MicrovmX64.dsc | 6 ++++++ OvmfPkg/Microvm/MicrovmX64.fdf | 2 ++ 2 files changed, 8 insertions(+) diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 617f92539518..27d2024266c2 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -232,6 +232,7 @@ [LibraryClasses.common] VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf =20 [LibraryClasses.common.SEC] QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf @@ -738,6 +739,11 @@ [Components] # MdeModulePkg/Universal/SerialDxe/SerialDxe.inf =20 + # + # device tree + # + EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf + # # SMBIOS Support # diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf index 6314014f3de7..cc8892a459ee 100644 --- a/OvmfPkg/Microvm/MicrovmX64.fdf +++ b/OvmfPkg/Microvm/MicrovmX64.fdf @@ -277,6 +277,8 @@ [FV.DXEFV] INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf =20 +INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf + !if $(TOOL_CHAIN_TAG) !=3D "XCODE5" INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf --=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 (#82037): https://edk2.groups.io/g/devel/message/82037 Mute This Topic: https://groups.io/mt/86316750/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- From nobody Sun May 5 20:33:34 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+82036+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+82036+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634225450; cv=none; d=zohomail.com; s=zohoarc; b=JdU81u++y3AbBbcz2VNAtjU3NZ26YkFFm7C1hgkJxvOzuN9qEWO0lPokAaaVj7DLWTB+3t7KST2MQ4D+C8A927hIzlQHJqCebJAIKuxTXW4ApjRiUZcqnHeaFWXgZDvtlS2Jl27fRtrpaKufxBuA8pSVX/h5usAKrqa7DmKb6t8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634225450; 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=UWrluPx0LQgXUec53qU7AOHEwOjCPaqqZfE7BAeartQ=; b=VgdkCw6FABHtCylpe0YXSGQn0unBcGpYzUkNZRHVMny0i7Z22bZ8Jh+bHl+TL9W8sHNwPF6YE1spP+Pwbn0UiiBtVUh27B6CAHaM8SISkbEKGzYh5JW0dUkKnBN8n1czOVZLk7+CFPYjdSOa5C9IwhzKmEH4hbFb4dTlQl2C9X4= 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+82036+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 1634225450052988.6650715185967; Thu, 14 Oct 2021 08:30:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ThZWYY1788612xVTFrL0jlKo; Thu, 14 Oct 2021 08:30:49 -0700 X-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.11251.1634225448528116551 for ; Thu, 14 Oct 2021 08:30:48 -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-166-a32II4ajNSukUwoaqojOnA-1; Thu, 14 Oct 2021 11:30:44 -0400 X-MC-Unique: a32II4ajNSukUwoaqojOnA-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0B315100C610; Thu, 14 Oct 2021 15:30:43 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2C3869CBF; Thu, 14 Oct 2021 15:30:42 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C632F18009F7; 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 2/5] OvmfPkg/Microvm/fdt: load fdt from fw_cfg Date: Thu, 14 Oct 2021 17:30:21 +0200 Message-Id: <20211014153024.2318942-3-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.11 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: 43jrgCtERcgRiAGQd4epqNjtx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634225449; bh=4iHyW5ZdoqH6UB6GtvXdKwsvi1/twSShFMFwUWdnMFQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=TVsZ672xwL/SbWQuOzvhiOpCJ7BAWAoBkB40fBUV8qs5UQagqkOQ9HNikOI8t2Bstk1 LvSWPaRbE+xqFjnRJhf+fCRHinHNd0adcvm7+dKL+V2oJILLMXudvmvbgOyEjbWuiyAPX EIOPH/XWy6gEz5GfgrfL9rExbvO3yDb18r4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634225451122100002 Content-Type: text/plain; charset="utf-8" Needed for hardware detection: virtio-mmio devices for now, later also pcie root bridge. Depends on patched qemu which actually provides an fdt: https://gitlab.com/kraxel/qemu/-/commits/sirius/microvm-device-tree https://bugzilla.tianocore.org/show_bug.cgi?id=3D3689 Signed-off-by: Gerd Hoffmann --- OvmfPkg/PlatformPei/PlatformPei.inf | 1 + OvmfPkg/PlatformPei/Platform.c | 40 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 67eb7aa7166b..56876184b17a 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -44,6 +44,7 @@ [Packages] =20 [Guids] gEfiMemoryTypeInformationGuid + gFdtHobGuid =20 [LibraryClasses] BaseLib diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index df2d9ad015aa..3c0cdba67c83 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -321,6 +321,45 @@ PciExBarInitialization ( ); } =20 +VOID +MicrovmInitialization ( + VOID + ) +{ + FIRMWARE_CONFIG_ITEM FdtItem; + UINTN FdtSize; + UINTN FdtPages; + EFI_STATUS Status; + UINT64 *FdtHobData; + VOID *NewBase; + + 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; + } + + FdtPages =3D EFI_SIZE_TO_PAGES (FdtSize); + NewBase =3D AllocatePages (FdtPages); + if (NewBase =3D=3D NULL) { + DEBUG ((DEBUG_INFO, "%a: AllocatePages failed\n", __FUNCTION__)); + return; + } + + QemuFwCfgSelectItem (FdtItem); + QemuFwCfgReadBytes (FdtSize, NewBase); + + FdtHobData =3D BuildGuidHob (&gFdtHobGuid, sizeof (*FdtHobData)); + if (FdtHobData =3D=3D NULL) { + DEBUG ((DEBUG_INFO, "%a: BuildGuidHob failed\n", __FUNCTION__)); + return; + } + + DEBUG ((DEBUG_INFO, "%a: fdt at 0x%x (size %d)\n", __FUNCTION__, + NewBase, FdtSize)); + *FdtHobData =3D (UINTN)NewBase; +} + VOID MiscInitialization ( VOID @@ -368,6 +407,7 @@ MiscInitialization ( break; case 0xffff: /* microvm */ DEBUG ((DEBUG_INFO, "%a: microvm\n", __FUNCTION__)); + MicrovmInitialization(); PcdStatus =3D PcdSet16S (PcdOvmfHostBridgePciDevId, MICROVM_PSEUDO_DEVICE_ID); ASSERT_RETURN_ERROR (PcdStatus); --=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 (#82036): https://edk2.groups.io/g/devel/message/82036 Mute This Topic: https://groups.io/mt/86316749/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- From nobody Sun May 5 20:33:34 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+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- From nobody Sun May 5 20:33:34 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+82039+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+82039+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634225464; cv=none; d=zohomail.com; s=zohoarc; b=cDnes+rPgVVVgWz/qbQ2kJYGa/R4pqAgKoG+BrswxiDzmysMFTsYdBnEFmGF3xwhynwO01+6sU+pluUFig0iBJ9bVZhnDhTv+2fhO3aT1lc/L+kVep2J6GrTxD64BcZVRzKgg/NSJPSFdDUF3M8gow+MpoBY3i9/kbB4CxKrFrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634225464; 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=++lvqMXYVcxnW4JU5emI1jC12zyptAbcF228Xrn+17I=; b=jIpxpq+zYJKpC/++e1D2YRYYJgmP5mMugRwy3qjt9e9MlZWzQOSchpra4k0rDcdaVY1f4ERsqVtuYtFj3KAscfwCMkLWcRUZl0IBmYX7aSQHmvVcSl4LA27ugAhS4urS7NmOTMLUUuEMtOBGaEupR1SgDkpTTMvo41LlbgYf5m4= 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+82039+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 1634225462816629.9661652841367; Thu, 14 Oct 2021 08:31:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id sFcLYY1788612xFqkTFsuac0; Thu, 14 Oct 2021 08:30:59 -0700 X-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.web12.11070.1634225459163185072 for ; Thu, 14 Oct 2021 08:30:59 -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-10-wabdNbpkOTivW2UXa4etdA-1; Thu, 14 Oct 2021 11:30:54 -0400 X-MC-Unique: wabdNbpkOTivW2UXa4etdA-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AEEDE10B3944; Thu, 14 Oct 2021 15:30:53 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2B076060F; Thu, 14 Oct 2021 15:30:44 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CC1A218009FA; 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 4/5] OvmfPkg/Microvm/virtio: add virtio-mmio support Date: Thu, 14 Oct 2021 17:30:23 +0200 Message-Id: <20211014153024.2318942-5-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.13 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: fFA2i2iM70aATdeHaKjHMIqOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634225459; bh=2nmd48TVtrAJ5K6Kh1qJoG7RpUcJkOjsSyNxBcvbNGs=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=O7Ir3iVm4xAhoPLce4T9YD3F7k+Rk7YxEVZ9CEJRDjVKAK1mT0SYDZkQG5KLkGH7jtE D4jyQHx1t1+HuniLREDX916z+61o5mC92sgr6vbgch4GR32V0TZax1R1eP0KaRhdOTcUc PWEJt3i1tRt2aLVX+ZnX3dI7SJnFyG4FM5s= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634225466454100001 Content-Type: text/plain; charset="utf-8" Add virtio-mmio support (VirtioMmioDeviceLib and VirtioFdtDxe). https://bugzilla.tianocore.org/show_bug.cgi?id=3D3689 Signed-off-by: Gerd Hoffmann --- OvmfPkg/Microvm/MicrovmX64.dsc | 2 ++ OvmfPkg/Microvm/MicrovmX64.fdf | 1 + 2 files changed, 3 insertions(+) diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 27d2024266c2..85afdca9beba 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -233,6 +233,7 @@ [LibraryClasses.common] SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice= Lib.inf =20 [LibraryClasses.common.SEC] QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf @@ -743,6 +744,7 @@ [Components] # device tree # EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf + OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf =20 # # SMBIOS Support diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf index cc8892a459ee..0bf20a702764 100644 --- a/OvmfPkg/Microvm/MicrovmX64.fdf +++ b/OvmfPkg/Microvm/MicrovmX64.fdf @@ -278,6 +278,7 @@ [FV.DXEFV] INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf =20 INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf +INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf =20 !if $(TOOL_CHAIN_TAG) !=3D "XCODE5" INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf --=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 (#82039): https://edk2.groups.io/g/devel/message/82039 Mute This Topic: https://groups.io/mt/86316759/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- From nobody Sun May 5 20:33:34 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+82040+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+82040+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634225465; cv=none; d=zohomail.com; s=zohoarc; b=LfHbB/nulP2hFd7JeAX7oERfJv+QE6tOkyA+gEZ5fxiXp10KjUn04vvG6WMkl26yNc2P3G5W+QTBBGKdvd3YGONQzB/Frcgcb7xdkWjSvoHt/m2YjUP14rBIcr4NbJzqNicDf5/IyzR09TE2sXD+iLvF2Ppf2RBRgd4IRj0/nfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634225465; 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=7lYCdSb9s0npWS89OwKYbWOSMF0WyCG67IvLoq77ACQ=; b=GZp2hIabesatyGQcg0Xl/w8k7ouVoaRbvxUwVU8JhSznO8q9H2Dl12fKPdQmiEI/zq8GNlO6ulVBBiwZtd9zK1gWGJ+bMBbI3bfAHRLze4gRQlkcfJp/JE47qwhl02TKGDi5Ar/uE9AX/1bT0ww6rHdfQeKk+AOeLqC09BrXVbw= 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+82040+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 1634225465967335.11440080720934; Thu, 14 Oct 2021 08:31:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yNIyYY1788612xxCHW1i9qQB; Thu, 14 Oct 2021 08:31:05 -0700 X-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.web09.11040.1634225461677713837 for ; Thu, 14 Oct 2021 08:31:01 -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-358-QmUJIyy1OkKE7t-cY70r5w-1; Thu, 14 Oct 2021 11:30:57 -0400 X-MC-Unique: QmUJIyy1OkKE7t-cY70r5w-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77E4A50777; Thu, 14 Oct 2021 15:30:56 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BEFB35F4E2; Thu, 14 Oct 2021 15:30:46 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CEEB118009FB; 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 , Jiewen Yao Subject: [edk2-devel] [PATCH 5/5] OvmfPkg/Microvm: add README Date: Thu, 14 Oct 2021 17:30:24 +0200 Message-Id: <20211014153024.2318942-6-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.15 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: cOy5Bx8RwcWet0THEAtfGACjx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1634225465; bh=4X0l5Im+sTj6iRw+CTHRg65bHQvevx2ffA26js8VLqQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Sb5OTTqgj1ZdsPnAiz6JtumU6TL1G7APSiM8e8S9fkv7AEGnSrOMBFxH8NZUjf/bt7c ED5p5N1aPFs3zsgxq20RItToXpTxKrPlio1szQEJxlKkHTXIbvLbrPDG/tC3Zsg+3BZWg rPSp0Xrthk3fccqUVDScXd9k9o54NBRQ4gw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1634225466945100003 Content-Type: text/plain; charset="utf-8" Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3599 Signed-off-by: Gerd Hoffmann Acked-by: Jiewen Yao --- OvmfPkg/Microvm/README | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 OvmfPkg/Microvm/README diff --git a/OvmfPkg/Microvm/README b/OvmfPkg/Microvm/README new file mode 100644 index 000000000000..82e2bfe03d37 --- /dev/null +++ b/OvmfPkg/Microvm/README @@ -0,0 +1,50 @@ + +This is an *experimental* port of OVMF for the qemu microvm +machine type. + +microvm background info +----------------------- + +microvm is designed for modern, virtio-based workloads. Most legacy +lpc/isa devices like pit and pic can be turned off. virtio-mmio +(i.e. '-device virtio-{blk,net,scsi,...}-device') is used for +storage/network/etc. + +Optional pcie support is available and any pcie device supported by +qemu can be plugged in (including virtio-pci if you prefer that over +virtio-mmio). + +https://qemu.readthedocs.io/en/latest/system/i386/microvm.html +https://www.kraxel.org/blog/2020/10/qemu-microvm-acpi/ + +design issues +------------- + +Not fully clear yet how to do hardware detection best. Right now +using device tree to find virtio-mmio devices and pcie host bridge, +can reuse existing ArmVirtPkg code that way. Needs patched qemu. + +features +-------- + [working] serial console + [working] direct kernel boot + [working] virtio-mmio support + [in progress] pcie support + +known limitations +----------------- + * rtc=3Don is required for now. + * can't use separate code/vars (actually an microvm limitation, + there is no pflash support). + * transitional virtio-pci devices do not work. microvm doesn't + support ioports on pcie, and ovmf doesn't initialize pcie devices + with ioports if there is no address space for them (even though + pcie devices are required to be functional without ioports). + +usage +----- +qemu-system-x86_64 \ + -nographic \ + -machine microvm,acpi=3Don,pit=3Doff,pic=3Doff,rtc=3Don \ + -bios /path/to/MICROVM.fd \ + [ ... more args here ... ] --=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 (#82040): https://edk2.groups.io/g/devel/message/82040 Mute This Topic: https://groups.io/mt/86316761/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-