Page MenuHomeFreeBSD

bhyve: define array to protect passthru regs
ClosedPublic

Authored by corvink on Mar 28 2023, 10:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 21 2024, 4:44 AM
Unknown Object (File)
Mar 4 2024, 12:14 PM
Unknown Object (File)
Mar 4 2024, 12:14 PM
Unknown Object (File)
Jan 3 2024, 2:40 AM
Unknown Object (File)
Jan 3 2024, 2:40 AM
Unknown Object (File)
Dec 20 2023, 7:38 AM
Unknown Object (File)
Dec 11 2023, 4:42 AM
Unknown Object (File)
Oct 31 2023, 9:42 AM
Subscribers

Details

Summary

GPU passthrough requires a special handling of some PCI config register.
Therefore, we need a flexible approach for implementing it. Adding an
array of handler meets this condition.

Start by using the default handler for all accesses to the PCI config
space. In upcoming commit, we can start to split the default handler
into several handler for each register that requires emulation.

Diff Detail

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

Event Timeline

markj added inline comments.
usr.sbin/bhyve/pci_passthru.c
661
This revision is now accepted and ready to land.Mar 28 2023, 1:41 PM
usr.sbin/bhyve/pci_passthru.c
885

Alternately, can cfgread/write just call cfgread/write_default if no handler is installed? That might be a bit simpler and easier to follow.

  • call cfgread/write_default if no handler is installed
This revision now requires review to proceed.Mar 29 2023, 7:01 AM
usr.sbin/bhyve/pci_passthru.c
885

But now this call isn't needed, right? And set_pcir_handler() can assert that a handler is not already set?

  • assert at set_pcir_handler if handler is already set
This revision is now accepted and ready to land.Apr 11 2023, 2:21 PM
This revision was automatically updated to reflect the committed changes.