]> 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)
commite3c97beab6bb110d5a66fed41a1dca30cc60203c
tree3f9521547989145ad1ae2b36900845c9ac160d76
parent840e1c1baf05c81163d3718f38d94255239908bc
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: 65e897ef431a3b ("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