aboutsummaryrefslogtreecommitdiff
path: root/softmmu/physmem.c
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 /softmmu/physmem.c
parentba0fa56bc06e563de68d2a2bf3ddb0cfea1be4f9 (diff)
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 'softmmu/physmem.c')
-rw-r--r--softmmu/physmem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 23e77cb771..088660d973 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -2055,7 +2055,8 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
int64_t file_size, file_align;
/* Just support these ram flags by now. */
- assert((ram_flags & ~(RAM_SHARED | RAM_PMEM | RAM_NORESERVE)) == 0);
+ assert((ram_flags & ~(RAM_SHARED | RAM_PMEM | RAM_NORESERVE |
+ RAM_PROTECTED)) == 0);
if (xen_enabled()) {
error_setg(errp, "-mem-path not supported with Xen");