All of lore.kernel.org
 help / color / mirror / Atom feed
From: Collin Walling <walling@linux.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
	mjrosato@linux.ibm.com, farman@linux.ibm.com, cohuck@redhat.com,
	david@kernel.org, iii@linux.ibm.com,
	richard.henderson@linaro.org,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Hendrik Brueckner <brueckner@linux.ibm.com>,
	Boris Fiuczynski <fiuczy@linux.ibm.com>
Subject: Re: [PATCH] target/s390x: query-cpu-definitions filter deprecated features
Date: Thu, 9 Jul 2026 12:50:14 -0400	[thread overview]
Message-ID: <526e5b56-ee82-45e1-b2fc-d8d9a073d3ff@linux.ibm.com> (raw)
In-Reply-To: <87mrw0hhix.fsf@pond.sub.org>

On 7/9/26 01:13, Markus Armbruster wrote:
> Collin Walling <walling@linux.ibm.com> writes:
> 
>> Part of the query-cpu-definitions return payload includes an array of
>> of "unavailable-features" which helps determine if the CPU model is
>> compatible with the system's configuration.  When a KVM guest is
>> using a CPU model with deprecated features disabled,
>> query-cpu-definitions will claim that certain models are incompatible
>> due to these features missing.
>>
>> Since deprecated features are preferred to be disabled for s390 CPU
>> models, lets filter them out from the "missing" features list.
>>
>> Signed-off-by: Collin Walling <walling@linux.ibm.com>
>> ---
>>
>> Examples output of query-cpu-definitions ran on a gen17a host:
>>
>> WithOUT patch:
>>
>> ```
>> {
>>   "return": [
>>     {
>>       "name": "z13",
>>       "typename": "z13-s390x-cpu",
>>       "unavailable-features": [
>>         "csske"
>>       ],
>>       "static": false,
>>       "migration-safe": true,
>>       "deprecated": false
>>     },
>>     ...
>> ```
>>
>> WITH patch:
>>
>> ```
>> {
>>   "return": [
>>     {
>>       "name": "z13",
>>       "typename": "z13-s390x-cpu",
>>       "unavailable-features": [],
>>       "static": false,
>>       "migration-safe": true,
>>       "deprecated": false
>>     },
>>     ...
>> ```
> 
> I'd put this right into the commit message.
> 
> Possibly stupid question (I know nothing about the subject matter): any
> compatibility ramifications?  Does the change need to be tied to machine
> type version?
> 
> 

This is a valid question, and one we raised internally when performing
some regression tests (specifically about differing QEMU and libvirt
versions).  Functionally, there should be no compatibility ramifications.

However, you got me to investigating some other behaviors, specifically
regarding how libvirt utilizes this command.

This patch introduces a possible discrepancy between libvirt's domain
capabilities report and what the user may expect when defining a domain
with a CPU model within that report.

Here's a rundown of how libvirt utilizes the query-cpu-definition data
command WITHOUT the patch:

Let's say I'm running on a z17 machine.  On this hardware generation,
some CPU features have been dropped completely (e.g. csske). Now, being
on a newer generation machine, I would assume that I could start a guest
with an older model (e.g. z14). However, running virsh domcapabilities,
libvirt tells me otherwise:

      <model usable='no' vendor='IBM'>z14</model>
      <blockers model='z14'>
        <feature name='csske'/>
      </blockers>

But this is not entirely true.  I could create a domain with a z14 CPU
model and either explicitly disable csske, or append the
deprecated_features='off' attribute to the <cpu> element and the domain
will start successfully.

Now, let's run through this scenario WITH the patch:

Running virsh domcapabilities, I see:

      <model usable='yes' vendor='IBM'>z14</model>

But this is _also_ not entirely true: a user cannot simply define a
domain using a z14 CPU model without further adjustments.  This invokes
the following error:

      qemu-system-s390x: Some features requested in the CPU model are
      not available in the current configuration: csske
      Consider a different accelerator, QEMU, or kernel version

Again, the user can either explicitly disable this feature or use the
deprecated_features attribute and everything is fine, but that isn't
immediately clear.

I am now wondering if this filtering should be handled via libvirt
instead of QEMU?  Right now, it is possible to run virsh domcapabilities
and provide a --disable-deprecated-features flag, which currently only
presents the host-model with deprecated features disabled.  I wonder if
this functionality should be extended to the custom models in this
output as well?  This could be done by simply checking the blocking
features against the deprecated features and filtering them out when the
command flag is provided.

I've added Christian, Hendrik, and Boris to CC to gather their input.

Thank you for posing your question.

-- 
Regards,
  Collin


      reply	other threads:[~2026-07-09 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 20:21 [PATCH] target/s390x: query-cpu-definitions filter deprecated features Collin Walling
2026-07-09  5:13 ` Markus Armbruster
2026-07-09 16:50   ` Collin Walling [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=526e5b56-ee82-45e1-b2fc-d8d9a073d3ff@linux.ibm.com \
    --to=walling@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brueckner@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@kernel.org \
    --cc=farman@linux.ibm.com \
    --cc=fiuczy@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.