On 18/8/25 20:37, Danny Canter wrote:
Howdy,
On macOS versions/SDKs before 26 you are correct, we had an invalid enum
value for HV_SYS_REG_MDCR_EL2 in the API, but the hv_vcpu_get/
set_sys_reg APIs work with this value even though the
encoding is incorrect. The enum value has been remedied in 26+ (0xe089
as you pointed out) and has been done in a backwards compatible way
internally in the framework.
Thanks Danny!
Richard, should we guard the QEMU_BUILD_BUG_ON() macro with:
#if defined(MAC_OS_VERSION_26_0) && \
MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_26_0
?
On Aug 18, 2025, at 8:46 AM, Philippe Mathieu-Daudé
<[email protected]> wrote:
Cc'ing Apple folks hoping they can forward or directly help :)
On 18/8/25 15:21, Richard Henderson wrote:
On 8/18/25 22:41, Philippe Mathieu-Daudé wrote:
Rebasing Mohamed's work I'm getting:
In file included from ../../target/arm/hvf/hvf.c:413:
../../target/arm/hvf/sysreg.c.inc:156:1: error: static assertion
failed due to requirement '!(HV_SYS_REG_MDCR_EL2 != (((((1 << 28) |
(19 << 16) | ((3) << 14) | ((4) << 11) | ((1) << 7) | ((1) << 3) |
((1) << 0)) | 13510798882111488ULL)) & 65535))': not expecting:
HV_SYS_REG_MDCR_EL2 != KVMID_TO_HVF(KVMID_AA64_SYS_REG64(1, 1, 3, 4, 1))
156 | DEF_SYSREG(HV_SYS_REG_MDCR_EL2, 1, 1, 3, 4, 1)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HV_SYS_REG_MDCR_EL2 = 0xe019, <----
How odd. It should be e089, if it were encoded like all the others.
I wonder if this is a manual typo that's now baked into the api, or
if it's an OS bug.
r~