Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp595451imd; Thu, 1 Nov 2018 02:22:29 -0700 (PDT) X-Google-Smtp-Source: AJdET5e6sVfsmpZHHWinChk24LnOTFgTpe+ekQV26T1OAANLrFQoI/CrK/Sd3UdikB+e8mv7U7hl X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr6793102plk.16.1541064149000; Thu, 01 Nov 2018 02:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541064148; cv=none; d=google.com; s=arc-20160816; b=a+hI1bRRk31cAwd8CWkKBRTD34X6FOcotU/AKctroOLGakOKTRlUcPr9WNYBLpYjHK gDVLm1K+R6yW/E+NWIPI7CMJVw7h+dsc5Cr/HPQ/NKFSl6FUX8Q6qvysY1acU1CGaFDt 5A6vF+hXzGAT157OJ6h3RvfS/fT9CTvXrMb6KXpolvWlcqnIJO0Xc1tA1Le6KDn3MGgh PUdwBpZ2IRaFKamxNHnVtA6ADk2jBVpmEPlHmGg7luhxtXTvqj09grqbMl9oGtJ/ADHc 6tuE+8dNQOwZ3gYnFlWr9X01md2mBy23Kv5wnn5KPTyhKcluYSXad8ZNnRaJEXU4VNyS DGyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:organization:from :references:cc:to:subject:reply-to:dkim-signature; bh=BQ5bbWAJUg9OP8QS/G1xDanJnHdf2z7/k5qcfrgmYnk=; b=jlk5yfNHktI/rr5HELOtVME0OIdJT7HOm8V5urD29T6K8vY780tYGzbOAkRpSahSxw ooD/aW+6BcCYgx3grrTv79LYvF3XnCDWmG6BXJcLW39yZlSdi9F3+Pwfwjof8OS0XPd3 F6PGMMITNeksz5VXFdqpQMwzYUnZC3HSjl4xMGIh9t7oYcuHJ/IKI3NRkxw2QBRi/Del e14TGjdG0stxJtGz15OVCAtMU65CVA92FDBdQwd3ItpFK3t9D1bqY48cPnHLEtMPOGyk +32qM/lbaFIkJFdZ89atX9bivRCn2Npn0gcb0XADCDYf04ujUtrTHnTUACmy0QoawGQD 1fRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ezpg2826; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31-v6si1018774plz.181.2018.11.01.02.22.12; Thu, 01 Nov 2018 02:22:28 -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=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ezpg2826; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727866AbeKASXm (ORCPT + 99 others); Thu, 1 Nov 2018 14:23:42 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57614 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726712AbeKASXm (ORCPT ); Thu, 1 Nov 2018 14:23:42 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wA19JQZF178912; Thu, 1 Nov 2018 09:21:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=reply-to : subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=BQ5bbWAJUg9OP8QS/G1xDanJnHdf2z7/k5qcfrgmYnk=; b=ezpg2826XS+sfnm0c9j3Vg2NBcP+dN7eeTZqRnQrN3CoDBO95OYXwZ8WUj4k14sYuMMy EX7InF1Qj8K5UXFy0G3hp+9qWWIKBoBjdhR+XroR4t05vIqqWDO9e2+t38C88K5Lmo/H nWNCPDo3XIHIpn5S/J2S4R4e3XPpHF2h7cHi06L85dASTuNJDpwZ895wLIVPRQFZQA5d U7kCuRh580/CMlqTLVlFT884534vYaPc/FvOkRiWAP6cbFlAbZ/CsZT6kgobdB/uJkVb 3AfNxymrgPxCTjVytikqvaOE/LahA9SexLxDDolDCsUKtS6fsiM3I58S1zK4AI/XRQJr mw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2ncgnr7rve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 09:21:02 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wA19Ku1g029918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 09:20:56 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA19KtlH015878; Thu, 1 Nov 2018 09:20:55 GMT Received: from [10.191.24.24] (/10.191.24.24) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Nov 2018 02:20:55 -0700 Reply-To: zhenzhong.duan@oracle.com Subject: Re: [PATCH 3/3] kprobes/x86: Simplify indirect-jump check in retpoline To: Peter Zijlstra 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 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> <20181101085634.GC3159@hirez.programming.kicks-ass.net> From: Zhenzhong Duan Organization: Oracle Message-ID: Date: Thu, 1 Nov 2018 17:21:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181101085634.GC3159@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9063 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=655 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010082 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/11/1 16:56, Peter Zijlstra wrote: > 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. > Yes, in this case there are also indirect branches. I'll drop 3rd patch in v2. Thanks Zhenzhong