Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp679707pxk; Wed, 2 Sep 2020 11:53:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsxeKZmOwHr56+UWwCWlweIXS9YWprlR09KpJQ2dCQ+LKoczs71RSLLIMFrLFTh0KJF2gy X-Received: by 2002:aa7:dc18:: with SMTP id b24mr1540542edu.224.1599072826590; Wed, 02 Sep 2020 11:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599072826; cv=none; d=google.com; s=arc-20160816; b=vDrTdbXYcAiJo45GFFlvmtLXsjLhaCP/VH+CNDQi58zDbuAXqcpywYUvlQFRtMlRht PTAz9g6oK1qBAyQJpepKCNzmWmXswRWLR0gRihW2Z5NRuP3ShZ6ALpjuuUO5dBsUpeHB e2JMqyXWx1KJA1gpleLyrvrsQu3Lg6PrDXlmzig9ixn7ogVz7AraQo5ECaczkWdGX779 H3gQlaoXDmuaiLLUHL07my8gzdiN1N9+u9AOOTjVtbg24itIZvNc9OL7Zm13RtzdFJwB 7OOKZY1wYaEqTtZcf9CymCfH3Xr0tR1Zmz+JFVonjv0zPEDrjjdlzMePmamb+PKijeKz htiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0PKBlY1afSTf5jYcMG7SLTcrTVlClNsqpY9fR/DOVnE=; b=yw6aHKH/xxtnOEAuJv68sSIcLl8wRvDazA7px/FFVrIZeRRxlV4Fip92wySKwTto25 ICK60dEkKElohfUP8YNs4vHbe0YdaDDpsIWCRcMTiwIu0LsXSOo8KpzzsPzu2UcLLiuc BZV6UBY1jaZsUUMvpw5tGxxWTCqH/7+2qUC1u3py5I6ATKYLB6fxurk85DgmqKCEoaL4 FZIlu39HDiJxODQcggEpEabxpOh2a/E81VHYQiaG7iFRNsUEKIsQRBBrxU6RXwsTp/yU llJUvbUlkNG6JlgxYdOTuzxAUUlWoUR6SH4SsY3vrWjcSFc8He1RvSgK65fmdqXuP5z/ ds5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si321873ejd.51.2020.09.02.11.53.21; Wed, 02 Sep 2020 11:53:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728041AbgIBSuo (ORCPT + 99 others); Wed, 2 Sep 2020 14:50:44 -0400 Received: from foss.arm.com ([217.140.110.172]:44750 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbgIBSul (ORCPT ); Wed, 2 Sep 2020 14:50:41 -0400 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 2BB1CD6E; Wed, 2 Sep 2020 11:50:41 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.4.242]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 89A6F3F71F; Wed, 2 Sep 2020 11:50:37 -0700 (PDT) Date: Wed, 2 Sep 2020 19:50:27 +0100 From: Mark Rutland To: Miroslav Benes , Mark Brown Cc: Catalin Marinas , Will Deacon , Vasily Gorbik , Heiko Carstens , Borislav Petkov , Thomas Gleixner , "H. Peter Anvin" , Christian Borntraeger , Ingo Molnar , Jiri Slaby , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] arm64: stacktrace: Convert to ARCH_STACKWALK Message-ID: <20200902184935.GA5875@C02TD0UTHF1T.local> References: <20200819124913.37261-1-broonie@kernel.org> <20200819124913.37261-4-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 02, 2020 at 11:32:13AM +0200, Miroslav Benes wrote: > Hi, > > it could be a silly question, but better to ask... > > > + if (regs) > > + start_backtrace(&frame, regs->regs[29], regs->pc); > > + else > > + start_backtrace(&frame, thread_saved_fp(task), > > + thread_saved_pc(task)); > > Would this also work for task == current? Given that the original code had > > > - start_backtrace(&frame, > > - (unsigned long)__builtin_frame_address(0), > > - (unsigned long)__save_stack_trace); Oh whoops; I'm annoyed I didn't spot that. With that gone this cannot work for (task == current && regs == NULL), as we'll erroneously use stale values from the task struct. It looks like the LKDTM tests only trigger cases with non-NULL regs, but IIUC this should show up with show_stack(NULL, NULL, KERN_INFO), as drivers/tty/sysrq.c does for other cpus. Thanks, Mark.