From patchwork Wed Dec 9 09:11:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 65929 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB99BeLZ029255 for ; Wed, 9 Dec 2009 09:11:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511AbZLIJLb (ORCPT ); Wed, 9 Dec 2009 04:11:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752134AbZLIJLb (ORCPT ); Wed, 9 Dec 2009 04:11:31 -0500 Received: from mga01.intel.com ([192.55.52.88]:3905 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752457AbZLIJLa (ORCPT ); Wed, 9 Dec 2009 04:11:30 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 09 Dec 2009 01:05:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,365,1257148800"; d="scan'208";a="521174874" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.76]) by fmsmga002.fm.intel.com with ESMTP; 09 Dec 2009 01:11:27 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1NIIa4-00067i-3A; Wed, 09 Dec 2009 17:11:32 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH] KVM: VMX: Add instruction rdtscp support for guest Date: Wed, 9 Dec 2009 17:11:24 +0800 Message-Id: <1260349884-23512-1-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.6.3.3 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 2b49454..8c39320 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h @@ -53,6 +53,7 @@ */ #define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001 #define SECONDARY_EXEC_ENABLE_EPT 0x00000002 +#define SECONDARY_EXEC_RDTSCP 0x00000008 #define SECONDARY_EXEC_ENABLE_VPID 0x00000020 #define SECONDARY_EXEC_WBINVD_EXITING 0x00000040 #define SECONDARY_EXEC_UNRESTRICTED_GUEST 0x00000080 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9a0a2cf..e1a2ed2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1243,7 +1243,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) SECONDARY_EXEC_ENABLE_VPID | SECONDARY_EXEC_ENABLE_EPT | SECONDARY_EXEC_UNRESTRICTED_GUEST | - SECONDARY_EXEC_PAUSE_LOOP_EXITING; + SECONDARY_EXEC_PAUSE_LOOP_EXITING | + SECONDARY_EXEC_RDTSCP; if (adjust_vmx_controls(min2, opt2, MSR_IA32_VMX_PROCBASED_CTLS2, &_cpu_based_2nd_exec_control) < 0)