qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Fix dma-reentrancy issues
@ 2022-05-27 16:19 Alexander Bulekov
  2022-05-27 16:19 ` [PATCH v2 1/3] memory: Track whether a Device is engaged in IO Alexander Bulekov
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Alexander Bulekov @ 2022-05-27 16:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexander Bulekov, Philippe Mathieu-Daudé,
	Mauro Matteo Cascella, Qiuhao Li, Peter Xu, Jason Wang,
	David Hildenbrand, Gerd Hoffmann, Peter Maydell, Li Qiang,
	Thomas Huth, Laurent Vivier, Bandan Das, Edgar E . Iglesias,
	Darren Kenny, Bin Meng, Paolo Bonzini, Stefan Hajnoczi

A shot at fixing dma-reentrancy issues.

Patch 1 adds a flag to track device IO activity to DeviceState.
Patch 2 Checks/sets the flag prior to invoking MemoryRegion handlers to
prevent the mmio->dma->mmio case
Patch 3 Sets the flag in dma-related calls to prevent the bh->dma->mmio
case

The related issues are tracked here: https://gitlab.com/qemu-project/qemu/-/issues/556
There is also a related whitepaper: https://qiuhao.org/Matryoshka_Trap.pdf

Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Mauro Matteo Cascella <mcascell@redhat.com>
Cc: Qiuhao Li <Qiuhao.Li@outlook.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Li Qiang <liq3ea@gmail.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Laurent Vivier <lvivier@redhat.com>
Cc: Bandan Das <bsd@redhat.com>
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Cc: Darren Kenny <darren.kenny@oracle.com>
Cc: Bin Meng <bin.meng@windriver.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>

Alexander Bulekov (3):
  memory: Track whether a Device is engaged in IO
  memory: fix PIO/MMIO-initiated dma-reentracy issues
  memory: fix bh-initiated dma-reentracy issues

 include/hw/pci/pci.h   | 13 +++++++++++--
 include/hw/qdev-core.h |  3 +++
 softmmu/dma-helpers.c  | 12 ++++++++++++
 softmmu/memory.c       | 15 +++++++++++++++
 softmmu/trace-events   |  1 +
 5 files changed, 42 insertions(+), 2 deletions(-)

-- 
2.33.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-05-30 14:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-27 16:19 [PATCH v2 0/3] Fix dma-reentrancy issues Alexander Bulekov
2022-05-27 16:19 ` [PATCH v2 1/3] memory: Track whether a Device is engaged in IO Alexander Bulekov
2022-05-30  9:58   ` Darren Kenny
2022-05-30 11:19   ` Peter Maydell
2022-05-30 13:09     ` Alexander Bulekov
2022-05-30 13:28       ` Peter Maydell
2022-05-30 13:39         ` Philippe Mathieu-Daudé via
2022-05-30 14:04           ` Alexander Bulekov
2022-05-30 13:41         ` Alexander Bulekov
2022-05-30 12:13   ` David Hildenbrand
2022-05-27 16:19 ` [PATCH v2 2/3] memory: fix PIO/MMIO-initiated dma-reentracy issues Alexander Bulekov
2022-05-27 16:19 ` [PATCH v2 3/3] memory: fix bh-initiated " Alexander Bulekov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).