Hello,
I'm currently working on a research project with the goal to (mostly)
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
hardware
(server boot times are a massive pain). However, I've noticed that QEMU
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
OVMF. For
this purpose, I identified `OvmfPkg/Library/PlatformInitLib/MemDetect.c`
as the
most fitting location to query NFIT in order to create HOBs for the
detected
nvdimms. However, ACPI, and therefore, NFIT is only available beginning
with
the DXE phase while the PlatformInitLib is executed during the PEI phase
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
part of
the DxeAcpiPlatformLib), but maybe I'm wrong and there is some way. Or
is it
also sufficient to create respective HOBs during DXE phase? If so,
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
(which
is still crucial for the Linux kernel)? Or are they strictly used by
OVMF and
not passed on to the remaining system in one way or another? So far,
I've only
found `OvmfPkg/Library/LoadLinuxLib/Linux.c:SetupLinuxMemmap()` to
rewrite the
E820 table, but apparently this is only used by QemuLoadImageLib which
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
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
entire
architecture/structure of the edk2 project.
Do you have any pointers for implementing the support of nvdimm in
edk2/OVMF?
Or is it not feasible and I need to also look at adding it directly into
QEMU
(I was hoping to avoid having to modify QEMU so far)?
Best regards,
Thomas Preisner
-=-=-=-=-=-=-=-=-=-=-=-
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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-