Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp2029483ybj; Wed, 6 May 2020 09:22:27 -0700 (PDT) X-Google-Smtp-Source: APiQypKdI+kKOkkkIs3QwY7WcJOcaSVFd7qUO3v1DqeKZDfonTAFj9fv77uB6PbpQUnqaJQXPxR7 X-Received: by 2002:a17:906:2604:: with SMTP id h4mr7759478ejc.307.1588782146856; Wed, 06 May 2020 09:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588782146; cv=none; d=google.com; s=arc-20160816; b=C2Y7DST+uFSaXXoVB0BDNEnzAEcIuarCtzwbBVt7REyNDvH/tUJfqwTd00OYXzKhKD DEypSgEhVXZSBu3Stc2BOaeG+sKOIP9OBtPZ1VBB4kAiv7zrRLg7LAYWTxMOnp5FlX/5 ngg4bm/rfX5dlG193k/4qFh0zUot27XMFROOboUqhi+2sgdg7qlpXeugXmR9OdmNvz9G 1qLdtKWXy7RQMZ2SnqxaWwYTAbeqDUmni/OXR3tjjHkE47i0mZdvSST+S6wD+LsGAGQj g+M/yBBd898KXBZb8Pod6e1gnBwm/vUNiMm1rlakIduC/uMzLdpG71kUdoWfXj9ipm/Y X4/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5mLMqArBW6jfYF76Y9dmQCS1j4NzrBHjUeYojdIbkfo=; b=SvI8quNOlUfqLicbh0a5c+MhdhV8Xvv/qruknl0Ed1t3VkIKRrv25DExhDnk0h6ph3 xhF7AiWhMcpfM+bz+SCqWLKec30R91to2mmFj7T7M3jHz5bYl9XICc1nOMUg4+JhuRa1 AlKJZnFbpRpQHDl0SZVLrTLWTZHKny2ZFKGML7lg5+yFJ3jOBBRojQ3v5AIfWx4EprVe OvbL2NI1zhMo2+ek8vhcejs4v0Y88YldBYoEaB4LqxYw3Zo5BzXbdIqb4FhgEMR8LlAK BXU83R2Sa8nEo+0EHFz0eqQNmoUeCSaY4zFUs4g8eWbtxcAQ5zE9sZd9LyeuHK4fPOLy E2RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZVZfWssV; 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 j23si1258338eds.468.2020.05.06.09.22.03; Wed, 06 May 2020 09:22:26 -0700 (PDT) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZVZfWssV; 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 S1729596AbgEFQT1 (ORCPT + 99 others); Wed, 6 May 2020 12:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729239AbgEFQT0 (ORCPT ); Wed, 6 May 2020 12:19:26 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E21DC061A0F for ; Wed, 6 May 2020 09:19:26 -0700 (PDT) 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=5mLMqArBW6jfYF76Y9dmQCS1j4NzrBHjUeYojdIbkfo=; b=ZVZfWssVFJEVUhUMfYX0vnZGSG JeVMiXeUfkUhUl5IY9mGmlv7ffd2UtQ35YDWAA9sn0Lvb73fpzSpm7MLJ2Wi//itVW9a16aLkfc1O tQT5MWXK0Vddk1UoHs4Pw6hatzgOjEHrFTXw6qm6fZNi0vBz4HA+0mprVYOLfzasAcNeumH1qP8nI J9wbpxd3p810ti+I5sASRPjH7Y9n1Z9994wzt3FdxJvoiOlJaLaaR5xBF1biyeC/m1N3FjMdo1RYL i6GNYnfW2nCTr3JsoXD5H1Y9WX3MC71I/8oJtxsRdT02l8w4+z3at+gdYcmaktEwTHRfeC5jLBxtw 8xIuiaCw==; 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 1jWMl0-00066N-Ou; Wed, 06 May 2020 16:18:50 +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 397C4300238; Wed, 6 May 2020 18:18:49 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 198A9203ECDC2; Wed, 6 May 2020 18:18:49 +0200 (CEST) Date: Wed, 6 May 2020 18:18:49 +0200 From: Peter Zijlstra To: Mathieu Desnoyers Cc: ndesaulniers , Linus Torvalds , Rasmus Villemoes , x86 , linux-kernel , rostedt , Masami Hiramatsu , bristot , jbaron , Thomas Gleixner , Ingo Molnar , Nadav Amit , "H. Peter Anvin" , Andy Lutomirski , Ard Biesheuvel , Josh Poimboeuf , Paolo Bonzini , "H.J. Lu" , clang-built-linux Subject: Re: [PATCH v4 14/18] static_call: Add static_cond_call() Message-ID: <20200506161849.GV3762@hirez.programming.kicks-ass.net> References: <20200501202849.647891881@infradead.org> <656098739.766.1588705237442.JavaMail.zimbra@efficios.com> <470458191.1021.1588710464160.JavaMail.zimbra@efficios.com> <20200506135502.GS3762@hirez.programming.kicks-ass.net> <482526608.2543.1588773672085.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <482526608.2543.1588773672085.JavaMail.zimbra@efficios.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 10:01:12AM -0400, Mathieu Desnoyers wrote: > ----- On May 6, 2020, at 9:55 AM, Peter Zijlstra peterz@infradead.org wrote: > > > On Tue, May 05, 2020 at 04:27:44PM -0400, Mathieu Desnoyers wrote: > >> Actually, if the goal is to do code patching of the call, I wonder > >> what makes it OK to "guess" all the call patterns generated by the compiler ? > > > > We're not guessing, have have objtool read the compiler output and > > record the location for us. The compiler can generate whatever it likes. > > So is the plan to adapt objtool if future compilers change the generated > instruction patterns ? If needed, sure. I don't really see what a compiler can do differently though. objtool looks for: JMP/CALL __SCT__##foo and writes a .static_call_sites table entry for it. Anything else we can't rewrite anyway and will have to keep relying on the trampoline working (which we also update, so that's fine).