Skip to content

[AI Generated] BugFix: Skip MSR Hyper-V platform-id test on arm64 (rdmsr/msr-tools is x86-only)#4561

Merged
LiliDeng merged 1 commit into
microsoft:mainfrom
johnsongeorge-w:bugfix/msr_arm64_unsupported_skip_250626_152005
Jun 29, 2026
Merged

[AI Generated] BugFix: Skip MSR Hyper-V platform-id test on arm64 (rdmsr/msr-tools is x86-only)#4561
LiliDeng merged 1 commit into
microsoft:mainfrom
johnsongeorge-w:bugfix/msr_arm64_unsupported_skip_250626_152005

Conversation

@johnsongeorge-w

Copy link
Copy Markdown
Collaborator

Problem

Msr.verify_hyperv_platform_id reads the Hyper-V guest OS id register using rdmsr (from msr-tools, backed by the x86 msr char-device driver). All three are x86-only. On arm64 there is no rdmsr instruction, msr-tools is not packaged (E: Unable to locate package msr-tools), and the msr driver does not exist.

Previously the test still attempted to install msr-tools on arm64, looped on retries (~100s wasted), and finally skipped with a misleading message. The arch map also contained an arm64 entry (0x00090002) that falsely implied rdmsr could read it — but that value is a Hyper-V synthetic register identifier read via the hypercall interface (HvGetVpRegisters), not an x86 MSR number.

Fix

  • Detect arm64 early (right after Lscpu.get_architecture()) and skip with an accurate reason, before any msr-tools install attempt.
  • Remove the misleading arm64 entry from HV_REGISTER_GUEST_OSID (the rdmsr offset map).
  • Preserve the arm64 register knowledge in a comment for a future hypercall-based implementation.

Validation

Ran Msr.verify_hyperv_platform_id on a real arm64 VM (Standard_D2pds_v5, Ubuntu 22.04 arm64, hardware_platform aarch64):

  • Result: SKIPPED with MSR platform-id test uses rdmsr/msr-tools (x86-only); on arm64 the register is read via hypercall, not rdmsr.
  • 0 msr-tools retry-loop lines (was ~12 before the fix).
  • Test body skips in microseconds; no wasted install retries.

No behavior change on x86 — the test runs exactly as before.

rdmsr/msr-tools and the x86 msr driver are x86-only. The Hyper-V guest OS id register exists on arm64 but is read via the hypercall interface, not rdmsr, so this rdmsr-based test cannot run there. Detect arm64 early and skip with an accurate reason instead of failing later on the (impossible) msr-tools install, which previously wasted ~100s on retry loops and produced a misleading skip message. Also drop the arm64 register entry that falsely implied rdmsr could read it.
Copilot AI review requested due to automatic review settings June 26, 2026 00:37
@johnsongeorge-w johnsongeorge-w changed the title Skip MSR Hyper-V platform-id test on arm64 (rdmsr/msr-tools is x86-only) [AI Generated] BugFix: Skip MSR Hyper-V platform-id test on arm64 (rdmsr/msr-tools is x86-only) Jun 26, 2026

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

This PR updates the Msr.verify_hyperv_platform_id test to correctly handle arm64 guests where rdmsr/msr-tools (and the underlying x86 MSR mechanism) are not available, avoiding wasted retries and providing an accurate skip reason.

Changes:

  • Skip verify_hyperv_platform_id early on CpuArchitecture.ARM64 with a precise explanation (hypercall-based register access required).
  • Remove the arm64 entry from the HV_REGISTER_GUEST_OSID rdmsr-offset map and preserve the arm64 register value as a comment for future hypercall-based work.

Comment thread lisa/microsoft/testsuites/core/msr.py
@LiliDeng
LiliDeng merged commit 368b589 into microsoft:main Jun 29, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants