From: "Björn Töpel" <bjorn@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>,
Alistair Francis <alistair.francis@wdc.com>,
Bin Meng <bmeng.cn@gmail.com>, Weiwei Li <liwei1518@gmail.com>,
Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org,
David Hildenbrand <david@redhat.com>,
Atish Patra <atishp@atishpatra.org>,
Atish Patra <atishp@rivosinc.com>
Cc: "Björn Töpel" <bjorn@rivosinc.com>,
"Sunil V L" <sunilvl@ventanamicro.com>,
"Santosh Mamila" <santosh.mamila@catalinasystems.io>,
"Chethan Seshadri" <Chethan.Seshadri@catalinasystems.io>,
"Sivakumar Munnangi" <siva.munnangi@catalinasystems.io>
Subject: [PATCH v2 2/3] hw/riscv/virt-acpi-build: Expose device memory in ACPI SRAT
Date: Tue, 21 May 2024 12:56:34 +0200 [thread overview]
Message-ID: <20240521105635.795211-3-bjorn@kernel.org> (raw)
In-Reply-To: <20240521105635.795211-1-bjorn@kernel.org>
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
next prev parent reply other threads:[~2024-05-21 10:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 10:56 [PATCH v2 0/3] RISC-V virt MHP support Björn Töpel
2024-05-21 10:56 ` [PATCH v2 1/3] hw/riscv/virt: Add memory hotplugging and virtio-md-pci support Björn Töpel
2024-05-24 8:53 ` Daniel Henrique Barboza
2024-05-27 11:49 ` Björn Töpel
2024-05-24 13:14 ` Daniel Henrique Barboza
2024-05-24 15:02 ` David Hildenbrand
2024-05-24 15:29 ` Daniel Henrique Barboza
2024-05-27 7:19 ` David Hildenbrand
2024-05-27 12:03 ` Björn Töpel
2024-05-27 13:19 ` Daniel Henrique Barboza
2024-05-21 10:56 ` Björn Töpel [this message]
2024-05-21 10:56 ` [PATCH v2 3/3] hw/riscv/virt: Add ACPI GED and PC-DIMM MHP support Björn Töpel
2024-05-24 9:10 ` Daniel Henrique Barboza
2024-05-27 12:08 ` Björn Töpel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240521105635.795211-3-bjorn@kernel.org \
--to=bjorn@kernel.org \
--cc=Chethan.Seshadri@catalinasystems.io \
--cc=alistair.francis@wdc.com \
--cc=atishp@atishpatra.org \
--cc=atishp@rivosinc.com \
--cc=bjorn@rivosinc.com \
--cc=bmeng.cn@gmail.com \
--cc=david@redhat.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=santosh.mamila@catalinasystems.io \
--cc=siva.munnangi@catalinasystems.io \
--cc=sunilvl@ventanamicro.com \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.