Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3718imu; Wed, 2 Jan 2019 12:48:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN4dgND2umKMzUGCXb/eq88P85pqi4GyzXzG7FsbUm0qMlm+rnxoZjaU/A/KsbWX/jJcFUS+ X-Received: by 2002:a17:902:32c3:: with SMTP id z61mr44581957plb.114.1546462108715; Wed, 02 Jan 2019 12:48:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546462108; cv=none; d=google.com; s=arc-20160816; b=X1WO52+ZDei6iRXqsc+LkiZn/2ssUQ07+KiRSpT0owL+JOW9xHUlNqH5yc5gc7QiqO /cvij1huRjQDNAVjXReQwBQ+nhwflJWqhv5JW8ubbRzJx21kMo+BLjb88BozEDyxhiKt a427hr+nj2XecKE+eUTSkryDul4GVSEnLzYR7pTU23SqDuO+KeOuL7OuhGkQUC+drlEA /kvwd5zqfJq5VCqZdIzkRFWYh+dEMLTJ3lCqFHDZ7ZDZ/ofJ/vw9nXQhBzSCwaluVRBP fiivw8hcYAMCdq7CndNK/fAB1ppktGro1cLK6j3FsT2U0V1i2kD6depeJkgnGkrfjrKj rPZQ== 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; bh=gwcsyyumWCjs3Z1zcIH11CrZcYPz2SeV2hq4Nn7keDA=; b=TflUeBhDNFIm93WELtRs/QI06nBjSB59cbifQZikouX8/ZhPiRYEYfr6WiZzBJByUv hnU2gYOsOEAYBIf3Ko610Gt/4ztlrQtJftR+StW5NLKAKibGvWi8zXPFfim5FI+l9tmx HIVpsIr2BiK2Eo+pR+q7rxUFwZCWZ8FyriidWWDlbQcnmCEMpbrMfLOWKSzc88ujB5DG kDLfW0gjZOi8xuMwEhPwmn4kjE95qyA4BjqfvtP1pmSdtRHQKK8Ni5MaZ2dWuovQX9lJ BAQAjEDWOksRv2GBrnAkHWEml8zT4hARgKn+eZuOXNWBWy1jIPyBcTecFr/z6V76EOd2 qJRQ== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d40si836277pla.427.2019.01.02.12.47.57; Wed, 02 Jan 2019 12:48:28 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727870AbfABSSo (ORCPT + 99 others); Wed, 2 Jan 2019 13:18:44 -0500 Received: from mga12.intel.com ([192.55.52.136]:36405 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727196AbfABSSo (ORCPT ); Wed, 2 Jan 2019 13:18:44 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2019 10:18:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,431,1539673200"; d="scan'208";a="103432162" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.154]) by orsmga007.jf.intel.com with ESMTP; 02 Jan 2019 10:18:43 -0800 Date: Wed, 2 Jan 2019 10:18:43 -0800 From: Sean Christopherson To: Yang Weijiang Cc: pbonzini@redhat.com, rkrcmar@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, mst@redhat.com, yu-cheng.yu@intel.com, yi.z.zhang@intel.com, hjl.tools@gmail.com, Zhang Yi Z Subject: Re: [PATCH v1 4/8] kvm:vmx Pass through host CET related MSRs to Guest. Message-ID: <20190102181843.GB7460@linux.intel.com> References: <20181226081532.30698-1-weijiang.yang@intel.com> <20181226081532.30698-5-weijiang.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181226081532.30698-5-weijiang.yang@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 26, 2018 at 04:15:28PM +0800, Yang Weijiang wrote: > During Guest OS execution, it accesses these MSRs to > configure CET runtime settings. The changelog needs to explain why it's ok to expose these MSRS to the guest, e.g. call out which are saved/loaded through the VMCS and which are saved/loaded via XSAVES/XRSTORS. And maybe expand "runtime settings" to elaborate on when most guest kernels will access the MSRs, i.e. to justify exposing them to the guest. It should also clarify why IA32_PL1_SSP and IA32_PL2_SSP are NOT exposed to the guest. > > Signed-off-by: Zhang Yi Z > Signed-off-by: Yang Weijiang > --- > arch/x86/kvm/vmx.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 25fa6bd2fb95..fa2db6248404 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -11550,6 +11550,13 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) > vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_SYSENTER_CS, MSR_TYPE_RW); > vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_SYSENTER_ESP, MSR_TYPE_RW); > vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_SYSENTER_EIP, MSR_TYPE_RW); > + > + vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_U_CET, MSR_TYPE_RW); > + vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_S_CET, MSR_TYPE_RW); > + vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_INT_SSP_TAB, MSR_TYPE_RW); > + vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_PL0_SSP, MSR_TYPE_RW); > + vmx_disable_intercept_for_msr(msr_bitmap, MSR_IA32_PL3_SSP, MSR_TYPE_RW); > + > vmx->msr_bitmap_mode = 0; > > vmx->loaded_vmcs = &vmx->vmcs01; > -- > 2.17.1 >