Skip to content

Build on pre-Sequoia SDKs#14

Merged
jserv merged 1 commit intomainfrom
sdk-fix
May 7, 2026
Merged

Build on pre-Sequoia SDKs#14
jserv merged 1 commit intomainfrom
sdk-fix

Conversation

@jserv
Copy link
Copy Markdown
Contributor

@jserv jserv commented May 7, 2026

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.

  • Bug Fixes
    • Define HV_SYS_REG_ACTLR_EL1 when __MAC_OS_X_VERSION_MAX_ALLOWED < 150000 (e.g., SDK 14.4) using the stable encoding 0xc081.
    • If ACTLR_EL1 isn’t exposed, hv_vcpu_get_sys_reg fails and we fall back to PR_SET_MEM_MODEL_DEFAULT.

Written for commit ff3f4a9. Summary will update on new commits.

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.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@jserv jserv merged commit c5ccb22 into main May 7, 2026
5 checks passed
@jserv jserv deleted the sdk-fix branch May 7, 2026 07:36
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.

1 participant