From: Björn Töpel <bjorn@rivosinc.com>
Now that device memory is supported by RISC-V 'virt', expose that
region in the ACPI SRAT (System/Static Resource Affinity Table).
ACPI SRAT is used by, e.g., the virtio-mem Linux kernel driver [1].
Link: https://virtio-mem.gitlab.io/user-guide/user-guide-linux.html # [1]
Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
hw/riscv/virt-acpi-build.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
index 0925528160f8..6dc3baa9ec86 100644
--- a/hw/riscv/virt-acpi-build.c
+++ b/hw/riscv/virt-acpi-build.c
@@ -610,6 +610,13 @@ build_srat(GArray *table_data, BIOSLinker *linker, RISCVVirtState *vms)
}
}
+ if (ms->device_memory) {
+ build_srat_memory(table_data, ms->device_memory->base,
+ memory_region_size(&ms->device_memory->mr),
+ ms->numa_state->num_nodes - 1,
+ MEM_AFFINITY_HOTPLUGGABLE | MEM_AFFINITY_ENABLED);
+ }
+
acpi_table_end(linker, &table);
}
--
2.40.1