From nobody Sat Feb 7 04:19:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E28231A7FA; Thu, 11 Dec 2025 17:21:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765473668; cv=none; b=utK8WeWM2vOenbLTGruDiyb4tNzyeeLMWJ+QfUhf9FNUN0EnZuq3xlfkLOotbIRTP/lBZpSYwdvxJi6KqXUgCMee8YYf5yRLpZD83n70C541wY3p5EOIZ0B6tvG/9mY+/nvtzMiBod4ppFkpSZWPQ+0w2Qg4xmLL+hXYhkoajkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765473668; c=relaxed/simple; bh=gKj05EfXWRzFgsdHcGDwkowJM1p6i+3gIjza9qiTqkA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qrVQgtjPIHjlD8WH2OMKKgyqAgYP6pF0vRzuVMquZf71XEv7UOUErUqMu6sWgh77IIPmf4SS0JdpVR8zb7s6UgQoOJ7W22CVi3Urjc51OgRQ0oQcTChu/DI06/KxH8I+kl4lFUEdHYJxiKoQL+jQqG4bepEbIfhCzj4GwjVqkYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=joQ2+ocZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="joQ2+ocZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4845AC16AAE; Thu, 11 Dec 2025 17:21:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765473668; bh=gKj05EfXWRzFgsdHcGDwkowJM1p6i+3gIjza9qiTqkA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=joQ2+ocZmDicQ/80iOJxvajr3vmQx4nRpb5ckojsPu9lwQzjp2YDYvIE6QPlou39S 1LyZ38WVb7YMa9Q2dDAoDbm8Jz3srPtLnoz7tCa06SEtQ7HR1Bmz5yP8PPpW7r/XDW 6h0Pdg4Rz3ZLJePZb5Ot2w1Eyt8+YSWpd58FNbQ9jwcga3ZvmJPQlQrwGgb2YH+c8C 6QqHZ19S7Ci9j3mXfGa7saRyW+J7ogeQFtTROVd+1VLtpzQ+nWl5ODpw3hfqCr/A/0 L2u7qGMhTmdgbmQyMnh+EVZ+T2UZig3h9TiMl+5edoeKSUDJVrxtaxYnAEB4lJoy2t i9/3zDcuyxMAw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3810AD41D6F; Thu, 11 Dec 2025 17:21:08 +0000 (UTC) From: Deepak Gupta via B4 Relay Date: Thu, 11 Dec 2025 09:20:51 -0800 Subject: [PATCH v26 18/28] riscv/kernel: update __show_regs to print shadow stack register Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251211-v5_user_cfi_series-v26-18-f0f419e81ac0@rivosinc.com> References: <20251211-v5_user_cfi_series-v26-0-f0f419e81ac0@rivosinc.com> In-Reply-To: <20251211-v5_user_cfi_series-v26-0-f0f419e81ac0@rivosinc.com> To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Christian Brauner , Peter Zijlstra , Oleg Nesterov , Eric Biederman , Kees Cook , Jonathan Corbet , Shuah Khan , Jann Horn , Conor Dooley , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl , Trevor Gross , Benno Lossin Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, alistair.francis@wdc.com, richard.henderson@linaro.org, jim.shu@sifive.com, andybnac@gmail.com, kito.cheng@sifive.com, charlie@rivosinc.com, atishp@rivosinc.com, evan@rivosinc.com, cleger@rivosinc.com, alexghiti@rivosinc.com, samitolvanen@google.com, broonie@kernel.org, rick.p.edgecombe@intel.com, rust-for-linux@vger.kernel.org, Andreas Korb , Valentin Haudiquet , Deepak Gupta X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765473664; l=1182; i=debug@rivosinc.com; s=20251023; h=from:subject:message-id; bh=XI4ppsK62Fegg41RmjuRUH5R6YykPAMiGtdfLotNIGk=; b=ettTKylRb+21RNIE6aRXlLKnCuNPUmzGJLadoF6KC5Cj1C8lsSzyz6HZsSQgomqLUbggJk4kI 9bhNG1WlOXtB6CRw8iiWSpE8JrYyW2IuNIAq4YQ5fBFrO1eV7PpQecT X-Developer-Key: i=debug@rivosinc.com; a=ed25519; pk=O37GQv1thBhZToXyQKdecPDhtWVbEDRQ0RIndijvpjk= X-Endpoint-Received: by B4 Relay for debug@rivosinc.com/20251023 with auth_id=553 X-Original-From: Deepak Gupta Reply-To: debug@rivosinc.com From: Deepak Gupta Updating __show_regs to print captured shadow stack pointer as well. On tasks where shadow stack is disabled, it'll simply print 0. Reviewed-by: Alexandre Ghiti Tested-by: Andreas Korb Tested-by: Valentin Haudiquet Signed-off-by: Deepak Gupta --- arch/riscv/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c index 49f527e3acfd..aacb23978f93 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -93,8 +93,8 @@ void __show_regs(struct pt_regs *regs) regs->s8, regs->s9, regs->s10); pr_cont(" s11: " REG_FMT " t3 : " REG_FMT " t4 : " REG_FMT "\n", regs->s11, regs->t3, regs->t4); - pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT "\n", - regs->t5, regs->t6); + pr_cont(" t5 : " REG_FMT " t6 : " REG_FMT " ssp : " REG_FMT "\n", + regs->t5, regs->t6, get_active_shstk(current)); =20 pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n", regs->status, regs->badaddr, regs->cause); --=20 2.43.0