Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1011062imu; Fri, 11 Jan 2019 13:14:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Hl8y7DDjj64CDi5SVEBcUtLVjz3CrddE3uHbRiGBWsvyJtr7pDRT80WrlEHTXMwjtWB5d X-Received: by 2002:a63:d818:: with SMTP id b24mr14477645pgh.174.1547241268993; Fri, 11 Jan 2019 13:14:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547241268; cv=none; d=google.com; s=arc-20160816; b=QRSvAUukRkSv0n8v+7MGJPZTvB6Nol1sBqfnHGt82wXNH0MhIrvjbXC0hEPlzxiF6l RIvXwcu6forUg9B2oVm64F5gisAytkpgZSwyBofpJ1UqD+8jAsRZBjh8Jy+zD1vGKGsU nbp7a9IWJr5ZG2wbaML49sGIDphT/fCH68Sp22eWzyMEzfVQuznH5cHCBFuGxgD2fF/0 4y+jXMvMDT009JQyZEmKUQMPEhI8NTVa+PU4cm4UbdqjzuyxuO0XeXOpJIgfrwVOMgJh oT1L86JxsRaIcU6JtvpUnlcYaczuqVxs1SQwICMVWlVGWgEOwE86Hn80U/aQ7Pga+xXd MpjA== 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=kl1J9naBK/WoQyawVdksAt2hMXDDvrIgKVyz1nNtQM8=; b=n6e7mdlzF0CpJV/may+GKikZbrKc9HR7jDPMwwE8D7xoNGPDeONjwp/C9ggkgFJNAR o752aRGPv0kIHc86eP6BedD6IksIpBhPMaIN9qmAwCCJWhuA5vPyp8YV6ZqNiEAoeD67 xk7zQIyitQVBiXndKO8PDDi7gUYVk4e9wr+1OzTcUgUZncd+Zpu3CygbG7Htc9kO1C0q aSOrvT17QAGiOaw/G6lzPvUfKq/eQAH78m+YaMbKN6HObwkTMtf4LKLvmDB5rIAc8pqG CUBgSxL4OTbjFL7v90z/mXFI+RYKhz3rtaOhbX78QGiV3FfotJu9ucsJtXsfdWdtiCnh dIhQ== 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 x186si21353777pfx.269.2019.01.11.13.14.13; Fri, 11 Jan 2019 13:14:28 -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 S2388252AbfAKUE3 (ORCPT + 99 others); Fri, 11 Jan 2019 15:04:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41170 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732290AbfAKUE2 (ORCPT ); Fri, 11 Jan 2019 15:04:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5ACE28046C; Fri, 11 Jan 2019 20:04:28 +0000 (UTC) Received: from treble (ovpn-122-231.rdu2.redhat.com [10.10.122.231]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAF5C81620; Fri, 11 Jan 2019 20:04:22 +0000 (UTC) Date: Fri, 11 Jan 2019 14:04:20 -0600 From: Josh Poimboeuf To: Linus Torvalds Cc: Nadav Amit , Andy Lutomirski , Peter Zijlstra , the arch/x86 maintainers , Linux List Kernel Mailing , Ard Biesheuvel , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Subject: Re: [PATCH v3 0/6] Static calls Message-ID: <20190111200420.qtyffayxceysoarf@treble> References: <20190110203023.GL2861@worktop.programming.kicks-ass.net> <20190110205226.iburt6mrddsxnjpk@treble> <20190111151525.tf7lhuycyyvjjxez@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 11 Jan 2019 20:04:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 11:03:30AM -0800, Linus Torvalds wrote: > The we'd change the end of poke_int3_handler() to do something like > this instead: > > void *newip = bp_int3_handler; > .. > if (new == magic_static_call_bp_int3_handler) { > if (regs->flags &X86_FLAGS_IF) { > newip = magic_static_call_bp_int3_handler_sti; > regs->flags &= ~X86_FLAGS_IF; > } > regs->ip = (unsigned long) newip; > return 1; > > AAND now we're *really* done. > > Does anybody see any issues in this? This sounds ok, with a possible tweak: instead of the sti tricks, couldn't we just use synchronize_rcu_tasks() (as Jason suggested), to make sure the stubs are no longer used by a preempted task? But really, to me, having to create and manage all those custom trampolines still feels a lot more complex than just making a gap on the stack. -- Josh