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=-9.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 2C450C11F68 for ; Tue, 29 Jun 2021 16:49:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EF85961D3E for ; Tue, 29 Jun 2021 16:49:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF85961D3E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=QPa47rzkboy00SSnCcPr9mQS+QyGs4SkX62RwBH+EdA=; b=Pp06Cjzys4W32/ VTIDgCjwQMCKDiCtjyNJXKB8pu0SDuUI9x5M2AZOV5UYZOxUzkjVjlMhrEDKW4rEV4Bizr1y2NZgR ezD43U4bq2gWJHia9ZMN2jGQbLPlg1aga5iGG8crWmQCLLmyvvDZoksJvzvPqAp+X3LxjdA6jnGPt 0KR7KHWChBzB0+9uwoFHhkDW4s0k1JEYDI7nDjcUHSj8e2m5ZseWHHJDoM4exHDw5558yIULsEMmY thRH5eZ4XR2To/w6sPoT5e4YP/ijl3SI/WCEorF6XyL2SZH+rlUevnGQH63Aj5bpXQ9zndxCiwifQ QSaMfvikyus9M1XGJl5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyGts-00Bdlz-7N; Tue, 29 Jun 2021 16:47:52 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyGto-00Bdkx-H0 for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 16:47:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624985265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+bJvwmYTs4hsRIzvijlTBKZHCJnIV9JSQ/ae942P0nQ=; b=TRWT2D2MZA1qjDDTpPsXkqzp5kK0OwTPjfnvk6Yuh34Zf0y8MZyOeyW45XIP1yO7NsyLsR 0KbiPAa/d84IZ360PJRH/M3RJiqLxFbH2l1zxm1vgAsbiD3aiSLADBkLSvmx+GP1LB9hOM SZ5JRyhU5AzNlw6vhcvt6zz06xEOjnk= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-yfccbY-NOoW75b21dE7dfA-1; Tue, 29 Jun 2021 12:47:43 -0400 X-MC-Unique: yfccbY-NOoW75b21dE7dfA-1 Received: by mail-pg1-f198.google.com with SMTP id 135-20020a63038d0000b0290227a64bf8f4so4486242pgd.12 for ; Tue, 29 Jun 2021 09:47:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+bJvwmYTs4hsRIzvijlTBKZHCJnIV9JSQ/ae942P0nQ=; b=aWC8QbxGQgIUT7UO8sOckLb0J+sAjBHU9u0Ih4C6qWyu7jJrwfQP5raSv5qmRAeot6 YxBNV8at378/4w8oa2j1LyWV6r1NUf9EVCsGy8eUSgCq74yIiVzPjPi6rzng6kPfklnW 3+fDASqo+0bqXFMIswTys1AfX5mxpT7u0UtJ8ALGuqnCL/MaAO+mqupdJyUrHQdWLzaJ 2ZyLdazug9AmQzAcB/uUY4zBmY6qeqqP7BSNEKFLYp/zoVW3PKd8P40XKLOe79cl49Zd ak2aRZUmAWic7if9NUDLPC/OXsCePAelAnDV03kJTnbBGIDLznUC+z54S+w2HO4C8KCp JZFw== X-Gm-Message-State: AOAM533FssaBftYGCpJLjOZ82E8/T2QGsZX+0VlqeAyWJCRdEqRPVd0c wFZdwazuJIp0uoVBV/aOSjHP6t6dB4SsVnIHfREkaMBH/oP0SlNJDpjyApbENf+n0IQ+17IGLol OY8Zlcv0oD9flGRUBBDfMYQgzNKGTulX7HrY= X-Received: by 2002:a17:90a:650b:: with SMTP id i11mr34962310pjj.39.1624985262581; Tue, 29 Jun 2021 09:47:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3vTTwAHy6BETIsORLHGghBWZRgo8av0Cd/hHZW70tMvDWoqyHwTA6FD/HIjdC3imDZWBejQ== X-Received: by 2002:a17:90a:650b:: with SMTP id i11mr34962286pjj.39.1624985262349; Tue, 29 Jun 2021 09:47:42 -0700 (PDT) Received: from treble ([2600:380:8772:6cac:dfb6:1d6c:e068:2f39]) by smtp.gmail.com with ESMTPSA id u2sm6013505pja.20.2021.06.29.09.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 09:47:41 -0700 (PDT) Date: Tue, 29 Jun 2021 11:47:36 -0500 From: Josh Poimboeuf To: Mark Rutland Cc: madvenka@linux.microsoft.com, broonie@kernel.org, ardb@kernel.org, nobuta.keiya@fujitsu.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, pasha.tatashin@soleen.com, jthierry@redhat.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v5 1/2] arm64: Introduce stack trace reliability checks in the unwinder Message-ID: <20210629164736.dnysynhkjjxya4vc@treble> References: <20210526214917.20099-1-madvenka@linux.microsoft.com> <20210526214917.20099-2-madvenka@linux.microsoft.com> <20210624144021.GA17937@C02TD0UTHF1T.local> MIME-Version: 1.0 In-Reply-To: <20210624144021.GA17937@C02TD0UTHF1T.local> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jpoimboe@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210629_094748_710058_B2190B4E X-CRM114-Status: GOOD ( 22.83 ) 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 On Thu, Jun 24, 2021 at 03:40:21PM +0100, Mark Rutland wrote: > Hi Madhavan, > > On Wed, May 26, 2021 at 04:49:16PM -0500, madvenka@linux.microsoft.com wrote: > > From: "Madhavan T. Venkataraman" > > > > The unwinder should check for the presence of various features and > > conditions that can render the stack trace unreliable and mark the > > the stack trace as unreliable for the benefit of the caller. > > > > Introduce the first reliability check - If a return PC is not a valid > > kernel text address, consider the stack trace unreliable. It could be > > some generated code. > > > > Other reliability checks will be added in the future. > > > > Signed-off-by: Madhavan T. Venkataraman > > At a high-level, I'm on-board with keeping track of this per unwind > step, but if we do that then I want to be abel to use this during > regular unwinds (e.g. so that we can have a backtrace idicate when a > step is not reliable, like x86 does with '?'), and to do that we need to > be a little more accurate. On x86, the '?' entries don't come from the unwinder's determination of whether a frame is reliable. (And the x86 unwinder doesn't track reliable-ness on a per-frame basis anyway; it keeps a per-unwind global error state.) The stack dumping code blindly scans the stack for kernel text addresses, in lockstep with calls to the unwinder. Any text addresses which aren't also reported by the unwinder are prepended with '?'. The point is two-fold: a) failsafe in case the unwinder fails or skips a frame; b) showing of breadcrumbs from previous execution contexts which can help the debugging of more difficult scenarios. -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel