From patchwork Sat Aug 31 02:27:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 1979258 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=sBpdeaRB; 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=DkkPMYD3; 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 4Wwf7q4s0Mz1yfK for ; Sat, 31 Aug 2024 12:28:07 +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: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:In-Reply-To:References: List-Owner; bh=QgUNiGxelzl1JPkLWotV856VCT6+09RZKhuIKur98IY=; b=sBpdeaRBewYV5g kSUTLmgV56dMQQuZA/Q3DCu46fFNMoolJiZEnwa4luksNxwvtLV2MduAnNfg4H4DpLgCrw1N1+izR kX3ZB5CeFDP/9fizxc8FfAPkE42VfM8Daop0cQhK5cMnENZ1Iu1uUBbQwEtv5LvBA55oRqnEt4h5l SXLxxcHxsh7zXt93khRk3WAT7lKf+oz7NxKSXlXPPA9Ix9+meZATZIsAI5B1/gVJMQtehgQFaecuU VQVo54WjM24iMOytWxMkpFgPrJbp8Qt8e/VU2bzGr/g4BtQWrh4QvoOhKmhcao2Cz1v16AeDpdyCC lNr9FL4fpfQB3Y1LVyqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1skDqH-00000008KLE-2aKA; Sat, 31 Aug 2024 02:27:57 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1skDqD-00000008KKV-49Am for opensbi@lists.infradead.org; Sat, 31 Aug 2024 02:27:55 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-202318c4f45so23992125ad.0 for ; Fri, 30 Aug 2024 19:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1725071273; x=1725676073; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ezGzrPnHhRCNukDxuGsn3kA68oo9YuzIoNYko4V7qu8=; b=DkkPMYD3HsNcqn767PwkjmNHkSIijoCbG6khSglmvObTyLdnVZr+TE8HkBMr11ZB8w vkC2VrHyPHkNEqS2zSB3LWo5c45Vd93Tj720M7zEBcI9+rznl3RrPcV9IuH7v6yTOiJI cSZTlbf+VJhkWlBFNUu4MKFPe6iSKylXyPppuR9kAV/KXTUIYu8eEqPOLI8vQc4+KW79 v66FdASrz9xIclDOLq4emHDeBtio5Ot+JcCApMIBuwkvbwvTFbHa69wSe/pO3HZLC3Lf UWQskgkoQoPXd2UOeNlw2eEI561TMP043AVaFn8gWJO0W6fDXdVOQDQkcXvsa/7CJoDO WLdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725071273; x=1725676073; 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=ezGzrPnHhRCNukDxuGsn3kA68oo9YuzIoNYko4V7qu8=; b=HjMzulK2pLt/KVXpGe7bEtfojUoKWM+gElUAqOLExhTgTeoy3eclneurIlEVXkeM0w SkdodbTgqlCesAacCJr5hF6/rEjNzMiZFj/BuaQQHDRF7VBdUqHXosUEc9b7Vt4GEgcx aeX7wTvtNHyxLclQdnVFtfMj0YwQCacdYogLQ2al/4sxErBZalBamvKDH27PXutjfOfQ GEJ+dWe5YHKO7bCZVoEgnnWOJGhvh2fkj2Qv30yW4e7fEuOK2bsyoJ607U2Oj+bqhEEY CE4xQBDjf1g8PpkxibPacTQRxn9I23eE2HVt+IYAomn+PW5pKARWnHZYFZQcmjUVZHK+ 6C1g== X-Gm-Message-State: AOJu0YwniAw5tll6hpUN/RgaxPF3o4HiyP4zJW79EP0JU5/UjQS8zIeb ETNStSiuHGQqYazsF2yKo5T//7/Pf9p2Q50WbeodwpkBxUNQcc3WiFajzghd9AEFuHGZMQaeF4I VnNWp7JHSp86JLb2N/9bMG89+FBZBPp7iBbAJVccR0Vl49Gh3J5KDnAe8aUmiggT7IegtSCdeyU SU3xc3mOTzmsATIVb744Re9LDwPMm2vgECU5OYgdQhOs5S6qwB0Fg= X-Google-Smtp-Source: AGHT+IG4nEY2Thb7Q4jF16yppAOPDtL3BsyYCQQ3Psr4Jsgm5sJZhw+MdyrTNRVnvNkhXEZx4Uq8lw== X-Received: by 2002:a17:903:2348:b0:203:a030:d0a1 with SMTP id d9443c01a7336-20546b5529fmr10790885ad.58.1725071272618; Fri, 30 Aug 2024 19:27:52 -0700 (PDT) Received: from sw06.internal.sifive.com ([4.53.31.132]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2054451608dsm3905175ad.209.2024.08.30.19.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 19:27:52 -0700 (PDT) From: Samuel Holland To: opensbi@lists.infradead.org Subject: [PATCH] lib: utils/ipi: Fix hartid wrongly used as hart index Date: Fri, 30 Aug 2024 19:27:43 -0700 Message-ID: <20240831022751.81875-1-samuel.holland@sifive.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_192754_218798_B0063156 X-CRM114-Status: GOOD ( 11.14 ) 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: Since commit 78c667b6fc07 ("lib: sbi: Prefer hartindex over hartid in IPI framework"), The .ipi_clear callback functions take a hart index, not a hartid. However, these warm_init functions were never [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62d listed in] [list.dnswl.org] -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 Since commit 78c667b6fc07 ("lib: sbi: Prefer hartindex over hartid in IPI framework"), The .ipi_clear callback functions take a hart index, not a hartid. However, these warm_init functions were never updated. Fixes: 78c667b6fc07 ("lib: sbi: Prefer hartindex over hartid in IPI framework") Signed-off-by: Samuel Holland Reviewed-by: Anup Patel --- These functions could be updated to use current_hartindex() once that API is added, and I will do that if I send a v2 of the hartindex series. lib/utils/ipi/aclint_mswi.c | 2 +- lib/utils/ipi/andes_plicsw.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/utils/ipi/aclint_mswi.c b/lib/utils/ipi/aclint_mswi.c index 4ae6bb1c..905c1996 100644 --- a/lib/utils/ipi/aclint_mswi.c +++ b/lib/utils/ipi/aclint_mswi.c @@ -74,7 +74,7 @@ static struct sbi_ipi_device aclint_mswi = { int aclint_mswi_warm_init(void) { /* Clear IPI for current HART */ - mswi_ipi_clear(current_hartid()); + mswi_ipi_clear(sbi_hartid_to_hartindex(current_hartid())); return 0; } diff --git a/lib/utils/ipi/andes_plicsw.c b/lib/utils/ipi/andes_plicsw.c index 413ac20e..37dc4f64 100644 --- a/lib/utils/ipi/andes_plicsw.c +++ b/lib/utils/ipi/andes_plicsw.c @@ -67,10 +67,8 @@ static struct sbi_ipi_device plicsw_ipi = { int plicsw_warm_ipi_init(void) { - u32 hartid = current_hartid(); - /* Clear PLICSW IPI */ - plicsw_ipi_clear(hartid); + plicsw_ipi_clear(sbi_hartid_to_hartindex(current_hartid())); return 0; }