Received: by 10.223.164.202 with SMTP id h10csp2849563wrb; Tue, 28 Nov 2017 02:17:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMaXfWt0wy4cMB/HU/N6ZBbdi9Gt8b9jR095h1RO5243LHG53l1GSyUKAKJo/n5pxkm+c/aB X-Received: by 10.159.241.1 with SMTP id q1mr42560073plr.383.1511864265389; Tue, 28 Nov 2017 02:17:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511864265; cv=none; d=google.com; s=arc-20160816; b=TjXg6EfgWc+fTBFmyOXR1MJfurMOp3VnlSNmZt8tYKjMMOQx8ke820BxVEJqNLGo/d mgtB9II9KLm/1ZKui2UxRtPtlsDuqhjtmrM3lckSeHNwycPsB19eVIT/5Txo/ccNrfip i4gWWKvMEbiFeubbW3IbPYNJ/37UyDcAcShaEa2m99DTY+ZQryuqUDs9/a+SngjcfR46 rW6RAoMmO7UyQBc4sPay2RcYlz6g4rW8cixrBvt8TQEwj97ouNKqfmi5msksViPtAIVb 07kIUYA2XR0xm0UJjtMDriFItr27UZlYKknu4Qn5trsLUzLwriOyP/RwmuS0bsFzoTN0 aDhQ== 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:arc-authentication-results; bh=Q9fLF/7EH7ICtfRoGvuhsD1XqjY1gnVqr/ogWwy6ncw=; b=M7svWHRPHkAMtnV72CZruO/kwOvP2n6hqgogJpHs0LRoDwncSg6UVP9OTQRRHHgjoG NZQveu17kiOZLj0GA5ZU9iqwJyk7ZEqnvOHqz/KBuHBVMj0rkpf/44/QmJmUC0GqDCxI wYlRu3KiAkInC6PlqF+DtU6sUYJ428KEo2sdT0IRKeQo+r+bz+cIv1Jx64ssPKMBwpVe 9t+p2H7rWueWT0PXTU57kj4Ok/iYFMTEgAPUHuSw8Q2+QfqwLQ1R4kAEG3THh9OUO8Om xL9/QRPPfWdrwg/K93v95zYGHbTWBEFGxImUekHpn/JbBiH2UPHzTKxthJ/BVWTMqUW1 6q2Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si25222618plx.791.2017.11.28.02.17.33; Tue, 28 Nov 2017 02:17:45 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbdK1KJp (ORCPT + 78 others); Tue, 28 Nov 2017 05:09:45 -0500 Received: from mga01.intel.com ([192.55.52.88]:59069 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752550AbdK1KJk (ORCPT ); Tue, 28 Nov 2017 05:09:40 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 02:09:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,467,1505804400"; d="scan'208";a="7939994" Received: from vmm.bj.intel.com ([10.238.135.172]) by fmsmga001.fm.intel.com with ESMTP; 28 Nov 2017 02:09:38 -0800 From: Luwei Kang To: kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, pbonzini@redhat.com, rkrcmar@redhat.com, linux-kernel@vger.kernel.org, joro@8bytes.org, Luwei Kang Subject: [PATCH v3 8/9] KVM: x86: Disable Intel Processor Trace when VMXON in L1 guest Date: Tue, 28 Nov 2017 04:24:01 +0800 Message-Id: <1511814242-12949-9-git-send-email-luwei.kang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511814242-12949-1-git-send-email-luwei.kang@intel.com> References: <1511814242-12949-1-git-send-email-luwei.kang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, Intel Processor Trace do not support tracing in L1 guest VMX operation(IA32_VMX_MISC[bit 14] is 0). As mentioned in SDM, on these type of processors, execution of the VMXON instruction will clears IA32_RTIT_CTL.TraceEn and any attempt to write IA32_RTIT_CTL causes a general-protection xception (#GP). Signed-off-by: Luwei Kang --- arch/x86/kvm/vmx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e002a44..b4ad8fc 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -7573,6 +7573,12 @@ static int handle_vmon(struct kvm_vcpu *vcpu) if (ret) return ret; + if (pt_mode == PT_MODE_HOST_GUEST) { + vmx->pt_desc.guest.ctl &= ~RTIT_CTL_TRACEEN; + pt_disable_intercept_for_msr(FALSE); + vmcs_write64(GUEST_IA32_RTIT_CTL, vmx->pt_desc.guest.ctl); + } + nested_vmx_succeed(vcpu); return kvm_skip_emulated_instruction(vcpu); } -- 1.8.3.1 From 1585327609885795656@xxx Tue Nov 28 16:23:44 +0000 2017 X-GM-THRID: 1584803484086682204 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread