qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 9d5139: vl: Clean up user-creatable objects w


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9d5139: vl: Clean up user-creatable objects when exiting
Date: Wed, 20 Sep 2017 11:16:10 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9d5139e543e8579aacd324193680c64fd1463d89
      
https://github.com/qemu/qemu/commit/9d5139e543e8579aacd324193680c64fd1463d89
  Author: Eduardo Habkost <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M include/qom/object_interfaces.h
    M qom/object_interfaces.c
    M vl.c

  Log Message:
  -----------
  vl: Clean up user-creatable objects when exiting

Delete all user-creatable objects in /objects when exiting QEMU, so they
can perform cleanup actions.

Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Acked-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Zack Cornelius <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 0f81d3353029d26c6f8731a65d8052c532b1ced6
      
https://github.com/qemu/qemu/commit/0f81d3353029d26c6f8731a65d8052c532b1ced6
  Author: Eduardo Habkost <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  osdep: Define QEMU_MADV_REMOVE

Define QEMU_MADV_REMOVE, so we can use it with qemu_madvise().

Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Tested-by: Zack Cornelius <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 11ae6ed8affdd131e735bac39b21e7d3cde66f7b
      
https://github.com/qemu/qemu/commit/11ae6ed8affdd131e735bac39b21e7d3cde66f7b
  Author: Eduardo Habkost <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M backends/hostmem-file.c
    M qemu-options.hx

  Log Message:
  -----------
  hostmem-file: Add "discard-data" option

The new option can be used to indicate that the file contents can
be destroyed and don't need to be flushed to disk when QEMU exits
or when the memory backend object is removed.

Internally, it will trigger a madvise(MADV_REMOVE) call when the
memory backend is removed.

Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
[ehabkost: fixup: improved documentation]
Reviewed-by: Daniel P. Berrange <address@hidden>
Tested-by: Zack Cornelius <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 3c72234c98004a01d79a24f78b07053cfebd0f22
      
https://github.com/qemu/qemu/commit/3c72234c98004a01d79a24f78b07053cfebd0f22
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M include/qom/cpu.h
    M qom/cpu.c

  Log Message:
  -----------
  qom: cpus: split cpu_generic_init() on feature parsing and cpu creation parts

it would allow to reuse feature parsing part in various machines
that have CPU features instead of re-implementing the same feature
parsing each time.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4482e05cbbb7e50e476f6a9500cf0b38913bd939
      
https://github.com/qemu/qemu/commit/4482e05cbbb7e50e476f6a9500cf0b38913bd939
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M bsd-user/main.c
    M hw/alpha/dp264.c
    M hw/arm/musicpal.c
    M hw/arm/omap1.c
    M hw/arm/omap2.c
    M hw/arm/pxa2xx.c
    M hw/arm/strongarm.c
    M hw/lm32/lm32_boards.c
    M hw/lm32/milkymist.c
    M hw/m68k/an5206.c
    M hw/m68k/mcf5208.c
    M hw/mips/cps.c
    M hw/mips/mips_fulong2e.c
    M hw/mips/mips_jazz.c
    M hw/mips/mips_malta.c
    M hw/mips/mips_mipssim.c
    M hw/mips/mips_r4k.c
    M hw/moxie/moxiesim.c
    M hw/openrisc/openrisc_sim.c
    M hw/ppc/e500.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/ppc440_bamboo.c
    M hw/ppc/ppc4xx_devs.c
    M hw/ppc/prep.c
    M hw/ppc/virtex_ml507.c
    M hw/sh4/r2d.c
    M hw/sh4/shix.c
    M hw/sparc/leon3.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sparc64.c
    M hw/tricore/tricore_testboard.c
    M hw/unicore32/puv3.c
    M hw/xtensa/sim.c
    M hw/xtensa/xtfpga.c
    M include/qom/cpu.h
    M linux-user/main.c
    M qom/cpu.c

  Log Message:
  -----------
  cpu: make cpu_generic_init() abort QEMU on error

Almost every user of cpu_generic_init() checks for
returned NULL and then reports failure in a custom way
and aborts process.
Some users assume that call can't fail and don't check
for failure, though they should have checked for it.

In either cases cpu_generic_init() failure is fatal,
so instead of checking for failure and reporting
it various ways, make cpu_generic_init() report
errors in consistent way and terminate QEMU on failure.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 6063d4c0f98b35a27ca018393d328a1825412a7e
      
