From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: "Miguel Luis" <miguel.luis@oracle.com>,
kvm@vger.kernel.org, "Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Haibo Xu" <haibo.xu@linaro.org>,
"Mohamed Mediouni" <mohamed@unpredictable.fr>,
"Mark Burton" <mburton@qti.qualcomm.com>,
"Alexander Graf" <agraf@csgraf.de>,
"Claudio Fontana" <cfontana@suse.de>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Mads Ynddal" <mads@ynddal.dk>,
"Eric Auger" <eric.auger@redhat.com>,
qemu-arm@nongnu.org, "Cameron Esfahani" <dirty@apple.com>
Subject: Re: [RFC PATCH 07/11] target/arm: Replace kvm_arm_pmu_supported by host_cpu_feature_supported
Date: Tue, 12 Aug 2025 08:03:14 +0200 [thread overview]
Message-ID: <3d88ea9c-9cfe-4cd4-a282-2f467f2a502f@linaro.org> (raw)
In-Reply-To: <14d7d948-e840-4ae7-ae93-122755d6a421@linaro.org>
On 12/8/25 06:49, Philippe Mathieu-Daudé wrote:
> On 12/8/25 02:48, Richard Henderson wrote:
>> On 8/12/25 03:06, Philippe Mathieu-Daudé wrote:
>>> +++ b/target/arm/kvm.c
>>> @@ -288,7 +288,7 @@ static bool
>>> kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
>>> 1 << KVM_ARM_VCPU_PTRAUTH_GENERIC);
>>> }
>>> - if (kvm_arm_pmu_supported()) {
>>> + if (host_cpu_feature_supported(ARM_FEATURE_PMU, false)) {
>>
>> Why is false correct here? Alternately, in the next patch, why is it
>> correct to pass true for the EL2 test?
>
> I think I copied to KVM the HVF use, adapted on top of:
> https://lore.kernel.org/qemu-devel/20250808070137.48716-12-
> mohamed@unpredictable.fr/
>
>>
>> What is the purpose of the can_emulate parameter at all?
>
> When using split-accel on pre-M3, we might emulate EL2:
>
> | feat | can_emulate | retval
> + ---- + ----- + ----
> M1/M2 | ARM_FEATURE_EL2 false false> M1/M2 |
ARM_FEATURE_EL2 true true
> M3/M4 | ARM_FEATURE_EL2 any true
For example in hvf.c:
static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
{
...
if (host_cpu_feature_supported(ARM_FEATURE_EL2, true)) {
ahcf->features |= 1ULL << ARM_FEATURE_EL2;
}
and then only when split-accel is not enabled:
hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range)
{
...
if (host_cpu_feature_supported(ARM_FEATURE_EL2, false)) {
ret = hv_vm_config_set_el2_enabled(config, true);
if (ret != HV_SUCCESS) {
goto cleanup;
}
}
next prev parent reply other threads:[~2025-08-12 6:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 17:06 [RFC PATCH 00/11] target/arm: Introduce host_cpu_feature_supported() API Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 01/11] accel/system: Introduce hwaccel_enabled() helper Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 02/11] target/arm: Use generic hwaccel_enabled() to check 'host' cpu type Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 03/11] target/arm: Restrict PMU to system mode Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 04/11] target/arm: Factor hvf_psci_get_target_el() out Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 05/11] target/arm: Introduce arm_hw_accel_cpu_feature_supported() Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 06/11] target/arm: Introduce host_cpu_feature_supported() Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 07/11] target/arm: Replace kvm_arm_pmu_supported by host_cpu_feature_supported Philippe Mathieu-Daudé
2025-08-12 0:48 ` Richard Henderson
2025-08-12 4:49 ` Philippe Mathieu-Daudé
2025-08-12 6:03 ` Philippe Mathieu-Daudé [this message]
2025-08-12 7:33 ` Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 08/11] target/arm: Replace kvm_arm_el2_supported " Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 09/11] target/arm/hvf: Sync registers used at EL2 Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 10/11] target/arm/hvf: Consider EL2 acceleration for Silicon M3+ chipsets Philippe Mathieu-Daudé
2025-08-11 17:06 ` [RFC PATCH 11/11] target/arm/hvf: Allow EL2/EL3 emulation on Silicon M1 / M2 Philippe Mathieu-Daudé
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=3d88ea9c-9cfe-4cd4-a282-2f467f2a502f@linaro.org \
--to=philmd@linaro.org \
--cc=agraf@csgraf.de \
--cc=alex.bennee@linaro.org \
--cc=cfontana@suse.de \
--cc=dirty@apple.com \
--cc=eric.auger@redhat.com \
--cc=haibo.xu@linaro.org \
--cc=kvm@vger.kernel.org \
--cc=mads@ynddal.dk \
--cc=mburton@qti.qualcomm.com \
--cc=miguel.luis@oracle.com \
--cc=mohamed@unpredictable.fr \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).