Conversation
Apple added HV_SYS_REG_ACTLR_EL1 to the Hypervisor.framework header in macOS 15 (Sequoia) SDK. Older SDKs, including the Nix-pinned apple-sdk-14.4 used by the issue 11 reporter, lack the enumerator and fail to compile. The encoding is stable across versions: op0=3, op1=0, CRn=1, CRm=0, op2=1 -> 0xc081. Define the value as a macro fallback when the SDK target predates Sequoia. The guard checks __MAC_OS_X_VERSION_MAX_ALLOWED rather than testing macro presence, because on macOS 15+ the symbol is an enum member, not a #define, so a plain #ifndef would always fire and shadow the SDK name with a same-spelling macro. The semantic of PR_GET_MEM_MODEL is unchanged: when the host kernel or hardware does not expose ACTLR_EL1, hv_vcpu_get_sys_reg returns a non-success status, actlr stays at 0, and the call falls through to PR_SET_MEM_MODEL_DEFAULT.
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.
Apple added HV_SYS_REG_ACTLR_EL1 to the Hypervisor.framework header in macOS 15 (Sequoia) SDK. Older SDKs, including the Nix-pinned apple-sdk-14.4 used by the issue 11 reporter, lack the enumerator and fail to compile. The encoding is stable across versions:
op0=3, op1=0, CRn=1, CRm=0, op2=1 -> 0xc081.
Define the value as a macro fallback when the SDK target predates Sequoia. The guard checks __MAC_OS_X_VERSION_MAX_ALLOWED rather than testing macro presence, because on macOS 15+ the symbol is an enum member, not a #define, so a plain #ifndef would always fire and shadow the SDK name with a same-spelling macro.
The semantic of PR_GET_MEM_MODEL is unchanged: when the host kernel or hardware does not expose ACTLR_EL1, hv_vcpu_get_sys_reg returns a non-success status, actlr stays at 0, and the call falls through to PR_SET_MEM_MODEL_DEFAULT.
Summary by cubic
Fix build failures on pre-Sequoia macOS SDKs by adding a fallback for HV_SYS_REG_ACTLR_EL1. Uses an SDK-version guard to avoid enum/macro conflicts; PR_GET_MEM_MODEL behavior is unchanged.
Written for commit ff3f4a9. Summary will update on new commits.