https://github.com/qemu/qemu/commit/6063d4c0f98b35a27ca018393d328a1825412a7e
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M include/hw/boards.h
    M vl.c

  Log Message:
  -----------
  vl.c: convert cpu_model to cpu type and set of global properties before 
machine_init()

All machines that support user specified cpu_model either call
cpu_generic_init() or cpu_class_by_name()/CPUClass::parse_features
to parse feature string and to get CPU type to create.

Which leads to code duplication and hard-codding default CPU model
within machine_foo_init() code. Which makes it impossible to
get CPU type before machine_init() is run.

So instead of setting default CPUs models and doing parsing in
target specific machine_foo_init() in various ways, provide
a generic data driven cpu_model parsing before machine_init()
is called.

in follow up per target patches, it will allow to:
  * define default CPU type in consistent/generic manner
    per machine type and drop custom code that fallbacks
    to default if cpu_model is NULL
  * drop custom features parsing in targets and do it
    in centralized way.
  * for cases of
      cpu_generic_init(TYPE_BASE/DEFAULT_CPU, "some_cpu")
    replace it with
      cpu_create(machine->cpu_type) || cpu_create(TYPE_FOO)
    depending if CPU type is user settable or not.
    not doing useless parsing and clearly documenting where
    CPU model is user settable or fixed one.

Patch allows machine subclasses to define default CPU type
per machine class at class_init() time and if that is set
generic code will parse cpu_model into a MachineState::cpu_type
which will be used to create CPUs for that machine instance
and allows gradual per board conversion.

Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Acked-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 311ca98d16bbb6a2a38b38ba898baa4a4d4ab9a7
      
https://github.com/qemu/qemu/commit/311ca98d16bbb6a2a38b38ba898baa4a4d4ab9a7
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M target/i386/cpu.c
    M target/i386/cpu.h

  Log Message:
  -----------
  pc: use generic cpu_model parsing

define default CPU type in generic way in pc_machine_class_init()
and let common machine code to handle cpu_model parsing

Patch also introduces TARGET_DEFAULT_CPU_TYPE define for 2 purposes:
  * make foo_machine_class_init() look uniform on every target
  * use define in [bsd|linux]-user targets to pick default
    cpu type

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: ba1ba5cca3962a9cc400c713c736b4fb8db1f38e
      
https://github.com/qemu/qemu/commit/ba1ba5cca3962a9cc400c713c736b4fb8db1f38e
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M hw/arm/armv7m.c
    M hw/arm/aspeed_soc.c
    M hw/arm/collie.c
    M hw/arm/exynos4210.c
    M hw/arm/gumstix.c
    M hw/arm/highbank.c
    M hw/arm/integratorcp.c
    M hw/arm/mainstone.c
    M hw/arm/mps2.c
    M hw/arm/musicpal.c
    M hw/arm/netduino2.c
    M hw/arm/nseries.c
    M hw/arm/omap1.c
    M hw/arm/omap2.c
    M hw/arm/omap_sx1.c
    M hw/arm/palm.c
    M hw/arm/pxa2xx.c
    M hw/arm/realview.c
    M hw/arm/spitz.c
    M hw/arm/stellaris.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/strongarm.c
    M hw/arm/tosa.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/z2.c
    M include/hw/arm/armv7m.h
    M include/hw/arm/aspeed_soc.h
    M include/hw/arm/stm32f205_soc.h
    M target/arm/cpu.c
    M target/arm/cpu.h

  Log Message:
  -----------
  arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly

there are 2 use cases to deal with:
  1: fixed CPU models per board/soc
  2: boards with user configurable cpu_model and fallback to
     default cpu_model if user hasn't specified one explicitly

For the 1st
  drop intermediate cpu_model parsing and use const cpu type
  directly, which replaces:
     typename = object_class_get_name(
     cpu_class_by_name(TYPE_ARM_CPU, cpu_model))
     object_new(typename)
  with
     object_new(FOO_CPU_TYPE_NAME)
  or
     cpu_generic_init(BASE_CPU_TYPE, "my cpu model")
  with
     cpu_create(FOO_CPU_TYPE_NAME)

as result 1st use case doesn't have to invoke not necessary
translation and not needed code is removed.

For the 2nd
 1: set default cpu type with MachineClass::default_cpu_type and
 2: use generic cpu_model parsing that done before machine_init()
    is run and:
    2.1: drop custom cpu_model parsing where pattern is:
       typename = object_class_get_name(
     cpu_class_by_name(TYPE_ARM_CPU, cpu_model))
       [parse_features(typename, cpu_model, &err) ]

    2.2: or replace cpu_generic_init() which does what
   2.1 does + create_cpu(typename) with just
   create_cpu(machine->cpu_type)
