Skip to content

nvme: reset shadow doorbell state#4011

Open
jstarks wants to merge 2 commits into
microsoft:mainfrom
jstarks:nvme_reset
Open

nvme: reset shadow doorbell state#4011
jstarks wants to merge 2 commits into
microsoft:mainfrom
jstarks:nvme_reset

Conversation

@jstarks

@jstarks jstarks commented Jul 23, 2026

Copy link
Copy Markdown
Member

Restore and clear the controller-owned doorbell backing after queue workers drain so stale shadow doorbell and event-index mappings do not survive controller reset. Retain the original backing allocation for reuse and cover both the normal and fault-injection emulators.

Thanks to @bitranox for identifying the stale mapping and suggesting the reset approach in #3915.

Restore and clear the controller-owned doorbell backing after queue workers drain so stale shadow doorbell and event-index mappings do not survive controller reset. Retain the original backing allocation for reuse and cover both the normal and fault-injection emulators.

Thanks to @bitranox for identifying the stale mapping and suggesting the reset approach in microsoft#3915.
Copilot AI review requested due to automatic review settings July 23, 2026 15:32
@jstarks
jstarks requested review from a team as code owners July 23, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses NVMe shadow doorbell state surviving a controller reset by restoring the controller-owned (private) doorbell backing and clearing any shadow doorbell / event-index mapping after queue workers drain, preventing post-reset writes into stale guest addresses.

Changes:

  • Reset DoorbellMemory to its controller-owned backing when NVMe workers fully reset/disable.
  • Preserve a reusable private doorbell backing allocation and add a DoorbellMemory::reset() helper to restore/clear it.
  • Add reset-focused shadow doorbell tests for both the normal and fault-injection NVMe emulators.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vm/devices/storage/nvme/src/workers/coordinator.rs Resets doorbell backing after workers finish draining during reset.
vm/devices/storage/nvme/src/queue.rs Adds reusable private backing + DoorbellMemory::reset() to restore power-on doorbell state.
vm/devices/storage/nvme/src/tests/shadow_doorbell_tests.rs Adds coverage around reset behavior after configuring shadow doorbells.
vm/devices/storage/nvme_test/src/workers/coordinator.rs Mirrors worker reset doorbell reset behavior in the fault-injection emulator.
vm/devices/storage/nvme_test/src/queue.rs Mirrors private backing + DoorbellMemory::reset() in the fault-injection emulator.
vm/devices/storage/nvme_test/src/tests/shadow_doorbell_tests.rs Mirrors reset-focused shadow doorbell test coverage in the fault-injection emulator.

Comment thread vm/devices/storage/nvme/src/queue.rs
Comment thread vm/devices/storage/nvme_test/src/queue.rs
Comment thread vm/devices/storage/nvme/src/tests/shadow_doorbell_tests.rs Outdated
Comment thread vm/devices/storage/nvme_test/src/tests/shadow_doorbell_tests.rs Outdated
@github-actions

Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings July 24, 2026 09:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants