[libvirt] [PATCH] use model "qemu" for s390 tcg cpu-model-expansion

When calling the query-cpu-model-expansion command via libvirt, we pass in model name "max" when using TCG. However, this model name is not supported for s390 on TCG. Let's use the model name "qemu" as an alternative. QEMU Results: When executing query-cpu-model-expansion via QEMU on s390 with TCG, the name "max" results in this error: { "execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "max"}}} -> {"error": {"class": "GenericError", "desc": "The CPU definition 'max' is unknown."}} An alternative is to use model name "qemu." On a z13.2 machine: { "execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "qemu"}}} -> {"return": {"model": {"name": "zEC12.2-base", "props": {"dateh2": false, "aen": true, "kmac-tdea-192": false, "kmc-tdea-192": false, "parseh": false, "csske": false, "hfpm": false, "hfpue": false, "dfp": false, "km-dea": false, "emon": false, "kimd-sha-1": false, "cmpsceh": false, "dfpzc": false, "dfphp": false, "kmc-dea": false, "klmd-sha-1": false, "asnlxr": false, "km-tdea-192": false, "km-tdea-128": false, "fpe": false, "kmac-dea": false, "kmc-tdea-128": false, "ais": true, "kmac-tdea-128": false, "nonqks": false, "pfpo": false, "msa4-base": true, "msa3-base": true, "tods": false}}}} I am by all means *not* an expert in TCG, but I noticed this error while I was messing around with things on my system. Thanks! Collin Walling (1): qemu: caps: use model "qemu" for s390 tcg cpu-model-expansion src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.4

Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg. Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max"; } else { virtType = VIR_DOMAIN_VIRT_KVM; model = "host"; -- 2.7.4

On Mon, Jul 23, 2018 at 17:45:33 -0400, Collin Walling wrote:
Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max";
I think we should also check if "max" is a supported model (qemuCaps->tcgCPUModels is already populated at this point) and only use "qemu" on s390 if "max" is not supported. And please, report the issue to QEMU developers since one of the reasons behind "max" is its universal availability on everywhere CPU model expansion is supported. Jirka

On Tue, 24 Jul 2018 18:08:21 +0200 Jiri Denemark <jdenemar@redhat.com> wrote:
On Mon, Jul 23, 2018 at 17:45:33 -0400, Collin Walling wrote:
Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max";
I think we should also check if "max" is a supported model (qemuCaps->tcgCPUModels is already populated at this point) and only use "qemu" on s390 if "max" is not supported. And please, report the issue to QEMU developers since one of the reasons behind "max" is its universal availability on everywhere CPU model expansion is supported.
Hm, can you point me to that discussion? A quick search through the QEMU log gives me the addition of the "max" model on i386 as a replacement to the "host" model for !kvm, but nothing about it being universal...

