qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, mads@ynddal.dk, agraf@csgraf.de,
	Danny Canter <danny_canter@apple.com>,
	qemu-arm@nongnu.org, Mohamed Mediouni <mohamed@unpredictable.fr>,
	Cameron Esfahani <dirty@apple.com>,
	Akihiko Odaki <akihiko.odaki@gmail.com>
Subject: Re: [PATCH 4/7] target/arm/hvf: Add KVMID_TO_HVF, HVF_TO_KVMID
Date: Mon, 1 Sep 2025 17:02:57 +0200	[thread overview]
Message-ID: <65617771-37ce-457e-aa2f-f59bf524bcca@linaro.org> (raw)
In-Reply-To: <BCCED674-EAEF-4755-9BE1-116FB36FB5C9@apple.com>

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é 
>> <philmd@linaro.org> 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~
>>
> 



  reply	other threads:[~2025-09-01 15:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18  4:13 [PATCH 0/7] target/arm/hvf cleanups Richard Henderson
2025-08-18  4:13 ` [PATCH 1/7] target/arm: Introduce KVMID_AA64_SYS_REG64 Richard Henderson
2025-08-18  4:13 ` [PATCH 2/7] target/arm: Move compare_u64 to helper.c Richard Henderson
2025-08-18  6:12   ` Philippe Mathieu-Daudé
2025-08-18  4:13 ` [PATCH 3/7] target/arm/hvf: Split out sysreg.c.inc Richard Henderson
2025-08-18  6:13   ` Philippe Mathieu-Daudé
2025-08-18  4:13 ` [PATCH 4/7] target/arm/hvf: Add KVMID_TO_HVF, HVF_TO_KVMID Richard Henderson
2025-08-18 12:41   ` Philippe Mathieu-Daudé
2025-08-18 13:21     ` Richard Henderson
2025-08-18 15:46       ` Philippe Mathieu-Daudé
2025-08-18 18:37         ` Danny Canter
2025-09-01 15:02           ` Philippe Mathieu-Daudé [this message]
2025-09-02 13:40             ` Richard Henderson
2025-08-18  4:13 ` [PATCH 5/7] target/arm/hvf: Remove hvf_sreg_match.key Richard Henderson
2025-08-18  6:15   ` Philippe Mathieu-Daudé
2025-08-18  4:13 ` [PATCH 6/7] target/arm/hvf: Replace hvf_sreg_match with hvf_sreg_list Richard Henderson
2025-08-18  6:17   ` Philippe Mathieu-Daudé
2025-08-18  4:13 ` [PATCH 7/7] target/arm/hvf: Sort the cpreg_indexes array Richard Henderson
2025-08-18  6:18   ` Philippe Mathieu-Daudé
2025-08-18 12:25 ` [PATCH 0/7] target/arm/hvf cleanups Philippe Mathieu-Daudé
2025-08-20 11:52 ` Mads Ynddal
  -- strict thread matches above, loose matches on Subject: below --
2025-08-27  1:03 [RFC PATCH 00/61] target/arm: Implement FEAT_SYSREG128 Richard Henderson
2025-08-27  1:03 ` [PATCH 4/7] target/arm/hvf: Add KVMID_TO_HVF, HVF_TO_KVMID Richard Henderson
2025-08-28 12:22   ` Manos Pitsidianakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65617771-37ce-457e-aa2f-f59bf524bcca@linaro.org \
    --to=philmd@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=akihiko.odaki@gmail.com \
    --cc=danny_canter@apple.com \
    --cc=dirty@apple.com \
    --cc=mads@ynddal.dk \
    --cc=mohamed@unpredictable.fr \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).