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 X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D57F0C433DB for ; Thu, 4 Mar 2021 11:38:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FCFF64F2C for ; Thu, 4 Mar 2021 11:38:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239486AbhCDLhw (ORCPT ); Thu, 4 Mar 2021 06:37:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238942AbhCDLhk (ORCPT ); Thu, 4 Mar 2021 06:37:40 -0500 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EEA6C06175F for ; Thu, 4 Mar 2021 03:37:00 -0800 (PST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Drpjz4ZPsz9s1l; Thu, 4 Mar 2021 22:36:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1614857817; bh=xB2NH2RDnNFxOP2JfengPRlNHO42YuHU5/2Vw/S7pOg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=h+SU9xNxDWKhrRHWY/w+mIUHKv4safweEwbe083MPF1DIbA7ozVlnplRYLYEjYAJ9 wmqzCycYy60nUrMIYRuUbUc8kfqkqyoXVfHOhL1PrnVbCGfQoikWh8cwN3Px8TDDal iPykVzq3qLmTkoF12otE7RCTAO94F5bXu9pENzh2D6xV+cphX+YS6+pydN/uTFbjVn NGqsD1AYnCk6lTCcv3zCzqYeWc8SzeOJgerEiFcKSnSiv3iYaIdfWNjWqJPbCiRhgQ o4LWE4StUWHNoBxWpYGN7JxTSJ3k2Poipicav9hVjHVnv3Fl8tWaC6HcUjZJUHuGYz gMeTf6WFlNGfw== From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , elver@google.com, rostedt@goodmis.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kasan-dev@googlegroups.com, Segher Boessenkool Subject: Re: [PATCH v2] powerpc: Fix save_stack_trace_regs() to have running function as first entry In-Reply-To: <20dad21f9446938697573e6642db583bdb874656.1614792440.git.christophe.leroy@csgroup.eu> References: <20dad21f9446938697573e6642db583bdb874656.1614792440.git.christophe.leroy@csgroup.eu> Date: Thu, 04 Mar 2021 22:36:49 +1100 Message-ID: <878s73rvzi.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > It seems like other architectures, namely x86 and arm64 > at least, include the running function as top entry when saving > stack trace with save_stack_trace_regs(). Also riscv AFAICS. > Functionnalities like KFENCE expect it. > > Do the same on powerpc, it allows KFENCE to properly identify the faulting > function as depicted below. Before the patch KFENCE was identifying > finish_task_switch.isra as the faulting function. Thanks, I think this is the right approach. There's kfence but also several other users from what I can see with a quick grep. ... > > Signed-off-by: Christophe Leroy > Fixes: 35de3b1aa168 ("powerpc: Implement save_stack_trace_regs() to enable kprobe stack tracing") > Cc: stable@vger.kernel.org I'm not sure about the Cc to stable. I think we are fixing the behaviour to match the (implied) intent of the API, but that doesn't mean we won't break something by accident. I'll think about it :) cheers