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 CPUID fields in nvx-time-probe clock as C's %#x does #590
nvx-time-probe clock prints the hypervisor's CPUID fields with Rust's {:#x}, which prints zero as 0x0, where the C program's %#x printed 0. The summary line's hv_max_leaf, hv_features_eax, and hv_features_edx are all zero when the hypervisor bit is clear, and its feature fields are zero under a hypervisor whose leaves end before 0x40000003. The cpuid.0x40000000 line's eax.max_leaf is likewise zero for a hypervisor whose leaf reads zero. Each such valid run 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. #589 is the same difference in the MSR values.
Proposal
Print these fields with the helper for C's %#x that #589 proposes, which prints zero without the prefix, as alternate_hex_width_10 already does for %#010x.
Tasks
Print zero as 0 in the summary line's hv_max_leaf, hv_features_eax, and hv_features_edx, and in the eax.max_leaf that print_cpuid prints, keeping 0x before nonzero values.
Add a regression for the zero-valued summary of a CPU without the hypervisor bit, with the C program's output as the expected result.
Activity
gezerui888 commentedon Oct 20, 2026
I'll include this in my fix for #589, with regression tests.