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=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 D496DC4707A for ; Fri, 21 May 2021 18:59:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A989E61261 for ; Fri, 21 May 2021 18:59:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbhEUTAm (ORCPT ); Fri, 21 May 2021 15:00:42 -0400 Received: from linux.microsoft.com ([13.77.154.182]:43496 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233291AbhEUTAl (ORCPT ); Fri, 21 May 2021 15:00:41 -0400 Received: from [192.168.254.32] (unknown [47.187.214.213]) by linux.microsoft.com (Postfix) with ESMTPSA id A2E5920B7188; Fri, 21 May 2021 11:59:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A2E5920B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1621623558; bh=s5fPPm7/cgoV4/kCfN3NJ1VijEprrtU3LGotGcg2ExM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=s+Xm95umlPDQltd3npd8+AG2+Ec9OFKHWzKtF0vsQBp1dbpksxO65Q0dJhiz91Z4r 1e6zH1/3pKKCrCzwkrpf1KFS+wwEcW43/YBJdphKf/5ZY3+eJSQ5JiRouVZvsjTlJe Wcbye1F4bG/A4sd0NBJJ9T7bJBg9+ux4MA3mkgEE= Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder To: Josh Poimboeuf , Mark Brown Cc: mark.rutland@arm.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> <20210521174242.GD5825@sirena.org.uk> <26c33633-029e-6374-16e6-e9418099da95@linux.microsoft.com> <20210521175318.GF5825@sirena.org.uk> <20210521184817.envdg232b2aeyprt@treble> From: "Madhavan T. Venkataraman" Message-ID: <74d12457-7590-bca2-d1ce-5ff82d7ab0d8@linux.microsoft.com> Date: Fri, 21 May 2021 13:59:16 -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: <20210521184817.envdg232b2aeyprt@treble> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org On 5/21/21 1:48 PM, Josh Poimboeuf wrote: > On Fri, May 21, 2021 at 06:53:18PM +0100, Mark Brown wrote: >> On Fri, May 21, 2021 at 12:47:13PM -0500, Madhavan T. Venkataraman wrote: >>> On 5/21/21 12:42 PM, Mark Brown wrote: >> >>>> Like I say we may come up with some use for the flag in error cases in >>>> future so I'm not opposed to keeping the accounting there. >> >>> So, should I leave it the way it is now? Or should I not set reliable = false >>> for errors? Which one do you prefer? >> >>> Josh, >> >>> Are you OK with not flagging reliable = false for errors in unwind_frame()? >> >> I think it's fine to leave it as it is. > > Either way works for me, but if you remove those 'reliable = false' > statements for stack corruption then, IIRC, the caller would still have > some confusion between the end of stack error (-ENOENT) and the other > errors (-EINVAL). > I will leave it the way it is. That is, I will do reliable = false on errors like you suggested. > So the caller would have to know that -ENOENT really means success. > Which, to me, seems kind of flaky. > Actually, that is why -ENOENT was introduced - to indicate successful stack trace termination. A return value of 0 is for continuing with the stack trace. A non-zero value is for terminating the stack trace. So, either we return a positive value (say 1) to indicate successful termination. Or, we return -ENOENT to say no more stack frames left. I guess -ENOENT was chosen. > BTW, not sure if you've seen what we do in x86, but we have a > 'frame->error' which gets set for an error, and which is cumulative > across frames. So non-fatal reliable-type errors don't necessarily have > to stop the unwind. The end result is the same as your patch, but it > seems less confusing to me because the 'error' is cumulative. But that > might be personal preference and I'd defer to the arm64 folks. > OK. I will wait to see if any arm64 folks have an opinion on this. I am fine with any approach. Madhavan 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 EDA88C47076 for ; Fri, 21 May 2021 19:01:00 +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 602CE6105A for ; Fri, 21 May 2021 19:01:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 602CE6105A 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=6REA3BL4siF42CMjJfoRCYsuzw+9IVZSCSAoBoiCjT0=; b=O/MMrPF9A30HXhQO6hUGHduQ6r nJ9eRbo3jhjZI1O1okTPyDgnnrhs+QEK8KtAvAiWj0ncc1K6ECeh99Mxdg2slP96X+irH0Pcms/Mx lNTf8BhalYbFvOEaf3LefFcu5u8wPyQdMmamfVHe2zKT+sxF9gosaVjM3xOzRM1Mi4CwkrIUysp4J c1ejNaOyX6m4q2rsBuodaSl2JR/94H1c3S0KmKrx0usxR4CvagCDP0IIfHpZANBkkiaLo/33aa9Fd X2sXmIVL6CkOd1F41G0od3iIm/yUgVapDaTUCAzlHX6P0oczb5jNn5ey5CvFyjHiWI9ZcZrduObRy yc6/ouCg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkAMm-000oD1-SC; Fri, 21 May 2021 18:59:25 +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 1lkAMk-000oCu-Iq for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 18:59:22 +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=s5fPPm7/cgoV4/kCfN3NJ1VijEprrtU3LGotGcg2ExM=; b=KZakO40lt23GTs4Le3JgSkAZ+D r+jSbPrOZxuycyC6kpfRpF2lWk+n0938zMz+7CirhAS5R6kR4sFSvjkAjVukHG87wjroLRAQhYn9b l31CUUYkKhgjRdKokg1RLGdFHgO96G8SHQvsrFuVAFgrktLPA7clnAj/tj+V2Sc6UgNnWHhpBYsnH RAU0AFZ9QjenICmdWcSupXe/harTP5sY59ZK22Z14kxoHoGBcw0ovNklQLC27cpXGmgh7NjLHmLlx 34pFPKpyH1gtgacFjyf4xfPTQDU6vx3C40nM1YjPrvBlVaVY44SNeKh3xMw+AQWoCLV14EDbOkpeY iklRKi2Q==; Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lkAMh-00HMtK-Vh for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 18:59:21 +0000 Received: from [192.168.254.32] (unknown [47.187.214.213]) by linux.microsoft.com (Postfix) with ESMTPSA id A2E5920B7188; Fri, 21 May 2021 11:59:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A2E5920B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1621623558; bh=s5fPPm7/cgoV4/kCfN3NJ1VijEprrtU3LGotGcg2ExM=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=s+Xm95umlPDQltd3npd8+AG2+Ec9OFKHWzKtF0vsQBp1dbpksxO65Q0dJhiz91Z4r 1e6zH1/3pKKCrCzwkrpf1KFS+wwEcW43/YBJdphKf/5ZY3+eJSQ5JiRouVZvsjTlJe Wcbye1F4bG/A4sd0NBJJ9T7bJBg9+ux4MA3mkgEE= Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder To: Josh Poimboeuf , Mark Brown Cc: mark.rutland@arm.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> <20210521174242.GD5825@sirena.org.uk> <26c33633-029e-6374-16e6-e9418099da95@linux.microsoft.com> <20210521175318.GF5825@sirena.org.uk> <20210521184817.envdg232b2aeyprt@treble> From: "Madhavan T. Venkataraman" Message-ID: <74d12457-7590-bca2-d1ce-5ff82d7ab0d8@linux.microsoft.com> Date: Fri, 21 May 2021 13:59:16 -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: <20210521184817.envdg232b2aeyprt@treble> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_115920_076611_E6D31586 X-CRM114-Status: GOOD ( 22.81 ) 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 1:48 PM, Josh Poimboeuf wrote: > On Fri, May 21, 2021 at 06:53:18PM +0100, Mark Brown wrote: >> On Fri, May 21, 2021 at 12:47:13PM -0500, Madhavan T. Venkataraman wrote: >>> On 5/21/21 12:42 PM, Mark Brown wrote: >> >>>> Like I say we may come up with some use for the flag in error cases in >>>> future so I'm not opposed to keeping the accounting there. >> >>> So, should I leave it the way it is now? Or should I not set reliable = false >>> for errors? Which one do you prefer? >> >>> Josh, >> >>> Are you OK with not flagging reliable = false for errors in unwind_frame()? >> >> I think it's fine to leave it as it is. > > Either way works for me, but if you remove those 'reliable = false' > statements for stack corruption then, IIRC, the caller would still have > some confusion between the end of stack error (-ENOENT) and the other > errors (-EINVAL). > I will leave it the way it is. That is, I will do reliable = false on errors like you suggested. > So the caller would have to know that -ENOENT really means success. > Which, to me, seems kind of flaky. > Actually, that is why -ENOENT was introduced - to indicate successful stack trace termination. A return value of 0 is for continuing with the stack trace. A non-zero value is for terminating the stack trace. So, either we return a positive value (say 1) to indicate successful termination. Or, we return -ENOENT to say no more stack frames left. I guess -ENOENT was chosen. > BTW, not sure if you've seen what we do in x86, but we have a > 'frame->error' which gets set for an error, and which is cumulative > across frames. So non-fatal reliable-type errors don't necessarily have > to stop the unwind. The end result is the same as your patch, but it > seems less confusing to me because the 'error' is cumulative. But that > might be personal preference and I'd defer to the arm64 folks. > OK. I will wait to see if any arm64 folks have an opinion on this. I am fine with any approach. Madhavan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel