On 24/06/26 4:09 pm, Peter Krempa wrote:
!-------------------------------------------------------------------|
   CAUTION: External Email

|-------------------------------------------------------------------!

On Wed, Jun 24, 2026 at 09:17:05 +0000, sandesh.patel--- via Devel wrote:
From: Sandesh Patel <[email protected]>

Unlike x86 boolean CPU features, ARM CPU features are exposed by QEMU
as multi-bit properties whose accepted values depend on the host; only
a subset of the possible values are valid on any given host.

A pending QEMU patch series [1] introduces a new QMP command,
'query-arm-cpu-props-info', which returns, for each ARM CPU property,
its type and the set of values supported on the host.

Add support to query feature supported values

[1] 
https://urldefense.proofpoint.com/v2/url?u=https-3A__lore.kernel.org_qemu-2Darm_20260605083358.1320563-2D1-2Dkhushit.shah-40nutanix.com_&d=DwIBAg&c=s883GpUCOChKOHiocYtGcg&r=ajsBdxrgfuOrDmj3TI1N33i_5h3O1lAyZdKxTAgvVEo&m=ttWBaHtlPQe6ILcqLrfw-SIv9lvGPFkRogl_dWW9zf81f6iCCdIpjr5z8RP0B4sW&s=yVv9khJte1ZvEBSqBlfoCxbrvsOnvbn3aMK5ItGRB8A&e=

Signed-off-by: Sandesh Patel <[email protected]>
---
Couple points about capability changes:

  src/qemu/qemu_capabilities.c                  | 13 +++
  src/qemu/qemu_capabilities.h                  |  1 +
  src/qemu/qemu_monitor.c                       | 51 +++++++++++
  src/qemu/qemu_monitor.h                       | 26 ++++++
  src/qemu/qemu_monitor_json.c                  | 66 ++++++++++++++
  src/qemu/qemu_monitor_json.h                  |  5 +
  .../caps_11.1.0_aarch64.replies               | 69 ++++++++++++++
  .../caps_11.1.0_aarch64.xml                   |  1 +
  tests/qemumonitorjsontest.c                   | 91 +++++++++++++++++++
  9 files changed, 323 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a28f87ad2b..cb933aa630 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -767,6 +767,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
/* 495 */
                "blockdev-mirror.target-is-zero", /* 
QEMU_CAPS_BLOCKDEV_MIRROR_TARGET_IS_ZERO */
+              "query-arm-cpu-props-info", /* 
QEMU_CAPS_QUERY_ARM_CPU_PROPS_INFO */
Generally new capability goes in a separate patch to show what it
influences.
Ack. Addressed in new patchset.


      );
@@ -812,6 +813,7 @@ struct _virQEMUCapsAccel {
      virQEMUCapsMachineType *machineTypes;
      virQEMUCapsHostCPUData hostCPU;
      qemuMonitorCPUDefs *cpuModels;
+    qemuMonitorCPUPropsInfoList *cpuProps; /* currently only populated on ARM 
+ KVM */
  };
[...]

diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.replies 
b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.replies
index 41cd5496c6..40fd157680 100644
--- a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.replies
+++ b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.replies
@@ -24932,6 +24932,40 @@
          "in-use",
          "auto"
        ]
+    },
+    {
+      "name": "query-arm-cpu-props-info",
+      "ret-type": "[999]",
+      "meta-type": "command",
+      "arg-type": "0"
+    },
+    {
+      "name": "[999]",
+      "element-type": "999",
+      "meta-type": "array"
+    },
+    {
+      "name": "999",
+      "members": [
+        {
+          "name": "name",
+          "type": "str"
+        },
+        {
+          "name": "type",
+          "type": "str"
+        },
+        {
+          "name": "supported-values",
+          "type": "[str]"
+        },
+        {
+          "name": "composite",
+          "default": null,
+          "type": "str"
+        }
+      ],
+      "meta-type": "object"
      }
    ],
    "id": "libvirt-4"
@@ -37945,6 +37979,41 @@
    }
  }
+{
+  "execute": "query-arm-cpu-props-info",
+  "id": "libvirt-46"
+}
+
+{
+  "return": [
+    {
+      "name": "hw_prop_WRPs",
+      "supported-values": [
+        "0-3"
+      ],
+      "type": "number"
+    },
+    {
+      "name": "hw_prop_API",
+      "composite": "pauth",
+      "supported-values": [
+        "off"
+      ],
+      "type": "string"
+    },
+    {
+      "name": "feat_RAS",
+      "supported-values": [
+        "0.0",
+        "1.0",
+        "1.1_base"
+      ],
+      "type": "string"
+    }
+  ],
+  "id": "libvirt-46"
+}
+
  {
    "execute": "qmp_capabilities",
    "id": "libvirt-1"
Changes to this file *must* be generated from a real qemu using the
dumping tool. Manual change like this are not acceptable.

Also changes to the capability dumps *must* be a separate patch.

The change will also only be accepted once the qemu code hits the
upstream repo. I'm taking care of re-generating this one so once the
corresponding code is upstream feel free to ping me to do a refresh.

In case the CPU I'm generating this on (a raspberry pi 5) doesn't
support what you need you can add another variant of the caps (see the
README in tests/qemucapabilitiesdata). In case you generate that on a
non-released qemu version you'll be also responsible to updating it once
qemu-11.1 is released. Further updates will happen only when you then
contribute another version of said variant once next qemu version is
released.
Thanks for the inputs. I have generated new dumps on a Graviton CPU
and added those in a separate patch. I plan to send final series only after
Qemu patches get merged so for now we need not worry about maintaining
the caps dumps.

Reply via email to