vhost: use mmap_size to check for 2MB hugepage multiple
Older versions of QEMU (<= 2.11) expose the VGA BIOS hole (0xA0000-0xBFFFF) by specifying two separate memory regions - one before and one after the hole. This results in the "size" not being a 2MB multiple. But the underlying memory is still mmaped at a 2MB multiple - so that's what we should be checking to ensure the memory is hugepage backed. Fixes #673. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I1644bb6d8a8fb1fd51a548ae7a17da061c18c669 Reviewed-on: https://review.gerrithub.io/c/445764 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447457 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
d07cc7d35d
commit
e22df3fbcf
@ -1085,8 +1085,11 @@ start_device(int vid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < vsession->mem->nregions; i++) {
|
for (i = 0; i < vsession->mem->nregions; i++) {
|
||||||
if (vsession->mem->regions[i].size & MASK_2MB) {
|
uint64_t mmap_size = vsession->mem->regions[i].mmap_size;
|
||||||
SPDK_ERRLOG("vhost device %d: Guest memory size is not a 2MB multiple\n", vid);
|
|
||||||
|
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);
|
free(vsession->mem);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user