From patchwork Fri Aug 30 15:49:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1979097 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=T5Sk2tni; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=BsvHmgow; 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 4WwMzD74y0z1ygJ for ; Sat, 31 Aug 2024 01:49:44 +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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HNMTkkkd2kUcNr2UEWddz0qd+0vxsmG2L+97Fy/e2pM=; b=T5Sk2tniijhvNl qakR6FmjNskXUtGgIc7mOf28mJSf/3OYpmpwdkS6wVfA1AP0IZbt1hz0gYrOvBGNLsxksn+5HoVSk Ma2XULhOqiFQiuszQm2IkHFiwJMbhPTAPajtWfpIvtFXeRELg+Q975aSbEdPsFTgEjrx358kN3mM9 37yXNrIrSuuRhFXIkqxykrxqG+U0VGYvohIAY2m9yfFiCIGPf5Urr+TwReukPGfIaA4/nVHRiJ5qB cLeKWu3JOGNph9EMa75SlFxnO0hTyF8UYI+HuAyeMwGEGvBfJviFclZZa+OMo4bOyp+AqSyftT6pN ys87xIs/LuNlWXEYO6hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk3sW-00000006sVJ-2pig; Fri, 30 Aug 2024 15:49:36 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sk3sU-00000006sUN-0F0U for opensbi@lists.infradead.org; Fri, 30 Aug 2024 15:49:35 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-714226888dfso1654841b3a.1 for ; Fri, 30 Aug 2024 08:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1725032973; x=1725637773; 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=T67+00H7KAjQG/4LRdD00AqObgDHLYK7u7WK93hryZQ=; b=BsvHmgow0QOnKJKfiGMZTqNLEJ2p2Slnw4XJRgSAft7TEVs6lEQ0dvlTLoU3TwAI/2 dyNSvMwEvW76dIFjt3RpwyHLEs9gbs9ZFYb3xtS0NjCq24rAoIkGFOhCh6ZxOR1lRHAm BvQ64hFFOr4w+vdGrtv0d5s4Tjz6WiTVDPvXr7HSvuyUr8fe4icrvNFLlwRMmlDFviFW O2qaxVZT46VPo9Q7Lu2tsDswkueFJ13wNDfElCV3dZqRBy7xNL1fONSqsk7cifrex3Fy JBCEGt5pi7QA1J6WHjMW5U61JD0ly7TvJM4Z30cwWTX+uJ6BYfHKgde7kQJOXhr7cewj MSpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725032973; x=1725637773; 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=T67+00H7KAjQG/4LRdD00AqObgDHLYK7u7WK93hryZQ=; b=MN3hkLdwd4DphtqAiz/NXgSLI8M5zzuJkwX/XU0I6u2dZW+OLAclTEnmN0YzWUrXpl 6Md3l2RiGAebgZeExVCMD678QbJebBHejc2Fj4Ef7h9xQ97Obiinc8fjjdEBPMCkNx3u F0Diofw8Q+KWK2irjzoqROhQqTmnWGmqAGLZ4CbX+fXan0CVI6arw7Ch+Li8fcQBBSwB 3HHQGNCcvwWVofCnCdWFQJ/LCCqDxRG0/EBEjvgaifXIcAGxn66I326EGU7TaK4dO+8z rwvDRaXvQz0+eGx9c6qTZdTg8sNL2u4q5Vup9JMhnZSdhMSackSLd1D0JYWn0uQGVEg7 DaTA== X-Gm-Message-State: AOJu0Yx0nyNhLEIs16LYLQMlMYvCAPyRI9TTQn4cZN7Ut2vt6me70Kbo 2QiAnWJBPHIqA7RnW6N7ZWmzaBcWkkva9XetuJr8cqzedy4dOPRoyeDAkM2OmXjdfHfQ7zkGr31 lV0SBohsLvrgwI8689Kpn8smhWb4SI+FsreWA77cxDfSnXLbcA31BJDMc97qQ6GujIjUg2G5Znz cpQmVJbvka1O5jYZGaaCVT5sm+oIc3loidADQCWsGn4G+C1Dzbqxg= X-Google-Smtp-Source: AGHT+IEz+dbhteA6f1RJ7nUjK3OCN9MenD2unshQ2F6bswkoOgmczlYL2UfUI35m5rE0Sr71citcww== X-Received: by 2002:a05:6a00:850:b0:705:d755:a9d5 with SMTP id d2e1a72fcca58-715dfc76340mr7920961b3a.27.1725032972887; Fri, 30 Aug 2024 08:49:32 -0700 (PDT) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-715e569e793sm2920817b3a.131.2024.08.30.08.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 08:49:32 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH 01/12] lib: sbi_init: Remove obsolete hartid check Date: Fri, 30 Aug 2024 08:49:05 -0700 Message-ID: <20240830154929.3971790-2-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240830154929.3971790-1-samuel.holland@sifive.com> References: <20240830154929.3971790-1-samuel.holland@sifive.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_084934_115535_0E987EB8 X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) 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: This check has been obsolete since commit c51f02cf143b ("include: sbi_platform: Introduce HART index to HART id table"). It originally filtered out harts that were disabled in the FDT, but those harts [...] Content analysis details: (-2.1 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:435 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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 T_SCC_BODY_TEXT_LINE No description available. 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 This check has been obsolete since commit c51f02cf143b ("include: sbi_platform: Introduce HART index to HART id table"). It originally filtered out harts that were disabled in the FDT, but those harts are omitted from the hart_index2id table, so they will hang in fw_base.S after the "Find HART index" loop and never enter sbi_init(). Signed-off-by: Samuel Holland Reviewed-by: Anup Patel --- lib/sbi/sbi_init.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index d80efe97..7443010e 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -500,21 +500,11 @@ static atomic_t coldboot_lottery = ATOMIC_INITIALIZER(0); */ void __noreturn sbi_init(struct sbi_scratch *scratch) { - u32 i, h; - bool hartid_valid = false; bool next_mode_supported = false; bool coldboot = false; u32 hartid = current_hartid(); const struct sbi_platform *plat = sbi_platform_ptr(scratch); - for (i = 0; i < plat->hart_count; i++) { - h = (plat->hart_index2id) ? plat->hart_index2id[i] : i; - if (h == hartid) - hartid_valid = true; - } - if (!hartid_valid) - sbi_hart_hang(); - switch (scratch->next_mode) { case PRV_M: next_mode_supported = true;