Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp599715imd; Thu, 1 Nov 2018 02:27:40 -0700 (PDT) X-Google-Smtp-Source: AJdET5ckdEIpq04rQ5JC6FR/TIsWgWxKnBQImtVWer1QMwVBzjXQ8KLn0t4QP4G9zRyr8vVX+0t2 X-Received: by 2002:a65:430b:: with SMTP id j11-v6mr6499165pgq.269.1541064460817; Thu, 01 Nov 2018 02:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541064460; cv=none; d=google.com; s=arc-20160816; b=rdJh/YDfwFj17gtuZTpFRTSlJtUBbcfczE/QFQfNqG9fmoYo/Ek/Rup1KsZvkhEKCZ cuhPE0a3qUJwhAFj6u0iSMX4Bq8PUc69qHItIpkHOUuOE2ngD9VtIOfRYZ03UxnfWmls eq3QYA1XgJVr6B6jCdPe1eGlAooanThTpNZjdkAAinjK3mxF+qFroygyvFpwxpE+0aX9 wwR44SyWDglAqxfXlx/XgdY3X3zaMuvdk5DHcl8iRXyYLsd+qVeiAarBSXPgbkl4trYA wx4IjHdI4BgRtTwwnc2RIPYl03MN5/rWnSm7NFovtO7TWvVG07Yj4V8T5WdHDGonQXAJ 7OaA== 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=3wRT7muTyIV4pFRdJFffwKR8WBv1D/kBcY4kzhUZeC0=; b=KmWfjDWa1KRo4C3w0cA2JfuXcjSMxWrlvrtiU4NnQUOS4J6B7aASKhnst8TMfx76DQ NSbj6iepW2JXn9syV59v6JEH5c0xSuRBiB3I0NG7cLCMhJmz19a/qazfd9qpk2iukz8B J/ikS77dv5Pec9wa5i02k45w/Em4fuhJ9VPSJZoQXb/OfsEeCGjCskzTh6+xaStzWVcy /aOJMmYpHW7JjWkrVXVZx+KtTIgd2rO0hsMk+D1bFGlGdcXt2TtgWcFCCVek0F7UKfJk WA/oleOdBpAOjzqubUEoaftt7TtT7ofZ5G+VIOAzP0PDDCe+v++Hhxrl1w1N0jn7hVaa 36Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=upgnXJwQ; 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 d16-v6si30220220pfj.251.2018.11.01.02.27.25; Thu, 01 Nov 2018 02:27:40 -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=upgnXJwQ; 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 S1728090AbeKAR6q (ORCPT + 99 others); Thu, 1 Nov 2018 13:58:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33326 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbeKAR6q (ORCPT ); Thu, 1 Nov 2018 13:58:46 -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=3wRT7muTyIV4pFRdJFffwKR8WBv1D/kBcY4kzhUZeC0=; b=upgnXJwQUGiMfYJbAGVnmwE8N myBtVphSaxOhWY7XXiwDXYw/MyWlvw1pcLKmi7DCuvp7FLTE1jpTwgdnUxEYk/r3GWbpPSbc2rXHy Evwfd668DBShD9RiMEmWPypYiRlmVegV/O1UMofoV5Yod7K+LgSmkiX3p0L4Upd7d1ieIDBmnW6Xo 4oITbkdmHBN23XRyc6TEudu4MDq5XKhV4EtFCTBglLNyAjgQnM7YlW/MXZXcx51ChcJXZ//mzy16K eJEh98IrqiHj7Lni8ZqF22FU/iC8F9CXFKCZvLspuqpu/XT5FUJw2JNxeNWJ7cJlYCjEMmWj+uzy4 Rp3DYu1sg==; 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 1gI8mL-0005eO-Fj; Thu, 01 Nov 2018 08:56:37 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DDB0E20296F15; Thu, 1 Nov 2018 09:56:34 +0100 (CET) Date: Thu, 1 Nov 2018 09:56:34 +0100 From: Peter Zijlstra To: Zhenzhong Duan Cc: Linux-Kernel , mingo@redhat.com, konrad.wilk@oracle.com, dwmw@amazon.co.uk, tglx@linutronix.de, Srinivas REDDY Eeda , bp@suse.de, hpa@zytor.com Subject: Re: [PATCH 3/3] kprobes/x86: Simplify indirect-jump check in retpoline Message-ID: <20181101085634.GC3159@hirez.programming.kicks-ass.net> References: <20181030083650.GB1459@hirez.programming.kicks-ass.net> <849ae148-85cd-5f46-d98b-b827cc9c605c@oracle.com> <20181031135320.GC13237@hirez.programming.kicks-ass.net> <20181031140032.GB13257@hirez.programming.kicks-ass.net> <04040fa2-02c6-9aa6-15fe-609ad21b3426@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04040fa2-02c6-9aa6-15fe-609ad21b3426@oracle.com> 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 Thu, Nov 01, 2018 at 10:02:14AM +0800, Zhenzhong Duan wrote: > > Hmm, what about the case where we have RETPOLINE runtime disabled? Then > > the CALL_NOSPEC alternative patches in an indirect call again, and the > > retpolines are gone. > > Is RETPOLINE runtime toggle supported in upstream? I don't see such code. arch/x86/kernel/cpu/bugs.c look for the "nospectre_v2" and related options. That will avoid X86_FEATURE_RETPOLINE from being set, and thus the JMP_NOSPEC and CALL_NOSPEC alternatives will not patch out the indirect jump / call.