Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp478333imm; Fri, 5 Oct 2018 06:58:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV61RUm5RmrJ+NJY7doY+xh/pzSgJxarS2DqneURh+W4I4oW4q6fWR6l9OrfiOZ/NRzstY8mu X-Received: by 2002:a17:902:6a2:: with SMTP id 31-v6mr11318979plh.1.1538747930102; Fri, 05 Oct 2018 06:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538747930; cv=none; d=google.com; s=arc-20160816; b=YXhODeD9TFjiDT9Reg1xWQCk+7pNU8LMA6nI3SHcdB8VtwpxM88VfJTN+8rLLfpN4b SJ7fs/lmQT02Rw9b3Ivg0gXNyo1zh1fFxjdWoEoNcMyIqcKPJMYFUKwVty7NDMNtjISO E22fBjVRFs34lUfepCKhgfi+QBfEguWFdHT8zrtzc8VvP+2Gxw9JLH5m7bpUOiU6oMmE 44+ivzPBP2O7DyUzhV0VnVi34YJNlmB2y5VC6XDYHCmDBXv5s/XOYwha31nJDwh4aGai CeWuiV0f3EXmwk9u4p8CGPIpOzxA1+kNjrEbmqEZCfvXI+Om9uu0ovQt19L4c/DZsr3u yE3g== 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=icoPfttjeff5yY2o/Haqd75W+rJ7k66AdEgbHZsvZdQ=; b=zpyHAMvnLNVm71aJSllnvp/XKV6aQvxNgE9aEvn+JeMyt3zfxdecsRRkAfXw2u6x0Z wztwX8MjPmNSKsbrtpBdL8JwbbFiFUBa6FiRWW3/o+83vIu0pu+pfz2QIy07zyIdv3oI g8so2Jv76ybsJUevEd+cYHxZHEWGdFKSdiGxq+gSAgZaDElHyQeKG78/hI0ipYUk2yXV BCjOfVWaldFAHxxZLfMu5oeqJ7OZJcR99D/ZRyWOQvyHfZ8P6LCiRZGFzK4D7+b7QR6j 6qOiv95ZJRJ23VQVMk5hQchKK5ZU2goqMq+Fp9IQoZ7vAWfyYQhn+WwsK9Ig8nyMHDu9 fYYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=o9nd7nhh; 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 d21-v6si8417356plr.327.2018.10.05.06.58.34; Fri, 05 Oct 2018 06:58:50 -0700 (PDT) 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=o9nd7nhh; 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 S1728624AbeJEU5M (ORCPT + 99 others); Fri, 5 Oct 2018 16:57:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38472 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728278AbeJEU5L (ORCPT ); Fri, 5 Oct 2018 16:57:11 -0400 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=icoPfttjeff5yY2o/Haqd75W+rJ7k66AdEgbHZsvZdQ=; b=o9nd7nhh2WiVbQs1DdQiuYphs seUdvLWCxp4QN3r6XTlPbH0TjUKivXKBEUMzDpwh/YP5vR42vfXOs3h1R6wQ1jtnbtNAgx7OkQMa7 GOHyGIdJ82TTwSAlMhLjzS9lLT3uJ2kDTQQvYsAf/1XBRYK6AakQt2f6AmnIuA/M0nCkjFXshEJcC xZYvI5Gi8JZ6zug3fkgvbZIwSfTsbQn8Lb6O7VA8ksT/5hUuoMbrt3Qe6BhrGLYCs3HdhwYwgQx2v dZD4beQj8LOKRgzhaxS/Tff68AGvofZjxmEZoFdmuWX+uxXnebDdwCh3g7wdn/JNi7mwh5frOfRXC JhOY3goog==; 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 1g8Qbi-0005pU-Pi; Fri, 05 Oct 2018 13:57:31 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5078A202631DA; Fri, 5 Oct 2018 15:57:28 +0200 (CEST) Date: Fri, 5 Oct 2018 15:57:28 +0200 From: Peter Zijlstra To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld" , Eric Biggers , Samuel Neves , Andy Lutomirski , Arnd Bergmann , Herbert Xu , "David S. Miller" , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Kees Cook , "Martin K. Petersen" , Greg Kroah-Hartman , Andrew Morton , Richard Weinberger , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [RFC PATCH 1/9] kernel: add support for patchable function pointers Message-ID: <20181005135728.GR19272@hirez.programming.kicks-ass.net> References: <20181005081333.15018-1-ard.biesheuvel@linaro.org> <20181005081333.15018-2-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181005081333.15018-2-ard.biesheuvel@linaro.org> 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 Fri, Oct 05, 2018 at 10:13:25AM +0200, Ard Biesheuvel wrote: > Add a function pointer abstraction that can be implemented by the arch > in a manner that avoids the downsides of function pointers, i.e., the > fact that they are typically located in a writable data section, and > their vulnerability to Spectre like defects. > > The FFP (or fast function pointer) is callable as a function, since > the generic incarnation is simply that. However, due to the fact that > C does not distinguish between functions and function pointers at the > call site, the architecture can instead emit it as a patchable sequence > of instructions consisting of ordinary branches. This is basically a static_key, except for indirection function calls? So why not call the thing static_func or static_call or something like that?