From patchwork Fri Aug 30 08:49:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= X-Patchwork-Id: 13784865 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CA59BCA0EFE for ; Fri, 30 Aug 2024 10:01:22 +0000 (UTC) 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:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UUf4rDbV9bT/DN97ndLU+x4NxjmEoyJrwFhzZpZ3AXY=; b=uMhmpTEf0P1S9F PzJaeAKk6vokkhHk4+WvPrT36lLmGsqGTMKdy/xf+X9pb6e7aiSpU+Ucyi6Whg/kkI1V/eGh88YUa K1BctA7PR5hgJAPS2Zc4vw3FSsk/2/seoUKzo1AwnQQAyQHcWZ6bCfjmm2yGVcahl/GME/JxeocNk kb+hWodrLrY+CNpDWRA6RzDVpC53uDXPIJGzfLkTWoYvf4VB9Y9e0+Y6yAZpVO7svolu3RBGJjf2j 8x1tLMIAEEc6cGtR+2Ldf2MJzI1zCHl1OlPC+z3dVqUu7sgeob0qSl4kr02TpMmTAklz+uNN+zvCW nZymhC9A936LIImTVycA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyRS-00000005gJr-0fQ1; Fri, 30 Aug 2024 10:01:18 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjxK9-00000005Qwt-2f9T for linux-riscv@lists.infradead.org; Fri, 30 Aug 2024 08:50:02 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-37182eee02dso990256f8f.1 for ; Fri, 30 Aug 2024 01:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1725007779; x=1725612579; 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=iGJL7OIFuIkfLAFkoMGwwROnKpnDuEMTd89ued1Cebg=; b=eVNN57aCs7tu+B8l27J1X0o1AdJLk2E4+tvbURXPCHoutSaUX5WCf+dRvNuEes1fDy 3nywArDRHFMmPlzumu8sy3zoJLGZRiCfLb5VZe7esglI8Rmi4y2MUMetiWELXUlR5wZz NR0B8kL3hGgCb+aH5LUDsfEkgxVpKbAKiNIgqhrONmjlHtUoUqKuZMVfvLw2tMkBdPK6 gsmMxtKkgBq8tTX/dAc46zSxa06mEeAzptJdlHJxZy2pG7ceU5F4UDiDDLzJnteU4DxS j2pkJzm43WRSQ2AtkytfvBgXXgmMEZ7rTTCS0/uDHFwJlZtgMQm+MbquLLqcHUBZjNSN z1rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725007779; x=1725612579; 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=iGJL7OIFuIkfLAFkoMGwwROnKpnDuEMTd89ued1Cebg=; b=cjEZ81detA20hXsrDVnUdsuMPdQzOlTwKDFIW4OzIu5L5PtKbKLOpk3bePemycMEqE 0m9B6m/GNYGVWcW6XX0ubEat8eSE3bsGF3SERufySKp4JIIsndkAqfoisCK3r1ZFQOrf GI5QBDTDkzuINXgRC3+OsDnRwepW6cqophJ/GR6/V+Im1AycaGjHg6I1CBNFq9svyUyo vawz0/COBmlc93Ji7ZplGNnFHlgUnM0cRr7AKcsv91kHUNBbzFJyxWEqcJvOVef5/i9j I4QGohpfni/0UiwdB97ThYGkPoHoxRr/ZdUTK46Orc/MpKyKlS26jCu5htsKuAmgpncf FXhw== X-Forwarded-Encrypted: i=1; AJvYcCUyKvZsJm6LvKW0DxG0czRt0Hg17D3uWlzQAAlo6izNQ4SBOkcqd8c8qIHtGAtrpq2SDKvIHXCE8BpnrQ==@lists.infradead.org X-Gm-Message-State: AOJu0YwfhDmCaZGqkVI0Uf87Zc6kXOmCVy19gtID7hm5+uQNZnJwMGUP St6fvPA1j8gzzdqFvtNn7POyDVt7oy5QlzNafQWS1qSOsMLiynZco2O5yOI3rGE= X-Google-Smtp-Source: AGHT+IE35PnHcXWnBWcAufXm2itAOGM3bjIxxoVO2EORI0hpbo/KkZo9FhT5TSGQ+S/KMoIRwGKHwg== X-Received: by 2002:a05:6000:1e90:b0:36b:b174:5256 with SMTP id ffacd0b85a97d-3749c1a9d0bmr2933640f8f.6.1725007778972; Fri, 30 Aug 2024 01:49:38 -0700 (PDT) Received: from carbon-x1.. ([2a01:e0a:e17:9700:16d2:7456:6634:9626]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749ee73fa0sm3373144f8f.43.2024.08.30.01.49.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2024 01:49:38 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: remove useless pc check in stacktrace handling Date: Fri, 30 Aug 2024 10:49:32 +0200 Message-ID: <20240830084934.3690037-1-cleger@rivosinc.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_014941_961438_D32CB7A4 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Checking for pc to be a kernel text address at this location is useless since pc == handle_exception. Remove this check. Signed-off-by: Clément Léger Reviewed-by: Alexandre Ghiti --- arch/riscv/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c index c6d5de22463f..f934c573c087 100644 --- a/arch/riscv/kernel/stacktrace.c +++ b/arch/riscv/kernel/stacktrace.c @@ -72,7 +72,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs, pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra, &frame->ra); if (pc == (unsigned long)handle_exception) { - if (unlikely(!__kernel_text_address(pc) || !fn(arg, pc))) + if (unlikely(!fn(arg, pc))) break; pc = ((struct pt_regs *)sp)->epc;