Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1617311lqo; Sun, 12 May 2024 10:12:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxM374hKJ+OxREmekmoecSsoqtVjPL3yL3wNicemyiI0cezNW+p11wTIivJovf6Qv/2oj7ihR/7DYEhCVHIiYIG1EgBDDCqqo9JH1h1w== X-Google-Smtp-Source: AGHT+IHy4oINhP7ev7Qg0+0mdtxYXjaJM2mDbVvRSyeyDOMDxsIUsqJ+8XK/DElpJug/3P2kKlRY X-Received: by 2002:a05:6e02:16cf:b0:36c:4ea0:c706 with SMTP id e9e14a558f8ab-36cc14fe294mr109974135ab.22.1715533949643; Sun, 12 May 2024 10:12:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715533949; cv=pass; d=google.com; s=arc-20160816; b=W0bHcJqWwtrJa4rCDAYG+5RjwWwvvCuW7SQpk6MKsv3UXFgxN1wIrZGvPJbstHvnmT Q80BqtOilxi6FRxekCvOBVgI/NGoPqb+L8//8m/LSK5QHifAozl/A/HHW7WNGaCmIN5f ZOkF2bsIQF7gEokLrXLzA2qtu9RF5rNeHtGNUUO5iOZB7bDRZqbQCOY9yzbYkyg0/2lb WqW9yKZuzFkhUPnjPAQl3r9SgfFK4+ufLepR9Poy+jeszDa4lDsJgAAsrb7wJr2BTgOb r5L5wWbfO3MALBoOfea5LPoOJbkOZRF2XmUGZzSHhohRTmQROg5o1uHjpcMHlO+nobfQ 6IKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=r1FxZ4SpT96GevNw3j4CHa7RwSLprV1wehQjF7UvVtw=; fh=tAELyelKdLPpJHiCXz/Zmt/B/1ekPWbwK4A9WYCiavo=; b=yeqltvEIzjxOndFR8xe1Jv4sviAK6sUvznqQvaiDRex8Zji0eBK98SI+cK4EWHlv+j VDZaiV1p5SZmx1OKyD30tw56CckMrdpunuogr/5k1r/phU32CrbwtXDlSyDCIuGRHGTg 029ZZ9wqWiLelRyeqN25FHzAH7p0drrSQMc06jID1yXNHp/4d3A/jnqd0tAlvEKUoW8X ZCeO/WV08VglJ4OA7TXnsyd/t9UUcbcU61zLvtZIA85C5ljEoVPaK8TR+OsyujAzFjKB lBS8tgaCF67VX+viVetlbhDHRnefwZCcYQpCHFG1zamYCniO1hgP2PWQ0ZMnXIFluQyM LmUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-176947-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176947-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e8251dsi7537358a12.77.2024.05.12.10.12.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 10:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176947-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-176947-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176947-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 3F2A2281409 for ; Sun, 12 May 2024 17:12:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06AB34D131; Sun, 12 May 2024 17:12:21 +0000 (UTC) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 5132B1CD1F; Sun, 12 May 2024 17:12:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715533940; cv=none; b=pgyBHAb9TT6OKsq8DbPiK79fymyR9KZkeJJ06WNvzaEijuhm9pxlJjaLzz/odyyRihliK9sr3gEVyCp6K0MjSCefrBOBBg/h20lOmtav4XBLDztv9tCx24o6ml2/3Z+ac3oi7JxioT9uZmvIVRLj/qvHW5unPUM1zgsdmnFc4Vw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715533940; c=relaxed/simple; bh=w6NwSoOtMT0hnPgKaWCq1divH8ZZ5o+3MEIUab+wZAw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SqnJyFofZcmy07XjMWGzHVkXHx2omAl9vm5FxkpgPeuP1IRHYvdxP+iBthgD1b6Z80wvtDPLSJ5NYWbN0SWgQrjwnN/WWK35dLn5X+xlYTnpFvkx43v19gLx4GRmxjj3ruykxW4/2RuMNNyIDqUEHGQ3sr72YXUsTciAoI0dQrI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id B9EE740007; Sun, 12 May 2024 17:11:03 +0000 (UTC) Message-ID: Date: Sun, 12 May 2024 19:10:59 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 20/29] riscv/kernel: update __show_regs to print shadow stack register Content-Language: en-US To: Deepak Gupta , 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, 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, 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 References: <20240403234054.2020347-1-debug@rivosinc.com> <20240403234054.2020347-21-debug@rivosinc.com> From: Alexandre Ghiti In-Reply-To: <20240403234054.2020347-21-debug@rivosinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr On 04/04/2024 01:35, Deepak Gupta wrote: > 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); Reviewed-by: Alexandre Ghiti