Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1088164imm; Tue, 2 Oct 2018 02:28:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV62nPjEMZNj3btfQEs4F/iiT4e1LNBkBoiwg/o4VqMqUFZhXRIRR26vA8yWQlPkTZZRJ1naH X-Received: by 2002:a17:902:8609:: with SMTP id f9-v6mr4561734plo.134.1538472513224; Tue, 02 Oct 2018 02:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538472513; cv=none; d=google.com; s=arc-20160816; b=dC3RVzct/sChycyQTeE1yt+7L3qhfDfr+cgWR0L+oQTit+ibZM3nK7UpQgC8jVBbbo 71rfXLh2AFG31Rgpf23OXrAoioGK3GvlgNA6GnSUo69E21cz8FhcAu/671h3OsAK9wb1 LMHmpoiQPq3AVk+Cr/SGJiPxcC0qVjmdKCv0VTdaLfr3mBY6+T02yfwacTJPjD6qWwuM NK2Ss3RvFtvfN7Cc2wWYij5FSJ04l1RbjzBUXkpw74Wr9nrzHEFntdYEXXxGyC0b07ZI Y230igAhImOdGWfmkvvMHR2/5vHd9d+NjYnWwBoFMZ6tcmzHPQKAd3snI/fR1d1151Sx kjjQ== 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=TfDKgO3ROfWKGzMNjfSakIrhWQA4hezrsgdse7Glczc=; b=d1SrCSrE7ZZGXN+8+7KoFTigFotzxQmoZ72yrvYdSCuulUqUmhbu6l5bcV/fNI8abL QMEQxmEi2dDoGAX/ty7zLbBgdl6yjsCIcx83bcD0cMCZxq0CQE7LhbYGQEoVsnUVVcl3 fhCiFsk8rT+U3DEIK+FNlP7I+SYYEFcHWrmJe3v3Z/6FPdd4ccWy9m7l0mIcycEsapCE JehfSCIm4QrytzrJAFPlVUrPN4xckxe7/m/XlHjWuzV6loEzC5Cb5I1PJk8ymhLkA6vz P7jY/629Qmh0lvvJQyBikxpH/v7v2DAEJhsrvVaEkJt7gVCr6xEHIUnt4W8HBuuPWY9K Xbzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Qs9BaT1t; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si15092192pld.424.2018.10.02.02.28.18; Tue, 02 Oct 2018 02:28:33 -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=@gmail.com header.s=20161025 header.b=Qs9BaT1t; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbeJBQJz (ORCPT + 99 others); Tue, 2 Oct 2018 12:09:55 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40110 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726407AbeJBQJy (ORCPT ); Tue, 2 Oct 2018 12:09:54 -0400 Received: by mail-wm1-f66.google.com with SMTP id z204-v6so613453wmc.5 for ; Tue, 02 Oct 2018 02:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TfDKgO3ROfWKGzMNjfSakIrhWQA4hezrsgdse7Glczc=; b=Qs9BaT1tAMetpqGbB4msfvk64+jHZJrxziVW8k0S/mVyWWEZHZ/LeUexaE8p1f48DU NSJN96VNZ3mpD/3Q5LjA2S6u5Woa9IF1SFCl1TRBKrAJteISvQSMyvwdpVAQYwpdCTTx XdkLQ3KhkAENptU8Kf3Hoi+piOW39e3rc0SLznCbY4zXZYl09Sg9zm/QOM1xt76n1twB RRTlGp5DPVNtYD03CwYUYaGm7T23u9qnCJpptRmtzHjpFgLxuOQcT5oZ2+iot4cTDj0q Y5TWy5/ay47kvdWJtJEzyAACqmDnB5Bk6/EYehNQNqte0WC8+CC+hI0aFfaarnZr13rj vxCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=TfDKgO3ROfWKGzMNjfSakIrhWQA4hezrsgdse7Glczc=; b=MNXUTIKVgEzkWL70qN0GP7eceRyEqThAN5K70YgCiuiEkp4vA+cBE6tsgx09D8Ag/2 xgL89m9eFJegkqBIUyltaoh+NXXEfnfNKqPoBOakqeA/jouaNUUnCPO/GD8VzA+xwTTW mMvKrqhwSBW1smkc/ZqYVtxKh6TQRdkg6a/Te7rmBKzSgcIizu1RnDpTTHlcl2DZJ2b6 +XWMbNbyz2iG8E+VhxC0JdUlLhjGyH+x7EaTRyKQBoE1sRzzc9Fx1VLXr7Lr/39sDy+v xpvk5eYMABfGIAT5g4xRBvkPIt6DD7UXjHHQ4Ts+tO/ukxPFUtdetY9cNxB1iRp+p09J sicw== X-Gm-Message-State: ABuFfoj6EIN0hg8zlB2hTwgSaTkL6P/ZNB8cxuW61yxYL6ROW95IUzCz iHI2hK5xvvHkxjHgqMBiRes= X-Received: by 2002:a1c:ac07:: with SMTP id v7-v6mr1184478wme.110.1538472454766; Tue, 02 Oct 2018 02:27:34 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id y184-v6sm11201974wmg.17.2018.10.02.02.27.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 02:27:34 -0700 (PDT) Date: Tue, 2 Oct 2018 11:27:31 +0200 From: Ingo Molnar To: Tim Chen Cc: Jiri Kosina , Thomas Gleixner , Thomas Lendacky , Ingo Molnar , Peter Zijlstra , Josh Poimboeuf , Andrea Arcangeli , David Woodhouse , Andi Kleen , Dave Hansen , Casey Schaufler , Asit Mallick , Arjan van de Ven , Jon Masters , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [Patch v2 3/4] x86/speculation: Extend per process STIBP to AMD cpus. Message-ID: <20181002092731.GB122128@gmail.com> References: <705b51cba5b5e7805aeb08af7f7d21e6ec897a17.1537920575.git.tim.c.chen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <705b51cba5b5e7805aeb08af7f7d21e6ec897a17.1537920575.git.tim.c.chen@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tim Chen wrote: > From: Thomas Lendacky > > We extend the app to app spectre v2 mitigation using STIBP > to the AMD cpus. We need to take care of special s/to the AMD cpus /to AMD CPUs > cases for AMD cpu's update of SPEC_CTRL MSR to avoid double > writing of MSRs from update to SSBD and STIBP. s/AMD cpu /AMD CPU > > Originally-by: Thomas Lendacky > Signed-off-by: Tim Chen > --- > arch/x86/kernel/process.c | 48 +++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 38 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > index cb24014..4a3a672 100644 > --- a/arch/x86/kernel/process.c > +++ b/arch/x86/kernel/process.c > @@ -399,6 +399,10 @@ static __always_inline void set_spec_ctrl_state(unsigned long tifn) > { > u64 msr = x86_spec_ctrl_base; > > + /* > + * AMD cpu may have used a different method to update SSBD, so > + * we need to be sure we are using the SPEC_CTRL MSR for SSBD. s/AMD cpu may have used a different method to update SSBD /AMD CPUs may use a different method to update the SSBD Thanks, Ingo