as result cpu_name -> cpu_type translation is done using
generic machine code one including parsing optional features
if supported/present (removes a bunch of duplicated cpu_model
parsing code) and default cpu type is defined in an uniform way
within machine_class_init callbacks instead of adhoc places
in boadr's machine_init code.

Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 79e0793614fcd6b5674fa96180b66971c37d1dfd
      
https://github.com/qemu/qemu/commit/79e0793614fcd6b5674fa96180b66971c37d1dfd
  Author: Igor Mammedov <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M hw/arm/virt.c
    M hw/core/machine.c
    M hw/i386/pc.c
    M hw/ppc/spapr.c
    M include/hw/boards.h

  Log Message:
  -----------
  numa: cpu: calculate/set default node-ids after all -numa CLI options are 
parsed

Calculating default node-ids for CPUs in possible_cpu_arch_ids()
is rather fragile since defaults calculation uses nb_numa_nodes but
callback might be potentially called early before all -numa CLI
options are parsed, which would lead to cpus assigned only upto
nb_numa_nodes at the time possible_cpu_arch_ids() is called.

Issue was introduced by
(7c88e65 numa: mirror cpu to node mapping in MachineState::possible_cpus)
and for example CLI:
  -smp 4 -numa node,cpus=0 -numa node
would set props.node-id in possible_cpus array for every non
explicitly mapped CPU to the first node.

Issue is not visible to guest nor to mgmt interface due to
  1) implictly mapped cpus are forced to the first node in
     case of partial mapping
  2) in case of default mapping possible_cpu_arch_ids() is
     called after all -numa options are parsed (resulting
     in correct mapping).

However it's fragile to rely on late execution of
possible_cpu_arch_ids(), therefore add machine specific
callback that returns node-id for CPU and use it to calculate/
set defaults at machine_numa_finish_init() time when all -numa
options are parsed.

Reported-by: Eduardo Habkost <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: f51878ba863d1f6938bc8e04381979767b7b508c
      
https://github.com/qemu/qemu/commit/f51878ba863d1f6938bc8e04381979767b7b508c
  Author: Dou Liyang <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M numa.c

  Log Message:
  -----------
  NUMA: Replace MAX_NODES with nb_numa_nodes in for loop

In QEMU, the number of the NUMA nodes is determined by parse_numa_opts().
Then, QEMU uses it for iteration, for example:
  for (i = 0; i < nb_numa_nodes; i++)

However, in memory_region_allocate_system_memory(), it uses MAX_NODES
not nb_numa_nodes.

So, replace MAX_NODES with nb_numa_nodes to keep code consistency and
reduce the loop times.

Signed-off-by: Dou Liyang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: 4926403c250fc41dc2d27f1c77e200e7d3d239cd
      
https://github.com/qemu/qemu/commit/4926403c250fc41dc2d27f1c77e200e7d3d239cd
  Author: Eduardo Habkost <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  hw/acpi-build: Fix SRAT memory building in case of node 0 without RAM

Currently, Using the fisrt node without memory on the machine makes
QEMU unhappy. With this example command line:
  ... \
  -m 1024M,slots=4,maxmem=32G \
  -numa node,nodeid=0 \
  -numa node,mem=1024M,nodeid=1 \
  -numa node,nodeid=2 \
  -numa node,nodeid=3 \
Guest reports "No NUMA configuration found" and the NUMA topology is
wrong.

This is because when QEMU builds ACPI SRAT, it regards node 0 as the
default node to deal with the memory hole(640K-1M). this means the
node0 must have some memory(>1M), but, actually it can have no
memory.

Fix this problem by cut out the 640K hole in the same way the PCI
4G hole does.

Signed-off-by: Eduardo Habkost <address@hidden>
Signed-off-by: Dou Liyang <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: e3d038b89f1bf3f09da4d59aa16b16e8305e1a05
      
https://github.com/qemu/qemu/commit/e3d038b89f1bf3f09da4d59aa16b16e8305e1a05
  Author: Eduardo Habkost <address@hidden>
  Date:   2017-09-19 (Tue, 19 Sep 2017)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Update git URLs for my trees

