-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NVMe: don't panic if guests tries a doorbell write for admin queues w…
…hile 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.
- Loading branch information
Showing
1 changed file
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters