qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/4] Add a 'in_mmio' device flag to avoid the DMA to MMIO
@ 2020-09-08 16:41 Li Qiang
  2020-09-08 16:41 ` [RFC 1/4] memory: add memory_region_init_io_with_dev interface Li Qiang
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Li Qiang @ 2020-09-08 16:41 UTC (permalink / raw)
  To: dmitry.fleytman, jasowang, kraxel, pbonzini, berrange, ehabkost,
	alxndr, peter.maydell, f4bug
  Cc: Li Qiang, liq3ea, qemu-devel

Currently the qemu device fuzzer find some DMA to MMIO issue. If the
device handling MMIO currently trigger a DMA which the address is MMIO,
this will reenter the device MMIO handler. As some of the device doesn't
consider this it will sometimes crash the qemu.

This patch tries to solve this by adding a per-device flag 'in_mmio'.
When the memory core dispatch MMIO it will check/set this flag and when
it leaves it will clean this flag.


Li Qiang (4):
  memory: add memory_region_init_io_with_dev interface
  memory: avoid reenter the device's MMIO handler while processing MMIO
  e1000e: use the new memory_region_init_io_with_dev interface
  hcd-xhci: use the new memory_region_init_io_with_dev interface

 hw/net/e1000e.c        |  8 ++++----
 hw/usb/hcd-xhci.c      | 25 ++++++++++++++---------
 include/exec/memory.h  |  9 +++++++++
 include/hw/qdev-core.h |  1 +
 softmmu/memory.c       | 46 +++++++++++++++++++++++++++++++++++++++---
 5 files changed, 72 insertions(+), 17 deletions(-)

-- 
2.17.1



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

end of thread, other threads:[~2020-09-21  4:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08 16:41 [RFC 0/4] Add a 'in_mmio' device flag to avoid the DMA to MMIO Li Qiang
2020-09-08 16:41 ` [RFC 1/4] memory: add memory_region_init_io_with_dev interface Li Qiang
2020-09-09  2:15   ` Jason Wang
2020-09-09  4:45     ` Li Qiang
2020-09-09  4:48     ` Gerd Hoffmann
2020-09-09  4:58       ` Li Qiang
2020-09-09 14:28         ` Alexander Bulekov
2020-09-10 14:37           ` Li Qiang
2020-09-14  2:37             ` Jason Wang
2020-09-20  7:55   ` Paolo Bonzini
2020-09-08 16:41 ` [RFC 2/4] memory: avoid reenter the device's MMIO handler while processing MMIO Li Qiang
2020-09-08 16:41 ` [RFC 3/4] e1000e: use the new memory_region_init_io_with_dev interface Li Qiang
2020-09-08 16:41 ` [RFC 4/4] hcd-xhci: " Li Qiang
2020-09-09  2:16 ` [RFC 0/4] Add a 'in_mmio' device flag to avoid the DMA to MMIO Jason Wang
2020-09-09  4:39   ` Li Qiang
2020-09-20  7:56 ` Paolo Bonzini
2020-09-20 20:24   ` Peter Maydell
2020-09-21  4:39   ` Li Qiang

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).