Skip to content

RFC Add a 'in_mmio' device flag to avoid the DMA to MMIO

Li Qiang qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4memory: add memory_region_init_io_with_dev interfaceinclude/exec/memory.h softmmu/memory.c+24 -08 replies
2/4memory: avoid reenter the device's MMIO handler while processing MMIOinclude/hw/qdev-core.h softmmu/memory.c+29 -30 replies
3/4e1000e: use the new memory_region_init_io_with_dev interfacehw/net/e1000e.c+4 -40 replies
4/4hcd-xhci: use the new memory_region_init_io_with_dev interfacehw/usb/hcd-xhci.c+15 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/4] Add a 'in_mmio' device flag to avoid the DMA to MMIO

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(-)
Signature · 1 line
2.17.1