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 A2D8DC4707A for ; Fri, 21 May 2021 20:10:01 +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 19E346101B for ; Fri, 21 May 2021 20:10:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19E346101B 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=qMztMEIsCGm0NuprRAH4b0VbN81snoIOAPp1A4Es/4Q=; b=ERP8kRfdhIDbUqZ1QjtDCc9vZI MzMOpLs2xEoIQR1rbl5TCrV/dLPD8p4IgVcpym8Q98rC10QaDV/7HZGDVA5Nc5E5LYz6IzMPmTWgg fOSKu6BYnrbym8nQX+NTe73XJ0/7yHSIyL5tyyY3o7lCYwLR0ZBG/Bges5aDt71smhO4Bi46Cm3cR 8Fm1aWhBawD3EsMGgVk9RRdB/fuLY4EGbi+GieSX+Km1ErDkqTDo+JU42O4ugBoAplb9PDYHKDvUv aghKLtCSWa3GyuDVlPJqE9wLm5niQSOq7NrXqfTH2kXGtqLn42Ji5OmzPcnuUoXSeAqReTYjkyHem VwmXbZmQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkBRW-000yZ5-3Y; Fri, 21 May 2021 20:08:22 +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 1lkBRP-000yXQ-Gr for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 20:08:19 +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=6SLlOvYcpJb9PnH2v8qQWMs/sPrQdiipYeANWUm+37s=; b=QuVxzw+KjJ+NfPx+1zVz1taJL2 ppakYEC5b+GW17Le8G35G2br+xDdDwdvk1waWBH2CtrKH05/x7WOEdYbEHOnBG2JpRtM+AyPXq4qP 7cVh72WQkh5rtDan7KADJgLILshpDibl57uEhIj+OviwKoFkIK3VcCBU9aXiQakXRYI6mETpbanQW BFas2TrURTZghTWgsBl2gokP8hQvFaAIhpIMPl9TpLpu4Jl39mBSGQCUGGFcWW4JVLdIx36ZNRVT9 ReQ1B7wh1B8Fqc0iJkfW3OJse6rFx8774ZQM/AjnMLJOHG4B4NmrUx3mg1SL8h/Vb7EHDMF/ogJx8 TD+icLOA==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkBRM-00HOpY-I9 for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 20:08:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621627690; 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=6SLlOvYcpJb9PnH2v8qQWMs/sPrQdiipYeANWUm+37s=; b=Jk3bJbLi7bpZKoC0mPeGq0jW6+OZUHdnFVxMlrqnr3CERSXOtLvVidvfmuJxUCWinuSqIF 9TTDllX11W53b5NjHDMvQAV8di+bdm5inGuUMRZqVmdLUQh5fYoXG6qN6o0Q+u+KQ2cY0V DYVVXmePIa8pM/ZcGM0iPXRfy38Q0GI= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-YUpoln7KMw-M_Dwr0XBxiA-1; Fri, 21 May 2021 16:08:09 -0400 X-MC-Unique: YUpoln7KMw-M_Dwr0XBxiA-1 Received: by mail-qk1-f200.google.com with SMTP id r25-20020a05620a03d9b02903a58bfe037cso11875436qkm.15 for ; Fri, 21 May 2021 13:08:09 -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=6SLlOvYcpJb9PnH2v8qQWMs/sPrQdiipYeANWUm+37s=; b=NaFjuj3mFMWI+wyZkai7pK5tY34QJW77F+t+d4ASao651vJsOWqS/lW6tmfNtsg0Vo 2WLqQNEr03MkLvRIBzk54FMm01mv5GqM6WYPR+HRVEm01tm0AmZd8I2C25E+Tq0bNDVp 2Wd6h7ayKTB/n2v7nJ3nt1Uq0CeLdY33FZGsD/xUDtD4VzFbgmhKOdDigNPo/vtSChZ1 ejCsC6nXltAdLUwsmR0PIQiDd2Kwji0k2tdxzEjQ5KMAybE5EEZjyBObAttQFcTATvOC JNMgXO5oYKffTAK4vj0O97OFwC8MzwPAlssuL4O7PCm8WMYlteZj7cYdXbJgzM5MlPjG q8kA== X-Gm-Message-State: AOAM5328yCv9wCcIGxudWUOJmbO5+bsGhm7boVh1sp8i0VI971SK4hzk R4Bi339RCAa0CIZ7hPrYyq8ZudvHiNsfEyHRj9Ae3Ay534HmMlkUYkan/TCryzNK5D/s2sbF/NV AW7y8Gm1L1aKUSbcw6lny4ZAPCS4hkNHm2eE= X-Received: by 2002:ad4:5f07:: with SMTP id fo7mr14729650qvb.54.1621627688942; Fri, 21 May 2021 13:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzzSaiCm9wXeWJHd3potrPtUisr0+MximgUPLbaSdQjQsFQj8zMXuNhj2iGG7ireBg86+TEw== X-Received: by 2002:ad4:5f07:: with SMTP id fo7mr14729622qvb.54.1621627688639; Fri, 21 May 2021 13:08:08 -0700 (PDT) Received: from treble ([68.52.236.68]) by smtp.gmail.com with ESMTPSA id y8sm5334555qtn.61.2021.05.21.13.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 13:08:08 -0700 (PDT) Date: Fri, 21 May 2021 15:08:06 -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: <20210521200806.nk3m7aldelmi3l2r@treble> References: <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> <20210521191608.f24sldzhpg3hyq32@treble> MIME-Version: 1.0 In-Reply-To: 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_130812_700537_47584774 X-CRM114-Status: GOOD ( 16.31 ) 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:41:56PM -0500, Madhavan T. Venkataraman wrote: > > 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. > > > > So, arch_stack_walk_reliable() would do this: > > start_backtrace(frame); > > while (...) { > if (!frame->reliable) > return error; > > consume_entry(...); > > ret = unwind_frame(...); > > if (ret) > break; > } > > if (ret == -ENOENT) > return success; > return error; > > > Something like that. I see. So basically there are six possible combinations of return states: 1) No error frame->reliable 2) No error !frame->reliable 3) -ENOENT frame->reliable 5) -ENOENT !frame->reliable (doesn't happen in practice) 4) Other error frame->reliable (doesn't happen in practice) 6) Other error !frame->reliable On x86 we have fewer combinations: 1) No error state->error 2) No error !state->error 3) Error state->error 4) Error !state->error (doesn't happen in practice) I think the x86 interface seems more robust, because it's more narrow and has fewer edge cases. Also it doesn't have to distinguish between error enums, which can get hairy if a downstream callee happens to return -ENOENT for a different reason. -- Josh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel