Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp894059imm; Fri, 3 Aug 2018 13:35:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcHZALLRKUfZgCXtrC3FYmNpZFdowsDv6owLSSdY7I0IIqncbsYTkNAT+Kitb3kDmiV4u9A X-Received: by 2002:a17:902:8f93:: with SMTP id z19-v6mr4831393plo.241.1533328513609; Fri, 03 Aug 2018 13:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533328513; cv=none; d=google.com; s=arc-20160816; b=e+LfBDam5PyTebw1BOMq9CeCkAJwTFmDgoP+NH1Z3y0hWJ/sTJ7j9lvydCt63glw8y tIcOHCTg5f+0vpdPzX0boPVFjuN12gAcxqI44P10y9ufeX1+pfY2t2eZ6XsepMXR65xn IgdIQ/pgYHc5MYjP5SEpsz+BKcNhVqGnHi+RihVaU2ecNwj407W0PU980L6TP5z1VT+H UCXmiPrKDUUci+Gj3+cMlxPwmONGilsudnA9SUM4VkMgd+BzRtRGLWX/GkVNmP6MhxTP 22BJ0p8p/oNkhOA9onI2FlzTVQQlUTbu/u3nMol7a7amlZ2SCljTIwmTcBWrMn1tX+0B dNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=7pbELVPlEmBFoIK49lGoMM6zfDBfgJOHwwyvMmhHeGI=; b=urMDy8Lca7Vtq5AH9+dkyvnIgCIFH19vJro4vrl4vAQHmY+Al6Utipgld1C+pBwGmU oZJ/Nfa/EawvqA4vnMnZ+tfqy1Rrj2I1Xskb6ZBjKVufJpdUrHbiJej9KkGbV8xD9I9B jREZ6T7Q5XELjwDhYeQrOqOvy8PToKy2nrACWne53cgy1bakAt5cXvSelHavJyXae9Cw 8efowDfCRK/j+Og82GhQNbbPeE/z9XCI45AHRCknLub31AgqeoJflH51lyzZqqRFSdlg HunHqvG26WFnAZIN7Urvl0NrgLE1nm61VfwLbHMooPsuJ4vZD/nDTTtzaKZBCfv6R+Cm z1zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sYpbGUxQ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8-v6si5751017pfo.128.2018.08.03.13.34.56; Fri, 03 Aug 2018 13:35:13 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=sYpbGUxQ; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731816AbeHCWby (ORCPT + 99 others); Fri, 3 Aug 2018 18:31:54 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45382 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729349AbeHCWby (ORCPT ); Fri, 3 Aug 2018 18:31:54 -0400 Received: by mail-pg1-f196.google.com with SMTP id f1-v6so3332099pgq.12 for ; Fri, 03 Aug 2018 13:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7pbELVPlEmBFoIK49lGoMM6zfDBfgJOHwwyvMmhHeGI=; b=sYpbGUxQ9J5SCqK15dSKFaYspru2fpVAA+mjqWvvjFv+ST8JMMmUlOF/VDM4DNzLkv QkJtLhTQNE7jsH46uh1oKTjrbyFYY3vCNCgLWruSYdzJRYmNllXLGoA1LKFIq+3pSbKF UVCBpJjoVqMbTVxTs45+0+dyJxwnGr6f+RDq/rwDe/xHvCywEnrRaGgwWOYMxGCyWQm1 QKpLFJRqfBIELqbse62HCw3bkhl4EfinuNqn03Mxk1OcPIRqY3S2C7JNw9duA43dZw9j B7EFdO/iPwwHY9ItDbxs/yyHTQfuG83TfYPaYwbTR2hqU0a1lf2tMS4RYRnW3ihpD2kt A8pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7pbELVPlEmBFoIK49lGoMM6zfDBfgJOHwwyvMmhHeGI=; b=BNpwmg3btaFwGZ3NlW9HBwLaR7mE4K/T4wmZpOcXmJzBM9z+W5tcNVdW8vvtzoH+tk J/vEkSOs8buNsUl/bTYEky8I2abs/KJ62udCtfzLYeM22642RAm0pGlCar++0eR1zC7m AWOAqBAGn/R+lV95fvTpUqDLtadmVI3rBQqAUJQ8JVBqUiV9FP2AUPQ7aLK6q8QlfRTn Q9CKs0IeWqFIlCeCfn0j6W2uiebP9yxxy1S2rS3rcvXyxn5dqBhYnXeyN5WZXp6ah0u8 YXG7RmADx8um0t51wUGSHfVLyP/pz8XYKNCRIk91N0nvvINspGnDyCzsFQtN+xJoq9pH MYnQ== X-Gm-Message-State: AOUpUlGAgj/pmo7ZN8Lp7Sj+ofX1YLUd144yPVZ6xzYHnA8w28YS/2Rb qZBtkvm4em1QttF9yCMJffLu/ASDYsMRCX+R7z2o3A== X-Received: by 2002:a63:9619:: with SMTP id c25-v6mr5111699pge.75.1533328442239; Fri, 03 Aug 2018 13:34:02 -0700 (PDT) MIME-Version: 1.0 References: <20180801182258.17834-1-ndesaulniers@google.com> <78c667f9-5c8b-3835-83eb-4b59e27e4f7e@bell.net> <54b2139b-53d2-01c5-f240-93a692cdbc59@bell.net> <536ef1b1-cfa2-f66d-4261-fb8405964632@bell.net> <80743c1c-2a8c-7bce-2068-24c63790eba7@bell.net> <81a7e33a-0403-b6d4-fcba-c2168a608ba6@bell.net> In-Reply-To: <81a7e33a-0403-b6d4-fcba-c2168a608ba6@bell.net> From: Nick Desaulniers Date: Fri, 3 Aug 2018 13:33:50 -0700 Message-ID: Subject: Re: [PATCH] parisc: prefer _THIS_IP_ and _RET_IP_ statement expressions To: dave.anglin@bell.net Cc: deller@gmx.de, jejb@parisc-linux.org, Nathan Chancellor , Thomas Gleixner , Pravin Shedge , Kate Stewart , Greg KH , linux-parisc@vger.kernel.org, LKML , Alistair Strachan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 3, 2018 at 12:09 PM John David Anglin wrote: > > On 2018-08-03 2:11 PM, Nick Desaulniers wrote: > > But the kernel uses the generic_THIS_IP_ *everywhere*, not parisc's > > custom current_text_addr(). So if this did actually break unwinding, > > you should have noticed by now. > The unwind problem was noticed. So parisc is currently broken (doesn't unwind) due to the pervasive use of _THIS_IP_ (generic C) throughout the kernel? If no, that implies this patch (generic C) causes no unwinding problems. If yes, that implies that the diff I posted later in this thread (inline assembly) is preferable, and that parisc has bigger problems (and probably needs to do rewrite the unwinding code to handle these extra labels everywhere). > Patches were recently applied to gcc and binutils to try and fix it. > The gcc patch moved > branch tables to rodata so that the label at the head of the table > wasn't in text. > > https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01804.html > https://sourceware.org/ml/binutils/2018-07/msg00474.html > > When I saw your suggested change, I realized there was another source of > text labels > that need linker relocations. Thank you for the links. On Fri, Aug 3, 2018 at 10:57 AM John David Anglin wrote: > The label breaks the unwind data, not the unwind code. So, localizing > the use of > current_text_addr() to the parisc unwind code doesn't help. Have you confirmed that applying my patch breaks *the ability to unwind correctly*? It looks like return_address() is used in ftrace_return_address(), so I assume you can boot a kernel with my patch applied, and CONFIG_FTRACE=y, then run: $ sudo trace-cmd record -p function date $ trace-cmd report | grep date- | less and see if the stacks aren't unwound or look messed up. -- Thanks, ~Nick Desaulniers