Files
Wanpeng Qian 75b1f96772 bhyve: restore the BARs at the addresses the guest gave them
A restore set the addresses in the BARs and the command register to
those of the snapshot, but left the regions registered where
pci_emul_alloc_bar() had put them when bhyve started.  That is only
right for a guest that kept bhyve's addresses.  The UEFI firmware moves
64-bit BARs above 4 GB, and after a restore every access to such a BAR
went nowhere:

  Emulating access to non-existent address to 0x800001014

Before the devices are restored, unregister the regions of all of them;
when a device is restored, register its regions at the restored
addresses, if the restored command register enables them.  All devices
go first because a restored BAR may be where another device's BAR is
before the restore.

Signed-off-by: Wanpeng Qian <[email protected]>
Sponsored by:	keelos.dev
Reviewed by:	bnovkov
Differential Revision:	https://reviews.freebsd.org/D60235
MFC after:	2 weeks
Tested by:	bnovkov
2026-11-04 18:33:44 +01:00
..
2024-10-14 10:26:17 -07:00
2023-08-16 11:54:16 -06:00
2023-08-16 11:54:16 -06:00
2023-06-20 10:56:23 +02:00
2026-01-16 10:48:34 -04:00
2026-01-16 10:48:34 -04:00
2023-08-16 11:54:16 -06:00
2026-09-19 16:19:35 +00:00
2026-08-23 14:02:49 +02:00
2024-10-31 20:24:12 +00:00
2026-08-23 14:02:49 +02:00
2024-10-02 17:31:59 -04:00
2024-04-10 11:17:55 -04:00
2026-02-19 14:27:49 -08:00
2024-04-11 11:53:37 -06:00
2023-08-16 11:54:16 -06:00