qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Ott <sebott@redhat.com>
To: Eric Auger <eric.auger@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	 Paolo Bonzini <pbonzini@redhat.com>,
	qemu-arm@nongnu.org,  qemu-devel@nongnu.org, kvm@vger.kernel.org,
	kvmarm@lists.linux.dev
Subject: Re: [PATCH v2 2/2] target/arm/kvm: add kvm-psci-version vcpu property
Date: Wed, 12 Nov 2025 18:20:47 +0100 (CET)	[thread overview]
Message-ID: <cff8ff25-f4a6-6b90-8b90-10b8da7972ac@redhat.com> (raw)
In-Reply-To: <0795ff4a-50d1-4b2d-84bf-e1bc9da11ba6@redhat.com>

On Tue, 11 Nov 2025, Eric Auger wrote:
> On 10/30/25 5:59 PM, Sebastian Ott wrote:
>> Provide a kvm specific vcpu property to override the default
>> (as of kernel v6.13 that would be PSCI v1.3) PSCI version emulated
>> by kvm. Current valid values are: 0.1, 0.2, 1.0, 1.1, 1.2, and 1.3
>>
>> Signed-off-by: Sebastian Ott <sebott@redhat.com>
>> ---
[...]
>> +static char *kvm_get_psci_version(Object *obj, Error **errp)
>> +{
>> +    ARMCPU *cpu = ARM_CPU(obj);
>> +    const struct psci_version *ver;
>> +
>> +    for (ver = psci_versions; ver->number != -1; ver++) {
>> +        if (ver->number == cpu->prop_psci_version)
> I still have the same question/comment as on v1. In case the end user
> does not override the psci version I think you want to return the
> default value, retrieved from KVM through KVM_REG_ARM_PSCI_VERSION and
> which populates cpu->psci_version. So to me you should use
> cpu->psci_version instead

Sry, I didn't get your question the first time and double checked that the
VM uses the default/most recent version when the property is not set.

I just found out how to actually call this function (via qom-get) and
you're right: the VM uses the correct version but we report something
different here - and in this version even trigger the assertion. Ouch.

[...]
>> @@ -1959,7 +2008,8 @@ int kvm_arch_init_vcpu(CPUState *cs)
>>      if (cs->start_powered_off) {
>>          cpu->kvm_init_features[0] |= 1 << KVM_ARM_VCPU_POWER_OFF;
>>      }
>> -    if (kvm_check_extension(cs->kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
>> +    if (cpu->prop_psci_version != QEMU_PSCI_VERSION_0_1 &&
> I don't understand what this change stands for. Please document it
> through both a comment and a commit msg explanation

The explanation is in the cover letter - I'll move it to this patch.

Thanks,
Sebastian



      reply	other threads:[~2025-11-12 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30 16:59 [PATCH v2 0/2] arm: add kvm-psci-version vcpu property Sebastian Ott
2025-10-30 16:59 ` [PATCH v2 1/2] target/arm/kvm: add constants for new PSCI versions Sebastian Ott
2025-11-11 17:50   ` Eric Auger
2025-10-30 16:59 ` [PATCH v2 2/2] target/arm/kvm: add kvm-psci-version vcpu property Sebastian Ott
2025-11-11 17:57   ` Eric Auger
2025-11-12 17:20     ` Sebastian Ott [this message]

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=cff8ff25-f4a6-6b90-8b90-10b8da7972ac@redhat.com \
    --to=sebott@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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).