Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAL/vm] Use etc/e820 fw_cfg file to learn reserved memory ranges #27

Open
dimakuv opened this issue May 6, 2024 · 0 comments · May be fixed by #28
Open

[PAL/vm] Use etc/e820 fw_cfg file to learn reserved memory ranges #27

dimakuv opened this issue May 6, 2024 · 0 comments · May be fixed by #28

Comments

@dimakuv
Copy link
Contributor

dimakuv commented May 6, 2024

Currently, the VM PAL assumes hard-coded reserved memory ranges and does not consult the E820 memory table.

This worked in the previous QEMU versions (e.g. it works on 6.2.0), but fails on e.g. 8.0.4.

I did a pretty stupid hard-coding like this:

e820_table_entry e820 = { .address = 0x0,
.size = rdfwcfg(FW_CFG_RAM_SIZE, sizeof(uint64_t)),
.type = E820_ADDRESS_RANGE_MEMORY };

(Note that TDX PAL correctly constructs the E820 table from the info provided by the TDX hobs.)

So it looks like I should use the etc/e820 fw_cfg file from now on. This was introduced in 2013, so no issues with older QEMUs.

Moreover, I cannot use FW_CFG_E820_TABLE fw_cfg, as it was deprecated since 7.2.0.

TODO: implement /etc/e820 fw_cfg and reconstruct the bytes from QEMU into our data struct. See qemu/qemu@7d67110 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant