Skip to content

RFC generalize parsing of cpu_model

Igor Mammedov qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3machine: call machine init from wrapperhw/core/machine.c include/hw/boards.h vl.c+8 -10 replies
2/3machine: generalize handling of default cpu_modelhw/arm/virt.c hw/core/machine.c hw/i386/pc.c +2 more+31 -160 replies
3/3machine: generilize cpu_model parsinghw/arm/virt.c hw/core/machine.c hw/i386/pc.c +4 more+54 -830 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-arm] [RFC 0/3] generalize parsing of cpu_model

Some callers call CPUClass->parse_features manually to convert '-cpu cpufoo,featurestr' string to cpu type and featurestr into a set of global properties. And theni do controlled cpu creation with setting properties and completing it with realize. That's a lot of code duplication as they are practically reimplement the same parsing logic.

Some don't and use cpu_generic_init() instead which does the same parsing along with creation/realizing cpu within one wrapper.

And some trying to switch to controlled cpu creation,
implement object_new()/set properties/realize steps
but forget feature parsing logic witch lieads to 'bugs'
commit 00909b585 (hw/arm/integratorcp: Support specifying features via -cpu)

This series moves -cpu option parsing to generic machine code that removes a little of code duplication and makes cpus creation process more unified.

PS:
As I don't have time to rewrite this part QEMU, being busy rewritting yet another part of QEMU,
SERIES IS UNFINISHED AND SERVERS TO SHOW IDEA HOW IT SHOULD BE DONE. FEEL FREE TO PICK UP AND COMPLETE THIS PATCHES TO HANDLE ALL BOARDS (series does it only for virt-arm/spapr/pc)

It compiles and pc machine even starts but otherwise is untested.

CC Eduardo Habkost <[email protected]>
CC Peter Maydell <[email protected]>
CC Marcel Apfelbaum <[email protected]>
CC Paolo Bonzini <[email protected]>
CC David Gibson <[email protected]>
CC "Michael S. Tsirkin" <[email protected]>

Igor Mammedov (3):
machine: call machine init from wrapper
machine: generalize handling of default cpu_model
machine: generilize cpu_model parsing

 include/hw/boards.h  |  5 +++++
 include/hw/ppc/ppc.h |  2 --
 hw/arm/virt.c        | 46 ++++++++++---------------------------------
 hw/core/machine.c    | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/i386/pc.c         | 42 +++++++++++++--------------------------
 hw/ppc/ppc.c         | 25 ------------------------
 hw/ppc/spapr.c       | 14 +++++++------
 vl.c                 |  2 +-
 8 files changed, 92 insertions(+), 99 deletions(-)
Signature · 1 line
2.7.4