From nobody Mon Nov 25 09:40:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1716289092; cv=none; d=zohomail.com; s=zohoarc; b=IQxJ25PcHJ4MXGqMMpkcyIq7qLnWVkLSFKWjJbDVkrVxBi105NxfEDqJPo+xAIgg86cBRMdaV5H1L5jnMc2y0UT9l+S6BET3/LpcGHu8fkVOJTtRgykz864INSRxNJdgTNXuu0VfHxviM3kKv+WwmoqxcrBgjOdRzxpnim946Xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716289092; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LuCtTVpA4TD+B9DoNIqIYGIHxQoP1DpoqYk5GFKUBOc=; b=Vh3SswitTsTsEkK4G5PNDhwLOs3Ry4/VXLVt9WoQUt0N25sEV7HHat8/UmyOub5dXirlKfoTOF7sgmaIvxj7jC4XjPrhb3rmRH2EIDpARXdxAd332mTK2yC9kKVyJYKWwLVOZxIzmBaMPXTD8EMITHsJ+2beX8IphqdMJCPHWoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716289092848597.127968521819; Tue, 21 May 2024 03:58:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9NB1-00009P-CF; Tue, 21 May 2024 06:57:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9NAw-00006k-N2; Tue, 21 May 2024 06:56:58 -0400 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9NAv-0008J3-3R; Tue, 21 May 2024 06:56:58 -0400 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2238362153; Tue, 21 May 2024 10:56:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26BF0C2BD11; Tue, 21 May 2024 10:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716289014; bh=izDUykFEQkwQc1xzdS3N2VcVYxMhBjpLt/wly4Hm8+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ptkkf9FNqTWXHMV9wfe3iEC7Qh9Anqly8weuR4s2SCdBoHXrd7L/2lTASBxBX0Y6a Htvk+obeXVQC7Vq943+8Ci2oFjdFCZ0ycs1jcPZl2o/filrrMhi8pswOoGyvAI97L+ +uTBpUyIQM8GMTUCt8JSKCSddpPJJ5jRdGzQOp1/ZicJjbWY4301MAiEZlp4YrU3fW 7oIg+XAXK0amIU4fG7IPPrvm3ZlCV0Xwpn59ViaGDpwaoHoH1D8mvNbB9z0uu9/Dlv Z1IxH7d/jcsknLoeqgH29b1/waqhq73kN0FIY2GwWpcewvLhosaoi5HT6UqeJO4WBy ZpFaZMbaUhHMg== From: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= To: Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , qemu-riscv@nongnu.org, qemu-devel@nongnu.org, David Hildenbrand , Atish Patra , Atish Patra Cc: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Sunil V L , Santosh Mamila , Chethan Seshadri , Sivakumar Munnangi 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 Message-Id: <20240521105635.795211-3-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240521105635.795211-1-bjorn@kernel.org> References: <20240521105635.795211-1-bjorn@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=139.178.84.217; envelope-from=bjorn@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -70 X-Spam_score: -7.1 X-Spam_bar: ------- X-Spam_report: (-7.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1716289093216100001 From: Bj=C3=B6rn T=C3=B6pel 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=C3=B6rn T=C3=B6pel --- 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, RIS= CVVirtState *vms) } } =20 + 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); } =20 --=20 2.40.1