Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1406333pxj; Fri, 21 May 2021 13:29:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww5OLGGmV2qhJAPTUJR+LT7hl3hrPA4y+0XPN3lGQLCKnOCbZsm7VZjQw5fG3Oie7CE9Tq X-Received: by 2002:a17:906:2dca:: with SMTP id h10mr11766202eji.507.1621628983283; Fri, 21 May 2021 13:29:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628983; cv=none; d=google.com; s=arc-20160816; b=y55u0lCL/L1Xup22/J2HwL/yZ9hyFBkpAz/eF9VpA26bwll5qb1SB8IQmIlDkTnFNQ FmqV6nq4aajONw2+9MY/jbj0FZOc8ADZpPVB/lMpDGMuGJL7/MyaTpUKSmEexQ9Zw/Jc xvwpgvDS4DiDJJLAKrU31xSX71kmA7OS7UCwpzme41Va2B90AZ6CXVmKuZqhfUaho84G mvlFS7uDOWOk/chfB8s9SmLt4UkOAGZSYW4QJKFeTQxr1gOAae+IAtb10kT8YbN20LQ7 SuvFNRi2zuji42kBC1/9uVZTrEK9qpJgL5LNU0IoXrJndgmmu2gim+ZBFvcB+Od93NtD ehXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6SLlOvYcpJb9PnH2v8qQWMs/sPrQdiipYeANWUm+37s=; b=vTbDEJfY/9vMVaFRtny/+n4PrSEa7ABmkuUO5XCya+P53c7yB/nJHuU7gYx9/n1cLa xIJurx1vv15rRBFsANROZAke7szk0AmNcL6mWmC2cJAWDgh9WgBrNNLU1PYVcW73X86Y zuhKpkoCkthZTKwy1FLOZsgwYquNenbTZ44sLELL+NleS8LD8+HZ3fH8+mfc9LHmZv99 6Yyt33MsTodcWiagysh6doVkiveCAYbzneEWnBzqUdfPsCLxwQJaq8oMsDfpejIcmMKd rCPlodqbC+VDS4shn3ojMbWKd2ZWAWaqWIKlr5UVn4FM9rshfB8dib8ag606Rv6E5kpi YSBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ivdMdBP8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si5669907edq.515.2021.05.21.13.29.17; Fri, 21 May 2021 13:29:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ivdMdBP8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230217AbhEUUJg (ORCPT + 99 others); Fri, 21 May 2021 16:09:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51963 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhEUUJe (ORCPT ); Fri, 21 May 2021 16:09:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621627691; 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=ivdMdBP8O0cxRvV2wEKYfo8GcnjzfXA7DUFbLjidd3HpehhdrAqVpkgSUDux4YzLcZFxHc bZl8fm2GNpZbPjQiaUc1fAmqygVwudJ8wWHlpqoP7L3z0bI11ONVEgBT1EbCUjwPC5NRdA +vBdYAtyTfE6JKnnqD5qjuylVUN9JD8= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-88-bbDC2A12ML6A72IVDnK4jQ-1; Fri, 21 May 2021 16:08:09 -0400 X-MC-Unique: bbDC2A12ML6A72IVDnK4jQ-1 Received: by mail-qv1-f72.google.com with SMTP id n12-20020a0cdc8c0000b02901efdf8d3bc7so15418159qvk.23 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=smDGUYp1Nbkc31uoVV7qyolQa0b9oiekC2KOk7GYDoj7BA6dDqDIaEucBS7Gc1JuAw aAjtIbvaNI5IepQQDkHTzkd/Uy4pprt9OqCbY2cNY67990aP7M6+7aPPd3OBlMEGO2xG kEf1NpWmX1/71NNVQydFabWb8TFWTAwpOmAgWnIer3O2l3QRb1qvLUnPjuY6UpzCS0ga DKmKS3tjMFSk+pqx+i9KCDLIVfzClGvaRjSBt8dLgPDtJ4+SP7wOdi9S4jpQv8ffPWeb gXwO6oqUWOGEmZJV7yHUcAiX02br+hqlKh7O5cUPAIJf2oGSOjQphMgKW99p+aTtt/YF YQKg== X-Gm-Message-State: AOAM532d663PmYmhsVXic774gp6LWSdWGss+2M3fReDlfK7cGFOvqSQR FZbRI1jOadXfuvHr9X59drJlJ0rHE6vBgqaiTfHnsfzRkO2FQak44/TsTu1AkMhAUr6cZoBRe6m 8pUnOxniwvIfmE/D0G7L5gUqB X-Received: by 2002:ad4:5f07:: with SMTP id fo7mr14729651qvb.54.1621627688942; Fri, 21 May 2021 13:08:08 -0700 (PDT) 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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