From 25c52cb32f4734b0f4a94d52a390e8169ac4e803 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Mon, 24 Jun 2019 14:16:17 +0200 Subject: [PATCH] qemu: Perform full expansion on ARM 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 Tested-by: Andrew Jones Reviewed-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 7 +- .../caps_4.2.0.aarch64.replies | 100 ++++++++++++++++-- .../caps_4.2.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 363fb0e197..fc6473651c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2559,10 +2559,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; + } /* Older s390 models do not report a feature set */ if (ARCH_IS_S390(qemuCaps->arch)) diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies index efd193d90d..127f121680 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.replies @@ -21228,7 +21228,7 @@ { "execute": "query-cpu-model-expansion", "arguments": { - "type": "static", + "type": "full", "model": { "name": "host" } @@ -21237,10 +21237,54 @@ } { - "id": "libvirt-42", + "return": { + "model": { + "name": "host", + "props": { + "sve768": false, + "sve128": true, + "sve1024": false, + "sve1280": false, + "sve896": false, + "sve256": true, + "sve1536": false, + "sve1792": false, + "sve384": false, + "sve": true, + "sve2048": false, + "sve512": true, + "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" } } @@ -21454,7 +21498,7 @@ { "execute": "query-cpu-model-expansion", "arguments": { - "type": "static", + "type": "full", "model": { "name": "max" } @@ -21463,9 +21507,53 @@ } { - "id": "libvirt-3", + "return": { + "model": { + "name": "max", + "props": { + "sve768": true, + "sve128": true, + "sve1024": true, + "sve1280": true, + "sve896": true, + "sve256": 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.2.0.aarch64.xml b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml index a4cb7ba4e6..17960460fb 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml @@ -175,6 +175,48 @@ 61700242 v4.1.0-2221-g36609b4fa3 aarch64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +