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)
Mon, Oct 21, 2:14 AM
Unknown Object (File)
Sep 29 2024, 2:47 PM
Unknown Object (File)
Sep 29 2024, 11:53 AM
Unknown Object (File)
Sep 26 2024, 8:40 PM
Unknown Object (File)
Sep 2 2024, 5:15 AM
Unknown Object (File)
Sep 1 2024, 11:14 AM
Unknown Object (File)
Aug 29 2024, 2:45 AM
Unknown Object (File)
Aug 18 2024, 7:24 PM
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.