From 3a0627f069213c4148530ce263e79b535c322f11 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Fri, 17 May 2019 10:59:54 +0200 Subject: [PATCH] vhost: remove 2MB memory region size restriction We no longer have any assumptions about vhost memory regions size being a 2MB multiple, so we can get rid of the security check preventing some vhost sessions from being initialized. It will be necessary for virtio-vhost-user, whose memory comes from PCI BARs and its size may not be a 2MB multiple. Change-Id: I48f9bc20f4c61aefdddf39ade875867148f0ed75 Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454879 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu --- lib/vhost/vhost.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 4058d38c0..1a9b05b79 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -1150,17 +1150,6 @@ start_device(int vid) goto out; } - for (i = 0; i < vsession->mem->nregions; i++) { - uint64_t mmap_size = vsession->mem->regions[i].mmap_size; - - if (mmap_size & MASK_2MB) { - SPDK_ERRLOG("vhost device %d: Guest mmaped memory size %" PRIx64 - " is not a 2MB multiple\n", vid, mmap_size); - free(vsession->mem); - goto out; - } - } - /* * Not sure right now but this look like some kind of QEMU bug and guest IO * might be frozed without kicking all queues after live-migration. This look like