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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 8C647C4707D for ; Fri, 21 May 2021 19:18:06 +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 04E60613B6 for ; Fri, 21 May 2021 19:18:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04E60613B6 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=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: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=mtEoNbm1YrOiubDUq4OBoQZ2o4oagZf0/x5mNfBT5g0=; b=YI82MmLZLsxX7ZNSQ5g3Xmlrg0 yPdKb+J0q1UVPBXHD6/1EpAe0w8SzX7efbj8k5yNJrN6ZxcTWvKZFGPtjYlAJs4lKSBr2dTYjOF83 zzEpI0Jga0kuNr81TtKJrkTxC4808G46eHR9DdCBVmXgt8brJAW3mKgI7KetDfGJwL6U4EeLKNIhZ 7FmImyMG+RrmDKVyd7E99lhcZyUJagIhmJ8pFa/Qh3L7TbSzWpHT0UwIjFZr0SjRf0UNSRbGw+pwv TURcYMB3+8nm5P/RCR9eZW4Sz2Ftpj+Zx/RT5qcKiKFkDUiA08bG/Cu/mAuByRJpgjFXiKUiR4s2S FyM5rTyA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkAdP-000pXH-2s; Fri, 21 May 2021 19:16:35 +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 1lkAdI-000pWs-E7 for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 19:16:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:In-Reply-To:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NM9RRRkodr6aZSYSHCjBSRNeYjgk1EB6pEubMwSkZ4Q=; b=Y7NtreYOBZipnWcsEwbAwjcKSo XbLuoFUkg4uitady5YMug+C3RfXyHtG+HtukszNlHOuWZbvUOTKkJ/1ZR3Zhpwb36tMhzZr8R0HCf UkpU+PndEuzAP1eA96wCTH1glIFCbh9W7U6Y0+yWfDFGzJ08fhAujQ20NbBPwkZ3sL83eYvgrJ19c tRGOc2et10iHXcIIxpV7QXYwtqqgVRqONJQ0KfcUq3DPOdaRe9z8dPzSZqPSRekv4vAHTWE05pU8u kQHJSfNEsqqP6KXnuO6SM+9D8/6JnELPGNsK1viPMgkgipxEGv+VC8UDr3tKTacdQndqJo63IhrfZ qCxjf6Fg==; Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkAdF-00HNJV-Qo for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 19:16:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621624583; 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=NM9RRRkodr6aZSYSHCjBSRNeYjgk1EB6pEubMwSkZ4Q=; b=BcXtZbKg0kjx3ilz42j0Co7K7i2MlM0X+56mRwqhajZYvgsj8y7vGNGomNBLe/GuTDHBSn XNbSObURB9aL+WY+i2y0p6rvexeGs4m7WiCo9PymfQyxiNQv3j29ZkAG/iIVUnLqeNKz1w oIYVWhztJCHWikrAgBt2X8fMG/STWa0= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-fdOEtOe_M_uI6adNSV5Eug-1; Fri, 21 May 2021 15:16:21 -0400 X-MC-Unique: fdOEtOe_M_uI6adNSV5Eug-1 Received: by mail-qt1-f199.google.com with SMTP id a7-20020a05622a02c7b02901fbef073c99so9836644qtx.15 for ; Fri, 21 May 2021 12:16:21 -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=NM9RRRkodr6aZSYSHCjBSRNeYjgk1EB6pEubMwSkZ4Q=; b=kVeg/Uw8yngYxCqwCx6BcOkVXuI7m+IN7hhtn2DQObjmTvV/CFmGQzYRzYgtqpCJXQ Z8sWhmt615MCixU8w7IIgJiOc/mbHR/7+EFibrfM6148B8azZUsE4ZEpG6YFD3WNXccl BbIsrku4FSitBRlWgrS4O2GfHfyYzZOJ19yGWiNXn7hHns+vHIbm5MS2XV5EWA9euKZc +5hiMuhwvK3Ex8qvc4XZA3GIjBS4YJ89XsK1q99l8CwABH4pjO3ohaa/TmS/4s2tnyDF k/e9W+NuZsZ+ZJFJQxsFFtXnfCHG1QLvvhlILcrs8C/c8ohSstq8geOkGGowOPwQjIxd JCxA== X-Gm-Message-State: AOAM533ihL6s4zILSEANQnitPrwo5fXlsv/aFbTMjnGi/YV55TmblDcw cyudemtjn4a0jRfdjGIN36FV9m99B1GS+pAxJzWQNfCpivFpV4WCHGiZawSj77rpzOz4gxsbNr+ 0eIAKNeypEMRrOGMV6KJ1z4+Y8zPXKlhLPb0= X-Received: by 2002:ac8:7d4c:: with SMTP id h12mr13171129qtb.130.1621624580602; Fri, 21 May 2021 12:16:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/AxR5/vGQaVvvOLN4V3Hm0lhLDxLsaGyXvxTwBIQiN8NOkrJ4IY8ylrPj8PFks7thayLIJw== X-Received: by 2002:ac8:7d4c:: with SMTP id h12mr13171107qtb.130.1621624580364; Fri, 21 May 2021 12:16:20 -0700 (PDT) Received: from treble ([68.52.236.68]) by smtp.gmail.com with ESMTPSA id f19sm5736116qkg.70.2021.05.21.12.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 12:16:19 -0700 (PDT) Date: Fri, 21 May 2021 14:16:08 -0500 From: Josh Poimboeuf To: "Madhavan T. Venkataraman" Cc: Mark Brown , 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 Subject: Re: [RFC PATCH v4 1/2] arm64: Introduce stack trace reliability checks in the unwinder Message-ID: <20210521191608.f24sldzhpg3hyq32@treble> References: <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> <74d12457-7590-bca2-d1ce-5ff82d7ab0d8@linux.microsoft.com> <20210521191140.4aezpvm2kruztufi@treble> MIME-Version: 1.0 In-Reply-To: <20210521191140.4aezpvm2kruztufi@treble> 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-20210521_121625_974972_FD71CAE9 X-CRM114-Status: GOOD ( 25.93 ) 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 Fri, May 21, 2021 at 02:11:45PM -0500, Josh Poimboeuf wrote: > On Fri, May 21, 2021 at 01:59:16PM -0500, Madhavan T. Venkataraman wrote: > > > > > > 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. > > I see. So it's a tri-state return value, and frame->reliable is > intended to be a private interface not checked by the callers. Or is frame->reliable supposed to be checked after all? Looking at the code again, I'm not sure. Either way it would be good to document the interface more clearly in a comment above the function. -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel