Commit 3a0627f0 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Changpeng Liu
Browse files

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: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454879


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent ac498fa3
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -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