Received: by 10.223.185.116 with SMTP id b49csp6503819wrg; Thu, 8 Mar 2018 08:29:24 -0800 (PST) X-Google-Smtp-Source: AG47ELuqh6Lp/r4ybnm44poSxJoJ2tQs/eYBxebw2LIQiLFzDZycR0RjVs2GW9blpeMX7YQQ58wB X-Received: by 10.99.177.72 with SMTP id g8mr21008685pgp.99.1520526564224; Thu, 08 Mar 2018 08:29:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520526564; cv=none; d=google.com; s=arc-20160816; b=jJmX4/NdM3aUj9DOI9jBBap4PuKhcVbeL/HRLViY+rJTkGElx6NPod89U7d9pwvhxD OydW9tO4cNsO9OIwUwWH8loKk7PKwhWPW1gUaPuQWx2dq+Rw4agGc6sYjo/FfcYgEyjN y2l8CPWZzj4/35DGK5IEATJV4mwjtQGusZH0JAAWj2cSk0qoiYyOHtVMYcV0hV8YU89e UnNuYcEAFC8euJ3V0jASpbUwywZw2LIu1xk6hPjV5K0WixHhc1xzeyQ8xy/fjkZU0Y2D UEWEMEg1MFmZTxxIPU1jKy9/Wx5JgwBeYpKxtpPIA0trwVEQ4+PTvxHV7sPqGEQPejdI dERA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=T3uPT34k9ANXIadw/2V1uz9DyuO93N/rBxyUzsZ6Ca8=; b=UbmPrGtgOcV5QM/JaSnitkobFqVe4MQ77AzD3XEtltrySpGTA0dHNxIrZkK9UPZUVv PSO0ThVPqMR6siXCei9rm7v27hPaFX1LWR5OhrGSElwbBRzqB/cFsNFkHv5RqarbhStf x/vA/s53WSXN2kAzP5mh4cxxm/OWZ8Z7vzkYPf7+46LMLi1EBSVgrEkj3MqMjjeEpdcA SQqMe4iRzjLuurPc3ZtdemxpZ/APOFDT24ciPOCIUxOXQXHBfp63AqYZ0KslqMOK4iv1 k3vmNxx/E2FY/aGeGmknTb2hrrEjn9NJuR6h5Jdhqra36Nw7/T7jeKl1D2aJtQ08E0Oj PN8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s36-v6si14800851pld.816.2018.03.08.08.29.09; Thu, 08 Mar 2018 08:29:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935910AbeCHQ0e (ORCPT + 99 others); Thu, 8 Mar 2018 11:26:34 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50946 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933513AbeCHQ0S (ORCPT ); Thu, 8 Mar 2018 11:26:18 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D0B34000787; Thu, 8 Mar 2018 16:26:17 +0000 (UTC) Received: from treble (ovpn-120-160.rdu2.redhat.com [10.10.120.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id E8DAD10A7E22; Thu, 8 Mar 2018 16:26:16 +0000 (UTC) Date: Thu, 8 Mar 2018 10:26:16 -0600 From: Josh Poimboeuf To: Torsten Duwe Cc: Michael Ellerman , Jiri Kosina , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Nicholas Piggin , live-patching@vger.kernel.org Subject: Re: [PATCH v2] On ppc64le we HAVE_RELIABLE_STACKTRACE Message-ID: <20180308162616.yhbymodggnfzpskx@treble> References: <20180305164928.GA17953@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180305164928.GA17953@lst.de> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 08 Mar 2018 16:26:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 08 Mar 2018 16:26:17 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 05, 2018 at 05:49:28PM +0100, Torsten Duwe wrote: > The "Power Architecture 64-Bit ELF V2 ABI" says in section 2.3.2.3: > > [...] There are several rules that must be adhered to in order to ensure > reliable and consistent call chain backtracing: > > * Before a function calls any other function, it shall establish its > own stack frame, whose size shall be a multiple of 16 bytes. > > – In instances where a function’s prologue creates a stack frame, the > back-chain word of the stack frame shall be updated atomically with > the value of the stack pointer (r1) when a back chain is implemented. > (This must be supported as default by all ELF V2 ABI-compliant > environments.) > [...] > – The function shall save the link register that contains its return > address in the LR save doubleword of its caller’s stack frame before > calling another function. > > To me this sounds like the equivalent of HAVE_RELIABLE_STACKTRACE. > This patch may be unneccessarily limited to ppc64le, but OTOH the only > user of this flag so far is livepatching, which is only implemented on > PPCs with 64-LE, a.k.a. ELF ABI v2. > > This change also implements save_stack_trace_tsk_reliable() for ppc64 > that checks for the above conditions, where possible. > > Signed-off-by: Torsten Duwe This doesn't seem to address some of my previous concerns: - Bailing on interrupt/exception frames - Function graph tracing return address conversion - kretprobes return address conversion -- Josh