Thanks, but the commit looks a bit strange: we are treating the pdev as a bus_dma_tag_t when it's really a pointer to a netmap adapter. It is not used at all on FreeBSD so it doesn't really matter, but maybe I'm missing something.
Nice cleanup. I didn't review the man page language updates super thoroughly, but the parts I skimmed looked good.
Prematurely committed as aad9746130aa92cc4dd325985849967c0a88e56d
I'm fine with the overall approach and am happy to have wrappers for the missing bits so that config_* is self-contained. I'm not sure some of the API changes in terms of adding 'const' really make sense though.
Also clear in freebsd32_setregs(). Add a local pcb pointer instead of using td->pcb repeatedly.
In fact, the spec is explicit that decoding must be disabled before sizing a BAR. In the PCI 2.3 spec there is an Implementation Note in the section on BARs (188.8.131.52) which says:
Ah, didn't notice that you'd committed this. Followup if you want, but if not it's no worse than most of the rest of that file.
Minor formatting nits. The content is good and this is a 'Accepted' if you tweak the sentence stuff.
What problem are you trying to solve? Competent OS's should disable decoding so that 'decode' is false here. If a busted OS leaves it enabled, bhyve should faithfully brick the guest just as real hardware would (and real hardware does.. doing this for the frame buffer BAR without disabling decoding is a great way to lock up real hardware). Ignoring writes of all ones would leave the BAR registered at its old address which would result in confusion if a subsequent write moved the bar to a new address after it was sized resulting in the BAR being active in two places. Barring a really good reason, I think this is probably a bad idea.
This bug occurs before OS start up; I can trip the failed assert when passing through a GPU without specifying a bootable OS disk. It also would happen again during PCI enumeration by Windows and by Linux.