nvx-rs: print zero MSR values in `nvx-time-probe clock --msr` as C's `%#x` does
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
Start in print_msrs in nvx-rs/src/guest/time_probe/clock.rs, where MSR values are printed with {:#x}, and look at alternate_hex_width_10 in the same file as a model for a helper that matches C's %#x. Done when zero MSR values print as 0 while nonzero values keep the 0x prefix, and a regression test checks both cases against the C program's output.
Written by the indexing model from the issue text.
Description
Summary
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
0inprint_msrs, keeping0xbefore nonzero values. - Add a regression that formats zero and nonzero MSR values, with the C program's output as the expected result.
- Dominant language
- Python
- Stars
- 408
- Forks
- 28
- Avg merge
- 13h 46m
- Merged PRs (30d)
- 275
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
Track sandbox live share bugs: the time ABI bind hides or breaks shares at /run targetsPossibly taken @jay23606 claimed this 3 days ago. Openbug-hunt confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Status: Triaged Type: Enhancement
Difficulty 1/5 Under an hour Newbie friendliness 82/100
canonical/craft-store#448 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
good first issue research size:s skill:numerics sub-issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SKaiNET-developers/SKaiNET#1372 ·
Maintainers usually reply within 1 day
-
debt
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/vscode-flake8#601 ·
Maintainers usually reply within 1 day