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)
Wed, Apr 17, 4:29 PM
Unknown Object (File)
Mar 20 2024, 2:42 AM
Unknown Object (File)
Mar 20 2024, 2:36 AM
Unknown Object (File)
Mar 20 2024, 2:36 AM
Unknown Object (File)
Mar 20 2024, 2:36 AM
Unknown Object (File)
Mar 18 2024, 3:46 PM
Unknown Object (File)
Jan 10 2024, 7:22 PM
Unknown Object (File)
Dec 20 2023, 6:37 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.