Skip to content

DO NOT COMMIT: IDE test - #4192

Open
Alex Landau (alandau) wants to merge 1 commit into
microsoft:mainfrom
alandau:ide-test
Open

DO NOT COMMIT: IDE test#4192
Alex Landau (alandau) wants to merge 1 commit into
microsoft:mainfrom
alandau:ide-test

Conversation

@alandau

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 7, 2026 20:22
@alandau
Alex Landau (alandau) marked this pull request as ready for review August 7, 2026 20:26
@alandau
Alex Landau (alandau) requested review from a team as code owners August 7, 2026 20:26

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

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_FEATURES is guest-controlled and may be invoked frequently (e.g., polling drivers). Emitting an unbounded tracing::warn! here can flood logs; use tracelimit::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 {
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