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 <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454879
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Darek Stojaczyk 2019-05-17 10:59:54 +02:00 committed by Changpeng Liu
parent ac498fa31c
commit 3a0627f069

View File

@ -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