]> git.baikalelectronics.ru Git - kernel.git/commit
xen: remove size limit of privcmd-buf mapping interface
authorJuergen Gross <jgross@suse.com>
Thu, 1 Nov 2018 12:33:07 +0000 (13:33 +0100)
committerJuergen Gross <jgross@suse.com>
Fri, 9 Nov 2018 15:38:34 +0000 (16:38 +0100)
commita09cb41ad4ebc10e34429406dee52fac33a3fb3f
tree3f9521547989145ad1ae2b36900845c9ac160d76
parent29ccd3241571357d409cd297bc33b17fa21bb441
xen: remove size limit of privcmd-buf mapping interface

Currently the size of hypercall buffers allocated via
/dev/xen/hypercall is limited to a default of 64 memory pages. For live
migration of guests this might be too small as the page dirty bitmask
needs to be sized according to the size of the guest. This means
migrating a 8GB sized guest is already exhausting the default buffer
size for the dirty bitmap.

There is no sensible way to set a sane limit, so just remove it
completely. The device node's usage is limited to root anyway, so there
is no additional DOS scenario added by allowing unlimited buffers.

While at it make the error path for the -ENOMEM case a little bit
cleaner by setting n_pages to the number of successfully allocated
pages instead of the target size.

Fixes: e6fe3dd0d066e1 ("xen: add new hypercall buffer mapping device")
Cc: <stable@vger.kernel.org> #4.18
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/privcmd-buf.c