Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp210935iob; Mon, 2 May 2022 17:19:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrvX66cwR8QuKUiOUHWFeKtNfBplQWMl4WNkvub7LMudYFnJ8wFjx/eNBhqdSsIOgAJVUC X-Received: by 2002:a05:6a00:174c:b0:50d:cc22:4a99 with SMTP id j12-20020a056a00174c00b0050dcc224a99mr12700534pfc.22.1651537178098; Mon, 02 May 2022 17:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651537178; cv=none; d=google.com; s=arc-20160816; b=wC+LtUB1FCDVzHGRzf/z8KjIxUr8uCMbR4pYIKhBz5PSgST89Qvnx2qIt+TySUQqfM 5jAKWadChpt0N69kmJj3MKzMhKJeZuQ3Z1msc8fewyLBrgbmxMdMMkXYuIpSmhg8qhtC qwLVQ98Q6ilQR4BYD2hseLm24WNaUiYXMtR5ubIpqftgsqtrwzDOIxIAb78mOK5I8Ukx dHpfLgMtkD/Yw9X2WPTKWlM6kA4nxKPMk/97qNJXs2iWidjACg/iyT6IiNrw3SpYWh/+ SHSos3AYaDAzHQJViDd4yXQ59RleaOzTEwlXJTNkM8BsW982DVfAFl3Pr6VYsyUhHLwc GTeg== 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=QjtbkDPft5gG0EhMGwH7CoQcPBdnWeFvylZ+csB/A4c=; b=kR/rGmHYwfLSRqJgfN6nWev6+jcR2lRsrAmK51FzSCu8GIVLn6lQPNp6cl+4gWVFK/ ng+BtVaKGqLhGq3/VpPfSsEM1KTs4HRafw6PfMNOClCyYFdKOf8kwnM5xOab1o0GdgCx xH5d9Hy1Ct1P7MxkB1LxeWtBc79+LpJn5ljSZ1k5edseP02+YfDtK0w7JoB6QCpbaHkt Gfx11AgFYMO11ABDnesOLgCriVdFa3q70wo+o2hQDV6PuWhiIc+RSDFok7SNCCbsC5lq zYPs/LnlUqPN7GLMM5EwBn8+WtCQ6CcAPCn964bUOHrHSa+lyV1ZetuluFqZM4mtt8fs a3vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uSvYhDeR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y4-20020a1709029b8400b001567b004ecdsi13963781plp.551.2022.05.02.17.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:19:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uSvYhDeR; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A1E43B2; Mon, 2 May 2022 17:16:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239935AbiD3Lrb (ORCPT + 99 others); Sat, 30 Apr 2022 07:47:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239233AbiD3Lr3 (ORCPT ); Sat, 30 Apr 2022 07:47:29 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D71B060AB6 for ; Sat, 30 Apr 2022 04:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QjtbkDPft5gG0EhMGwH7CoQcPBdnWeFvylZ+csB/A4c=; b=uSvYhDeRVB7jF9rWVyMoU7WAU6 YRs6y0y7cI6FAs3I+fSEtRXdv4T39eDO8aIC+DaI6wRzSV1On3tmw9+tecL0CHhw/Ilj0KAKJ67yt F13UIkSQN3/IKJhtHSHi8poKsCPG3cZCQo2L01JFj6IvJiov4UZxFqQzUTD1u0sNsIgJ4a+GR5GaH F5KDuL+yLkZ2hgBXj78haFu22a0cHh4IujeHw4N0GY7RqRibJqwmjvRwgutX2vaoX/3RfxD4SWl/l Qigl5IESeecLJXY8j6srhmtW7VScmfHlzfRX6l38wYsUgtr4EaLE+TVvXpTTq+N6Re/9VDi6zyuQu 2dEWOJzQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nklW6-00DIlm-Q6; Sat, 30 Apr 2022 11:44:02 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DA20A3001EA; Sat, 30 Apr 2022 13:44:00 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BF7F32028EFE6; Sat, 30 Apr 2022 13:44:00 +0200 (CEST) Date: Sat, 30 Apr 2022 13:44:00 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Masami Hiramatsu Subject: Re: [PATCH] objtool: Fix STACK_FRAME_NON_STANDARD reloc type Message-ID: References: <20220429092024.GT2731@worktop.programming.kicks-ass.net> <20220429225636.6qm2orq4uwnl33ii@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220429225636.6qm2orq4uwnl33ii@treble> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 29, 2022 at 03:56:36PM -0700, Josh Poimboeuf wrote: > On Fri, Apr 29, 2022 at 02:00:44PM +0200, Peter Zijlstra wrote: > > On Fri, Apr 29, 2022 at 11:20:24AM +0200, Peter Zijlstra wrote: > > > > > > STACK_FRAME_NON_STANDARD results in inconsistent relocation types > > > depending on .c or .S usage: > > > > > > Relocation section '.rela.discard.func_stack_frame_non_standard' at offset 0x3c01090 contains 5 entries: > > > Offset Info Type Symbol's Value Symbol's Name + Addend > > > 0000000000000000 00020c2200000002 R_X86_64_PC32 0000000000047b40 do_suspend_lowlevel + 0 > > > 0000000000000008 0002461e00000001 R_X86_64_64 00000000000480a0 machine_real_restart + 0 > > > 0000000000000010 0000001400000001 R_X86_64_64 0000000000000000 .rodata + b3d4 > > > 0000000000000018 0002444600000002 R_X86_64_PC32 00000000000678a0 __efi64_thunk + 0 > > > 0000000000000020 0002659d00000001 R_X86_64_64 0000000000113160 __crash_kexec + 0 > > > > So that weird .rodata entry is optprobe_template_func. > > > > It being in .rodata also means it's not validated and there is no ORC > > data generated, is that all intentional? The changelog for: > > > > 877b145f0f47 ("x86/kprobes: Move trampoline code into RODATA") > > > > doesn't really say anything useful about any of that :/ > > > > I also don't see any kprobe/optprobe hooks in unwind.h, so what happens > > if we hit an optprobe? > > Same as for any other generated code, the unwinder will try to fall back > to frame pointers, and if that doesn't work, the unwind stops. > > That commit didn't change anything since it was already not being > directly executed anyway, but rather used to generate code on the fly. > > And before that commit it was being ignored by ORC anyway, thanks to > STACK_FRAME_NON_STANDARD. Which can now be removed since this code is > now data and objtool will no longer try to understand it. Right; but I suppose I'm wondering if we should fix this. It seems a rather sub-optimal state of affairs.