Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5028206imm; Tue, 7 Aug 2018 11:19:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpexv/Lr86zPaaHVRS6yzu4SYiE/up7RP5hnxzkT/lzkuc7zTvzwBcBbDMMWCYBRp4+4hv8j X-Received: by 2002:a63:e318:: with SMTP id f24-v6mr19394386pgh.175.1533665991164; Tue, 07 Aug 2018 11:19:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533665991; cv=none; d=google.com; s=arc-20160816; b=A/S5YtKqCUCKaPdrGSunvQ/1wq1PZqSu5Pu1+n3UolyfND0o+BdpNZB64BfcXUbSX/ 7QANQJtxGnw3LQmkjz1Xvd5fCrDVybwqH7j6G9M2K7eTgY1MJ9aA5yt426F9EN71wvnY vx7DIZllxtWgPFaQCNsNLpdLAOz7JiN7Br468fT2vdEUWaPzawIS7hLGsKukdlxAyQOR np4XLq7uEq7Fjmk51JKHNZxKjOMGMukBHm57s/lBn6fAWva1pr2KS95pdbphrASuu19O 6DoqJ85j6u8rVAkkpjOZTll2R62TFBCuP38oxpQORNVNTvxPMC9gO1s71ue2IvcUfBTI b40w== 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=SQEKNpO0hpT7bkNsy39qmGPaZqXhTg3NHgpJCyWd7t0=; b=Q0wtvs0Sk7PEA9LiI6BcKQKx154MKlPi8VYnGXlbpYVBS5O+LmgWY8wXq2vwvKqR1k 0lzRo+jJQQJGiv92Q5OFv7ZIiQmhw1vb7AF5ScRyZ0evOqUt/Hd7XWrT1efOiR3CP+wO qPpIz+C0b7WPZil8Oy3ran2HM8c3G5jiT2Lno5DPe/afG37PfPVzh1o/h4W5OFrWFxma i5H4Nhqb9K1IbFi5/IqAGchcW4XxRepYkesqAQSWKn1YpZQvLLmW+JDYhixu9+OGEvm0 jmrEZnWRwbshA3lZh+JFojPbDfge96P+wZGIi9ZYVrb9iPjR/J1fogDHRbiNFQ6uZrNv 3IzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sQ9ceGhD; 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 f26-v6si2094218pgf.10.2018.08.07.11.19.36; Tue, 07 Aug 2018 11:19:51 -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=sQ9ceGhD; 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 S2388935AbeHGU1l (ORCPT + 99 others); Tue, 7 Aug 2018 16:27:41 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:34837 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727572AbeHGU1l (ORCPT ); Tue, 7 Aug 2018 16:27:41 -0400 Received: by mail-pl0-f65.google.com with SMTP id w3-v6so7450106plq.2 for ; Tue, 07 Aug 2018 11:12:08 -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=SQEKNpO0hpT7bkNsy39qmGPaZqXhTg3NHgpJCyWd7t0=; b=sQ9ceGhD5Irswr2brHyLaP3Irv0yb21kZephA7POiLcuE1M8VQepYuH1MbvSjRgqqh 6B+WHriQgX4k82udIXbQ/issdW858SyAuZtRLIw8JM1VvgZICYu3xmHs+8eR5sL/mwv5 ZI2WqlYD1h1GOZ1bklZ0gNBFR9xImA04IpD5r4UepaVhK9g5/Q/NXmeUyZyD4RNKmAll cHLEjb91bGoidiilgGKx/LYH9eNfj4chaGUSvTVYDkKKTp533sCovHITHSFfdb8Z6PaV lGtQ0bAUNIntFfWOjxx67fGkNDdtyJY016oha1QAVU4ePcBsbj/rkN3eCaRX8TtC7tMW vLYg== 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=SQEKNpO0hpT7bkNsy39qmGPaZqXhTg3NHgpJCyWd7t0=; b=ZcfD6f7BdM/tksL74g0Za+hpbGt8G21F8P5Zcq9nc/3NBEtc495sizZPhK76wqnjD9 RC2E0Y0AZj4MJiKh7G27UCqo1QRHMf98m61SPghzRtyyZcc7XPjctvQb8i2EVT0Ie8lb eMbFKtdBD09Ebkbg6JX5M4Lynx4+1pesnLvWuMfgVkq7j8WSQIsmg5h7HH1KawUx/N98 tGlBkrhQ2UAPTdyWBsICHZ3bfsrVAnWjNair833ijO2A6bCOmju59wlp+Xbm0qZRakv9 /toZsipv73oo2cvNtVjDCC9rDkE66jbrKRqp7lLcU7Z6CNhupuUZF8sgcWTMAp9lUakO ErZQ== X-Gm-Message-State: AOUpUlEe6eGaBXvnY89ukyoWsVQZiSKMSu9797Vh7JKslH5GmpvX0FEj 8mJBFYLSe1RhpiHTrNz6f7nr02eIIj1098F9VTEugw== X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr18646295plk.214.1533665527406; Tue, 07 Aug 2018 11:12:07 -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> <1d577675-c337-d433-f235-1e46e5d56d4c@gmx.de> In-Reply-To: <1d577675-c337-d433-f235-1e46e5d56d4c@gmx.de> From: Nick Desaulniers Date: Tue, 7 Aug 2018 11:11:56 -0700 Message-ID: Subject: Re: [PATCH] parisc: prefer _THIS_IP_ and _RET_IP_ statement expressions To: deller@gmx.de Cc: dave.anglin@bell.net, 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 3:34 PM Helge Deller wrote: > > On 03.08.2018 22:33, Nick Desaulniers wrote: > > 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? > > I tested it on the 32bit kernel. > The answer is: No. Unwinding works (with and without your patch). > > > If no, that implies this patch (generic C) causes no unwinding problems. > > correct. > > > 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*? > > I tested your patch (on 32bit). > Your patch does not break anything. > > > 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. > > I faced issues with trace-cmd, but calling ftracing functions manually worked. > > So, your patch is basically OK and doesn't break anything. > But I agree with Dave that Andrew, that THIS_IP is ugly. I don't disagree, and other maintainers have remarked on _THIS_IP_ being ugly, but renaming it en masse is a tree wide change, which I'm trying to avoid at the moment. It sounds like we have a working patch? Are there 64b parisc machines to test on, or can this get merged? -- Thanks, ~Nick Desaulniers