]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Update TX descriptor base address and host mapping on change
authorRyan Moeller <freqlabs@FreeBSD.org>
Fri, 16 Oct 2020 20:27:20 +0000 (20:27 +0000)
committerRyan Moeller <freqlabs@FreeBSD.org>
Fri, 16 Oct 2020 20:27:20 +0000 (20:27 +0000)
commit60dc6bee1f4877ecd4de7fc2678ccc241eff2705
tree490a644b7de9e49e68faea36477ae20bc4accbd1
parent6d55b98d523b9d60e062419bb021eff49f40a239
bhyve: Update TX descriptor base address and host mapping on change

bhyve sometimes segfaults when using an e1000 NIC with a Windows guest.

We are only updating our tdba and cached host mapping when the low address
register is written and when tx is set enabled, but not when the high address
or length registers are written. It is observed that Windows 10 is occasionally
enabling tx first then writing the registers in the order low, high, len. This
leaves us with a bogus base address and mapping, which causes a segfault later
when we try to copy from a descriptor that has unpredictable garbage in a
pointer.

Updating the address and mapping when any of those registers change seems to fix
that particular issue.

Reviewed by: mav, grehan (bhyve)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D26798
usr.sbin/bhyve/pci_e82545.c