DO NOT COMMIT: IDE test - #4192
Open
Alex Landau (alandau) wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds temporary IDE “divergence probes” (log/counter instrumentation) and new metamorphic/property-style unit tests intended to detect Hyper-V compatibility differences and guard against enlightened-command interference/TOCTOU regressions.
Changes:
- Introduces IRQ divergence probes (A/B) and per-opcode dedup probing for unknown commands (C), plus additional IDEPROBE warnings (D/E/F).
- Extends IDE channel/drive logic with probe helpers for “pending IRQ while unselected” and “raw pending IRQ”.
- Adds new metamorphic tests to assert enlightened reads are invariant to non-target drive state, including a generated-interference property test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| vm/devices/storage/ide/src/lib.rs | Adds probe counters/dedup helpers, hooks probe logic into I/O paths/IRQ updates, and adds metamorphic/property tests. |
| vm/devices/storage/ide/src/drive/hard_drive.rs | Adds probe helpers and several IDEPROBE warnings (non-512 sector, mid-command drive change, SET_FEATURES cache, unknown opcode). |
| vm/devices/storage/ide/src/drive/atapi_drive.rs | Adds probe helpers and unknown-opcode dedup warning for ATAPI. |
| vm/devices/storage/ide/src/drive.rs | Adds DiskDrive probe forwarding methods used by channel-level probe logic. |
Suppressed comments (2)
vm/devices/storage/ide/src/lib.rs:1352
- This warning is guest-triggerable (interrupt behavior depends on guest I/O timing/state) and may be hit repeatedly. To avoid log spam in CI/production, prefer
tracelimit::warn_ratelimited!here (the message is already edge-triggered, but can still oscillate).
tracing::warn!(
vm/devices/storage/ide/src/drive/hard_drive.rs:975
SET_FEATURESis guest-controlled and may be invoked frequently (e.g., polling drivers). Emitting an unboundedtracing::warn!here can flood logs; usetracelimit::warn_ratelimited!instead.
tracing::warn!(
subcommand = sub,
"IDEPROBE_D_SET_FEATURES_CACHE guest toggled write cache; UH ignores"
);
}
Comment on lines
+113
to
+114
| pub static IRQ_DIVERGENCE_A: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); | ||
| pub static IRQ_DIVERGENCE_B: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0); |
Comment on lines
+1261
to
+1265
| tracing::warn!( | ||
| channel = self.channel, | ||
| count, | ||
| "IDEPROBE_B guest cleared nIEN with a pending IRQ" | ||
| ); |
Comment on lines
575
to
577
| tracing::warn!( | ||
| "Changing selected drive in the middle of operation. Resetting previously selected drive" | ||
| "IDEPROBE_F_DRIVE_CHANGE_MID_CMD Changing selected drive in the middle of operation. Resetting previously selected drive" | ||
| ); |
| rng | ||
| }; | ||
|
|
||
| for _ in 0..256 { |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.