On Tue, Jul 24, 2018 at 06:53:54PM +0200, Cornelia Huck wrote:
On Tue, 24 Jul 2018 18:08:21 +0200 Jiri Denemark <jdenemar@redhat.com> wrote:
On Mon, Jul 23, 2018 at 17:45:33 -0400, Collin Walling wrote:
Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max";
I think we should also check if "max" is a supported model (qemuCaps->tcgCPUModels is already populated at this point) and only use "qemu" on s390 if "max" is not supported. And please, report the issue to QEMU developers since one of the reasons behind "max" is its universal availability on everywhere CPU model expansion is supported.
Hm, can you point me to that discussion? A quick search through the QEMU log gives me the addition of the "max" model on i386 as a replacement to the "host" model for !kvm, but nothing about it being universal...
I don't recall the link but "max" is supposed to be the standard shorthand for "enable all the features supported by the virt type". IOW, 'max' should work both KVM and TCG ("host" was only well defined for KVM), and across all architectures. So having to use a different name on s390 is a bug in QEMU imho. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 07/24/2018 12:59 PM, Daniel P. Berrangé wrote:
On Tue, Jul 24, 2018 at 06:53:54PM +0200, Cornelia Huck wrote:
On Tue, 24 Jul 2018 18:08:21 +0200 Jiri Denemark <jdenemar@redhat.com> wrote:
On Mon, Jul 23, 2018 at 17:45:33 -0400, Collin Walling wrote:
Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max";
I think we should also check if "max" is a supported model (qemuCaps->tcgCPUModels is already populated at this point) and only use "qemu" on s390 if "max" is not supported. And please, report the issue to QEMU developers since one of the reasons behind "max" is its universal availability on everywhere CPU model expansion is supported.
Hm, can you point me to that discussion? A quick search through the QEMU log gives me the addition of the "max" model on i386 as a replacement to the "host" model for !kvm, but nothing about it being universal...
I don't recall the link but "max" is supposed to be the standard shorthand for "enable all the features supported by the virt type". IOW, 'max' should work both KVM and TCG ("host" was only well defined for KVM), and across all architectures.
So having to use a different name on s390 is a bug in QEMU imho.
Regards, Daniel
Thanks for expanding on what the "max" model name is suppose to be. I wonder if a s/"qemu"/"max" in QEMU would suffice (I'm taking a shot in the dark here.) @Connie, @David, you both are far more knowledgeable in this area than I am. What do either of you suggest for moving forward with this? Should we forward this discussion on qemu-devel? -- Respectfully, - Collin Walling

On 25.07.2018 01:02, Collin Walling wrote:
On 07/24/2018 12:59 PM, Daniel P. Berrangé wrote:
On Tue, Jul 24, 2018 at 06:53:54PM +0200, Cornelia Huck wrote:
On Tue, 24 Jul 2018 18:08:21 +0200 Jiri Denemark <jdenemar@redhat.com> wrote:
On Mon, Jul 23, 2018 at 17:45:33 -0400, Collin Walling wrote:
Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max";
I think we should also check if "max" is a supported model (qemuCaps->tcgCPUModels is already populated at this point) and only use "qemu" on s390 if "max" is not supported. And please, report the issue to QEMU developers since one of the reasons behind "max" is its universal availability on everywhere CPU model expansion is supported.
Hm, can you point me to that discussion? A quick search through the QEMU log gives me the addition of the "max" model on i386 as a replacement to the "host" model for !kvm, but nothing about it being universal...
I don't recall the link but "max" is supposed to be the standard shorthand for "enable all the features supported by the virt type". IOW, 'max' should work both KVM and TCG ("host" was only well defined for KVM), and across all architectures.
So having to use a different name on s390 is a bug in QEMU imho.
Regards, Daniel
Thanks for expanding on what the "max" model name is suppose to be. I wonder if a s/"qemu"/"max" in QEMU would suffice (I'm taking a shot in the dark here.)
Nope, it dynamically has to map to qemu/host depending on the accelerator. But it also has to be a valid QOM object ("max-s390x-cpu").
@Connie, @David, you both are far more knowledgeable in this area than I am. What do either of you suggest for moving forward with this? Should we forward this discussion on qemu-devel?
I can have a look if nobody else wants to tackle it. -- Thanks, David / dhildenb

On Wed, 25 Jul 2018 09:34:08 +0200 David Hildenbrand <david@redhat.com> wrote:
On 25.07.2018 01:02, Collin Walling wrote:
Thanks for expanding on what the "max" model name is suppose to be. I wonder if a s/"qemu"/"max" in QEMU would suffice (I'm taking a shot in the dark here.)
Nope, it dynamically has to map to qemu/host depending on the accelerator. But it also has to be a valid QOM object ("max-s390x-cpu").
@Connie, @David, you both are far more knowledgeable in this area than I am. What do either of you suggest for moving forward with this? Should we forward this discussion on qemu-devel?
I can have a look if nobody else wants to tackle it.
I'll gladly merge a patch :) This is probably 3.1 material, so libvirt will need compat handling for it, I guess.

On 24.07.2018 18:59, Daniel P. Berrangé wrote:
On Tue, Jul 24, 2018 at 06:53:54PM +0200, Cornelia Huck wrote:
On Tue, 24 Jul 2018 18:08:21 +0200 Jiri Denemark <jdenemar@redhat.com> wrote:
On Mon, Jul 23, 2018 at 17:45:33 -0400, Collin Walling wrote:
Use model name "qemu" instead of "max" when calling query-cpu-model-expansion for s390 on tcg.
Signed-off-by: Collin Walling <walling@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 23b4833..e9b44cc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2356,7 +2356,10 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { virtType = VIR_DOMAIN_VIRT_QEMU; - model = "max"; + if (ARCH_IS_S390(qemuCaps->arch)) + model = "qemu"; + else + model = "max";
I think we should also check if "max" is a supported model (qemuCaps->tcgCPUModels is already populated at this point) and only use "qemu" on s390 if "max" is not supported. And please, report the issue to QEMU developers since one of the reasons behind "max" is its universal availability on everywhere CPU model expansion is supported.
Hm, can you point me to that discussion? A quick search through the QEMU log gives me the addition of the "max" model on i386 as a replacement to the "host" model for !kvm, but nothing about it being universal...
I don't recall the link but "max" is supposed to be the standard shorthand for "enable all the features supported by the virt type". IOW, 'max' should work both KVM and TCG ("host" was only well defined for KVM), and across all architectures.
I remember the discussions and I agreed back than that this was the right thing to do. Looks like x86, arm and ppc have it. We should have it, too.
So having to use a different name on s390 is a bug in QEMU imho.
While this should be fixed, it is compat handling and not really a BUG.
Regards, Daniel
-- Thanks, David / dhildenb

On Mon, Jul 23, 2018 at 17:45:32 -0400, Collin Walling wrote:
When calling the query-cpu-model-expansion command via libvirt, we pass in model name "max" when using TCG. However, this model name is not supported for s390 on TCG. Let's use the model name "qemu" as an alternative.
QEMU Results:
When executing query-cpu-model-expansion via QEMU on s390 with TCG, the name "max" results in this error:
{ "execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "max"}}}
-> {"error": {"class": "GenericError", "desc": "The CPU definition 'max' is unknown."}}
An alternative is to use model name "qemu." On a z13.2 machine:
{ "execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "qemu"}}}
-> {"return": {"model": {"name": "zEC12.2-base", "props": {"dateh2": false, "aen": true, "kmac-tdea-192": false, "kmc-tdea-192": false, "parseh": false, "csske": false, "hfpm": false, "hfpue": false, "dfp": false, "km-dea": false, "emon": false, "kimd-sha-1": false, "cmpsceh": false, "dfpzc": false, "dfphp": false, "kmc-dea": false, "klmd-sha-1": false, "asnlxr": false, "km-tdea-192": false, "km-tdea-128": false, "fpe": false, "kmac-dea": false, "kmc-tdea-128": false, "ais": true, "kmac-tdea-128": false, "nonqks": false, "pfpo": false, "msa4-base": true, "msa3-base": true, "tods": false}}}}
Providing a cover letter for a single patch is pointless, all contents which you would put in it should go into the commit message of the patch itself.
I am by all means *not* an expert in TCG, but I noticed this error while I was messing around with things on my system.
Except this, but you could put it after --- Jirka

On 07/24/2018 12:03 PM, Jiri Denemark wrote:
On Mon, Jul 23, 2018 at 17:45:32 -0400, Collin Walling wrote:
When calling the query-cpu-model-expansion command via libvirt, we pass in model name "max" when using TCG. However, this model name is not supported for s390 on TCG. Let's use the model name "qemu" as an alternative.
QEMU Results:
When executing query-cpu-model-expansion via QEMU on s390 with TCG, the name "max" results in this error:
{ "execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "max"}}}
-> {"error": {"class": "GenericError", "desc": "The CPU definition 'max' is unknown."}}
An alternative is to use model name "qemu." On a z13.2 machine:
{ "execute": "query-cpu-model-expansion", "arguments": {"type": "static", "model": {"name": "qemu"}}}
-> {"return": {"model": {"name": "zEC12.2-base", "props": {"dateh2": false, "aen": true, "kmac-tdea-192": false, "kmc-tdea-192": false, "parseh": false, "csske": false, "hfpm": false, "hfpue": false, "dfp": false, "km-dea": false, "emon": false, "kimd-sha-1": false, "cmpsceh": false, "dfpzc": false, "dfphp": false, "kmc-dea": false, "klmd-sha-1": false, "asnlxr": false, "km-tdea-192": false, "km-tdea-128": false, "fpe": false, "kmac-dea": false, "kmc-tdea-128": false, "ais": true, "kmac-tdea-128": false, "nonqks": false, "pfpo": false, "msa4-base": true, "msa3-base": true, "tods": false}}}}
Providing a cover letter for a single patch is pointless, all contents which you would put in it should go into the commit message of the patch itself.
It probably would've made more sense to send the QEMU output as an attachment instead.
I am by all means *not* an expert in TCG, but I noticed this error while I was messing around with things on my system.
Except this, but you could put it after ---
Good to know. Thanks! :)
Jirka
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Respectfully, - Collin Walling
participants (5)
-
Collin Walling
-
Cornelia Huck
-
Daniel P. Berrangé
-
David Hildenbrand
-
Jiri Denemark