QEMU-Arm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Khushit Shah <khushit.shah@nutanix.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"Eric Auger" <eric.auger@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Marc Zyngier" <maz@kernel.org>,
	"Oliver Upton" <oliver.upton@linux.dev>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Andrea Bolognani" <abologna@redhat.com>,
	"Jiri Denemark" <jdenemar@redhat.com>,
	"Gavin Shan" <gshan@redhat.com>,
	"Shameer Kolothum" <skolothumtho@nvidia.com>,
	"Sebastian Ott" <sebott@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Jinqian Yang" <yangjinqian1@huawei.com>,
	"Shaju Abraham" <shaju.abraham@nutanix.com>,
	"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
	"Sandesh Patel" <sandesh.patel@nutanix.com>
Subject: Re: [RFC PATCH v2 23/29] target/arm/qmp: add query-arm-cpu-props-info
Date: Mon, 06 Jul 2026 14:28:11 +0200	[thread overview]
Message-ID: <87bjcknvz8.fsf@pond.sub.org> (raw)
In-Reply-To: <17B524D0-6D08-4ECF-93FC-E38EB0F8F6D7@nutanix.com> (Khushit Shah's message of "Fri, 19 Jun 2026 11:54:19 +0000")

I apologize for taking so long to reply.

Khushit Shah <khushit.shah@nutanix.com> writes:

>> On 19 Jun 2026, at 2:55 PM, Markus Armbruster <armbru@redhat.com> wrote:
>> 
>> !-------------------------------------------------------------------|
>>  CAUTION: External Email
>> 
>> |-------------------------------------------------------------------!
>> 
>> Khushit Shah <khushit.shah@nutanix.com> writes:
>> 
>>> Introduce 'query-arm-cpu-props-info' QMP command. This command returns
>>> information about ARM CPU model properties, including their name, type,
>>> supported values on the given host, and composite parent if any.
>>> 
>>> This provides management layer necessary information to determine
>>> migration compatibility off a VM on different host.
>
> Note: s/off/of.
>
>>> 
>>> Signed-off-by: Khushit Shah <khushit.shah@nutanix.com>
>>> ---
>>> qapi/misc-arm.json              | 41 ++++++++++++++++
>>> stubs/qmp-arm-gic.c             |  6 +++
>>> target/arm/arm-cpu-props-stub.c | 13 +++++
>>> target/arm/arm-cpu-props.c      | 85 +++++++++++++++++++++++++++++++++
>>> target/arm/arm-cpu-props.h      |  5 ++
>>> target/arm/arm-qmp-cmds.c       | 44 +++++++++++++++++
>>> target/arm/cpu-idregs.c         | 71 +++++++++++++++++++++++++++
>>> target/arm/cpu-idregs.h         |  8 ++++
>>> 8 files changed, 273 insertions(+)
>>> 
>>> diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json
>>> index 4dc66d00e5..1a3fb140c4 100644
>>> --- a/qapi/misc-arm.json
>>> +++ b/qapi/misc-arm.json
>>> @@ -46,6 +46,47 @@
>>> ##
>>> { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
>>> 
>>> +##
>>> +# @CpuPropInfo:
>> 
>> CpuPropertyInfo for consistency with type names such as ObjectPropertyInfo.
>
> Acked. 
>
>>> +#
>>> +# Information about a specific ARM CPU model property.
>>> +#
>>> +# @name: the name of the property
>>> +#
>>> +# @type: the type of the property, any of ('string', 'boolean',
>>> +#     'number').
>>> +#
>>> +# @supported-values: the set of values the host hardware supports
>>> +#     for the property, a list of strings.
>> 
>> I figure the set of values depends on the host, i.e. it isn't known at
>> compile time.  Correct?
>> 
>
> Yes, correct.
>
>> Are the possible property names known at compile time?
>
> Yes, property names are known at compile time.

Why can't we use a struct then?

    { 'struct': ...
      'data': {
          'PROP1': 'TYPE1',
          'PROP2': 'TYPE2',
          ... } }

>> List of strings is fine when the values are strings.  When they're not,
>> the interface requires its users to parse strings, which is something we
>> try hard to avoid in QAPI/QMP.
>
> Okay, then I think we can do this with flat union discriminated with 
> “type” (changing it to enum) :
>    boolean: [‘bool’]
>    string: [’str’]
>    number: ['NumRange’] where NumRange: {‘min’: uint64, ‘max’: uint64}
>
> Range form to handle numeric properties with no restrictions.
>
> Does this look reasonable to you?

Yes, this is a reasonable way to do dynamic typing in QAPI.

I still need to understand why you you dynamic types here.

[...]



  reply	other threads:[~2026-07-06 12:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05  8:33 [RFC PATCH v2 00/29] target/arm: Named CPU models for Arm64 on KVM Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 01/29] target/arm: named_cpu_model: define containers for ID registers and fields Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 02/29] target/arm: Add ID Register field descriptions in cpu-idregs.h.inc Khushit Shah
2026-06-12  9:35   ` Eric Auger
2026-06-12 11:01     ` Khushit Shah
2026-06-17  6:32   ` Eric Auger
2026-06-05  8:33 ` [RFC PATCH v2 03/29] target/arm: Add MIDR, REVIDR, AIDR and extra ID regs to cpu-sysregs Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 04/29] target/arm: Generate ARM64 ID registers and field tables Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 05/29] target/arm: Replace FIELD() macros with IDREG_FIELD expansion Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 06/29] target/arm: Introduce data-structures for the ARM property layer Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 07/29] target/arm: Define ARM properties Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 08/29] target/arm: Add ID register field helper functions Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 09/29] target/arm: Add all ARM64 properties to host model Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 10/29] target/arm: Add named cpu model infra + graviton3 named model Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 11/29] target/arm: Add Nvidia Grace " Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 12/29] target/arm/kvm: Writeback modified ID registers to KVM Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 13/29] target/arm/kvm: enable writable implementation ID registers Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 14/29] target/arm: Validate cpu->isar.idregs[] before writeback Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 15/29] target/arm/kvm: handle DCZID_EL0 specially Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 16/29] target/arm: skip GIC, COPDBG and PMU fields during KVM writeback Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 17/29] target/arm: Add composite property type to model definitions Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 18/29] target/arm: define pauth composite property Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 19/29] target/arm: define sve " Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 20/29] target/arm: Introduce stub files required for qmp support Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 21/29] target/arm/qmp: add named models and properties to cpu-model-expansion Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 22/29] target/arm/kvm: introduce kvm_arm_get_host_isar helper Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 23/29] target/arm/qmp: add query-arm-cpu-props-info Khushit Shah
2026-06-19  9:25   ` Markus Armbruster
2026-06-19 11:54     ` Khushit Shah
2026-07-06 12:28       ` Markus Armbruster [this message]
2026-06-19  9:51   ` Daniel P. Berrangé
2026-06-19 11:06     ` Andrea Bolognani
2026-06-19 12:04     ` Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 24/29] target/arm: Report "off" for ID fields gated by vCPU init flags Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 25/29] target/arm/qmp: hook blockers in query-cpu-definitions Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 26/29] target/arm: Support exposing cache information for named cpu models Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 27/29] target/arm: Provide default cache hierarchy Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 28/29] target/arm: supported-values and blockers for CCSIDR cache properties Khushit Shah
2026-06-05  8:33 ` [RFC PATCH v2 29/29] target/arm/kvm: fix host model writeback when kernel supports EL2 Khushit Shah
2026-06-12 14:50 ` [RFC PATCH v2 00/29] target/arm: Named CPU models for Arm64 on KVM Eric Auger
2026-06-15  5:45   ` Khushit Shah
2026-06-15 16:15     ` Eric Auger

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=87bjcknvz8.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=abologna@redhat.com \
    --cc=berrange@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=gshan@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=khushit.shah@nutanix.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=mark.caveayland@nutanix.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sandesh.patel@nutanix.com \
    --cc=sebott@redhat.com \
    --cc=shaju.abraham@nutanix.com \
    --cc=skolothumtho@nvidia.com \
    --cc=yangjinqian1@huawei.com \
    /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