The ARM implementation of query-cpu-model-expansion only
supports full expansion, so we have to make sure we're using
that expansion mode if we want to obtain any useful data.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 7 +-
.../caps_4.1.0.aarch64.replies | 100 ++++++++++++++++--
.../caps_4.1.0.aarch64.xml | 42 ++++++++
3 files changed, 141 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b3fbc76d07..e87bde837a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2509,10 +2509,13 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
* the initial static expansion to get all variants of feature names.
*/
if (ARCH_IS_X86(qemuCaps->arch) &&
- !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES))
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CANONICAL_CPU_FEATURES)) {
type = QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC_FULL;
- else
+ } else if (ARCH_IS_ARM(qemuCaps->arch)) {
+ type = QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL;
+ } else {
type = QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC;
+ }
if (qemuMonitorGetCPUModelExpansion(mon, type, model, true, &modelInfo) < 0)
goto cleanup;
diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.replies
b/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.replies
index 4dd40ecee6..66c7bc4237 100644
--- a/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.replies
+++ b/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.replies
@@ -20280,7 +20280,7 @@
{
"execute": "query-cpu-model-expansion",
"arguments": {
- "type": "static",
+ "type": "full",
"model": {
"name": "host"
}
@@ -20289,10 +20289,54 @@
}
{
- "id": "libvirt-42",
+ "return": {
+ "model": {
+ "name": "host",
+ "props": {
+ "sve128": false,
+ "sve768": false,
+ "sve1024": false,
+ "sve1280": false,
+ "sve256": false,
+ "sve896": false,
+ "sve1536": false,
+ "sve1792": false,
+ "sve384": false,
+ "sve": false,
+ "sve2048": false,
+ "sve512": false,
+ "aarch64": true,
+ "pmu": true,
+ "sve1920": false,
+ "sve1152": false,
+ "sve640": false,
+ "sve1408": false,
+ "sve1664": false
+ }
+ }
+ },
+ "id": "libvirt-42"
+}
+
+{
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "host",
+ "props": {
+ "migratable": false
+ }
+ }
+ },
+ "id": "libvirt-43"
+}
+
+{
+ "id": "libvirt-43",
"error": {
"class": "GenericError",
- "desc": "The requested expansion type is not supported."
+ "desc": "Parameter 'migratable' is unexpected"
}
}
@@ -20506,7 +20550,7 @@
{
"execute": "query-cpu-model-expansion",
"arguments": {
- "type": "static",
+ "type": "full",
"model": {
"name": "max"
}
@@ -20515,9 +20559,53 @@
}
{
- "id": "libvirt-3",
+ "return": {
+ "model": {
+ "name": "max",
+ "props": {
+ "sve128": true,
+ "sve768": true,
+ "sve1024": true,
+ "sve1280": true,
+ "sve256": true,
+ "sve896": true,
+ "sve1536": true,
+ "sve1792": true,
+ "sve384": true,
+ "sve": true,
+ "sve2048": true,
+ "sve512": true,
+ "aarch64": true,
+ "pmu": true,
+ "sve1920": true,
+ "sve1152": true,
+ "sve640": true,
+ "sve1408": true,
+ "sve1664": true
+ }
+ }
+ },
+ "id": "libvirt-3"
+}
+
+{
+ "execute": "query-cpu-model-expansion",
+ "arguments": {
+ "type": "full",
+ "model": {
+ "name": "max",
+ "props": {
+ "migratable": false
+ }
+ }
+ },
+ "id": "libvirt-4"
+}
+
+{
+ "id": "libvirt-4",
"error": {
"class": "GenericError",
- "desc": "The requested expansion type is not supported."
+ "desc": "Parameter 'migratable' is unexpected"
}
}
diff --git a/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.xml
b/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.xml
index 99def43be9..950b954bdd 100644
--- a/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.1.0.aarch64.xml
@@ -171,6 +171,48 @@
<microcodeVersion>61700759</microcodeVersion>
<package>v4.0.0-1532-ga44ee58faa-dirty</package>
<arch>aarch64</arch>
+ <hostCPU type='kvm' model='host' migratability='no'>
+ <property name='sve128' type='boolean' value='false'/>
+ <property name='sve768' type='boolean' value='false'/>
+ <property name='sve1024' type='boolean'
value='false'/>
+ <property name='sve1280' type='boolean'
value='false'/>
+ <property name='sve256' type='boolean' value='false'/>
+ <property name='sve896' type='boolean' value='false'/>
+ <property name='sve1536' type='boolean'
value='false'/>
+ <property name='sve1792' type='boolean'
value='false'/>
+ <property name='sve384' type='boolean' value='false'/>
+ <property name='sve' type='boolean' value='false'/>
+ <property name='sve2048' type='boolean'
value='false'/>
+ <property name='sve512' type='boolean' value='false'/>
+ <property name='aarch64' type='boolean' value='true'/>
+ <property name='pmu' type='boolean' value='true'/>
+ <property name='sve1920' type='boolean'
value='false'/>
+ <property name='sve1152' type='boolean'
value='false'/>
+ <property name='sve640' type='boolean' value='false'/>
+ <property name='sve1408' type='boolean'
value='false'/>
+ <property name='sve1664' type='boolean'
value='false'/>
+ </hostCPU>
+ <hostCPU type='tcg' model='max' migratability='no'>
+ <property name='sve128' type='boolean' value='true'/>
+ <property name='sve768' type='boolean' value='true'/>
+ <property name='sve1024' type='boolean' value='true'/>
+ <property name='sve1280' type='boolean' value='true'/>
+ <property name='sve256' type='boolean' value='true'/>
+ <property name='sve896' type='boolean' value='true'/>
+ <property name='sve1536' type='boolean' value='true'/>
+ <property name='sve1792' type='boolean' value='true'/>
+ <property name='sve384' type='boolean' value='true'/>
+ <property name='sve' type='boolean' value='true'/>
+ <property name='sve2048' type='boolean' value='true'/>
+ <property name='sve512' type='boolean' value='true'/>
+ <property name='aarch64' type='boolean' value='true'/>
+ <property name='pmu' type='boolean' value='true'/>
+ <property name='sve1920' type='boolean' value='true'/>
+ <property name='sve1152' type='boolean' value='true'/>
+ <property name='sve640' type='boolean' value='true'/>
+ <property name='sve1408' type='boolean' value='true'/>
+ <property name='sve1664' type='boolean' value='true'/>
+ </hostCPU>
<cpu type='kvm' name='pxa262'/>
<cpu type='kvm' name='pxa270-a0'/>
<cpu type='kvm' name='arm1136'/>
--
2.21.0