From patchwork Fri Aug 9 03:47:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregor Haas X-Patchwork-Id: 1970792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lbBBfPJ1; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=WV7Iatop; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wg8xg57Gyz1yfC for ; Fri, 9 Aug 2024 13:47:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Btasq7xYYdoGbYAV/jE4icmm82KaGpPKQ3vO4Gqwe5g=; b=lbBBfPJ1/lOSxE Us3N4cirJI6D83yEKYdfWAf/sECEwsFG+8KYLLK0jF+mSxZZfqh9x2/OcHTYhs5C6M11dMYW/kiJa i5INjSZvgqFSu/epKwV6zfYNhYTs6Rm/OPWMIxiTiZX9cIlFfLMvqXkBNICllSrIsaRWLMMQdTYGz jI2ZrqBqN5yVoaaI1Km2vUBoI9dN3rTi+Wlfx6GQVdhqNGLnoBFYH2TaDKfTMBOxt2h+2XjLfOuT9 8cguLLsKDl+2kSaZg80JVdDy/S90CtvrTwR26misHhWgaMa+N7XB0bwea3wi/U2bOJR1xO42dGKjX +2Oy8R5hHYHcIXIYbYXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scGb8-0000000AAJn-1oa1; Fri, 09 Aug 2024 03:47:26 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scGb5-0000000AAIt-1TJz for opensbi@lists.infradead.org; Fri, 09 Aug 2024 03:47:24 +0000 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1fda7fa60a9so15262605ad.3 for ; Thu, 08 Aug 2024 20:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723175242; x=1723780042; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=02eWHcNcKfADeKzvEd/nQLYj1C2MqmnoqKUFO6RU2g0=; b=WV7IatopI2/SmI8k6yHARMtY/6jBNQUS4NseHlZMEet1lnOdn7ghw/Gql6A9t3wqaD qyXXbqYctxY4bJzwLji4EE0RLjMjSNCsvHIQxaJDMHKiCXd693wvkPhQgTTmg8VHCB6+ 7oYRQQOA3LXSiGYOq8Tp5LFK663UfHgxPOnNzddkwQqsLrpZkvTzOTp2W4Wr2k95aBl8 uqjhrNMU4WnhE+UVDHVOkEIdOU1z7fddeP/HkCR3QCQrZq8ulFHrPTe1CEkRl+LkBTs1 WJ0VMZ9+PQazswY8ZUPJGzhV+z7W5fwG6JpZibJAKevTf1jtKJeQKvbZyjwb57yP3z1t /MqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723175242; x=1723780042; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=02eWHcNcKfADeKzvEd/nQLYj1C2MqmnoqKUFO6RU2g0=; b=Xkh869of+reddrgwWcqu3S0aaFcMR+aaGTXGVfRm/PTZVmY24d0FEvA+yOIS7nA/+j D/MjItEfIJ9o9FN3UxRBGf8pdmrKUzOsvJs+ROa0CkGt2hqXv7wgVDJkDIIigF2OkMxM T1cCemxbXkPXVo7Orxf/oTMmG/gVAi5DsZXc6h5ZYersWwWsuPOuIFazoBGuHthMK1Cq t0XYQBCpYQLfqgRWnb3TZXG02cp954OXMVKb1wE5ZvCWOkJWBBmTvwlgHof5t2HS5+Gd RiNWTuTpKW1iu4hFY3E87VshMYTQ0QgnS5e1zGi4KHBiUzu7iMJhw1HkUDHhmv5sDycy MkEA== X-Gm-Message-State: AOJu0Yy4Gl2Q8o47Ig1h2RJ2QE29H4+amHTWzAo62ztGGzpIpYrd34mr zpllYg3HQyMnY1A7R8Cj+46Rnm/loR/lxKhzxIWKkWaoshIb/7/enYmxF0lp X-Google-Smtp-Source: AGHT+IHfLxO30p+mxNVO/UW2OEdavJcZ6vzO3Ief4Y0xMSA+vFRcqaGS34K23TgnsZzahZ2c2gsdDw== X-Received: by 2002:a17:902:d491:b0:1fb:8a0e:7730 with SMTP id d9443c01a7336-200ae51ce3amr2356545ad.26.1723175242238; Thu, 08 Aug 2024 20:47:22 -0700 (PDT) Received: from localhost ([136.27.11.53]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-1ff59176eb6sm132551435ad.196.2024.08.08.20.47.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 20:47:21 -0700 (PDT) From: Gregor Haas To: opensbi@lists.infradead.org Cc: atishp@rivosinc.com, anup@brainfault.org, Gregor Haas Subject: [PATCH v2 1/1] lib: utils: fdt_domain: Make opensbi-domain optional in CPU specification Date: Thu, 8 Aug 2024 20:47:12 -0700 Message-ID: <20240809034712.24857-2-gregorhaas1997@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240809034712.24857-1-gregorhaas1997@gmail.com> References: <20240809034712.24857-1-gregorhaas1997@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_204723_447744_2F5B982D X-CRM114-Status: GOOD ( 15.59 ) X-Spam-Score: -1.8 (-) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The domain_support.md documentation states that "the HART to domain instance assignment can be parsed from the device tree using *optional* DT property opensbi-domain in each CPU DT node". However, th [...] Content analysis details: (-1.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gregorhaas1997(at)gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [gregorhaas1997(at)gmail.com] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The domain_support.md documentation states that "the HART to domain instance assignment can be parsed from the device tree using *optional* DT property opensbi-domain in each CPU DT node". However, the current implementation does not treat this parameter as optional when determining which HARTs to assign to a freshly discovered domain from the device tree, causing an effect where every HART in the system must be explicitly assigned to a domain only if a domain is specified in the device tree. Instead, this patch simply ignores CPUs that do not specify a domain, and does not attempt to assign them into the recently discovered domain. Signed-off-by: Gregor Haas Reviewed-by: Anup Patel --- lib/utils/fdt/fdt_domain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c index fa1c357..c6ee127 100644 --- a/lib/utils/fdt/fdt_domain.c +++ b/lib/utils/fdt/fdt_domain.c @@ -459,12 +459,12 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque) if (!fdt_node_is_enabled(fdt, cpu_offset)) continue; + /* This is an optional property */ val = fdt_getprop(fdt, cpu_offset, "opensbi-domain", &len); - if (!val || len < 4) { - err = SBI_EINVAL; - goto fail_free_all; - } + if (!val || len < 4) + continue; + /* However, it should be valid if specified */ doffset = fdt_node_offset_by_phandle(fdt, fdt32_to_cpu(*val)); if (doffset < 0) { err = doffset;