History

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.

Michael S. Tsirkin committed 6 years ago

Commit 544fc7d1 parent b3fb6de2 files · +11 −11Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/virtio_mem.h+2−2
@@ -185,10 +185,10 @@ struct virtio_mem_resp { · 184 unmodified lines
185 185
186struct virtio_mem_config {186struct virtio_mem_config {
187 /* Block size and alignment. Cannot change. */187 /* Block size and alignment. Cannot change. */
188 __u32 block_size;188 __u64 block_size;
189 /* Valid with VIRTIO_MEM_F_ACPI_PXM. Cannot change. */189 /* Valid with VIRTIO_MEM_F_ACPI_PXM. Cannot change. */
190 __u16 node_id;190 __u16 node_id;
191 __u16 padding;191 __u8 padding[6];
192 /* Start address of the memory region. Cannot change. */192 /* Start address of the memory region. Cannot change. */
193 __u64 addr;193 __u64 addr;
194 /* Region size (maximum). Cannot change. */194 /* Region size (maximum). Cannot change. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t