]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: keep physical and virtual COMMAND reg in sync
authorCorvin Köhne <CorvinK@beckhoff.com>
Mon, 22 Nov 2021 15:26:03 +0000 (16:26 +0100)
committerEmmanuel Vadot <manu@FreeBSD.org>
Fri, 14 Jan 2022 14:18:08 +0000 (15:18 +0100)
commit6448a0a51a81846764f56afb5d83a2245f139d37
tree85919b79de2c81412e13009f9bd8a36172b1855d
parentf281bda11a1a01abd911053325407205cffcf808
bhyve: keep physical and virtual COMMAND reg in sync

On startup all virtual BARs are registered.
Additionally, the encoding bit in the virtual cmd register is set.
After that, the passthru emulation overwrites the virtual cmd register with
the physical one.
This could lead to a mismatch between registered BARs and the encoding
bits in the cmd register.
Instead of writing the physical to the virtual cmd register,
write the virtual to the physical cmd register to solve this issue.

Reviewed by:   markj
Differential Revision: https://reviews.freebsd.org/D32687
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 2eb2079554f4d54c4283410b4ee1aca549b29616)
usr.sbin/bhyve/pci_passthru.c