[Qemu-devel] [PATCH 0/3] spapr: fix CPU device tree nodes

Greg Kurz posted 3 patches 7 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/151618081462.20461.3393245354775542888.stgit@bahia.lan
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppc passed
Test s390x passed
hw/ppc/spapr.c                  |   30 ++++++++++++++++++------------
hw/ppc/spapr_cpu_core.c         |   15 +++++++++++++--
hw/ppc/spapr_rtas.c             |    9 ---------
include/hw/ppc/spapr_cpu_core.h |    2 ++
4 files changed, 33 insertions(+), 23 deletions(-)
[Qemu-devel] [PATCH 0/3] spapr: fix CPU device tree nodes
Posted by Greg Kurz 7 years, 9 months ago
When a compatibility mode is requested on the command line,
only the boot CPU core is correctly advertised in the device
tree. Any other CPU core, either hot-plugged or cold-plugged,
appears to be in raw mode with the host PVR.

Guest started on a POWER8 host with:
     -smp cores=2 -machine pseries,max-cpu-compat=compat7

# dtc -f -I fs -O dts /proc/device-tree | egrep 'cpu-version|pa-features'
                        ibm,pa-features = [18 00 f6 3f c7 c0 80 f0 80 00
 00 00 00 00 00 00 00 00 80 00 80 00 80 00 00 00];
                        cpu-version = <0x4d0200>;

                               ^^^
                        second CPU core

                        ibm,pa-features = <0x600f63f 0xc70080c0>;
                        cpu-version = <0xf000003>;

                               ^^^
                          boot CPU core

This happens because the compatibility mode for any CPU but
the boot one is set after the device tree was populated, and
exposed to the guest.

This series fixes the issue by setting the compatibility mode
during CPU reset. This is done in the last patch.

The first two patches are preliminary cleanup of the CPU reset
and CPU hotplug paths. They are not strictly needed, but I
think they are valuable anyway.

--
Greg

---

Greg Kurz (3):
      spapr: drop duplicate variable in spapr_core_plug()
      spapr_cpu_core: don't reset CPUs during realization
      spapr: fix device tree properties when using compatibility mode


 hw/ppc/spapr.c                  |   30 ++++++++++++++++++------------
 hw/ppc/spapr_cpu_core.c         |   15 +++++++++++++--
 hw/ppc/spapr_rtas.c             |    9 ---------
 include/hw/ppc/spapr_cpu_core.h |    2 ++
 4 files changed, 33 insertions(+), 23 deletions(-)