Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3036685lqz; Wed, 3 Apr 2024 16:47:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyyaWqaLHlW3Tl9TipEQRGzYSHWIOrWyQ1Y9AfTP6mMtbMNQCkwauBQx7dx5RjKdAjzauqRcAG7w6ApmLfoDpJjCkp5Ng+6BK76a6J/A== X-Google-Smtp-Source: AGHT+IEzWDGBYvFTul7Jqud0LMO5ZdypbMb6wJIFvYEC0JV9h4gD/JjH5ve7auuJ9pb3qUkHlB8G X-Received: by 2002:a05:6a00:98e:b0:6ec:e785:1769 with SMTP id u14-20020a056a00098e00b006ece7851769mr685547pfg.20.1712188074649; Wed, 03 Apr 2024 16:47:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712188074; cv=pass; d=google.com; s=arc-20160816; b=Te/rNVDHTgk2ysooMA4IXK+/RdkNgqKS49hIM0HmiCJLVwhCWD4Ql+xgphpNOh6JUJ C67ljTTss3zA4bFR2UZSYP5nD1MjZEpbKI7hon3w7mo4SJIiOy1kPfwiUu1NOwyWbPgl zUZ6NG1ez/BKnIFgzjgpudpQ1im2yUXsf0LqiDjTYVjbr/K4RXI5SD2lOR+PIN1VkWp4 35DJgm7dwPNbtjrmmbPhw2IHCziGsrvVSdvi3FW8XKduhFD848cpbKqotXJz7N33UJJj Xij9kDobUyqYapzOPpK6tdYbA3RDR6IUbvQgpxK9A8ZlQI0Qc39ryF3oU72f94aBH223 eNIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MSiG1xhiflfyI9bPxIgqPsLfJsD+ZxoOiAqpJ0kRoxs=; fh=I14UDtyyuJoQq8o/4DdMerebYPjMymIOFOoYC0gQ42k=; b=qg6jSj5VSTHXAxxpMfFOftENQ0LsTTMSgHbXzuafbQSz6LK039clVbgWRLaFMiV68B /rc+xakV9p8ThDbkjdRFGNpgrqeP75Xz6PzBRl+4IsyWnmn02jmvqd3pbZIx4I0bnMv+ xlR5n5SuQG5NExfcTNkniPJYDEOumdh422YaMsYejE7hHRaqYIu11fVigIH5foq4prxF 4xw6WO3Mm/rpIurRAxVy2HOEUGxTSnfzbOFPGL9nl8XqjlDBg2RnJVkfPzjFBoqT9V1M 0S+JTVOoK7JxV6Qqv27+yoMHxerA7qjtDV2e7zj35VjQPLe/Tki+o/SWB28tF2iEDU0Y k5Cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b="hcRRCZ/o"; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-130739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130739-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g2-20020aa78182000000b006e73e276e3asi13756691pfi.52.2024.04.03.16.47.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 16:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b="hcRRCZ/o"; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-130739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130739-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 959002870F8 for ; Wed, 3 Apr 2024 23:47:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A1A71598F1; Wed, 3 Apr 2024 23:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="hcRRCZ/o" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4779715990D for ; Wed, 3 Apr 2024 23:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712187755; cv=none; b=CXtFAg5fLjOvXXi4TVuIFP52XXeGOnQJAs7c57YadwoE8URwjieqBpUGBfX2Vui344FAqV//xYCdWMEHne3iKoNJQwj6E+E3gjWYpgnxGTbPxEqur7+8pjkTKn7cAXkV2ZKUWcJpDeyZcQae9xNpQ+k+FqOEUUug9Q60AndwgiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712187755; c=relaxed/simple; bh=+UdJVnxzhmL2rdbI+oZOPCA50rkIsX+rxI4MUuund6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LLR2AH6ZVVehrXDa3ox06MgLJbUYzROT2ISzamGpQyJigbxqdzu7GxfOrdsxvvWGFqGu1x23mlv69Fu99KF1KgfjLU14qh/I7N9f3oO9NhKSloRvwMq8oR6k/+qTWPzwpN/fUh/4GdJsWKcuXLmkdIrWz9VFkMv/5PJX9gIAylg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=hcRRCZ/o; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e2235c630aso2253165ad.2 for ; Wed, 03 Apr 2024 16:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712187751; x=1712792551; darn=vger.kernel.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=MSiG1xhiflfyI9bPxIgqPsLfJsD+ZxoOiAqpJ0kRoxs=; b=hcRRCZ/o9lYHMulcB9q8PwWpcv9PXJNWRi3viSgowhd9ObyUXJdpqvwbCCa7m2kRi9 2skbIqH52jYKm4bftBNANkcezUv7bfpamfL7bCZZsCDW4/2876HeequmTQXmHrn48uZ5 NLLTcd/zo3JBbBMkKXDbBgHMqsJusiw9I+idCq48BYWbq2s/9+ZCivPUpPJw+8zRujFT E37QRbZAj4A7gG52o0sFHqjPUXD73arbeAOEAcjDd3x7SdACh4gnyKobMP98+Tbj2lEX sBYCcYojfIbeMW1L/RUTtvdb1aa1VtbOLN2C+PlSKwmARrHFxzP9HcIwK5wAvkvrD710 K4IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712187751; x=1712792551; 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=MSiG1xhiflfyI9bPxIgqPsLfJsD+ZxoOiAqpJ0kRoxs=; b=W7BGSVfGwV42RcpQIP59sXONvFsnai53J6lMhzTi5lVVEpGpJwg2WzaDx1l9k1gJYy SpTl7xNlETcwFKWNw+NAJVFloj+PKXA0mQvxPYXmqQrdGjcT6ktrWiJ20xL8PNWz4YuG 1qXP0rX7w3XPzAnV2BG8OTo3KDteRYCTXBe99qUBu4pN02tz5RZbwz27oQREcQy8Enn0 hg0P9R+Yesp8ShaUBsxhv/XY/eUzLaQGEbeyp/aoxQIJDIVjkFWwDh3WEjVvlyssq8nO eJxquhaZ7uTr1AmFjQVGLVo8JlCUxCzVmOcBQBgKYV40epWJT13MEfUmlWuEhX9Puyi3 6uIw== X-Forwarded-Encrypted: i=1; AJvYcCVSdwVYuLCxuIZRsrcay+uu86cO/iuaQettxEERayFMvwi0+OskZEDib3egRm2i+37AvQmj586MDTwnaB7wUDfs89XmVQmcSmQXliE+ X-Gm-Message-State: AOJu0YxSPRJFEwHbPXrDzV0XDRrkz569N0w5cBjl/0Y7P9otv2XekM43 ADLGKl0+XwndRK7P9nK1Qkf60lkyZLd/ABYh80nEPF2irpoMLU4K1ecW2+d31eI= X-Received: by 2002:a17:903:487:b0:1df:f6ce:c9b3 with SMTP id jj7-20020a170903048700b001dff6cec9b3mr824638plb.43.1712187751469; Wed, 03 Apr 2024 16:42:31 -0700 (PDT) Received: from debug.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id b18-20020a170902d51200b001deeac592absm13899117plg.180.2024.04.03.16.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 16:42:31 -0700 (PDT) From: Deepak Gupta To: paul.walmsley@sifive.com, rick.p.edgecombe@intel.com, broonie@kernel.org, Szabolcs.Nagy@arm.com, kito.cheng@sifive.com, keescook@chromium.org, ajones@ventanamicro.com, conor.dooley@microchip.com, cleger@rivosinc.com, atishp@atishpatra.org, alex@ghiti.fr, bjorn@rivosinc.com, alexghiti@rivosinc.com, samuel.holland@sifive.com, conor@kernel.org Cc: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, corbet@lwn.net, palmer@dabbelt.com, aou@eecs.berkeley.edu, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, oleg@redhat.com, akpm@linux-foundation.org, arnd@arndb.de, ebiederm@xmission.com, Liam.Howlett@oracle.com, vbabka@suse.cz, lstoakes@gmail.com, shuah@kernel.org, brauner@kernel.org, debug@rivosinc.com, andy.chiu@sifive.com, jerry.shih@sifive.com, hankuan.chen@sifive.com, greentime.hu@sifive.com, evan@rivosinc.com, xiao.w.wang@intel.com, charlie@rivosinc.com, apatel@ventanamicro.com, mchitale@ventanamicro.com, dbarboza@ventanamicro.com, sameo@rivosinc.com, shikemeng@huaweicloud.com, willy@infradead.org, vincent.chen@sifive.com, guoren@kernel.org, samitolvanen@google.com, songshuaishuai@tinylab.org, gerg@kernel.org, heiko@sntech.de, bhe@redhat.com, jeeheng.sia@starfivetech.com, cyy@cyyself.name, maskray@google.com, ancientmodern4@gmail.com, mathis.salmen@matsal.de, cuiyunhui@bytedance.com, bgray@linux.ibm.com, mpe@ellerman.id.au, baruch@tkos.co.il, alx@kernel.org, david@redhat.com, catalin.marinas@arm.com, revest@chromium.org, josh@joshtriplett.org, shr@devkernel.io, deller@gmx.de, omosnace@redhat.com, ojeda@kernel.org, jhubbard@nvidia.com Subject: [PATCH v3 20/29] riscv/kernel: update __show_regs to print shadow stack register Date: Wed, 3 Apr 2024 16:35:08 -0700 Message-ID: <20240403234054.2020347-21-debug@rivosinc.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240403234054.2020347-1-debug@rivosinc.com> References: <20240403234054.2020347-1-debug@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Updating __show_regs to print captured shadow stack pointer as well. On tasks where shadow stack is disabled, it'll simply print 0. 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 ebed7589c51a..079fd6cd6446 100644 --- a/arch/riscv/kernel/process.c +++ b/arch/riscv/kernel/process.c @@ -89,8 +89,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)); pr_cont("status: " REG_FMT " badaddr: " REG_FMT " cause: " REG_FMT "\n", regs->status, regs->badaddr, regs->cause); -- 2.43.2