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=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 C27E8C4707A for ; Fri, 21 May 2021 17:25:55 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 34A4A6109F for ; Fri, 21 May 2021 17:25:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34A4A6109F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yslxH/4zIa+AanJZZ9rWLCIXHpB2jL7u73MX1/NY+2Q=; b=MPnzhk8z7fWlMm9Q/bJ6/SynnW yLzrlWw0j6ofIRPGQ/eF0CBeUK5bSs6Y2MNwiWLy2XcjMBzG+KjPCsYMKKjlOHM0/L29vO/3OdBg3 fWd4atyyGWpkJWklhJxT3i4Q9oeFj3dvlOn9gcudfz9O8ZdwQ9miGrh3QdFDQCu9PAteGNt8SwsGd 2HFhJvteuSG0chEio3nTNUlPPcuqsMN9v1XIg4LETwvtaOWZSeLN+7bkN8tmLW/OTFyrnWmR/rN2W //np7GO6QC5we/2fkYjJ5n9gctTBz7LjL5oevDs2bDxp3fZdXc0RCFUjx1yF/IjUfdBJN9tDl/41s I1MY2J3A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk8sY-000U7S-Ju; Fri, 21 May 2021 17:24:07 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk8sQ-000U5M-Uj for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 17:24:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=dsmQpGSpViASu2Lm8EpJourdT7RJuov0nXLCLji8uHw=; b=J9McGULvbImVeVFs+mtQnZIX5F V4ltZTOS7p2Sbe9w2PZ9QusMBRvKJ3T3T1Fr/YXOgWf2uJLGQeYURpehFeIF7xisZ7rU6PuEiNxgT Yesqz4784alK2p/xzgBKURBbm4shKgK4P1zM3duqtNQ1vdUgKZpatg3YKryrIr6ycOnbczpNSBY+D g/hAkVvCnJQ6BYA1+h8KAtyOSbWlqo3MmwN8QVaKn1SzwRsFOdGUdVZhVu7ShpKEdBfpVfTCkHN+S eKYv1q8Db/6HB6UUIj3Z/dBAxCPtWb0L1XgFnUrpRREQck5m3dIDn9bBbJMU5fxTYoTk8QPCTcp9Y sGzwezEQ==; Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lk8sO-00HJIT-Bu for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 17:23:57 +0000 Received: from [192.168.254.32] (unknown [47.187.214.213]) by linux.microsoft.com (Postfix) with ESMTPSA id 8EB9020B7188; Fri, 21 May 2021 10:23:53 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8EB9020B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1621617834; bh=dsmQpGSpViASu2Lm8EpJourdT7RJuov0nXLCLji8uHw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=iX33lxGgvBIWRLXPXT/y9uGoHbgKy27qqVfF/Y/wnHBeBjXJNYIeos5+GVAWP3c4Q +gy1NyQCSS/ip7vrI55Xbbx8vG19EyFK/FVXpzD08oKct5vo063qKdHzmLdR3FrefY H5O2mLHz3Ic11/fRCT5wM/jo4OLE5+vlG5gjbtIc= Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder To: Mark Brown Cc: mark.rutland@arm.com, jpoimboe@redhat.com, ardb@kernel.org, jthierry@redhat.com, catalin.marinas@arm.com, will@kernel.org, jmorris@namei.org, pasha.tatashin@soleen.com, linux-arm-kernel@lists.infradead.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org References: <68eeda61b3e9579d65698a884b26c8632025e503> <20210516040018.128105-1-madvenka@linux.microsoft.com> <20210516040018.128105-2-madvenka@linux.microsoft.com> <20210521161117.GB5825@sirena.org.uk> From: "Madhavan T. Venkataraman" Message-ID: Date: Fri, 21 May 2021 12:23:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210521161117.GB5825@sirena.org.uk> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_102356_464924_87AEA1AC X-CRM114-Status: GOOD ( 21.69 ) 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 5/21/21 11:11 AM, Mark Brown wrote: > On Sat, May 15, 2021 at 11:00:17PM -0500, madvenka@linux.microsoft.com wrote: > >> Other reliability checks will be added in the future. > > ... > >> + frame->reliable = true; >> + > > All these checks are good checks but as you say there's more stuff that > we need to add (like your patch 2 here) so I'm slightly nervous about > actually setting the reliable flag here without even a comment. Equally > well there's no actual use of this until arch_stack_walk_reliable() gets > implemented so it's not like it's causing any problems and it gives us > the structure to start building up the rest of the checks. > OK. So how about changing the field from a flag to an enum that says exactly what happened with the frame? enum { FRAME_NORMAL = 0, FRAME_UNALIGNED, FRAME_NOT_ACCESSIBLE, FRAME_RECURSION, FRAME_GRAPH_ERROR, FRAME_INVALID_TEXT_ADDRESS, FRAME_UNRELIABLE_FUNCTION, FRAME_NUM_STATUS, } frame_status; struct stackframe { ... enum frame_status status; }; unwind_frame() { frame->status = FRAME_NORMAL; Then, for each situation, change the status appropriately. } Eventually, arch_stack_walk_reliable() could just declare the stack trace as unreliable if status != FRAME_NORMAL. Also, the caller can get an exact idea of why the stack trace failed. Is that acceptable? > The other thing I guess is the question of if we want to bother flagging > frames as unrelaible when we return an error; I don't see an issue with > it and it may turn out to make it easier to do something in the future > so I'm fine with that Initially, I thought that there is no need to flag it for errors. But Josh had a comment that the stack trace is indeed unreliable on errors. Again, the word unreliable is the one causing the problem. The above enum-based solution addresses Josh's comment as well. Let me know if this is good. Thanks! Madhavan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel