History

virtio-mem: Allow to specify an ACPI PXM as nid

We want to allow to specify (similar as for a DIMM), to which node a virtio-mem device (and, therefore, its memory) belongs. Add a new virtio-mem feature flag and export pxm_to_node, so it can be used in kernel module context.

David Hildenbrand committed 6 years ago

Commit f2af6d31 parent dfb0b2e3 files · +47 −3Browse files

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

Unified · Split

include/uapi/linux/virtio_mem.h+9−1
@@ -83,6 +83,12 @@ · 82 unmodified lines
8383 * device is busy.
8484 */
8585
86+/* --- virtio-mem: feature bits --- */
87+
88+/* node_id is an ACPI PXM and is valid */
89+#define VIRTIO_MEM_F_ACPI_PXM 0
90+
91+
8692 /* --- virtio-mem: guest -> host requests --- */
8793
8894 /* request to plug memory blocks */
@@ -177,7 +183,9 @@ struct virtio_mem_resp { · 88 unmodified lines
177183 struct virtio_mem_config {
178184 /* Block size and alignment. Cannot change. */
179185 __u32 block_size;
180− __u32 padding;
186+ /* Valid with VIRTIO_MEM_F_ACPI_PXM. Cannot change. */
187+ __u16 node_id;
188+ __u16 padding;
181189 /* Start address of the memory region. Cannot change. */
182190 __u64 addr;
183191 /* Region size (maximum). Cannot change. */