Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5321925imu; Wed, 26 Dec 2018 00:14:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Y55fezvrTw+ZAzRUjCI2xB8yXjRM2R+E+CT7FKtoVcHpPn1cFrnO+nvM+zpbyytnjSbZt X-Received: by 2002:a17:902:b592:: with SMTP id a18mr13510241pls.293.1545812065195; Wed, 26 Dec 2018 00:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545812065; cv=none; d=google.com; s=arc-20160816; b=webuPEZr6FZb5M7urj2XYbgcLZvhICcy5csvjgAnBJKupNLNFacAhhsO4Nfo9FAUan b757GI9vjppmIiy/iaXfgsjFyvOFw0VsuTV5xjvDnUhu1aICPYgkhAQmfFNbl16xv4CU gxiZ8pNAnyLfaU06leKBtPrUfl6/3PfYtjbFvl7EQvdM917jWrLw0pGO2yTKO5ATt6Xz 7ezPymYn4iUIGuervRgyfMxYByqPLAkedINptkchuaN1ah+Ljc33JnjZjG24+iagvlzz ktJknGcDcWeBLu2IX+t6uvQtQc721aGHh28GPLdL7SezDLKvhB56qYdhWeyBnL2LVNm9 CBbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=GL0H4X8BrwrQi88YjRnXur2KjLgv4FtmRYdukRHWv7s=; b=iyoceoJSXDVI+F423sC30o+QegpO+KISHfpT88c2j9jBloc0VlmP+5MtPik5bUfG2G d4JcC/rSndHAIX2INdjQzSXm+426NEH0HdedvdOiC54bpsvjRP9jwp39bFKC0PoYgsNj VX1XxhBkqVlSMtVoah7VIJRDNeadq0dWqO/MaKr+Esk3FKSb1Kc/E9aMGdfvNaCNylS6 pXj1UrLghajC3QgvzM44l9PCOxo2LnaZhMshrBihGXSYGD//1a/weDBR2PSFzWr3LmWT zrnmQ3GlVQTVeTRKs4iT90LKAb9LxXRPu2o3rl3APn1EUQ/T6ucFn9CyYvrUy+xQcldT lDsA== 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 q26si30517939pgk.162.2018.12.26.00.13.56; Wed, 26 Dec 2018 00:14:25 -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 S1726528AbeLZIMs (ORCPT + 99 others); Wed, 26 Dec 2018 03:12:48 -0500 Received: from mga11.intel.com ([192.55.52.93]:64132 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726129AbeLZIMp (ORCPT ); Wed, 26 Dec 2018 03:12:45 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Dec 2018 00:12:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,400,1539673200"; d="scan'208";a="104759680" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.13.104]) by orsmga008.jf.intel.com with ESMTP; 26 Dec 2018 00:12:43 -0800 From: Yang Weijiang To: 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 Cc: Yang Weijiang , Zhang Yi Z Subject: [PATCH v1 4/8] kvm:vmx Pass through host CET related MSRs to Guest. Date: Wed, 26 Dec 2018 16:15:28 +0800 Message-Id: <20181226081532.30698-5-weijiang.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181226081532.30698-1-weijiang.yang@intel.com> References: <20181226081532.30698-1-weijiang.yang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During Guest OS execution, it accesses these MSRs to configure CET runtime settings. 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