Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2397367imu; Thu, 10 Jan 2019 13:30:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN7nNozTZAhWZr3YHBcwQqiEZ/jlyuYAAJuIPK8fD9eNPOBITvi9y9NyVelJZqdPpgbYz1nB X-Received: by 2002:a62:18ce:: with SMTP id 197mr12252598pfy.88.1547155836672; Thu, 10 Jan 2019 13:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547155836; cv=none; d=google.com; s=arc-20160816; b=IjpfUMfqgxIAQX7E1XM4oxVXQrbFaJVpS0ROvuGuVwgnKJA6QGSo7LiIUERXyNniDS ++3eXQnW4twLpB2w0DeMi6w4PJOtsW8Aj2UY4WmEnSwS6N7pcQcIsPsm1KvOc+ZiHwGL h3h6pUFSm3Z2fYf1YCsCOR8jnOlrj/+PREDq7LzKHZW1ZLPd9x1ZcTMhYzVqP7mDT4wR 78MuHsovANy9tZIDvovOFC/5wj1dB9OzSyff8AGiqu935WJxwwCO+vwe7Crd5hpKReli /VG77ipdLVZKSjnhO8ZSaZuW8ILJesG8wfySyvx2eC6RCgImpMI1x8UY2TCMr0MZ6Z4a 5o6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CjkNeA8PkHKP1HKZL0qO3kcFn/z4/e5Sl5TTxM/V8RU=; b=yLB54SN1VY1932FvPgwHp85KgLWGj4BQRPUBjqkFbgeqLzbJkxl3qLaNoj9qx+g7RH xsgg/OSGV5oBY2fNeF2KOFLV9DJ/sAdtra5czMxxl2whpbHH+ts2OW2Tsxa3V1lct+Pt DJb/LK2Q66kbcjVHDGCETTzOF4ton2lsYuiODLKfJc+D/beYG56qnjlh1LvpAyX//2lA dpG8E6NqOtCa7/Sc0oRjK908bFiIr+NVyeOzNP5aywJSFVg6aOuG0mewJq5a96yFez7m M9Qsusa3rdKmpBfIv6xhuJhyTmGqiPykYaFES8wu/p7RYwWC/YP8V6kBMzjiOn/ZnQjs AXNg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u129si8473982pfu.117.2019.01.10.13.30.21; Thu, 10 Jan 2019 13:30:36 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729611AbfAJUwj (ORCPT + 99 others); Thu, 10 Jan 2019 15:52:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35066 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729459AbfAJUwj (ORCPT ); Thu, 10 Jan 2019 15:52:39 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90ECC2090D; Thu, 10 Jan 2019 20:52:37 +0000 (UTC) Received: from treble (ovpn-125-32.rdu2.redhat.com [10.10.125.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A736104812A; Thu, 10 Jan 2019 20:52:28 +0000 (UTC) Date: Thu, 10 Jan 2019 14:52:26 -0600 From: Josh Poimboeuf To: Peter Zijlstra Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , Andy Lutomirski , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Nadav Amit , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Subject: Re: [PATCH v3 0/6] Static calls Message-ID: <20190110205226.iburt6mrddsxnjpk@treble> References: <20190110203023.GL2861@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190110203023.GL2861@worktop.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 10 Jan 2019 20:52:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 10, 2019 at 09:30:23PM +0100, Peter Zijlstra wrote: > On Wed, Jan 09, 2019 at 04:59:35PM -0600, Josh Poimboeuf wrote: > > With this version, I stopped trying to use text_poke_bp(), and instead > > went with a different approach: if the call site destination doesn't > > cross a cacheline boundary, just do an atomic write. Otherwise, keep > > using the trampoline indefinitely. > > > - Get rid of the use of text_poke_bp(), in favor of atomic writes. > > Out-of-line calls will be promoted to inline only if the call sites > > don't cross cache line boundaries. [Linus/Andy] > > Can we perserve why text_poke_bp() didn't work? I seem to have forgotten > again. The problem was poking the return address onto the stack from the > int3 handler, or something along those lines? Right, emulating a call instruction from the #BP handler is ugly, because you have to somehow grow the stack to make room for the return address. Personally I liked the idea of shifting the iret frame by 16 bytes in the #DB entry code, but others hated it. So many bad-but-not-completely-unacceptable options to choose from. -- Josh