[libvirt PATCH 0/8] Drop 'monitor' from modern x86 CPU models

Jiri Denemark posted 8 patches 3 days, 4 hours ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1605900836.git.jdenemar@redhat.com
src/conf/cpu_conf.c                           |  50 +++++--
src/conf/cpu_conf.h                           |   5 +
src/cpu/cpu.c                                 |  52 +++----
src/cpu/cpu.h                                 |   3 +-
src/cpu/cpu_arm.c                             |   5 +-
src/cpu/cpu_ppc64.c                           |   3 +-
src/cpu/cpu_s390.c                            |   6 +-
src/cpu/cpu_x86.c                             | 127 ++++++++++++++----
src/cpu_map/x86_Dhyana.xml                    |   2 +-
src/cpu_map/x86_EPYC-IBPB.xml                 |   2 +-
src/cpu_map/x86_EPYC.xml                      |   2 +-
src/cpu_map/x86_Opteron_G3.xml                |   2 +-
src/libvirt_private.syms                      |   1 +
.../x86_64-cpuid-EPYC-7601-32-Core-guest.xml  |   1 +
.../x86_64-cpuid-EPYC-7601-32-Core-host.xml   |   1 +
..._64-cpuid-EPYC-7601-32-Core-ibpb-guest.xml |   1 +
...6_64-cpuid-EPYC-7601-32-Core-ibpb-host.xml |   1 +
...6_64-cpuid-EPYC-7601-32-Core-ibpb-json.xml |   2 +-
.../x86_64-cpuid-EPYC-7601-32-Core-json.xml   |   2 +-
..._64-cpuid-Hygon-C86-7185-32-core-guest.xml |   1 +
...6_64-cpuid-Hygon-C86-7185-32-core-host.xml |   1 +
...6_64-cpuid-Hygon-C86-7185-32-core-json.xml |   2 +-
.../x86_64-cpuid-Opteron-1352-guest.xml       |   1 +
.../x86_64-cpuid-Opteron-1352-host.xml        |   1 +
.../x86_64-cpuid-Opteron-2350-guest.xml       |   1 +
.../x86_64-cpuid-Opteron-2350-host.xml        |   1 +
.../x86_64-cpuid-Opteron-2350-json.xml        |   2 +-
.../x86_64-cpuid-Phenom-B95-guest.xml         |   1 +
.../x86_64-cpuid-Phenom-B95-json.xml          |   2 +-
...4-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml |   1 +
...64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml |   1 +
...64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml |   2 +-
.../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml |   1 +
.../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml |   1 +
.../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  |   1 +
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  |   1 +
.../cpu-host-model-cmt.x86_64-4.0.0.args      |   6 +-
43 files changed, 223 insertions(+), 78 deletions(-)

[libvirt PATCH 0/8] Drop 'monitor' from modern x86 CPU models

Posted by Jiri Denemark 3 days, 4 hours ago
Doing so would normally break migration to older libvirt, but most of
the patches in this series prepare an infrastructure for removing
features from existing CPU models while maintaining backward
compatibility during migration.

See patch 7 for more details.

https://bugzilla.redhat.com/show_bug.cgi?id=1798004

Jiri Denemark (8):
  conf: Rename virCPUDefUpdateFeatureInternal
  conf: Use enum in virCPUDefAddFeatureInternal
  conf: Add virCPUDefAddFeatureIfMissing
  cpu: Run arch specific code for virCPUUpdate for all custom CPUs
  cpu_x86: Change the flow in virCPUx86Update
  cpu_x86: Add support for marking features as removed from a CPU model
  cpu_x86: Make sure removed features are always mentioned in CPU def
  cpu_map: Drop 'monitor' from modern x86 CPU models

 src/conf/cpu_conf.c                           |  50 +++++--
 src/conf/cpu_conf.h                           |   5 +
 src/cpu/cpu.c                                 |  52 +++----
 src/cpu/cpu.h                                 |   3 +-
 src/cpu/cpu_arm.c                             |   5 +-
 src/cpu/cpu_ppc64.c                           |   3 +-
 src/cpu/cpu_s390.c                            |   6 +-
 src/cpu/cpu_x86.c                             | 127 ++++++++++++++----
 src/cpu_map/x86_Dhyana.xml                    |   2 +-
 src/cpu_map/x86_EPYC-IBPB.xml                 |   2 +-
 src/cpu_map/x86_EPYC.xml                      |   2 +-
 src/cpu_map/x86_Opteron_G3.xml                |   2 +-
 src/libvirt_private.syms                      |   1 +
 .../x86_64-cpuid-EPYC-7601-32-Core-guest.xml  |   1 +
 .../x86_64-cpuid-EPYC-7601-32-Core-host.xml   |   1 +
 ..._64-cpuid-EPYC-7601-32-Core-ibpb-guest.xml |   1 +
 ...6_64-cpuid-EPYC-7601-32-Core-ibpb-host.xml |   1 +
 ...6_64-cpuid-EPYC-7601-32-Core-ibpb-json.xml |   2 +-
 .../x86_64-cpuid-EPYC-7601-32-Core-json.xml   |   2 +-
 ..._64-cpuid-Hygon-C86-7185-32-core-guest.xml |   1 +
 ...6_64-cpuid-Hygon-C86-7185-32-core-host.xml |   1 +
 ...6_64-cpuid-Hygon-C86-7185-32-core-json.xml |   2 +-
 .../x86_64-cpuid-Opteron-1352-guest.xml       |   1 +
 .../x86_64-cpuid-Opteron-1352-host.xml        |   1 +
 .../x86_64-cpuid-Opteron-2350-guest.xml       |   1 +
 .../x86_64-cpuid-Opteron-2350-host.xml        |   1 +
 .../x86_64-cpuid-Opteron-2350-json.xml        |   2 +-
 .../x86_64-cpuid-Phenom-B95-guest.xml         |   1 +
 .../x86_64-cpuid-Phenom-B95-json.xml          |   2 +-
 ...4-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml |   1 +
 ...64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml |   1 +
 ...64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml |   2 +-
 .../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml |   1 +
 .../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml |   1 +
 .../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  |   1 +
 .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  |   1 +
 .../cpu-host-model-cmt.x86_64-4.0.0.args      |   6 +-
 43 files changed, 223 insertions(+), 78 deletions(-)

-- 
2.29.2

Re: [libvirt PATCH 0/8] Drop 'monitor' from modern x86 CPU models

Posted by Daniel P. Berrangé 13 hours ago
On Fri, Nov 20, 2020 at 08:38:59PM +0100, Jiri Denemark wrote:
> Doing so would normally break migration to older libvirt, but most of
> the patches in this series prepare an infrastructure for removing
> features from existing CPU models while maintaining backward
> compatibility during migration.
> 
> See patch 7 for more details.

QEMU introduced versioned CPU models to allow them to add/remove
arbitrary features within a named model. What's the timeframe for
supporting those in libvirt. IIUC, that should stop us needing to
introduce special workarounds like this series ? 

> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1798004
> 
> Jiri Denemark (8):
>   conf: Rename virCPUDefUpdateFeatureInternal
>   conf: Use enum in virCPUDefAddFeatureInternal
>   conf: Add virCPUDefAddFeatureIfMissing
>   cpu: Run arch specific code for virCPUUpdate for all custom CPUs
>   cpu_x86: Change the flow in virCPUx86Update
>   cpu_x86: Add support for marking features as removed from a CPU model
>   cpu_x86: Make sure removed features are always mentioned in CPU def
>   cpu_map: Drop 'monitor' from modern x86 CPU models
> 
>  src/conf/cpu_conf.c                           |  50 +++++--
>  src/conf/cpu_conf.h                           |   5 +
>  src/cpu/cpu.c                                 |  52 +++----
>  src/cpu/cpu.h                                 |   3 +-
>  src/cpu/cpu_arm.c                             |   5 +-
>  src/cpu/cpu_ppc64.c                           |   3 +-
>  src/cpu/cpu_s390.c                            |   6 +-
>  src/cpu/cpu_x86.c                             | 127 ++++++++++++++----
>  src/cpu_map/x86_Dhyana.xml                    |   2 +-
>  src/cpu_map/x86_EPYC-IBPB.xml                 |   2 +-
>  src/cpu_map/x86_EPYC.xml                      |   2 +-
>  src/cpu_map/x86_Opteron_G3.xml                |   2 +-
>  src/libvirt_private.syms                      |   1 +
>  .../x86_64-cpuid-EPYC-7601-32-Core-guest.xml  |   1 +
>  .../x86_64-cpuid-EPYC-7601-32-Core-host.xml   |   1 +
>  ..._64-cpuid-EPYC-7601-32-Core-ibpb-guest.xml |   1 +
>  ...6_64-cpuid-EPYC-7601-32-Core-ibpb-host.xml |   1 +
>  ...6_64-cpuid-EPYC-7601-32-Core-ibpb-json.xml |   2 +-
>  .../x86_64-cpuid-EPYC-7601-32-Core-json.xml   |   2 +-
>  ..._64-cpuid-Hygon-C86-7185-32-core-guest.xml |   1 +
>  ...6_64-cpuid-Hygon-C86-7185-32-core-host.xml |   1 +
>  ...6_64-cpuid-Hygon-C86-7185-32-core-json.xml |   2 +-
>  .../x86_64-cpuid-Opteron-1352-guest.xml       |   1 +
>  .../x86_64-cpuid-Opteron-1352-host.xml        |   1 +
>  .../x86_64-cpuid-Opteron-2350-guest.xml       |   1 +
>  .../x86_64-cpuid-Opteron-2350-host.xml        |   1 +
>  .../x86_64-cpuid-Opteron-2350-json.xml        |   2 +-
>  .../x86_64-cpuid-Phenom-B95-guest.xml         |   1 +
>  .../x86_64-cpuid-Phenom-B95-json.xml          |   2 +-
>  ...4-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml |   1 +
>  ...64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml |   1 +
>  ...64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml |   2 +-
>  .../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml |   1 +
>  .../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml |   1 +
>  .../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  |   1 +
>  .../cpu-host-model-cmt.x86_64-4.0.0.args      |   6 +-
>  43 files changed, 223 insertions(+), 78 deletions(-)
> 
> -- 
> 2.29.2
> 

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 :|

Re: [libvirt PATCH 0/8] Drop 'monitor' from modern x86 CPU models

Posted by Jiri Denemark 11 hours ago
On Mon, Nov 23, 2020 at 10:15:11 +0000, Daniel P. Berrangé wrote:
> On Fri, Nov 20, 2020 at 08:38:59PM +0100, Jiri Denemark wrote:
> > Doing so would normally break migration to older libvirt, but most of
> > the patches in this series prepare an infrastructure for removing
> > features from existing CPU models while maintaining backward
> > compatibility during migration.
> > 
> > See patch 7 for more details.
> 
> QEMU introduced versioned CPU models to allow them to add/remove
> arbitrary features within a named model. What's the timeframe for
> supporting those in libvirt.

No idea, to be honest. QEMU currently does not provide all data we need
to start using it. I've been (occasionally, though) asking for QMP
extension for some time.

> IIUC, that should stop us needing to introduce special workarounds
> like this series ?

However, versioned CPU models would not save us in this case anyway as
QEMU did not introduce a new versions of models when removing "monitor".
This workaround is targeted at features which were included in CPU
models mostly accident and when they were not in fact enabled even
though the definitions of the CPU models contained them.

Jirka

Re: [libvirt PATCH 0/8] Drop 'monitor' from modern x86 CPU models

Posted by Tim Wiederhake 14 hours ago
On Fri, 2020-11-20 at 20:38 +0100, Jiri Denemark wrote:
> Doing so would normally break migration to older libvirt, but most of
> the patches in this series prepare an infrastructure for removing
> features from existing CPU models while maintaining backward
> compatibility during migration.
> 
> See patch 7 for more details.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1798004
> 
> Jiri Denemark (8):
>   conf: Rename virCPUDefUpdateFeatureInternal
>   conf: Use enum in virCPUDefAddFeatureInternal
>   conf: Add virCPUDefAddFeatureIfMissing
>   cpu: Run arch specific code for virCPUUpdate for all custom CPUs
>   cpu_x86: Change the flow in virCPUx86Update
>   cpu_x86: Add support for marking features as removed from a CPU
> model
>   cpu_x86: Make sure removed features are always mentioned in CPU def
>   cpu_map: Drop 'monitor' from modern x86 CPU models
> 
>  src/conf/cpu_conf.c                           |  50 +++++--
>  src/conf/cpu_conf.h                           |   5 +
>  src/cpu/cpu.c                                 |  52 +++----
>  src/cpu/cpu.h                                 |   3 +-
>  src/cpu/cpu_arm.c                             |   5 +-
>  src/cpu/cpu_ppc64.c                           |   3 +-
>  src/cpu/cpu_s390.c                            |   6 +-
>  src/cpu/cpu_x86.c                             | 127 ++++++++++++++
> ----
>  src/cpu_map/x86_Dhyana.xml                    |   2 +-
>  src/cpu_map/x86_EPYC-IBPB.xml                 |   2 +-
>  src/cpu_map/x86_EPYC.xml                      |   2 +-
>  src/cpu_map/x86_Opteron_G3.xml                |   2 +-
>  src/libvirt_private.syms                      |   1 +
>  .../x86_64-cpuid-EPYC-7601-32-Core-guest.xml  |   1 +
>  .../x86_64-cpuid-EPYC-7601-32-Core-host.xml   |   1 +
>  ..._64-cpuid-EPYC-7601-32-Core-ibpb-guest.xml |   1 +
>  ...6_64-cpuid-EPYC-7601-32-Core-ibpb-host.xml |   1 +
>  ...6_64-cpuid-EPYC-7601-32-Core-ibpb-json.xml |   2 +-
>  .../x86_64-cpuid-EPYC-7601-32-Core-json.xml   |   2 +-
>  ..._64-cpuid-Hygon-C86-7185-32-core-guest.xml |   1 +
>  ...6_64-cpuid-Hygon-C86-7185-32-core-host.xml |   1 +
>  ...6_64-cpuid-Hygon-C86-7185-32-core-json.xml |   2 +-
>  .../x86_64-cpuid-Opteron-1352-guest.xml       |   1 +
>  .../x86_64-cpuid-Opteron-1352-host.xml        |   1 +
>  .../x86_64-cpuid-Opteron-2350-guest.xml       |   1 +
>  .../x86_64-cpuid-Opteron-2350-host.xml        |   1 +
>  .../x86_64-cpuid-Opteron-2350-json.xml        |   2 +-
>  .../x86_64-cpuid-Phenom-B95-guest.xml         |   1 +
>  .../x86_64-cpuid-Phenom-B95-json.xml          |   2 +-
>  ...4-cpuid-Ryzen-7-1800X-Eight-Core-guest.xml |   1 +
>  ...64-cpuid-Ryzen-7-1800X-Eight-Core-host.xml |   1 +
>  ...64-cpuid-Ryzen-7-1800X-Eight-Core-json.xml |   2 +-
>  .../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml |   1 +
>  .../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml |   1 +
>  .../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml  |   1 +
>  .../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml  |   1 +
>  .../cpu-host-model-cmt.x86_64-4.0.0.args      |   6 +-
>  43 files changed, 223 insertions(+), 78 deletions(-)
> 

lgtm.

Do we want to have a schema for the cpu definitions in src/cpu_map/
somewhen, maybe as a "bite sized task"? I do understand it is kind of
superfluous, but if it *can* be tested automatically...

Reviewed-by: Tim Wiederhake <twiederh@redhat.com>

Cheers,
Tim