aboutsummaryrefslogtreecommitdiff
path: root/lib/common.h
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-06-01 15:14:46 +0100
committerGitHub <noreply@github.com>2021-06-01 15:14:46 +0100
commit9c37a1813b65899ad3b0288a51b0cf1c372ee775 (patch)
tree3cdf95f941ec40788ff64957542cd74c72c988f1 /lib/common.h
parent96ec963075e721c939441eaf0b92ea2a24b65668 (diff)
downloadlibvfio-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/common.h')
-rw-r--r--lib/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/common.h b/lib/common.h
index a56a0f0..599759f 100644
--- a/lib/common.h
+++ b/lib/common.h
@@ -43,6 +43,7 @@
#define UNUSED __attribute__((unused))
#define EXPORT __attribute__((visibility("default")))
+#define ONE_TB (1024UL * 1024 * 1024 * 1024)
#define PAGE_SIZE (size_t)sysconf(_SC_PAGE_SIZE)
#define PAGE_ALIGNED(x) (((x) & ((typeof(x))(PAGE_SIZE) - 1)) == 0)