Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4209214pxb; Mon, 8 Feb 2021 10:24:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxP6dQzChrHypQFtbnx6AJLAohbjVVzYyq+qfk9n4bE3vZswFzozgwvmVQfv6Fdqc8jkwxr X-Received: by 2002:a17:906:2293:: with SMTP id p19mr10180856eja.206.1612808680915; Mon, 08 Feb 2021 10:24:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612808680; cv=none; d=google.com; s=arc-20160816; b=RsjP6c7sMNhEA1UjjeGko80Okf7/rbTNpdPGnoVqfkIOdEsBV5uJnj3+TUuakU6fcF W5bj2eWg/3hIewgeJsT0uEXefTZrhfuW8UsDxwBpKE9r6nUQN5x+eH9VOAtZ1TQa3Ca0 iA5HoS1xJdKm0VpkzEf+rCmT1NFgKECFvNjjqUltCmPege39XPN+jFCRyw/MYHI8UiSF IP1iSTtMLjPSfTXtk3P5vI2pGqXrDvbEgkFdgTW/L+Hzyr/a+uc6TFOJY8vUt5Ca1Hny h/gH+pLcN25I91m34edynDrRR2GN6cudcWxYpxgMfitpo7pNMUkdNcuNnCusSi7OIVQb dq3A== 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=CrSWaJykWlogrwjWXAgw3unW07UIgYkSvgAmm3gGDH0=; b=l783TeTbAuc77yozOxxz4lLW7D0b0Bl+Jhz+oAPl024t66rmk014Qsgw5lJMT781uV VmyX8OHibtVnXmROfHfQHeRJkBmdrgi3h2FUahHRLW8c/yt0QwFqrcU7bxyJZREzqvh7 0XngLojk/Dj6Vv8nFHpPRlPdhNVCAoPOuTp6Rjku8L4P/uH661gou71X4hg9Kov/BI6U 1sG6LAvoJ+gN35oKCRxrsIj+l0bmzlLqnxgz4qNt3r/DNFM8L30pv/Vp6jPDqUWs7nN1 xtRVVBDYcdSx19MLluHAttHC3/GN3AMKc562/F67pdo1la1popqncvNMj4wrxhh519+n bE/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=RhG6xnkO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si13059327ejt.167.2021.02.08.10.24.16; Mon, 08 Feb 2021 10:24:40 -0800 (PST) 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=@infradead.org header.s=merlin.20170209 header.b=RhG6xnkO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235689AbhBHSXU (ORCPT + 99 others); Mon, 8 Feb 2021 13:23:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234181AbhBHPsM (ORCPT ); Mon, 8 Feb 2021 10:48:12 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49755C061788; Mon, 8 Feb 2021 07:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=CrSWaJykWlogrwjWXAgw3unW07UIgYkSvgAmm3gGDH0=; b=RhG6xnkOd/2Vxhd/Q+09zua+6e YEnensgIq8t1el+30dhU+4Y0TSno4WV+jLwMP4bunKsgofSNZmE3i0zbClw0O9LA4vR+0ig6sfHnv /RMiLWxkne1snwBStxkRX7HWqrIf/RM/6rBjyuWov3N4WiVBgrINN0D03FHC92CduF4y/aur8oB+G 1KaofsniSF/rIwTcOwvAaz1sqSF4m3cRIpzVVoDCqSoR4DN8ZJpuMS06rlPwH+54IDXQbyvtrUbsK RhmPPvFaNjh1OoqzFtzJKx76/eskTc5Ksi0pOVLLmMC7mC/ZRmEmEYPhUGVobP0rwm9awg9xKZz6f 5yr8l9qg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l98ko-0004QF-8r; Mon, 08 Feb 2021 15:47:10 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 26A163012DF; Mon, 8 Feb 2021 16:47:06 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E28C92BD561CD; Mon, 8 Feb 2021 16:47:05 +0100 (CET) Date: Mon, 8 Feb 2021 16:47:05 +0100 From: Peter Zijlstra To: Josh Poimboeuf Cc: Steven Rostedt , Linus Torvalds , Borislav Petkov , Dave Hansen , x86-ml , lkml , Alexei Starovoitov , live-patching@vger.kernel.org Subject: Re: [GIT PULL] x86/urgent for v5.11-rc7 Message-ID: References: <20210207104022.GA32127@zn.tnic> <20210207175814.GF32127@zn.tnic> <20210207224540.ercf5657pftibyaw@treble> <20210208100206.3b74891e@gandalf.local.home> <20210208153300.m5skwcxxrdpo37iz@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210208153300.m5skwcxxrdpo37iz@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 09:33:00AM -0600, Josh Poimboeuf wrote: > On Mon, Feb 08, 2021 at 10:02:06AM -0500, Steven Rostedt wrote: > > On Sun, 7 Feb 2021 16:45:40 -0600 > > Josh Poimboeuf wrote: > > > > > > I do suspect involved people should start thinking about how they want > > > > to deal with functions starting with > > > > > > > > endbr64 > > > > call __fentry__ > > > > > > > > instead of the call being at the very top of the function. > > > > > > FWIW, objtool's already fine with it (otherwise we would have discovered > > > the need to disable fcf-protection much sooner). > > > > And this doesn't really affect tracing (note, another user that might be > > affected is live kernel patching). > > Good point, livepatch is indeed affected. Is there a better way to get > the "call __fentry__" address for a given function? > > > /* > * Convert a function address into the appropriate ftrace location. > * > * Usually this is just the address of the function, but on some architectures > * it's more complicated so allow them to provide a custom behaviour. > */ > #ifndef klp_get_ftrace_location > static unsigned long klp_get_ftrace_location(unsigned long faddr) > { > return faddr; > } > #endif I suppose the trivial fix is to see if it points to endbr64 and if so, increment the addr by the length of that.