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)
Oct 3 2024, 9:35 AM
Unknown Object (File)
Oct 1 2024, 9:54 PM
Unknown Object (File)
Sep 20 2024, 5:25 AM
Unknown Object (File)
Sep 7 2024, 4:55 AM
Unknown Object (File)
Sep 4 2024, 11:24 PM
Unknown Object (File)
Sep 4 2024, 11:23 PM
Unknown Object (File)
Sep 4 2024, 11:23 PM
Unknown Object (File)
Sep 4 2024, 11:23 PM

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 :(