From patchwork Fri Apr 29 15:51:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1624436 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=JXTnEhI+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=fKMB+k1v; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KqcT06HBGz9sBB for ; Sat, 30 Apr 2022 01:52:52 +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=hHrNLV4dBkINyPsvu5nl9KnixaqEOTRnlo/1O3UXyxw=; b=JXTnEhI+UpTAIt XhJdr5yA8wLIM/tlI+tH39lKhFD7CkvGt9N/LyY2a2R17zO8LH07aenJptyBZioxhMbRPBCo5aWso cYQCV/b9XSZZArRsyj8oMN7SRKswpXyb93K7mldCO6ujdMGqxkJueBX3f/fHAAkwt6vyxUcAZhlEt VCzYdjj0R9VrMMzNJC0aa2p3CQQWxI/NixiJc3N8Ei4Rm7PDm0gccyLV1+uyZ9Fl50KV/YKJtdxSM B7BksbweBalkiubWkHGKTPVExFLRRASFWRyWRyHI0B+FHIv1E21ibCNzeNZ2i0r6koiXA7HIMfpW3 3SaVaDjuHsGNWO6k2njA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkSvA-00Bprk-Ir; Fri, 29 Apr 2022 15:52:40 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkSv7-00BpnY-2l for opensbi@lists.infradead.org; Fri, 29 Apr 2022 15:52:38 +0000 Received: by mail-pg1-x535.google.com with SMTP id s137so6832780pgs.5 for ; Fri, 29 Apr 2022 08:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O5VLghBeXhnL8rer7u0y8qxvc+QVIa22UO2NarDOL6w=; b=fKMB+k1v5pnzjykh/jGAvSKVqGsH2pjV0Ft+j3ax5e/KnyScVuZI5Rlx5m/Kzb/HoG +BvjsEKbUOAfinnrRVfdUdnfagHxjrPHiU8EAUe/XftYCoWRsVABkEBfAMiXnPJdX2an NtS/6hptZADFpFezmY55tb+WGB6PyJv9+6RehxzuOUghql3knPZoqY/VMfWvb2Hgio3p 22jGQv8uwOYbV3mS7zmTBu9OgQf2Zf6mrXPUCKG7Dq2kebZsc5Sa6mWPAmEC7ynVATIm fIHuOPy+Tvr8uX5d7HIf1/I7oBup3hqfW+oj+E/KR87Qp0xnYm8b77xfstWojujLsOo6 pKRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O5VLghBeXhnL8rer7u0y8qxvc+QVIa22UO2NarDOL6w=; b=6OIg0zk+HzoJqKPKSRBvImBUA5ZX/oD4HJk2zkzFdxuKW99c6w4Fow1fLFUYohKw+b 3WzZ1Em+DK5j1nrz3qY0BOxn9FZ1oDB+P8NOj4nBAWE8PKXkbpjxqwyQpaCex2IEGhPV QfESaT6/bPAa/0KuA/HViK6bsni2EIVROOFH4AENOZTJ9nOJxO8hvfQHSnFcthZg5wmQ /UFMTYgJ25t45ooBn+MvxZ1oa7TpMuHCIX/QT/2w4qysYoirf07xOMdpxs/U4kq73+vd 4gXRkDSDEsgV1tXxxYzLlLYmLt40wwez6et1G0F+6HjhbC/meI5aRhcrkkbY2aDOt9UZ R8Pw== X-Gm-Message-State: AOAM533zESx5mAt+hNc8iPEHi5FnTYdXrq4UNzoVdzO+4JyjIRjEztRM rdzrnhixK+HRHP3wbbAMtPvIhw== X-Google-Smtp-Source: ABdhPJyywO09IuaQnuDQsbT4WMudFqJC6ejV5KxyWHeT/Yri6t9U8H4/aewbsUC1HRvdIBAHQMz/Yw== X-Received: by 2002:a63:6e84:0:b0:398:1338:689 with SMTP id j126-20020a636e84000000b0039813380689mr23615pgc.283.1651247555538; Fri, 29 Apr 2022 08:52:35 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.167.97.237]) by smtp.gmail.com with ESMTPSA id p2-20020a17090ad30200b001cd4989feb7sm15287280pju.3.2022.04.29.08.52.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 08:52:34 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 07/11] lib: sbi: Fix AIA feature detection Date: Fri, 29 Apr 2022 21:21:47 +0530 Message-Id: <20220429155151.314788-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220429155151.314788-1-apatel@ventanamicro.com> References: <20220429155151.314788-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_085237_151200_640FAC00 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) 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 AIA feature detection uses unnecessary goto which is not need and AIA case in sbi_hart_feature_id2string() does not break. This patch fixes both issues in AIA feature detection. Signed-off-by: Anup Patel --- lib/sbi/sbi_hart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) Content analysis details: (-0.2 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:535 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 Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 AIA feature detection uses unnecessary goto which is not need and AIA case in sbi_hart_feature_id2string() does not break. This patch fixes both issues in AIA feature detection. Signed-off-by: Anup Patel Reviewed-by: Atish Patra --- lib/sbi/sbi_hart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 5ee5ddd..fdfb6d9 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -408,6 +408,7 @@ static inline char *sbi_hart_feature_id2string(unsigned long feature) break; case SBI_HART_HAS_AIA: fstr = "aia"; + break; case SBI_HART_HAS_SSTC: fstr = "sstc"; break; @@ -632,10 +633,8 @@ __mhpm_skip: /* Detect if hart has AIA local interrupt CSRs */ csr_read_allowed(CSR_MTOPI, (unsigned long)&trap); - if (trap.cause) - goto __aia_skip; - hfeatures->features |= SBI_HART_HAS_AIA; -__aia_skip: + if (!trap.cause) + hfeatures->features |= SBI_HART_HAS_AIA; /* Detect if hart supports stimecmp CSR(Sstc extension) */ if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) {