]> git.proxmox.com Git - mirror_qemu.git/commit
intel-iommu: optimize nodmar memory regions
authorPeter Xu <peterx@redhat.com>
Wed, 13 Mar 2019 09:43:23 +0000 (17:43 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Mar 2019 10:44:13 +0000 (11:44 +0100)
commit4b519ef1de9a7cb8123abadab9e6c5697373087c
tree2c12938a5b20a2f6fc7c5d1e33f7aa43e5156ec5
parent8b159699d49bf340cad90a3291f6ce631ce58c8c
intel-iommu: optimize nodmar memory regions

Previously we have per-device system memory aliases when DMAR is
disabled by the system.  It will slow the system down if there are
lots of devices especially when DMAR is disabled, because each of the
aliased system address space will contain O(N) slots, and rendering
such N address spaces will be O(N^2) complexity.

This patch introduces a shared nodmar memory region and for each
device we only create an alias to the shared memory region.  With the
aliasing, QEMU memory core API will be able to detect when devices are
sharing the same address space (which is the nodmar address space)
when rendering the FlatViews and the total number of FlatViews can be
dramatically reduced when there are a lot of devices.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20190313094323.18263-1-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/intel_iommu.c
include/hw/i386/intel_iommu.h