Received: by 10.223.164.221 with SMTP id h29csp3778573wrb; Tue, 31 Oct 2017 04:51:08 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RmBPL+x8xSiyvYLmzglz7hgdSTLODdIKc4cUb7cXxiK72YXgR5bP0LBRUoxi8S/M8J11AG X-Received: by 10.98.181.3 with SMTP id y3mr1794976pfe.264.1509450668584; Tue, 31 Oct 2017 04:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509450668; cv=none; d=google.com; s=arc-20160816; b=zN9yv02Ony0zi6+auUYno7FGMcCucJVEF3Xix9L8HgdPOV6sLHMvbB0ZkYR87PkPrd zkqNCjV3wPapE8AVYT6SOTLR45FeMM+oV0ZKEcII5AThhk/+bPJ4OokyBixGNspmxNi5 X4E9Jx/xlyt3buy6NSRnM471jY+OeOxtWBHBg4OhGnnlYkj1w4pnHrG5SYKN8XSLSRKw 7dSkKfI5PgZdRVryNypeTkQt+Tg2yIZT2KfvborqaZPlGff6gp0j7n5jDpd6kCly9QCN l72YT49kt6f1UR50AYAR64Qau518dtnkz7k6eieDi7GpLMTEn0ayf7qlBpzJr75sc6pX ciAw== 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=dN0OGPxpH0rI16iE0mjI0oJ0/k14tQMseXPq+lzlVx0=; b=rTior03a0KInifuMwpBUoxozo7y7uV0li+byOmRm5qHb4EFUzszdIc7kjRfXSNyJWs XDgfpSgxc9VLVOyuOfQFNAo4ZtcM2Gn2WY8oZ2wCLFQYVBLok+Dtp1HoNBjvxGDfKQcY +MHw6WHCYuc3JklED3PHwZ+5Bd97okxKINIFcax6kP+ptest/jKe5QUwGXZEJLSqjvzW 1Z1Z1lD9ZyX4SffEnKVFNS1MtAlSX2amQKW0Jz+/UR9WVNmIMNJR/9GohJ6qoGU391CW zXgXjaxa1wQAUQ/sW0kby5ejce1onmNcXuYVdTNxmpFEUuai8kSbonOy0vjS1DhKRXNF 6iuQ== 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 n73si1459251pfb.254.2017.10.31.04.50.55; Tue, 31 Oct 2017 04:51:08 -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; 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 S932456AbdJaLte (ORCPT + 99 others); Tue, 31 Oct 2017 07:49:34 -0400 Received: from mga02.intel.com ([134.134.136.20]:30523 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932374AbdJaLt3 (ORCPT ); Tue, 31 Oct 2017 07:49:29 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2017 04:49:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,323,1505804400"; d="scan'208";a="915804380" Received: from vmm.bj.intel.com ([10.238.135.172]) by FMSMGA003.fm.intel.com with ESMTP; 31 Oct 2017 04:49:22 -0700 From: Luwei Kang To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Luwei Kang Subject: [patch v2 8/8] KVM: x86: Disable intercept for Intel processor trace MSRs Date: Tue, 31 Oct 2017 06:05:17 +0800 Message-Id: <1509401117-15521-9-git-send-email-luwei.kang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509401117-15521-1-git-send-email-luwei.kang@intel.com> References: <1509401117-15521-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 From: Chao Peng Pass through Intel processor trace to guest directly. Signed-off-by: Chao Peng Signed-off-by: Luwei Kang --- arch/x86/kvm/vmx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 8f61a8d..01447e2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -7029,6 +7029,19 @@ static __init int hardware_setup(void) !cpu_has_vmx_intel_pt() || !cpu_has_vmx_pt_use_gpa()) pt_mode = PT_MODE_SYSTEM; + if (pt_mode == PT_MODE_HOST_GUEST) { + u32 i, eax, ebx, ecx, edx; + + cpuid_count(0x14, 1, &eax, &ebx, &ecx, &edx); + vmx_disable_intercept_for_msr(MSR_IA32_RTIT_STATUS, false); + vmx_disable_intercept_for_msr(MSR_IA32_RTIT_OUTPUT_BASE, false); + vmx_disable_intercept_for_msr(MSR_IA32_RTIT_OUTPUT_MASK, false); + vmx_disable_intercept_for_msr(MSR_IA32_RTIT_CR3_MATCH, false); + for (i = 0; i < (eax & 0x7); i++) + vmx_disable_intercept_for_msr(MSR_IA32_RTIT_ADDR0_A + i, + false); + } + return alloc_kvm_area(); out: -- 1.8.3.1 From 1583994417897827879@xxx Mon Nov 13 23:13:13 +0000 2017 X-GM-THRID: 1583994417897827879 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread