Ticket #73519: qemu_10.2_monterey_arm64_fix.patch

File qemu_10.2_monterey_arm64_fix.patch, 1.9 KB (added by peterwwillis (Peter W), 3 months ago)

Patch to make qemu build succeed on monterey arm64

  • target/arm/hvf/hvf.c

    a b uint32_t hvf_arm_get_default_ipa_bit_size(void) 
    830830uint32_t hvf_arm_get_default_ipa_bit_size(void)
    831831{
     832#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000
    832833    uint32_t default_ipa_size;
    833834    hv_return_t ret = hv_vm_config_get_default_ipa_size(&default_ipa_size);
    834835    assert_hvf_ok(ret);
    835 
    836836    return default_ipa_size;
     837#else
     838    /* hv_vm_config_get_default_ipa_size requires macOS 13+; on Monterey M1, default is 36 */
     839    return 36;
     840#endif
    837841}
    838842
    839843uint32_t hvf_arm_get_max_ipa_bit_size(void)
    840844{
     845#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130000
    841846    uint32_t max_ipa_size;
    842847    hv_return_t ret = hv_vm_config_get_max_ipa_size(&max_ipa_size);
    843848    assert_hvf_ok(ret);
    844849
    845850    /*
    846851     * We clamp any IPA size we want to back the VM with to a valid PARange
    847852     * value so the guest doesn't try and map memory outside of the valid range.
    848853     * This logic just clamps the passed in IPA bit size to the first valid
    849854     * PARange value <= to it.
    850855     */
    851856    return round_down_to_parange_bit_size(max_ipa_size);