You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NVMe: don't panic if guests tries a doorbell write for admin queues while controller is disabled (#309)
* nvme: use bare cast instead of try_into to better match spec
The spec defines the doorbell registers as 32-bits wide but leaves
the upper 16 bits as reserved. Now, a guest shouldn't be setting those
upper bits but we can't control that. To better model that, just use a bare
`as` cast to keep the bottom 16 bits rather than potentially failing via
unwrapping a valid try_into.
* nvme: don't process doorbell writes if controller disabled
While the guest shouldn't be trying to write to the Admin or IO
queue's doorbell registers when the controller isn't enabled, we
also shouldn't just panic. Just log a warning and bail out.
* nvme: remove unwraps for grabbing admin queues.
Even though we should only be trying to unwrap at points we know the
admin queues should exist, don't assume they are. We should treat them
same as the IO queues where we'll bail with an error that gets logged
instead of panic'ing.
0 commit comments