From mboxrd@z Thu Jan 1 00:00:00 1970 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 847D9C00140 for ; Tue, 2 Aug 2022 12:28:11 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=71+BUHI0yFr/qs0KHNEi6jeDn8Y8H7N78jSK0T3Lea8=; b=Vm8aEf7rKZBE+/ Gvru96+/tmqiFxNwdqobO6XAxDuDG9SqWpveBPYl07dVpe35w41R+LaSLt9M61yQEfVKR8H0VIbm4 lGpdoRtOa3COgO+WDWRUCaga6S1m/9sp+KslH323zM7D21CDKs8ZQuPbJmHLB+T/C7iMVt1skYXFq EG/cO2csfg295NcaupZeRrgUqhk+eyEQCqD5/iKraH8mCU3IEM6bCwj6e8sANfuLu4hOXt5BPBHtN uX69R2pLJKQ0IHJA7x468eTfmDLpOaHm47Cu59P6iQU2dx2bZ55kCvVVYFfbEEmEAHDDKR96ZJUIi gsqcUiHZhT/hrqbxxhtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIqzI-00Dxtb-TA; Tue, 02 Aug 2022 12:27:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIqz6-00Dxim-Ds for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2022 12:26:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D6C7213D5; Tue, 2 Aug 2022 05:26:44 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.44.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B7B563F67D; Tue, 2 Aug 2022 05:26:42 -0700 (PDT) Date: Tue, 2 Aug 2022 13:26:36 +0100 From: Mark Rutland To: Kalesh Singh Cc: "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)" , Mark Brown , Catalin Marinas , James Morse , "Madhavan T. Venkataraman" , Marc Zyngier , Fuad Tabba , Will Deacon Subject: Re: [PATCH 3/8] arm64: stacktrace: move SDEI stack helpers to stacktrace code Message-ID: References: <20220801121209.2479449-1-mark.rutland@arm.com> <20220801121209.2479449-4-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220802_052652_588945_B34A121A X-CRM114-Status: GOOD ( 16.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Kalesh, On Mon, Aug 01, 2022 at 09:53:35PM -0700, Kalesh Singh wrote: > On Mon, Aug 1, 2022 at 5:12 AM Mark Rutland wrote: > > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > > index 4c8865e495fea..04a9b56b114c1 100644 > > --- a/arch/arm64/kernel/stacktrace.c > > +++ b/arch/arm64/kernel/stacktrace.c > > @@ -86,8 +86,17 @@ static bool on_accessible_stack(const struct task_struct *tsk, > > return true; > > if (on_overflow_stack(sp, size, info)) > > return true; > > - if (on_sdei_stack(sp, size, info)) > > - return true; > > + > > + if (IS_ENABLED(CONFIG_VMAP_STACK) && > > + IS_ENABLED(CONFIG_ARM_SDE_INTERFACE) && > > + in_nmi()) > > I think we can remove the IS_ENABLED() checks since it's handled by > ifdefs in asm/stacktrace.h > > Otherwise, Reviewed-by: Kalesh Singh I'd kept the IS_ENABLED() checks here to avoid code being generated of in_nmi() when SDEI is not configured in. Since in_nmi() uses preempt_count() and that uses READ_ONCE(), the compiler can't optimize the read away in case there are side effects (but I imagine will discard the value immediately). With that in mind, are you happy if I leave this as is, and take your Reviewed-by? Thanks, Mark. > > > + { > > + if (on_sdei_critical_stack(sp, size, info)) > > + return true; > > + > > + if (on_sdei_normal_stack(sp, size, info)) > > + return true; > > + } > > > > return false; > > } > > -- > > 2.30.2 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel