This patch is based on D24066. To simplify testing, all changes are included in this patch. I'm going to rebase this patch, when D24066 is merged.
bhyve allocates the BARs of device 0:0.0 first, after that it allocates the BARs of device 0:1.0, then of device 0:2.0 and so on.
This could lead to a large fragmentation. If using large BARs like framebuffers for graphic devices, MMIO Space could be exceeded.
To reduce fragmentation, order BARs by size.