fix: guard breakpoint() with x86 check for ARM64 Windows support#674
Merged
NotRequiem merged 2 commits intokernelwernel:mainfrom Apr 7, 2026
Merged
Conversation
The breakpoint() function uses x86-specific intrinsics (__stosb, __movsb) and x86 debug registers (Dr0, Dr7 from CONTEXT) that don't exist on ARM64 Windows. This causes compilation to fail when targeting aarch64-pc-windows-msvc. Added the same #if (!x86) return false; #endif guard that msr() already uses.
…ption(), and breakpoint() The previous pattern (#if (!x86) return false; #endif) inserts an early return but the compiler still compiles the code below. MSVC on ARM64 fails because x86-specific intrinsics (__readmsr, __stosb, __movsb) and x86 debug registers (Dr0, Dr7) don't exist on that platform. Changed all three functions to use #if (!x86) return false; #else ... #endif so the x86-specific code is completely excluded from compilation on non-x86 targets.
Collaborator
|
ty :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
msr(),kvm_interception(), andbreakpoint()functions use x86-specific intrinsics and registers that don't exist on ARM64 Windows, causing compilation to fail when targetingaarch64-pc-windows-msvc:Root cause
These functions already had
#if (!x86) return false; #endifguards, but that pattern only inserts an early return. The compiler still compiles the code after#endif. On MSVC ARM64, this fails because x86-specific intrinsics (__readmsr,__stosb,__movsb) and x86 debug registers (Dr0,Dr7fromCONTEXT) don't exist.Fix
Changed all three functions to use
#if (!x86) return false; #else ... #endifso the x86-specific code is completely excluded from compilation on non-x86 targets.