List the branches where I queue patches for Machine Core, NUMA,
Memory Backends, and X86.  Update the NUMA section to list the
"machine-next" branch instead of "numa".

Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>


  Commit: d3f5433c7b4aa2d59c6de4175743f4126e181aea
      
https://github.com/qemu/qemu/commit/d3f5433c7b4aa2d59c6de4175743f4126e181aea
  Author: Peter Maydell <address@hidden>
  Date:   2017-09-20 (Wed, 20 Sep 2017)

  Changed paths:
    M MAINTAINERS
    M backends/hostmem-file.c
    M bsd-user/main.c
    M hw/alpha/dp264.c
    M hw/arm/armv7m.c
    M hw/arm/aspeed_soc.c
    M hw/arm/collie.c
    M hw/arm/exynos4210.c
    M hw/arm/gumstix.c
    M hw/arm/highbank.c
    M hw/arm/integratorcp.c
    M hw/arm/mainstone.c
    M hw/arm/mps2.c
    M hw/arm/musicpal.c
    M hw/arm/netduino2.c
    M hw/arm/nseries.c
    M hw/arm/omap1.c
    M hw/arm/omap2.c
    M hw/arm/omap_sx1.c
    M hw/arm/palm.c
    M hw/arm/pxa2xx.c
    M hw/arm/realview.c
    M hw/arm/spitz.c
    M hw/arm/stellaris.c
    M hw/arm/stm32f205_soc.c
    M hw/arm/strongarm.c
    M hw/arm/tosa.c
    M hw/arm/versatilepb.c
    M hw/arm/vexpress.c
    M hw/arm/virt.c
    M hw/arm/xilinx_zynq.c
    M hw/arm/z2.c
    M hw/core/machine.c
    M hw/i386/acpi-build.c
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/lm32/lm32_boards.c
    M hw/lm32/milkymist.c
    M hw/m68k/an5206.c
    M hw/m68k/mcf5208.c
    M hw/mips/cps.c
    M hw/mips/mips_fulong2e.c
    M hw/mips/mips_jazz.c
    M hw/mips/mips_malta.c
    M hw/mips/mips_mipssim.c
    M hw/mips/mips_r4k.c
    M hw/moxie/moxiesim.c
    M hw/openrisc/openrisc_sim.c
    M hw/ppc/e500.c
    M hw/ppc/mac_newworld.c
    M hw/ppc/mac_oldworld.c
    M hw/ppc/ppc440_bamboo.c
    M hw/ppc/ppc4xx_devs.c
    M hw/ppc/prep.c
    M hw/ppc/spapr.c
    M hw/ppc/virtex_ml507.c
    M hw/sh4/r2d.c
    M hw/sh4/shix.c
    M hw/sparc/leon3.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sparc64.c
    M hw/tricore/tricore_testboard.c
    M hw/unicore32/puv3.c
    M hw/xtensa/sim.c
    M hw/xtensa/xtfpga.c
    M include/hw/arm/armv7m.h
    M include/hw/arm/aspeed_soc.h
    M include/hw/arm/stm32f205_soc.h
    M include/hw/boards.h
    M include/qemu/osdep.h
    M include/qom/cpu.h
    M include/qom/object_interfaces.h
    M linux-user/main.c
    M numa.c
    M qemu-options.hx
    M qom/cpu.c
    M qom/object_interfaces.c
    M target/arm/cpu.c
    M target/arm/cpu.h
    M target/i386/cpu.c
    M target/i386/cpu.h
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/ehabkost/tags/machine-next-pull-request' into staging

Machine/CPU/NUMA queue, 2017-09-19

# gpg: Signature made Tue 19 Sep 2017 21:17:01 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <address@hidden>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-pull-request:
  MAINTAINERS: Update git URLs for my trees
  hw/acpi-build: Fix SRAT memory building in case of node 0 without RAM
  NUMA: Replace MAX_NODES with nb_numa_nodes in for loop
  numa: cpu: calculate/set default node-ids after all -numa CLI options are 
parsed
  arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly
  pc: use generic cpu_model parsing
  vl.c: convert cpu_model to cpu type and set of global properties before 
machine_init()
  cpu: make cpu_generic_init() abort QEMU on error
  qom: cpus: split cpu_generic_init() on feature parsing and cpu creation parts
  hostmem-file: Add "discard-data" option
  osdep: Define QEMU_MADV_REMOVE
  vl: Clean up user-creatable objects when exiting

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/c51700273ad9...d3f5433c7b4a

reply via email to

[Prev in Thread] Current Thread [Next in Thread]