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é <[email protected]>
Cc: Mauro Matteo Cascella <[email protected]>
Cc: Qiuhao Li <[email protected]>
Cc: Peter Xu <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Li Qiang <[email protected]>
Cc: Thomas Huth <[email protected]>
Cc: Laurent Vivier <[email protected]>
Cc: Bandan Das <[email protected]>
Cc: Edgar E. Iglesias <[email protected]>
Cc: Darren Kenny <[email protected]>
Cc: Bin Meng <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>


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