The problem is that, address_space_get_iotlb_entry() shares a lot with address_space_translate(). This patch tries to abstract the shared elements.
Originally, this work is derived from discussion from VT-d passthrough series discussions [1]. But for sure we can just see this series as a standalone cleanup. So I posted it separately here. Smoke tests are done with general VM boots, IOs, especially with vhost dmar configurations. I believe with current series I can throw away the old patch [1], which may be good. But before that, please kindly review. Thanks. References: [1] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg02335.html Peter Xu (4): exec: simplify phys_page_find() params exec: rename resolve_subpage exec: further use is_mmio exec: abstract address_space_do_translate() exec.c | 122 ++++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 46 deletions(-) -- 2.7.4