Here's my shot at fixing dma-reentracy issues. This patch adds a flag to
the DeviceState, which is set/checked when we call an accessor
associated with the device's IO MRs.

The problem, in short, as I understand it: For the vast majority of
cases, we want to prevent a device from accessing it's own PIO/MMIO
regions over DMA.

V2: Try to fix reentrancies initiated by DMA accesses in BHs

Cc: Philippe Mathieu-Daudé <phi...@redhat.com>
Cc: Mauro Matteo Cascella <mcasc...@redhat.com>
Cc: Qiuhao Li <qiuhao...@outlook.com>
Cc: Peter Xu <pet...@redhat.com>
Cc: Jason Wang <jasow...@redhat.com>
Cc: David Hildenbrand <da...@redhat.com>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: Peter Maydell <peter.mayd...@linaro.org>
Cc: Li Qiang <liq...@gmail.com>
Cc: Thomas Huth <th...@redhat.com>
Cc: Laurent Vivier <lviv...@redhat.com>
Cc: Bandan Das <b...@redhat.com>
Cc: Edgar E. Iglesias <edgar.igles...@gmail.com>
Cc: Darren Kenny <darren.ke...@oracle.com>
Cc: Bin Meng <bin.m...@windriver.com>
Cc: Paolo Bonzini <pbonz...@redhat.com>
Cc: Stefan Hajnoczi <stefa...@redhat.com>


Alexander Bulekov (2):
  memory: fix dma-reentrancy issues at the MMIO level
  memory: set engaged_in_io when a device calls DMA APIs

 include/hw/pci/pci.h   |  6 +++++-
 include/hw/qdev-core.h |  1 +
 softmmu/dma-helpers.c  |  2 ++
 softmmu/memory.c       | 15 +++++++++++++++
 softmmu/trace-events   |  1 +
 5 files changed, 24 insertions(+), 1 deletion(-)

-- 
2.33.0


Reply via email to