From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8645DD80220 for ; Tue, 9 Jul 2024 13:33:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=xaP8fZCsO9jG113/ZBxiTOzdyigVDVuMoP3NWlIS4Kw=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:To:From:Subject:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1720532003; v=1; b=5P6nlthlL29yvsI0l4xKkpOCdjw9v9JEF0S/M7aPBo50ydRKKSXfMwqkF7GY1MzaYp9nGHol nEe3gjgnInGy6/PTC4nFf3bHkpeAr3geNTNzoSdRDDvoLy/AKg5Y6n7Sprwnj5kQ4pBTebHf8pR TLMTfn0/4iAbLnlrjwyc0zqYRV00h+Yn7JNZ7KaPKFkBDOMQ/kSFTKo6IWEWKrEmQdnPVlaSzpZ j8y6ZQiZ916ZWSHt7Nw0MkxP4hajWxj0pQLMBBhwhWg+Mw7WcoW1XNjP83qUPEIJKmzyVxIIeKP xpvvySDGTn2e+QK313ayg68tXj3kGXVYHQxT16g1id4uQ== X-Received: by 127.0.0.2 with SMTP id 6C3RYY7687511xnjaQKt12iy; Tue, 09 Jul 2024 06:33:22 -0700 X-Received: from faui40.informatik.uni-erlangen.de (faui40.informatik.uni-erlangen.de [131.188.34.40]) by mx.groups.io with SMTP id smtpd.web11.22.1720475716483614663 for ; Mon, 08 Jul 2024 14:55:17 -0700 X-Received: from [192.168.1.40] (dslb-002-202-107-007.002.202.pools.vodafone-ip.de [2.202.107.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: preisner) by faui40.informatik.uni-erlangen.de (Postfix) with ESMTPSA id 4WHybN1dSfznkMg for ; Mon, 8 Jul 2024 23:55:12 +0200 (CEST) Message-ID: <108b8e09-7d9f-411a-8384-1a8c0e0fcd07@cs.fau.de> Date: Mon, 8 Jul 2024 23:55:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: devel@edk2.groups.io From: "Thomas Preisner" Subject: [edk2-devel] Questions regarding NVDIMM and OVMF 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 Resent-Date: Tue, 09 Jul 2024 06:33:20 -0700 Resent-From: preisner@cs.fau.de Reply-To: devel@edk2.groups.io,preisner@cs.fau.de List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: dozRaFr7Yp9LB8IHYuXLeqQwx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=5P6nlthl; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none Hello, I'm currently working on a research project with the goal to (mostly)=20 replace DRAM with NVRAM on the OS-side. In order to speed things up, I'm currenlty trying to switch over to QEMU+OVMF instead of developing directly on=20 hardware (server boot times are a massive pain). However, I've noticed that QEMU=20 only announces the existence of nvdimm devices via ACPI's NFIT. As a result, virtualized nvdimm devices neither appear in the E820 table nor in UEFI's GetMemoryMap() and, e.g., Linux doesn't find it during its boot. Hence, I've been trying to add support for QEMU's nvdimm devices to=20 OVMF. For this purpose, I identified `OvmfPkg/Library/PlatformInitLib/MemDetect.c`=20 as the most fitting location to query NFIT in order to create HOBs for the=20 detected nvdimms. However, ACPI, and therefore, NFIT is only available beginning=20 with the DXE phase while the PlatformInitLib=C2=A0 is executed during the PEI ph= ase according to my understanding. Is there any other way to access the ACPI table during PEI phase? I would assume it isn't (as it is loaded via QEMU's fw_cfg "table-loader" as=20 part of the DxeAcpiPlatformLib), but maybe I'm wrong and there is some way. Or=20 is it also sufficient to create respective HOBs during DXE phase? If so,=20 where/when would be the most fitting location for this addition? In either case, are the HOBs at some point fed back into the E820 table=20 (which is still crucial for the Linux kernel)? Or are they strictly used by=20 OVMF and not passed on to the remaining system in one way or another? So far,=20 I've only found `OvmfPkg/Library/LoadLinuxLib/Linux.c:SetupLinuxMemmap()` to=20 rewrite the E820 table, but apparently this is only used by QemuLoadImageLib which=20 is not executed during a 'normal' boot. At least it wasn't for my case (tested by simply adding an infinite loop). So either there is another location=20 that I've overlooked (any pointer is welcome!) or the E820 table is not updated accordingly? Currently, I'm still trying to get a (proper) grasp of the=20 entire architecture/structure of the edk2 project. Do you have any pointers for implementing the support of nvdimm in=20 edk2/OVMF? Or is it not feasible and I need to also look at adding it directly into=20 QEMU (I was hoping to avoid having to modify QEMU so far)? Best regards, Thomas Preisner -=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 (#119845): https://edk2.groups.io/g/devel/message/119845 Mute This Topic: https://groups.io/mt/107122508/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-