From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63EA9EE01EB for ; Tue, 10 Sep 2024 21:29:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so8PK-0006VD-CO; Tue, 10 Sep 2024 17:28:18 -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 1so8PJ-0006Qu-12; Tue, 10 Sep 2024 17:28:17 -0400 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so8PH-0002OG-Bp; Tue, 10 Sep 2024 17:28:16 -0400 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-e1a9dc3f0a3so6482020276.0; Tue, 10 Sep 2024 14:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726003693; x=1726608493; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=22XBIU3pc0P+VXjFfMQTf9BHKfxrdihaJYixQ+/HslQ=; b=gtj8a67EKzYrJfddUei6P64tndT7cwZSENBs/lx6DwQ66O3V6esJWKSlQrpAOSBWG8 DHwqc08WBfDahwrdcewJdT1yrbW0WXe3u+VNA8CU7uO3OYvuLFl3XBDuqjTN7fj0Xe4V KhVWxKgkAoEc/+k30NnpNX5F9U123p7fk5tI+YR9Vh/NOx3nvAoNgZRadjS7pl/FsrJR dUxqMYZhisKnyHbZq4Ll4n1PhjNmb37nB8bdhnHEAcNJwp0p/Zc9udSjC0693oqteDeQ wdmH7x2wKlk3l2PNJHSU8hc+Gbg9vXeoNx9YJlGiVT09LkyM2ByFvydvjVl5ThiEUcm8 s6Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726003693; x=1726608493; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=22XBIU3pc0P+VXjFfMQTf9BHKfxrdihaJYixQ+/HslQ=; b=torRh/J3JlEWEbajXE4VrGxlpITnJHP6gU05xP6c1rMQKImMK0jtqFhdjgyidGkbUc Wy9JAwCrxNtCqyl6GjPyZ9JB9QrIqV4y4ZymPVV7feO+hbUt93dFwKBdVU457F/sc+3k MKOgxFq2vmBupuD0+3N+10oleH0aBEnAzaZfL0wulEih/6hYH0dikRKEoBM+7+Q8/nA1 F0kn4oGFTRGVbKW5YUuavF1PQQyhK+Lbgy2wxhsnlIpZTyaEXS1tN3gA193n6JPFB3Iz TpgZ6+V82XG/CRreJMQBQXob0N2QZ103wne+TrFZSfJjvmGPdH4s992E1ZMS5efeXdMn bgCg== X-Gm-Message-State: AOJu0YzI8fid5smO8NZuDh70wFUcxxR2B/UfpwRDy1XkafFDo1mncTy9 O/s1pQqpGCPpB0zXN7FLq9bKSPU7I6gEa6oBKOQhq67eDdNjyDihOgeaWY8e X-Google-Smtp-Source: AGHT+IFMQXFjG2JvvW+Imws4sLBxgjmly7Akyjvs2ghVhCgOynAHpCdfu/Jijq8zj6UKN0ubQwjTfg== X-Received: by 2002:a05:6902:2293:b0:e11:6348:5d95 with SMTP id 3f1490d57ef6-e1d348a1b9cmr17072624276.7.1726003693670; Tue, 10 Sep 2024 14:28:13 -0700 (PDT) Received: from localhost ([2600:1700:830:3db0::14]) by smtp.gmail.com with UTF8SMTPSA id 3f1490d57ef6-e1d7ba163b5sm438904276.26.2024.09.10.14.28.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 14:28:13 -0700 (PDT) From: Gregor Haas To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, atishp@rivosinc.com, dbarboza@ventanamicro.com, alistair.francis@wdc.com, Gregor Haas Subject: [PATCH v5 0/2] Add support for generating OpenSBI domains in the device tree Date: Tue, 10 Sep 2024 14:28:09 -0700 Message-ID: <20240910212811.996184-1-gregorhaas1997@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::b33; envelope-from=gregorhaas1997@gmail.com; helo=mail-yb1-xb33.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Apologies for the double-email, forgot to run checkpatch ... This patch series adds support for specifying OpenSBI domains on the QEMU command line. A simple example of what this looks like is included in the documentation changes included in this series, along with detailed information on each option to each of the new flags. v5: - Add missing Signed-off-by line in the documentation commit v4: - Added license comments to the top of each new file - Made id mandatory for OpenSBI domains - Added documentation v3: - Addressed review comments from v2 by adding default values to new properties. This results in concrete errors at QEMU configuration time if a mandatory property (as mandated by the OpenSBI spec) is not provided. - Changed command line encoding for the possible-harts field from a CPU bitmask (e.g. where bit X is set if CPU X is a possible hart) to a range format (e.g. the possible harts should be CPUs X-Y, where Y >= X). This does constrain the hart assignment to consecutive ranges of harts, but this constraint is also present for other QEMU subsystems (such as NUMA). - Added create_fdt_one_device(), which is invoked when scanning the device tree for a memregion's devices. This function allocates a phandle for a region's device if one does not yet exist. v2: - Addressed review comments from v1. Specifically, renamed domain.{c,h} -> opensbi_domain.{c,h} to increase clarity of what these files do. Also, more consistently use g_autofree for dynamically allocated variables - Added an "assign" flag to OpenSBIDomainState, which indicates whether to assign the domain's boot hart to it at domain parsing time. Gregor Haas (2): hw/riscv: Add support for generating OpenSBI domains in the device tree docs/system/riscv: Add documentation for command-line OpenSBI domains MAINTAINERS | 8 + docs/system/riscv/opensbi_domains.rst | 156 +++++++ docs/system/target-riscv.rst | 10 + hw/riscv/Kconfig | 4 + hw/riscv/meson.build | 1 + hw/riscv/opensbi_domain.c | 558 ++++++++++++++++++++++++++ hw/riscv/virt.c | 3 + include/hw/riscv/opensbi_domain.h | 69 ++++ 8 files changed, 809 insertions(+) create mode 100644 docs/system/riscv/opensbi_domains.rst create mode 100644 hw/riscv/opensbi_domain.c create mode 100644 include/hw/riscv/opensbi_domain.h -- 2.46.0