diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2020-06-08 08:03:15 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-06-09 12:42:06 +0200 |
commit | 544fc7dbbf920a3e64d109c416ee229e8e1763c5 (patch) | |
tree | 245dfdd4f99b721b1c4a28a7ac82394dd4f801bf /include | |
parent | virtio-mem: drop unnecessary initialization (diff) | |
download | linux-544fc7dbbf920a3e64d109c416ee229e8e1763c5.tar.xz linux-544fc7dbbf920a3e64d109c416ee229e8e1763c5.zip |
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.h | 4 |
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. */ |