You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nvx-rs: print zero MSR values in nvx-time-probe clock --msr as C's %#x does #589
nvx-time-probe clock --msr prints each MSR's value with Rust's {:#x}, which prints zero as 0x0. The C program printed it with %#" PRIx64, whose alternate form prefixes 0x to nonzero values only, so a zero MSR prints = 0x0 (0) where C printed = 0 (0). CPU 0's HV_X64_MSR_VP_INDEX, which the probe reads, is always zero, so every clock --msr run that can read the MSRs differs from the C program's byte-exact output.
Found in the #550 review. The port has differed since its first revision, and #550 leaves the fix to this issue. #590 is the same difference in the CPUID fields.
Proposal
Add a helper for C's %#x, which prints zero without the prefix, as alternate_hex_width_10 in nvx-rs/src/guest/time_probe/clock.rs already does for %#010x, and print the MSR values with it. #590 can use the same helper.
Tasks
Print zero MSR values as 0 in print_msrs, keeping 0x before nonzero values.
Add a regression that formats zero and nonzero MSR values, with the C program's output as the expected result.
Activity
gezerui888 commentedon Oct 20, 2026
I'd like to fix this together with #590 and add regression tests. I'll open a PR shortly.