Skip to content

Conversation

@iximeow
Copy link
Member

@iximeow iximeow commented Feb 9, 2026

I have barely tested this, but I built a propolis-standalone and threw it + a Windows Server 2022 onto a Cosmo and I'm no longer seeing the results of Windows repeatedly resetting the device. so this gets #1052 and apparently #1048 with it.

this probably should just be a mutex that we take somewhere in managing virtio device configuration but this was simple enough to throw together for a quick PoC/validation..

@iximeow iximeow added bug Something that isn't working. networking Related to networking devices/backends. guest-os Related to compatibility and/or functionality observed by guest software. labels Feb 9, 2026
mac_addr: [u8; ETHERADDRL],
mtu: Option<u16>,
hdl: VionaHdl,
mq_active: AtomicBool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would like a comment on this explaining what it means and why it's tracked here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i found the description of the suspected issue in #1048 and #1052 quite useful and felt like something like that (though not necessarily from the angle of "it was broken") would be nice to capture closer to the code.

use std::num::NonZeroU16;
use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::{Arc, Condvar, Mutex, Weak};
use std::sync::atomic::{Ordering, AtomicBool};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clippy is kind of obnoxiously mad about alphabetization here :|

@dancrossnyc
Copy link
Contributor

I think that Windows may be in error here; or, at least, there's some ambiguity in the spec (VirtIO 1.2).

Section 2.2 of the spec reads, in part:

Each virtio device offers all the features it understands. During device initialization, the driver reads this and tells the device the subset that it accepts. The only way to renegotiate is to reset the device.

(Emphasis added)

However, sec. 2.2.2 goes on to say,

If a device has successfully negotiated a set of features at least once (by accepting the FEATURES_OK device status bit during device initialization), then it SHOULD NOT fail re-negotiation of the same set of features after a device or system reset.

(Again, emphasis added)

What this says to me is that, once the driver has written the FEATURES_OK bit in the device status register, and this has been acknowledged by the device by similarly reflecting that bit back to the driver on a read, then the driver should not write to the features register again.

However, I could also imagine that most devices should be able to tolerate a read that doesn't change the value of the register; that is, if I read the register and write it right back, perhaps that should be a tragically complicated no-op. However, if the driver tries to change anything, then that ought to fail, either by clearing (and refusing to set) FEATURES_OK or by resetting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something that isn't working. guest-os Related to compatibility and/or functionality observed by guest software. networking Related to networking devices/backends.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants