[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/10] hw/ppc/ppc440_uc.c: Remove incorrect iothread locking from
From: |
David Gibson |
Subject: |
[PULL 08/10] hw/ppc/ppc440_uc.c: Remove incorrect iothread locking from dcr_write_pcie() |
Date: |
Tue, 7 Apr 2020 14:36:04 +1000 |
From: Peter Maydell <address@hidden>
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>
---
hw/ppc/ppc440_uc.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c
index d5ea962249..b30e093cbb 100644
--- a/hw/ppc/ppc440_uc.c
+++ b/hw/ppc/ppc440_uc.c
@@ -13,7 +13,6 @@
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "qemu/log.h"
-#include "qemu/main-loop.h"
#include "qemu/module.h"
#include "cpu.h"
#include "hw/irq.h"
@@ -1183,9 +1182,7 @@ static void dcr_write_pcie(void *opaque, int dcrn,
uint32_t val)
case PEGPL_CFGMSK:
s->cfg_mask = val;
size = ~(val & 0xfffffffe) + 1;
- qemu_mutex_lock_iothread();
pcie_host_mmcfg_update(PCIE_HOST_BRIDGE(s), val & 1, s->cfg_base,
size);
- qemu_mutex_unlock_iothread();
break;
case PEGPL_MSGBAH:
s->msg_base = ((uint64_t)val << 32) | (s->msg_base & 0xffffffff);
--
2.25.2
- [PULL 00/10] ppc-for-5.0 queue 20200407, David Gibson, 2020/04/07
- [PULL 01/10] hw/ppc/e500.c: Handle qemu_find_file() failure, David Gibson, 2020/04/07
- [PULL 03/10] ppc/spapr: KVM FWNMI should not be enabled until guest requests it, David Gibson, 2020/04/07
- [PULL 02/10] vfio/spapr: Fix page size calculation, David Gibson, 2020/04/07
- [PULL 04/10] ppc/spapr: Improve FWNMI machine check delivery corner case comments, David Gibson, 2020/04/07
- [PULL 08/10] hw/ppc/ppc440_uc.c: Remove incorrect iothread locking from dcr_write_pcie(),
David Gibson <=
- [PULL 05/10] ppc/spapr: Add FWNMI machine check delivery warnings, David Gibson, 2020/04/07
- [PULL 06/10] ppc/spapr: Don't kill the guest if a recovered FWNMI machine check delivery fails, David Gibson, 2020/04/07
- [PULL 10/10] ppc/pnv: Create BMC devices only when defaults are enabled, David Gibson, 2020/04/07
- [PULL 09/10] pseries: Update SLOF firmware image, David Gibson, 2020/04/07
- [PULL 07/10] spapr: Fix failure path for attempting to hot unplug PCI bridges, David Gibson, 2020/04/07
- Re: [PULL 00/10] ppc-for-5.0 queue 20200407, Peter Maydell, 2020/04/07