Page MenuHomeFreeBSD

bhyve: add helper to add fwcfg items
ClosedPublic

Authored by corvink on Feb 1 2023, 11:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 8 2024, 7:03 AM
Unknown Object (File)
Oct 8 2024, 7:03 AM
Unknown Object (File)
Oct 8 2024, 7:03 AM
Unknown Object (File)
Oct 8 2024, 7:03 AM
Unknown Object (File)
Oct 8 2024, 6:41 AM
Unknown Object (File)
Sep 23 2024, 2:00 AM
Unknown Object (File)
Sep 22 2024, 11:17 PM
Unknown Object (File)
Sep 19 2024, 5:52 AM
Subscribers

Details

Summary

This helper makes it easier to add multiple fwcfg items. You can pass an
index and some data to the helper. The helper adds these information to
the fwcfg emulation so that the guest reads the given data on the
specified index.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.sbin/bhyve/qemu_fwcfg.c
142

Should we validate the indices, if only with assert()?

usr.sbin/bhyve/qemu_fwcfg.c
142

I'm not sure about this. items is defined as struct qemu_fwcfg_item items[QEMU_FWCFG_MAX_ARCHS][QEMU_FWCFG_MAX_ENTRIES];. The value of idx is masked. So, it's impossible for idx to be too large.

This revision is now accepted and ready to land.Feb 14 2023, 2:55 PM
This revision was automatically updated to reflect the committed changes.