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/common.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/common.h')
-rw-r--r-- | lib/common.h | 1 |
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) |