Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3226146imu; Mon, 28 Jan 2019 00:43:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7yyXlnclK42aHgVpKGlo4aBz8SczfNUxKFIPX39ACTCRrw3llTX5UT6euNx/4yMhcfbV1N X-Received: by 2002:a17:902:1126:: with SMTP id d35mr19693330pla.1.1548665017816; Mon, 28 Jan 2019 00:43:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548665017; cv=none; d=google.com; s=arc-20160816; b=CrHi0byIhIwt2e2Dhq65t+xLKtZUC21ReN89Lt/w5XAMbeFQkhqzmb+J5/Xxw97ihb MXiAU+nMoCFOs4FNbYLsjBrz+Qb+tJ6TbkSLkViVbqis1/nCKMYYdlDnslZcrxJTnsDJ 1xy0AQJMm1Jex+PpsRuPFtpItcNujYz2+kQg3eIJ9b70Ngj4c6YF3MbWtmml487b7gPL eKBJEsh4ZloPOQLlMdlg0QlMCpaU+C+lsqLRdM+2phctx47xc3m8olNYuNwmUfefkLXb 4LlOPYYrtNuS3E4V/R3KFZOm1MjjU5tnz7Yd83RQCmw3++B6GqUy1QhpBTggUHbUqPSD KQuA== 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=jGyKWhEIcdqSmY/XpVC3JxpBMGgFQLDY82WtcM7NvCY=; b=WcAXgvd/0xU7y6u9trnIjJWj/TbUknXM/YH+F4ZsrAhP5EoWiWozcjUz/JS8YlZZwh niweAKlxR10sEY4g0N1P59UowU7TIUm5UzcAeGW2z3BwyakIwxdEqZYrc9ujk+kdoDzp HL+i7yfhNSDvqGrgWY/muLlwN400dhdQX6ON/htQgMKTI88L+EuSVZPFHgpZHa3yH8UJ K9TrWHBMcJqPuwsnactBjZoKqSerXv6XDN5W5nEf1bZSOWEhVloVhJa3ZN7uGNePdhg+ XYj/U1iffgC/TGI8lMYnUHPvAQoumnsMIGiUKKr7go3Els+lIrakaqDelX757Tv9YuFz /8ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ttffg+nD; 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 r11si29572750pli.175.2019.01.28.00.43.21; Mon, 28 Jan 2019 00:43:37 -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=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ttffg+nD; 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 S1726851AbfA1Il1 (ORCPT + 99 others); Mon, 28 Jan 2019 03:41:27 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:51800 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfA1Il1 (ORCPT ); Mon, 28 Jan 2019 03:41:27 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0S8cq6F031540; Mon, 28 Jan 2019 08:41:06 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=jGyKWhEIcdqSmY/XpVC3JxpBMGgFQLDY82WtcM7NvCY=; b=ttffg+nDEYncqKExs2sFaW+YPjHWO6Vci2CZcwpFBK4D355eP5iwjVzk97zWU1x/f1gQ Y0sEqnCbHnOu4hmx9r2xKmOZymfL3CACdIljuvr4J2/SAVxgYHmV7jkStvNz7ZxYLTSr 4mHtxrQQ6AUZBO/JtNIrTvhR7/Ysn82thymhp/dtZo06wgOfH7kmnX9iRT5ArQE7MFR+ PfEbSQ9oV+SnRZS7To0kP5vqR4IhCeA0Ep7kZgBcorP9HAUD8iTt4AWS7Uw7kZ/kyjt3 tfI79cBxpcqNnZ9pBW42IZOL5FlOp1QPlTmsuD9K+7jthMUkA1/nAfQ8Malk14ugIlEt iA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2q8d2dvukn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jan 2019 08:41:06 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x0S8f6GX030294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jan 2019 08:41:06 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x0S8f50s002609; Mon, 28 Jan 2019 08:41:06 GMT Received: from [192.168.0.118] (/171.117.190.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 Jan 2019 00:41:05 -0800 Reply-To: zhenzhong.duan@oracle.com Subject: Re: [PATCH] x86/speculation: Update TIF_SPEC_IB before ibpb barrier To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, konrad.wilk@oracle.com, x86@kernel.org, srinivas.eeda@oracle.com, bp@suse.de, tim.c.chen@linux.intel.com, peterz@infradead.org, hpa@zytor.com References: <48a105d3-fa32-40e4-9775-37d49f42eac0@default> <0aa09e77-1454-9eaf-ef67-b00518e6f2d2@oracle.com> From: Zhenzhong Duan Organization: Oracle Message-ID: <26c4fb45-eaa1-9520-bd35-1cf8ca673e30@oracle.com> Date: Mon, 28 Jan 2019 16:42:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9149 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=324 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901280072 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/1/28 16:36, Thomas Gleixner wrote: > On Mon, 28 Jan 2019, Zhenzhong Duan wrote: >> On 2019/1/26 2:03, Thomas Gleixner wrote: >>> Bah, nonsense. Brain was clearly still out for lunch and I confused IBPB >>> and STIBP for a moment. cond_ibpb() is the thing issues in switch_mm() and >>> that is not leaving a stale MSR around because we only write to it when we >>> need the barrier. The bit is not stale because the barrier is only issued >>> with the write. The bit has not to be cleared. >>> >>> So the only 'issue' what happens is that switch_to() either issues a >>> barrier too much or misses one. That's really not a problem. >> >> Ok, yes, the purpose of this patch is to avoid the one missed barrier. > > And that missed barrier is not worth it to do extra work in switch_to/mm > simply because it's a one off event and there is no way to exploit that > reliably. Got it. Thanks Zhenzhong