virtio_mem: convert device block size into 64bit
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 8 Jun 2020 06:03:15 +0000 (02:03 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Jun 2020 10:42:06 +0000 (06:42 -0400)
commit544fc7dbbf920a3e64d109c416ee229e8e1763c5
tree245dfdd4f99b721b1c4a28a7ac82394dd4f801bf
parentb3fb6de7c6019c5d8495c3a115d42a0f118f631c
virtio_mem: convert device block size into 64bit

If subblock size is large (e.g. 1G) 32 bit math involving it
can overflow. Rather than try to catch all instances of that,
let's tweak block size to 64 bit.

It ripples through UAPI which is an ABI change, but it's not too late to
make it, and it will allow supporting >4Gbyte blocks while might
become necessary down the road.

Fixes: 5f1f79bbc9e26 ("virtio-mem: Paravirtualized memory hotplug")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: David Hildenbrand <david@redhat.com>
drivers/virtio/virtio_mem.c
include/uapi/linux/virtio_mem.h