aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2021-07-19 19:21:04 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-09-30 14:50:19 +0200
commit56918a126ae25383cb0c2c74a6f0f784a6d59ac1 (patch)
tree2694e522c8582fb67fed63bfcad65fe3649ca3bc /hw
parentba0fa56bc06e563de68d2a2bf3ddb0cfea1be4f9 (diff)
downloadqemu-56918a126ae25383cb0c2c74a6f0f784a6d59ac1.zip
qemu-56918a126ae25383cb0c2c74a6f0f784a6d59ac1.tar.gz
qemu-56918a126ae25383cb0c2c74a6f0f784a6d59ac1.tar.bz2
memory: Add RAM_PROTECTED flag to skip IOMMU mappings
Add a new RAMBlock flag to denote "protected" memory, i.e. memory that looks and acts like RAM but is inaccessible via normal mechanisms, including DMA. Use the flag to skip protected memory regions when mapping RAM for DMA in VFIO. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Yang Zhong <yang.zhong@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/vfio/common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 8728d4d..1289cfa 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -562,6 +562,7 @@ static bool vfio_listener_skipped_section(MemoryRegionSection *section)
{
return (!memory_region_is_ram(section->mr) &&
!memory_region_is_iommu(section->mr)) ||
+ memory_region_is_protected(section->mr) ||
/*
* Sizing an enabled 64-bit BAR can cause spurious mappings to
* addresses in the upper part of the 64-bit address space. These