Page MenuHomeFreeBSD

/usr/sbin/bhyve: Update TX descriptor base address and host mapping on change
ClosedPublic

Authored by freqlabs on Oct 15 2020, 5:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 20 2024, 2:22 PM
Unknown Object (File)
Jan 13 2024, 11:12 AM
Unknown Object (File)
Nov 29 2023, 10:32 AM
Unknown Object (File)
Oct 5 2023, 11:27 PM
Unknown Object (File)
Aug 21 2023, 4:29 AM
Unknown Object (File)
Aug 15 2023, 10:45 AM
Unknown Object (File)
Aug 12 2023, 5:13 PM
Unknown Object (File)
Aug 6 2023, 8:02 AM

Details

Summary

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.

Sponsored by: iXsystems, Inc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

e82545_tx_ctl() clears the sc->esc_tdba and sc->esc_txdesc when disabling tx. I think it would be cleaner to keep/add sc->esc_tx_enabled checks. Is there some reason to remove it? I understand that paddr_guest2host() is very forgiving, but still.

Restored check that tx is enabled

This revision is now accepted and ready to land.Oct 15 2020, 5:56 PM
grehan added a subscriber: grehan.

Ahh Windows :(