summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2020-06-08 02:03:15 -0400
committerMichael S. Tsirkin <mst@redhat.com>2020-06-09 06:42:06 -0400
commit544fc7dbbf920a3e64d109c416ee229e8e1763c5 (patch)
tree245dfdd4f99b721b1c4a28a7ac82394dd4f801bf /include
parentb3fb6de7c6019c5d8495c3a115d42a0f118f631c (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/virtio_mem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/uapi/linux/virtio_mem.h b/include/uapi/linux/virtio_mem.h
index a455c488a995..a9ffe041843c 100644
--- a/include/uapi/linux/virtio_mem.h
+++ b/include/uapi/linux/virtio_mem.h
@@ -185,10 +185,10 @@ struct virtio_mem_resp {
struct virtio_mem_config {
/* Block size and alignment. Cannot change. */
- __u32 block_size;
+ __u64 block_size;
/* Valid with VIRTIO_MEM_F_ACPI_PXM. Cannot change. */
__u16 node_id;
- __u16 padding;
+ __u8 padding[6];
/* Start address of the memory region. Cannot change. */
__u64 addr;
/* Region size (maximum). Cannot change. */