Skip to content

MsvmPkg/PlatformPei: Skip DMA pinning detection when Hv is disabled#95

Merged
jstarks merged 1 commit into
microsoft:mainfrom
jstarks:user/jstarks/fix-nohv-dma-pinning-hypercall
Jul 21, 2026
Merged

MsvmPkg/PlatformPei: Skip DMA pinning detection when Hv is disabled#95
jstarks merged 1 commit into
microsoft:mainfrom
jstarks:user/jstarks/fix-nohv-dma-pinning-hypercall

Conversation

@jstarks

@jstarks jstarks commented Jul 20, 2026

Copy link
Copy Markdown
Member

HvDetectDmaPinningRequired() issues an AArch64 hypercall (AsmGetVpRegister(HvRegisterFeaturesInfo)) unconditionally during PEI. The X64 path guards this with a HypervisorPresent CPUID check, but the AArch64 path had no equivalent guard.

On a Generic (no-Hyper-V) platform there is no hypervisor to service the hvc. Issuing it in PEI - before the exception vectors are installed - causes an intercept loop that hard hangs the machine.

This is a regression: the no-Hv support (PcdHvEnabled, gated via the SEC platform type PPI) predates HvDetectDmaPinningRequired, which was added later by the IommuDxe pinning work without accounting for the no-Hv path.

Guard the whole detection on PcdHvEnabled so no hypercall is issued when Hyper-V is disabled. X64 is unaffected (PcdHvEnabled defaults TRUE and is never cleared there).

HvDetectDmaPinningRequired() issues an AArch64 hypercall
(AsmGetVpRegister(HvRegisterFeaturesInfo)) unconditionally during PEI.
The X64 path guards this with a HypervisorPresent CPUID check, but the
AArch64 path had no equivalent guard.

On a Generic (no-Hyper-V) platform there is no hypervisor to service the
hvc. Issuing it in PEI - before the exception vectors are installed -
causes an intercept loop that hard hangs the machine.

This is a regression: the no-Hv support (PcdHvEnabled, gated via the SEC
platform type PPI) predates HvDetectDmaPinningRequired, which was added
later by the IommuDxe pinning work without accounting for the no-Hv path.

Guard the whole detection on PcdHvEnabled so no hypercall is issued when
Hyper-V is disabled. X64 is unaffected (PcdHvEnabled defaults TRUE and is
never cleared there).
@jstarks
jstarks merged commit 6411838 into microsoft:main Jul 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants