Skip to main content

diag_verify_phase_b

Function diag_verify_phase_b 

Source
fn diag_verify_phase_b(gpa: u64, pre: &[u8], post: &[u8])
Expand description

Immediately after the shared -> private transition and copy-back, compare the same chunk (via the identity map) against the Phase-A bytes we captured before the transition, at 4 KB PAGE granularity. On mismatch, emits:

  • DIAG_TRANSITION_MISMATCH header with total/bad page counts and per- chunk pre/post SHA-384.
  • DIAG_TRANSITION_BITMAP (hex) and DIAG_TRANSITION_PAGES (RLE) so we can see the distribution of corrupt pages within the chunk.
  • DIAG_BAD_PAGE_HASH per corrupt page (capped at DIAG_MAX_BAD_PAGE_HASHES) with SHA-384 of both pre and post.
  • Full 4 KB hex dump of the FIRST corrupt page via DIAG_FIRST_BAD_PAGE_{BEGIN,LINE,END} – but ONLY if no previous call (from any chunk or from Phase C) has already claimed the one-shot dump latch. One sample is enough to characterise the corruption pattern.