diff options
author | John Levon <john.levon@nutanix.com> | 2021-06-01 15:14:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 15:14:46 +0100 |
commit | 9c37a1813b65899ad3b0288a51b0cf1c372ee775 (patch) | |
tree | 3cdf95f941ec40788ff64957542cd74c72c988f1 /lib/dma.h | |
parent | 96ec963075e721c939441eaf0b92ea2a24b65668 (diff) | |
download | libvfio-user-9c37a1813b65899ad3b0288a51b0cf1c372ee775.zip libvfio-user-9c37a1813b65899ad3b0288a51b0cf1c372ee775.tar.gz libvfio-user-9c37a1813b65899ad3b0288a51b0cf1c372ee775.tar.bz2 |
limit max DMA region size (#545)
Since the dirty bitmap in message replies is allocated based upon the maximum
size of an individual region, add a limit (somewhat arbitrarily 8TiB, which is a
bitmap size of 256MiB). Add a couple of basic tests on the two DMA limits.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'lib/dma.h')
-rw-r--r-- | lib/dma.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -92,6 +92,7 @@ typedef struct { typedef struct dma_controller { int max_regions; + size_t max_size; int nregions; struct vfu_ctx *vfu_ctx; size_t dirty_pgsize; // Dirty page granularity @@ -99,7 +100,7 @@ typedef struct dma_controller { } dma_controller_t; dma_controller_t * -dma_controller_create(vfu_ctx_t *vfu_ctx, int max_regions); +dma_controller_create(vfu_ctx_t *vfu_ctx, size_t max_regions, size_t max_size); void dma_controller_remove_all_regions(dma_controller_t *dma, |