Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp120724imu; Mon, 26 Nov 2018 08:41:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/UyjUkB4TFAV1yYR3fdfu/ryR3sbljVzlTiC40fu6ur+9pu06JcfZ0Ep2CWhzwOiXyRecB2 X-Received: by 2002:a17:902:2969:: with SMTP id g96mr28243825plb.295.1543250502802; Mon, 26 Nov 2018 08:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543250502; cv=none; d=google.com; s=arc-20160816; b=zNMcZSFEb/m0TqGKB78pC7Jy9Xw6ZRMcG9dRZkWi6qwIhGQ6o9oHIJxnAeyDRewRbc aosVtAQnKzv1w5HTjwCbb2VRuGSdpEYJX8vm+Ypj0jedPGNP7aGnPTEQeotMWQ2uh35/ r8TuaHt6kK/Z9mR26WxY/fqmusumrTpw/D0RJsmk3nYI23LqIdaQyrj59XykwMVCSPPM EVHbESjxQgjjRhQcI3er5+8EiVuQLbFQtLfNqCDb0ZXWPZetOflwHBPw5eIrM7LUDISB A8pVmpdS7gdwyMOYrndpTfOYqJuDKxDt+L2manFDJveh/uyFiyAxhohs25svtIJnLMey 1+og== 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:dkim-signature; bh=44aeCHeKySluNGD7M4jVwHCSxTCuoMjwIkcW4/8Nidk=; b=cOSZaUMxiNMKUGYX0pzGOa2vzcxLeh+SisUWzD4xtBPlsqkpr4CHDd/7oVsMfHqLsb mOj5WBOfvvkKgbmrYju4cY/lnTtrsLYaRlJQlPoIFo3Kh3004bXlaIxEQob3lpeHOcJm NGLxYiKooqAXq9NVgnsqzpAFIAloEoJvEfjoO7qbW2wbwpQuW4rIwNKz4igtYHAiGYCX mJvYW1NoLzY4ZVbBlvgBlko+IyvvKyGv3FbzRYWz1X71xqvqy7tHgx6I4Oa/x7OYbdu1 hBVbKNjbx/+rYmL8P21BsIvfLC3AtoGpsTbsUBc5UUk+t2phMtvJRSzij8Ynq6vpPgUo xLxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FaKHFIl8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si712149pgn.61.2018.11.26.08.40.50; Mon, 26 Nov 2018 08:41:42 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FaKHFIl8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726705AbeK0DeL (ORCPT + 99 others); Mon, 26 Nov 2018 22:34:11 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:49470 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbeK0DeL (ORCPT ); Mon, 26 Nov 2018 22:34:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=44aeCHeKySluNGD7M4jVwHCSxTCuoMjwIkcW4/8Nidk=; b=FaKHFIl8bsuEqOzSMl1jzS6py HclEQIXlxKLLmQJhRNELeO43u814KBfnZnooLEkPUTg9IRABpDdBAsDSYfc73nDreWg0s1d11aXNt O/y0TxRx4m8NzVUEcJYYfRAWmPs1XMgvgp3P9kQ3oHPgJTmnPk/KOncgs7VgFna1x6qmKyxPzU4Fh UL97DJxyeH5VNKsAmrvMQSL5Zq2Ui6r/m8pblasXa9xdw5rQ60XvXicHHGFLVODfL0ij3HB/6Js/G p0SgbVXQznnkwOSkUY8aMBimx+iZdaVqvWbFeUoTk6XZ+DcMIIQp360s9T8bhv7KOPjh1e8gMcjUF +WZDN3Jgw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRJuu-0005xy-Pm; Mon, 26 Nov 2018 16:39:24 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2E8E72029FD58; Mon, 26 Nov 2018 17:39:23 +0100 (CET) Date: Mon, 26 Nov 2018 17:39:23 +0100 From: Peter Zijlstra To: Ard Biesheuvel Cc: Josh Poimboeuf , the arch/x86 maintainers , Linux Kernel Mailing List , Andy Lutomirski , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , julia@ni.com, Jessica Yu , "H. Peter Anvin" Subject: Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64 Message-ID: <20181126163923.GT2113@hirez.programming.kicks-ass.net> References: <62188c62f6dda49ca2e20629ee8e5a62a6c0b500.1543200841.git.jpoimboe@redhat.com> <20181126160837.GS2113@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 26, 2018 at 05:11:05PM +0100, Ard Biesheuvel wrote: > On Mon, 26 Nov 2018 at 17:08, Peter Zijlstra wrote: > > > > On Mon, Nov 26, 2018 at 07:55:00AM -0600, Josh Poimboeuf wrote: > > > +#ifdef CONFIG_HAVE_STATIC_CALL_INLINE > > > +void arch_static_call_defuse_tramp(void *site, void *tramp) > > > +{ > > > + unsigned short opcode = INSN_UD2; > > > + > > > + mutex_lock(&text_mutex); > > > + text_poke((void *)tramp, &opcode, 2); > > > + mutex_unlock(&text_mutex); > > > +} > > > +#endif > > > > I would rather think that makes the trampoline _more_ dangerous, rather > > than less so. > > > > My dictionary sayeth: > > > > defuse: verb > > > > - remove the fuse from (an explosive device) in order to prevent it > > from exploding. > > > > - make (a situation) less tense or dangerous > > > > patching in an UD2 seems to do the exact opposite. > > That is my fault. > > The original name was 'poison' iirc, but on arm64, we need to retain > the trampoline for cases where the direct branch is out of range, and > so poisoning is semantically inaccurate. > > But since you opened your dictionary anyway, any better suggestions? :-) I was leaning towards: "prime", but I'm not entirely sure that works with your case.