qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 3b4f50: hw/ppc/e500.c: Handle qemu_find_file(


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 3b4f50: hw/ppc/e500.c: Handle qemu_find_file() failure
Date: Tue, 07 Apr 2020 06:15:18 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 3b4f50bd7d16322a109a026a87a945dff660f38b
      
https://github.com/qemu/qemu/commit/3b4f50bd7d16322a109a026a87a945dff660f38b
  Author: Peter Maydell <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/e500.c

  Log Message:
  -----------
  hw/ppc/e500.c: Handle qemu_find_file() failure

If qemu_find_file() doesn't find the BIOS it returns NULL; we were
passing that unchecked through to load_elf(), which assumes a non-NULL
pointer and may misbehave. In practice it fails with a weird message:

  $ qemu-system-ppc -M ppce500 -display none -kernel nonesuch
  Bad address
  qemu-system-ppc: could not load firmware '(null)'

Handle the failure case better:

  $ qemu-system-ppc -M ppce500 -display none -kernel nonesuch
  qemu-system-ppc: could not find firmware/kernel file 'nonesuch'

Spotted by Coverity (CID 1238954).

Signed-off-by: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 79178edd2a0b012c5cd27e0168beb83ef4b617ef
      
https://github.com/qemu/qemu/commit/79178edd2a0b012c5cd27e0168beb83ef4b617ef
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/vfio/spapr.c

  Log Message:
  -----------
  vfio/spapr: Fix page size calculation

Coverity detected an issue (CID 1421903) with potential call of clz64(0)
which returns 64 which make it do "<<" with a negative number.

This checks the mask and avoids undefined behaviour.

In practice pgsizes and memory_region_iommu_get_min_page_size() always
have some common page sizes and even if they did not, the resulting page
size would be 0x8000.0000.0000.0000 (gcc 9.2) and
ioctl(VFIO_IOMMU_SPAPR_TCE_CREATE) would fail anyway.

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


  Commit: ec010c00665ba1e78e6b3df104f923c4ea68504a
      
https://github.com/qemu/qemu/commit/ec010c00665ba1e78e6b3df104f923c4ea68504a
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/spapr_caps.c
    M hw/ppc/spapr_rtas.c
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h

  Log Message:
  -----------
  ppc/spapr: KVM FWNMI should not be enabled until guest requests it

The KVM FWNMI capability should be enabled with the "ibm,nmi-register"
rtas call. Although MCEs from KVM will be delivered as architected
interrupts to the guest before "ibm,nmi-register" is called, KVM has
different behaviour depending on whether the guest has enabled FWNMI
(it attempts to do more recovery on behalf of a non-FWNMI guest).

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


  Commit: 6c3dd24c054a0701169b17be57b611bac8d99b5d
      
https://github.com/qemu/qemu/commit/6c3dd24c054a0701169b17be57b611bac8d99b5d
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/spapr_events.c

  Log Message:
  -----------
  ppc/spapr: Improve FWNMI machine check delivery corner case comments

Some of the conditions are not as clearly documented as they could be.
Also the non-FWNMI case does not need a large comment.

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


  Commit: b90b9ecb12ae37c089d1a837d8ff2c888d71902e
      
https://github.com/qemu/qemu/commit/b90b9ecb12ae37c089d1a837d8ff2c888d71902e
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/spapr_events.c
    M hw/ppc/spapr_rtas.c

  Log Message:
  -----------
  ppc/spapr: Add FWNMI machine check delivery warnings

Add some messages which explain problems and guest misbehaviour that
may be difficult to diagnose in rare cases of machine checks.

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


  Commit: 4f7a11f93fcb970bdcd2faa12337f4d1269b45f4
      
https://github.com/qemu/qemu/commit/4f7a11f93fcb970bdcd2faa12337f4d1269b45f4
  Author: Nicholas Piggin <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/spapr_events.c

  Log Message:
  -----------
  ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery 
fails

Try to be tolerant of FWNMI delivery errors if the machine check had been
recovered by the host.

Signed-off-by: Nicholas Piggin <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
[dwg: Updated comment at Greg's suggestion]
Signed-off-by: David Gibson <address@hidden>


  Commit: 7aab5899764887f6b0512cb2e5c11bdc2a5d3644
      
https://github.com/qemu/qemu/commit/7aab5899764887f6b0512cb2e5c11bdc2a5d3644
  Author: David Gibson <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/spapr_pci.c

  Log Message:
  -----------
  spapr: Fix failure path for attempting to hot unplug PCI bridges

For various technical reasons we can't currently allow unplug a PCI to PCI
bridge on the pseries machine.  spapr_pci_unplug_request() correctly
generates an error message if that's attempted.

But.. if the given errp is not error_abort or error_fatal, it doesn't
actually stop trying to unplug the bridge anyway.

Fixes: 14e714900f6b "spapr: Allow hot plug/unplug of PCI bridges and devices 
under PCI bridges"
Signed-off-by: David Gibson <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>


  Commit: 2025fc6766ab25501e0041c564c44bb0f7389774
      
https://github.com/qemu/qemu/commit/2025fc6766ab25501e0041c564c44bb0f7389774
  Author: Peter Maydell <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/ppc440_uc.c

  Log Message:
  -----------
  hw/ppc/ppc440_uc.c: Remove incorrect iothread locking from dcr_write_pcie()

In dcr_write_pcie() we take the iothread lock around a call to
pcie_host_mmcfg_udpate().  This is an incorrect attempt to deal with
the bug fixed in commit 235352ee6e73d7716, where we were not taking
the iothread lock before calling device dcr read/write functions.
(It's not sufficient locking, because although the other cases in the
switch statement won't assert, there is no locking which prevents
multiple guest CPUs from trying to access the PPC460EXPCIEState
struct at the same time and corrupting data.)

Unfortunately with commit 235352ee6e73d7716 we are now trying
to recursively take the iothread lock, which will assert:

  $ qemu-system-ppc -M sam460ex --display none
  **
  
ERROR:/home/petmay01/linaro/qemu-from-laptop/qemu/cpus.c:1830:qemu_mutex_lock_iothread_impl:
 assertion failed: (!qemu_mutex_iothread_locked())
  Aborted (core dumped)

Remove the locking within dcr_write_pcie().

Fixes: 235352ee6e73d7716
Signed-off-by: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Tested-by: BALATON Zoltan <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: a872e4328bb3c2dda0699e04abf0f902950221f3
      
https://github.com/qemu/qemu/commit/a872e4328bb3c2dda0699e04abf0f902950221f3
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M pc-bios/README
    M pc-bios/slof.bin
    M roms/SLOF

  Log Message:
  -----------
  pseries: Update SLOF firmware image

This is a single regression fix for for 5.0:

Greg Kurz (1):
      slof: Only close stdout for virtio-serial devices

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: 25f3170b06544e4de620336da5b2ea3b392d66bc
      
https://github.com/qemu/qemu/commit/25f3170b06544e4de620336da5b2ea3b392d66bc
  Author: Cédric Le Goater <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/pnv.c
    M hw/ppc/pnv_bmc.c
    M include/hw/ppc/pnv.h

  Log Message:
  -----------
  ppc/pnv: Create BMC devices only when defaults are enabled

Commit e2392d4395dd ("ppc/pnv: Create BMC devices at machine init")
introduced default BMC devices which can be a problem when the same
devices are defined on the command line with :

  -device ipmi-bmc-sim,id=bmc0 -device isa-ipmi-bt,bmc=bmc0,irq=10

QEMU fails with :

  qemu-system-ppc64: error creating device tree: node: FDT_ERR_EXISTS

Use defaults_enabled() when creating the default BMC devices to let
the user provide its own BMC devices using '-nodefaults'. If no BMC
device are provided, output a warning but let QEMU run as this is a
supported configuration. However, when multiple BMC devices are
defined, stop QEMU with a clear error as the results are unexpected.

Fixes: e2392d4395dd ("ppc/pnv: Create BMC devices at machine init")
Reported-by: Nathan Chancellor <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Tested-by: Nathan Chancellor <address@hidden>
Signed-off-by: David Gibson <address@hidden>


  Commit: c185e22112f55f33693398e3ae30265421b21742
      
https://github.com/qemu/qemu/commit/c185e22112f55f33693398e3ae30265421b21742
  Author: Peter Maydell <address@hidden>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M hw/ppc/e500.c
    M hw/ppc/pnv.c
    M hw/ppc/pnv_bmc.c
    M hw/ppc/ppc440_uc.c
    M hw/ppc/spapr_caps.c
    M hw/ppc/spapr_events.c
    M hw/ppc/spapr_pci.c
    M hw/ppc/spapr_rtas.c
    M hw/vfio/spapr.c
    M include/hw/ppc/pnv.h
    M pc-bios/README
    M pc-bios/slof.bin
    M roms/SLOF
    M target/ppc/kvm.c
    M target/ppc/kvm_ppc.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.0-20200407' into 
staging

ppc patch queue 2020-04-07

An assortment of fixes for qemu-5.0, including a number for the FWNMI
feature which is new this release.

# gpg: Signature made Tue 07 Apr 2020 05:35:10 BST
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <address@hidden>" [full]
# gpg:                 aka "David Gibson (Red Hat) <address@hidden>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <address@hidden>" [full]
# gpg:                 aka "David Gibson (kernel.org) <address@hidden>" 
[unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-5.0-20200407:
  ppc/pnv: Create BMC devices only when defaults are enabled
  pseries: Update SLOF firmware image
  hw/ppc/ppc440_uc.c: Remove incorrect iothread locking from dcr_write_pcie()
  spapr: Fix failure path for attempting to hot unplug PCI bridges
  ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery 
fails
  ppc/spapr: Add FWNMI machine check delivery warnings
  ppc/spapr: Improve FWNMI machine check delivery corner case comments
  ppc/spapr: KVM FWNMI should not be enabled until guest requests it
  vfio/spapr: Fix page size calculation
  hw/ppc/e500.c: Handle qemu_find_file() failure

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


Compare: https://github.com/qemu/qemu/compare/53ef8a92eb04...c185e22112f5



reply via email to

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