qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 0990ce: ppc: Add intc_destroy() handlers to S


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 0990ce: ppc: Add intc_destroy() handlers to SpaprInterrupt...
Date: Mon, 18 Nov 2019 05:47:46 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0990ce6a2e900d0bdda7f3ecdc991746f63551fb
      
https://github.com/qemu/qemu/commit/0990ce6a2e900d0bdda7f3ecdc991746f63551fb
  Author: Greg Kurz <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xics_spapr.c
    M hw/intc/xive.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_core.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_irq.c
    M include/hw/ppc/pnv.h
    M include/hw/ppc/spapr_irq.h
    M include/hw/ppc/xics.h
    M include/hw/ppc/xive.h

  Log Message:
  -----------
  ppc: Add intc_destroy() handlers to SpaprInterruptController/PnvChip

SpaprInterruptControllerClass and PnvChipClass have an intc_create() method
that calls the appropriate routine, ie. icp_create() or xive_tctx_create(),
to establish the link between the VCPU and the presenter component of the
interrupt controller during realize.

There aren't any symmetrical call to be called when the VCPU gets unrealized
though. It is assumed that object_unparent() is the only thing to do.

This is questionable because the parenting logic around the CPU and
presenter objects is really an implementation detail of the interrupt
controller. It shouldn't be open-coded in the machine code.

Fix this by adding an intc_destroy() method that undoes what was done in
intc_create(). Also NULLify the presenter pointers to avoid having
stale pointers around. This will allow to reliably check if a vCPU has
a valid presenter.

Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 35886de140b7ff781b775d2da5e7475e8a8cb4c6
      
https://github.com/qemu/qemu/commit/35886de140b7ff781b775d2da5e7475e8a8cb4c6
  Author: Greg Kurz <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M hw/intc/xics.c
    M hw/intc/xive.c

  Log Message:
  -----------
  xive, xics: Fix reference counting on CPU objects

When a VCPU gets connected to the XIVE interrupt controller, we add a
const link targetting the CPU object to the TCTX object. Similar links
are added to the ICP object when using the XICS interrupt controller.

As explained in <qom/object.h>:

 * The caller must ensure that @target stays alive as long as
 * this property exists.  In the case @target is a child of @obj,
 * this will be the case.  Otherwise, the caller is responsible for
 * taking a reference.

We're in the latter case for both XICS and XIVE. Add the missing
calls to object_ref() and object_unref().

This doesn't fix any known issue because the life cycle of the TCTX or
ICP happens to be shorter than the one of the CPU or XICS fabric, but
better safe than sorry.

Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 0a83b47055246d3942084f03fc54731c4fb9b731
      
https://github.com/qemu/qemu/commit/0a83b47055246d3942084f03fc54731c4fb9b731
  Author: Greg Kurz <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M hw/intc/xics.c
    M hw/intc/xive.c

  Log Message:
  -----------
  ppc: Skip partially initialized vCPUs in 'info pic'

CPU_FOREACH() can race with vCPU hotplug/unplug on sPAPR machines, ie.
we may try to print out info about a vCPU with a NULL presenter pointer.

Check that in order to prevent QEMU from crashing.

Signed-off-by: Greg Kurz <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: a49f62b9fd7cf825d7c1f6fad10d865220ff01b2
      
https://github.com/qemu/qemu/commit/a49f62b9fd7cf825d7c1f6fad10d865220ff01b2
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M hw/ppc/spapr.c

  Log Message:
  -----------
  spapr: Add /chosen to FDT only at reset time to preserve kernel and 
initramdisk

Since "spapr: Render full FDT on ibm,client-architecture-support" we build
the entire flatten device tree (FDT) twice - at the reset time and
when "ibm,client-architecture-support" (CAS) is called. The full FDT from
CAS is then applied on top of the SLOF internal device tree.

This is mostly ok, however there is a case when the QEMU is started with
-initrd and for some reason the guest decided to move/unpack the init RAM
disk image - the guest correctly notifies SLOF about the change but
at CAS it is overridden with the QEMU initial location addresses and
the guest may fail to boot if the original initrd memory was changed.

This fixes the problem by only adding the /chosen node at the reset time
to prevent the original QEMU's linux,initrd-start/linux,initrd-end to
override the updated addresses.

This only treats /chosen differently as we know there is a special case
already and it is unlikely anything else will need to change /chosen at CAS
we are better off not touching /chosen after we handed it over to SLOF.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: 165dc3edd7f705c6c10908860b8c72e55eadd04b
      
https://github.com/qemu/qemu/commit/165dc3edd7f705c6c10908860b8c72e55eadd04b
  Author: David Gibson <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M target/ppc/kvm.c

  Log Message:
  -----------
  spapr/kvm: Set default cpu model for all machine classes

We have to set the default model of all machine classes, not just for
the active one. Otherwise, "query-machines" will indicate the wrong
CPU model (e.g. "power9_v2.0-powerpc64-cpu" instead of
"host-powerpc64-cpu") as "default-cpu-type".

s390x already fixed this in de60a92e "s390x/kvm: Set default cpu model for
all machine classes".  This patch applies a similar fix for the pseries-*
machine types on ppc64.

Doing a
    {"execute":"query-machines"}
under KVM now results in
    {
      "hotpluggable-cpus": true,
      "name": "pseries-4.2",
      "numa-mem-supported": true,
      "default-cpu-type": "host-powerpc64-cpu",
      "is-default": true,
      "cpu-max": 1024,
      "deprecated": false,
      "alias": "pseries"
    },
    {
      "hotpluggable-cpus": true,
      "name": "pseries-4.1",
      "numa-mem-supported": true,
      "default-cpu-type": "host-powerpc64-cpu",
      "cpu-max": 1024,
      "deprecated": false
    },
    ...

Libvirt probes all machines via "-machine none,accel=kvm:tcg" and will
currently see the wrong CPU model under KVM.

Reported-by: Jiři Denemark <address@hidden>
Cc: David Hildenbrand <address@hidden>
Cc: Igor Mammedov <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Jiri Denemark <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: cd8843ff25d62a0af747517289a4f330b1ae2a6e
      
https://github.com/qemu/qemu/commit/cd8843ff25d62a0af747517289a4f330b1ae2a6e
  Author: Laurent Vivier <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M hw/misc/mos6522.c

  Log Message:
  -----------
  mos6522: fix T1 and T2 timers

With the Quadra 800 emulation, mos6522 timers processing can consume
until 70% of the host CPU time with an idle guest (I guess the problem
should also happen with PowerMac emulation).

On a recent system, it can be painless (except if you look at top), but
on an old host like a PowerMac G5 the guest kernel can be terribly slow
during the boot sequence (for instance, unpacking initramfs can take 15
seconds rather than only 3 seconds).

We can avoid this CPU overload by enabling QEMU internal timers only if
the mos6522 counter interrupts are enabled. Sometime the guest kernel
wants to read the counters values, but we don't need the timers to
update the counters.

With this patch applied, an idle Q800 consumes only 3% of host CPU time
(and the guest can boot in a decent time).

Signed-off-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>


  Commit: bbe165740a96f67f48ecd3029dc26bdd7fd5192c
      
https://github.com/qemu/qemu/commit/bbe165740a96f67f48ecd3029dc26bdd7fd5192c
  Author: Peter Maydell <address@hidden>
  Date:   2019-11-18 (Mon, 18 Nov 2019)

  Changed paths:
    M hw/intc/spapr_xive.c
    M hw/intc/xics.c
    M hw/intc/xics_spapr.c
    M hw/intc/xive.c
    M hw/misc/mos6522.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_core.c
    M hw/ppc/spapr.c
    M hw/ppc/spapr_cpu_core.c
    M hw/ppc/spapr_irq.c
    M include/hw/ppc/pnv.h
    M include/hw/ppc/spapr_irq.h
    M include/hw/ppc/xics.h
    M include/hw/ppc/xive.h
    M target/ppc/kvm.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/vivier2/tags/ppc-for-4.2-pull-request' 
into staging

ppc patch queue 2019-11-15

Several fixes for 4.2.0-rc2:

fix mos6522 performance issue,
xive/xics issues,
fix /chosen device-tree on reset
and KVM default cpu-model for all machine classes

# gpg: Signature made Mon 18 Nov 2019 10:52:19 GMT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "address@hidden"
# gpg: Good signature from "Laurent Vivier <address@hidden>" [full]
# gpg:                 aka "Laurent Vivier <address@hidden>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <address@hidden>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/ppc-for-4.2-pull-request:
  mos6522: fix T1 and T2 timers
  spapr/kvm: Set default cpu model for all machine classes
  spapr: Add /chosen to FDT only at reset time to preserve kernel and 
initramdisk
  ppc: Skip partially initialized vCPUs in 'info pic'
  xive, xics: Fix reference counting on CPU objects
  ppc: Add intc_destroy() handlers to SpaprInterruptController/PnvChip

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


Compare: https://github.com/qemu/qemu/compare/369e8f5bbd8a...bbe165740a96



reply via email to

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