Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2823269imu; Thu, 29 Nov 2018 10:47:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/W86BPRkoHYCBM4ZeL+Bt14ZdNXt2WhIYEjmMcJVLbMWLTjBX7HRGBfziu64BtAXek7soX7 X-Received: by 2002:a63:63c3:: with SMTP id x186mr2213196pgb.330.1543517268262; Thu, 29 Nov 2018 10:47:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543517268; cv=none; d=google.com; s=arc-20160816; b=uqnZy6JkcFSurTb7IXjmbf6oF4sHH4MiKjDekSZG9pIdAgti1VZPLW2KKDeiftoQ10 ir27ANG0wNFQ0TTz+cPCSZI5488e2UvljMcWUC6vfBxFiwLxkZfCObEp9TMYs/0HIgrI InZYwncxLhwH5xoAwawWEgFX0ccWa7xPdxt4jUCsdBVkIBRNbtLCp/hEk1/w/tIHgyDL AZ65z2HPnMbb4LUcv/ja8LwR/YYfo5qpkra2IcICkslP+BnReBJaWIAHrIRaH60siGYb bQIasQLJdUyWxo7T51LFgtqvFQ+hgdl8UXlUdaztboaOt9CRTo0OTgmremD8MORKTz3V uenQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zDKYNESZMtlj143BH+TJYTUMmVLAfcrmOTHsqBDPXjo=; b=MEXdlwhAE5WwyMjly8Fw07xkUpkIjhRI+B2qxzLWObJyKW8JQb3ZW6iAHjo+WhFkdE wpQrmxzMOk5ctoQiSgg8Or2QMJZWgPYB/5VKHE/jKFYiC0p5IkaxiEHPJkS5Qe3fv9vs b115Y2zLKmXUcivTdCTubUnePUu/SWeAz5kYbjdDQMcnwdMRnnJSnux1N7Qb4w3SmWGD igvKLXfC0TDrTu8l6OdkVqP99bkY9JRjoYBtylAn0NCZ2BPEzG38vcwSiq4JUPCl8EQJ c/nz5hn0XdPTOd2+EnBANFtikp7AzV4QD1KtMr6eTg+21XtqQujqo2WdXiqe1MGYNRq+ bQBQ== 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 z2si2631941pgs.267.2018.11.29.10.47.33; Thu, 29 Nov 2018 10:47:48 -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 S1727514AbeK3Fnh (ORCPT + 99 others); Fri, 30 Nov 2018 00:43:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60504 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726918AbeK3Fnh (ORCPT ); Fri, 30 Nov 2018 00:43:37 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A63146EB89; Thu, 29 Nov 2018 18:37:18 +0000 (UTC) Received: from treble (ovpn-123-4.rdu2.redhat.com [10.10.123.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D092D620C8; Thu, 29 Nov 2018 18:37:14 +0000 (UTC) Date: Thu, 29 Nov 2018 12:37:12 -0600 From: Josh Poimboeuf To: Peter Zijlstra Cc: Andy Lutomirski , Andy Lutomirski , X86 ML , LKML , Ard Biesheuvel , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , julia@ni.com, jeyu@kernel.org, "H. Peter Anvin" Subject: Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64 Message-ID: <20181129183712.s5eocp5hf4ta4zks@treble> References: <20181126212628.4apztfazichxnt7r@treble> <20181127084330.GX2113@hirez.programming.kicks-ass.net> <20181129094210.GC2131@hirez.programming.kicks-ass.net> <20181129143853.GO2131@hirez.programming.kicks-ass.net> <20181129163342.tp5wlfcyiazwwyoh@treble> <20181129164914.GA9027@hirez.programming.kicks-ass.net> <0FDA053D-7ADC-4F42-AEA5-99DA155FCED0@amacapital.net> <20181129171539.GD9027@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181129171539.GD9027@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 29 Nov 2018 18:37:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 06:15:39PM +0100, Peter Zijlstra wrote: > On Thu, Nov 29, 2018 at 08:59:31AM -0800, Andy Lutomirski wrote: > > > If you make it conditional on CPL, do it for 32-bit as well, add > > comments, > > > and convince yourself that there isn’t a better solution > > (like pointing IP at a stub that retpolines to the target by reading > > the function pointer, a la the unoptimizable version), then okay, I > > guess, with only a small amount of grumbling. > > Right; so we _could_ grow the trampoline with a retpoline indirect call > and ret. It just makes the trampoline a whole lot bigger, but it could > work. I'm trying to envision how this would work. How would the function (or stub) know how to return back to the call site? -- Josh