Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
David Hildenbrandwrites: > On 22.08.2017 16:24, Cornelia Huck wrote: >> On Tue, 22 Aug 2017 15:22:52 +0200 >> Marc-André Lureau wrote: >> >>> Signed-off-by: Marc-André Lureau >>> --- >>> qapi-schema.json| 10 +++--- >>> include/sysemu/arch_init.h | 6 -- >>> monitor.c | 14 -- >>> qmp.c | 14 -- >>> stubs/arch-query-cpu-model-baseline.c | 12 >>> stubs/arch-query-cpu-model-comparison.c | 12 >>> target/s390x/cpu_models.c | 4 ++-- >>> stubs/Makefile.objs | 2 -- >>> 8 files changed, 9 insertions(+), 65 deletions(-) >>> delete mode 100644 stubs/arch-query-cpu-model-baseline.c >>> delete mode 100644 stubs/arch-query-cpu-model-comparison.c >>> >>> diff --git a/qapi-schema.json b/qapi-schema.json >>> index 58574b3044..d4e1552ddc 100644 >>> --- a/qapi-schema.json >>> +++ b/qapi-schema.json >>> @@ -3577,7 +3577,8 @@ >>> # >>> ## >>> { 'command': 'dump-skeys', >>> - 'data': { 'filename': 'str' } } >>> + 'data': { 'filename': 'str' }, >>> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} >> >> I agree with making this s390x specific... >>> >>> ## >>> # @netdev_add: >>> @@ -4621,7 +4622,9 @@ >>> ## >>> { 'command': 'query-cpu-model-comparison', >>>'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, >>> - 'returns': 'CpuModelCompareInfo' } >>> + 'returns': 'CpuModelCompareInfo', >>> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} >>> + >>> >>> ## >>> # @CpuModelBaselineInfo: >>> @@ -4673,7 +4676,8 @@ >>> { 'command': 'query-cpu-model-baseline', >>>'data': { 'modela': 'CpuModelInfo', >>> 'modelb': 'CpuModelInfo' }, >>> - 'returns': 'CpuModelBaselineInfo' } >>> + 'returns': 'CpuModelBaselineInfo', >>> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} >> >> ...but I'm not sure about the cpu model stuff. Wasn't the idea to move >> to this model for all architectures later? (Given that we have stubs >> for architectures not implementing this, instead of ifdeffing it in >> monitor.c) >> > > +1, not architecture specific (in contrast to skey), simply not > supported _yet_ on other architectures. Yes, but Marc-André's patch makes the "not supported yet" information available in query-qmp-schema. Carrying such information is pretty much the point of schema introspection. We could add a comment explaining this command isn't target-specific, but just happens not to be implemented for some targets. Would that help?
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
David Hildenbrandwrites: >> Yes, but Marc-André's patch makes the "not supported yet" information >> available in query-qmp-schema. Carrying such information is pretty much >> the point of schema introspection. >> >> We could add a comment explaining this command isn't target-specific, >> but just happens not to be implemented for some targets. Would that >> help? >> > > Certainly! Let's do it then.
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
> Yes, but Marc-André's patch makes the "not supported yet" information > available in query-qmp-schema. Carrying such information is pretty much > the point of schema introspection. > > We could add a comment explaining this command isn't target-specific, > but just happens not to be implemented for some targets. Would that > help? > Certainly! -- Thanks, David
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
Hi - Original Message - > On Tue, 22 Aug 2017 10:41:34 -0400 (EDT) > Marc-André Lureauwrote: > > > Hi > > > > - Original Message - > > > On 22.08.2017 16:24, Cornelia Huck wrote: > > > > On Tue, 22 Aug 2017 15:22:52 +0200 > > > > Marc-André Lureau wrote: > > > > >> @@ -4621,7 +4622,9 @@ > > > >> ## > > > >> { 'command': 'query-cpu-model-comparison', > > > >>'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, > > > >> - 'returns': 'CpuModelCompareInfo' } > > > >> + 'returns': 'CpuModelCompareInfo', > > > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > > >> + > > > >> > > > >> ## > > > >> # @CpuModelBaselineInfo: > > > >> @@ -4673,7 +4676,8 @@ > > > >> { 'command': 'query-cpu-model-baseline', > > > >>'data': { 'modela': 'CpuModelInfo', > > > >> 'modelb': 'CpuModelInfo' }, > > > >> - 'returns': 'CpuModelBaselineInfo' } > > > >> + 'returns': 'CpuModelBaselineInfo', > > > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > > > > > > > ...but I'm not sure about the cpu model stuff. Wasn't the idea to move > > > > to this model for all architectures later? (Given that we have stubs > > > > for architectures not implementing this, instead of ifdeffing it in > > > > monitor.c) > > > > > > > > > > +1, not architecture specific (in contrast to skey), simply not > > > supported _yet_ on other architectures. > > > > We can add other archs once they implement it. See for example: > > "qapi: make query-cpu-model-expansion depend on s390 or x86" > > That seems a bit like whack-a-mole, though. Depending on something like > "provides cpumodel feature xy" makes it clearer that this is supposed > to be non-architecture-specific. I would say the function name and documentation should say if it's architecture specific. The #ifdef in qapi generation or in qemu code base is just an implementation detail. I suggest to add FIXME in the schema so people looking at this realize it's not yet there (instead of error stubs in qemu code / runtime). >
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
On Tue, 22 Aug 2017 10:41:34 -0400 (EDT) Marc-André Lureauwrote: > Hi > > - Original Message - > > On 22.08.2017 16:24, Cornelia Huck wrote: > > > On Tue, 22 Aug 2017 15:22:52 +0200 > > > Marc-André Lureau wrote: > > >> @@ -4621,7 +4622,9 @@ > > >> ## > > >> { 'command': 'query-cpu-model-comparison', > > >>'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, > > >> - 'returns': 'CpuModelCompareInfo' } > > >> + 'returns': 'CpuModelCompareInfo', > > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > >> + > > >> > > >> ## > > >> # @CpuModelBaselineInfo: > > >> @@ -4673,7 +4676,8 @@ > > >> { 'command': 'query-cpu-model-baseline', > > >>'data': { 'modela': 'CpuModelInfo', > > >> 'modelb': 'CpuModelInfo' }, > > >> - 'returns': 'CpuModelBaselineInfo' } > > >> + 'returns': 'CpuModelBaselineInfo', > > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > > > > > ...but I'm not sure about the cpu model stuff. Wasn't the idea to move > > > to this model for all architectures later? (Given that we have stubs > > > for architectures not implementing this, instead of ifdeffing it in > > > monitor.c) > > > > > > > +1, not architecture specific (in contrast to skey), simply not > > supported _yet_ on other architectures. > > We can add other archs once they implement it. See for example: > "qapi: make query-cpu-model-expansion depend on s390 or x86" That seems a bit like whack-a-mole, though. Depending on something like "provides cpumodel feature xy" makes it clearer that this is supposed to be non-architecture-specific.
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
Hi - Original Message - > On 22.08.2017 16:24, Cornelia Huck wrote: > > On Tue, 22 Aug 2017 15:22:52 +0200 > > Marc-André Lureauwrote: > > > >> Signed-off-by: Marc-André Lureau > >> --- > >> qapi-schema.json| 10 +++--- > >> include/sysemu/arch_init.h | 6 -- > >> monitor.c | 14 -- > >> qmp.c | 14 -- > >> stubs/arch-query-cpu-model-baseline.c | 12 > >> stubs/arch-query-cpu-model-comparison.c | 12 > >> target/s390x/cpu_models.c | 4 ++-- > >> stubs/Makefile.objs | 2 -- > >> 8 files changed, 9 insertions(+), 65 deletions(-) > >> delete mode 100644 stubs/arch-query-cpu-model-baseline.c > >> delete mode 100644 stubs/arch-query-cpu-model-comparison.c > >> > >> diff --git a/qapi-schema.json b/qapi-schema.json > >> index 58574b3044..d4e1552ddc 100644 > >> --- a/qapi-schema.json > >> +++ b/qapi-schema.json > >> @@ -3577,7 +3577,8 @@ > >> # > >> ## > >> { 'command': 'dump-skeys', > >> - 'data': { 'filename': 'str' } } > >> + 'data': { 'filename': 'str' }, > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > > > I agree with making this s390x specific... > >> > >> ## > >> # @netdev_add: > >> @@ -4621,7 +4622,9 @@ > >> ## > >> { 'command': 'query-cpu-model-comparison', > >>'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, > >> - 'returns': 'CpuModelCompareInfo' } > >> + 'returns': 'CpuModelCompareInfo', > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > >> + > >> > >> ## > >> # @CpuModelBaselineInfo: > >> @@ -4673,7 +4676,8 @@ > >> { 'command': 'query-cpu-model-baseline', > >>'data': { 'modela': 'CpuModelInfo', > >> 'modelb': 'CpuModelInfo' }, > >> - 'returns': 'CpuModelBaselineInfo' } > >> + 'returns': 'CpuModelBaselineInfo', > >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > > > ...but I'm not sure about the cpu model stuff. Wasn't the idea to move > > to this model for all architectures later? (Given that we have stubs > > for architectures not implementing this, instead of ifdeffing it in > > monitor.c) > > > > +1, not architecture specific (in contrast to skey), simply not > supported _yet_ on other architectures. We can add other archs once they implement it. See for example: "qapi: make query-cpu-model-expansion depend on s390 or x86" Thanks
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
On Tue, 22 Aug 2017 15:22:52 +0200 Marc-André Lureauwrote: > Signed-off-by: Marc-André Lureau > --- > qapi-schema.json| 10 +++--- > include/sysemu/arch_init.h | 6 -- > monitor.c | 14 -- > qmp.c | 14 -- > stubs/arch-query-cpu-model-baseline.c | 12 > stubs/arch-query-cpu-model-comparison.c | 12 > target/s390x/cpu_models.c | 4 ++-- > stubs/Makefile.objs | 2 -- > 8 files changed, 9 insertions(+), 65 deletions(-) > delete mode 100644 stubs/arch-query-cpu-model-baseline.c > delete mode 100644 stubs/arch-query-cpu-model-comparison.c > > diff --git a/qapi-schema.json b/qapi-schema.json > index 58574b3044..d4e1552ddc 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3577,7 +3577,8 @@ > # > ## > { 'command': 'dump-skeys', > - 'data': { 'filename': 'str' } } > + 'data': { 'filename': 'str' }, > + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} I agree with making this s390x specific... > > ## > # @netdev_add: > @@ -4621,7 +4622,9 @@ > ## > { 'command': 'query-cpu-model-comparison', >'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, > - 'returns': 'CpuModelCompareInfo' } > + 'returns': 'CpuModelCompareInfo', > + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > + > > ## > # @CpuModelBaselineInfo: > @@ -4673,7 +4676,8 @@ > { 'command': 'query-cpu-model-baseline', >'data': { 'modela': 'CpuModelInfo', > 'modelb': 'CpuModelInfo' }, > - 'returns': 'CpuModelBaselineInfo' } > + 'returns': 'CpuModelBaselineInfo', > + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} ...but I'm not sure about the cpu model stuff. Wasn't the idea to move to this model for all architectures later? (Given that we have stubs for architectures not implementing this, instead of ifdeffing it in monitor.c) > > ## > # @AddfdInfo: > diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h > index 8751c468ed..e9f1ea0cca 100644 > --- a/include/sysemu/arch_init.h > +++ b/include/sysemu/arch_init.h > @@ -35,11 +35,5 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error > **errp); > CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType > type, >CpuModelInfo *mode, >Error **errp); > -CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela, > - CpuModelInfo *modelb, > - Error **errp); > -CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela, > -CpuModelInfo *modelb, > -Error **errp); > > #endif > diff --git a/monitor.c b/monitor.c > index fcacf10f59..c9f04652b4 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -971,19 +971,12 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject > **ret_data, > */ > static void qmp_unregister_commands_hack(void) > { > -#ifndef TARGET_S390X > -qmp_unregister_command(_commands, "dump-skeys"); > -#endif > #ifndef TARGET_ARM > qmp_unregister_command(_commands, "query-gic-capabilities"); > #endif > #if !defined(TARGET_S390X) && !defined(TARGET_I386) > qmp_unregister_command(_commands, "query-cpu-model-expansion"); > #endif > -#if !defined(TARGET_S390X) > -qmp_unregister_command(_commands, "query-cpu-model-baseline"); > -qmp_unregister_command(_commands, "query-cpu-model-comparison"); > -#endif > #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \ > && !defined(TARGET_S390X) > qmp_unregister_command(_commands, "query-cpu-definitions"); > @@ -4153,13 +4146,6 @@ QemuOptsList qemu_mon_opts = { > }, > }; > > -#ifndef TARGET_S390X > -void qmp_dump_skeys(const char *filename, Error **errp) > -{ > -error_setg(errp, QERR_FEATURE_DISABLED, "dump-skeys"); > -} > -#endif > - > #ifndef TARGET_ARM > GICCapabilityList *qmp_query_gic_capabilities(Error **errp) > { > diff --git a/qmp.c b/qmp.c > index 90816ba283..7b6861846f 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -553,20 +553,6 @@ CpuModelExpansionInfo > *qmp_query_cpu_model_expansion(CpuModelExpansionType type, > return arch_query_cpu_model_expansion(type, model, errp); > } > > -CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *modela, > -CpuModelInfo *modelb, > -Error **errp) > -{ > -return arch_query_cpu_model_comparison(modela, modelb, errp); > -} > - > -CpuModelBaselineInfo *qmp_query_cpu_model_baseline(CpuModelInfo
Re: [Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
On 22.08.2017 16:24, Cornelia Huck wrote: > On Tue, 22 Aug 2017 15:22:52 +0200 > Marc-André Lureauwrote: > >> Signed-off-by: Marc-André Lureau >> --- >> qapi-schema.json| 10 +++--- >> include/sysemu/arch_init.h | 6 -- >> monitor.c | 14 -- >> qmp.c | 14 -- >> stubs/arch-query-cpu-model-baseline.c | 12 >> stubs/arch-query-cpu-model-comparison.c | 12 >> target/s390x/cpu_models.c | 4 ++-- >> stubs/Makefile.objs | 2 -- >> 8 files changed, 9 insertions(+), 65 deletions(-) >> delete mode 100644 stubs/arch-query-cpu-model-baseline.c >> delete mode 100644 stubs/arch-query-cpu-model-comparison.c >> >> diff --git a/qapi-schema.json b/qapi-schema.json >> index 58574b3044..d4e1552ddc 100644 >> --- a/qapi-schema.json >> +++ b/qapi-schema.json >> @@ -3577,7 +3577,8 @@ >> # >> ## >> { 'command': 'dump-skeys', >> - 'data': { 'filename': 'str' } } >> + 'data': { 'filename': 'str' }, >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > I agree with making this s390x specific... >> >> ## >> # @netdev_add: >> @@ -4621,7 +4622,9 @@ >> ## >> { 'command': 'query-cpu-model-comparison', >>'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, >> - 'returns': 'CpuModelCompareInfo' } >> + 'returns': 'CpuModelCompareInfo', >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} >> + >> >> ## >> # @CpuModelBaselineInfo: >> @@ -4673,7 +4676,8 @@ >> { 'command': 'query-cpu-model-baseline', >>'data': { 'modela': 'CpuModelInfo', >> 'modelb': 'CpuModelInfo' }, >> - 'returns': 'CpuModelBaselineInfo' } >> + 'returns': 'CpuModelBaselineInfo', >> + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} > > ...but I'm not sure about the cpu model stuff. Wasn't the idea to move > to this model for all architectures later? (Given that we have stubs > for architectures not implementing this, instead of ifdeffing it in > monitor.c) > +1, not architecture specific (in contrast to skey), simply not supported _yet_ on other architectures. -- Thanks, David
[Qemu-devel] [PATCH v2 51/54] qapi: make s390 commands depend on TARGET_S390X
Signed-off-by: Marc-André Lureau--- qapi-schema.json| 10 +++--- include/sysemu/arch_init.h | 6 -- monitor.c | 14 -- qmp.c | 14 -- stubs/arch-query-cpu-model-baseline.c | 12 stubs/arch-query-cpu-model-comparison.c | 12 target/s390x/cpu_models.c | 4 ++-- stubs/Makefile.objs | 2 -- 8 files changed, 9 insertions(+), 65 deletions(-) delete mode 100644 stubs/arch-query-cpu-model-baseline.c delete mode 100644 stubs/arch-query-cpu-model-comparison.c diff --git a/qapi-schema.json b/qapi-schema.json index 58574b3044..d4e1552ddc 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3577,7 +3577,8 @@ # ## { 'command': 'dump-skeys', - 'data': { 'filename': 'str' } } + 'data': { 'filename': 'str' }, + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} ## # @netdev_add: @@ -4621,7 +4622,9 @@ ## { 'command': 'query-cpu-model-comparison', 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, - 'returns': 'CpuModelCompareInfo' } + 'returns': 'CpuModelCompareInfo', + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} + ## # @CpuModelBaselineInfo: @@ -4673,7 +4676,8 @@ { 'command': 'query-cpu-model-baseline', 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' }, - 'returns': 'CpuModelBaselineInfo' } + 'returns': 'CpuModelBaselineInfo', + 'if': ['defined(NEED_CPU_H)', 'defined(TARGET_S390X)']} ## # @AddfdInfo: diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index 8751c468ed..e9f1ea0cca 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -35,11 +35,5 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp); CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type, CpuModelInfo *mode, Error **errp); -CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela, - CpuModelInfo *modelb, - Error **errp); -CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela, -CpuModelInfo *modelb, -Error **errp); #endif diff --git a/monitor.c b/monitor.c index fcacf10f59..c9f04652b4 100644 --- a/monitor.c +++ b/monitor.c @@ -971,19 +971,12 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data, */ static void qmp_unregister_commands_hack(void) { -#ifndef TARGET_S390X -qmp_unregister_command(_commands, "dump-skeys"); -#endif #ifndef TARGET_ARM qmp_unregister_command(_commands, "query-gic-capabilities"); #endif #if !defined(TARGET_S390X) && !defined(TARGET_I386) qmp_unregister_command(_commands, "query-cpu-model-expansion"); #endif -#if !defined(TARGET_S390X) -qmp_unregister_command(_commands, "query-cpu-model-baseline"); -qmp_unregister_command(_commands, "query-cpu-model-comparison"); -#endif #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \ && !defined(TARGET_S390X) qmp_unregister_command(_commands, "query-cpu-definitions"); @@ -4153,13 +4146,6 @@ QemuOptsList qemu_mon_opts = { }, }; -#ifndef TARGET_S390X -void qmp_dump_skeys(const char *filename, Error **errp) -{ -error_setg(errp, QERR_FEATURE_DISABLED, "dump-skeys"); -} -#endif - #ifndef TARGET_ARM GICCapabilityList *qmp_query_gic_capabilities(Error **errp) { diff --git a/qmp.c b/qmp.c index 90816ba283..7b6861846f 100644 --- a/qmp.c +++ b/qmp.c @@ -553,20 +553,6 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, return arch_query_cpu_model_expansion(type, model, errp); } -CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *modela, -CpuModelInfo *modelb, -Error **errp) -{ -return arch_query_cpu_model_comparison(modela, modelb, errp); -} - -CpuModelBaselineInfo *qmp_query_cpu_model_baseline(CpuModelInfo *modela, - CpuModelInfo *modelb, - Error **errp) -{ -return arch_query_cpu_model_baseline(modela, modelb, errp); -} - void qmp_add_client(const char *protocol, const char *fdname, bool has_skipauth, bool skipauth, bool has_tls, bool tls, Error **errp) diff --git a/stubs/arch-query-cpu-model-baseline.c b/stubs/arch-query-cpu-model-baseline.c deleted file mode 100644 index 094ec13c2c..00 --- a/stubs/arch-query-cpu-model-baseline.c +++ /dev/null @@