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)
Wed, May 1, 3:54 AM
Unknown Object (File)
Wed, May 1, 3:54 AM
Unknown Object (File)
Wed, May 1, 3:54 AM
Unknown Object (File)
Wed, May 1, 3:54 AM
Unknown Object (File)
Tue, Apr 30, 11:49 PM
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

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 Skipped
Unit
Tests Skipped

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