From patchwork Mon Jun 21 09:31:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanmin Zhang X-Patchwork-Id: 107158 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5L9VwN8026660 for ; Mon, 21 Jun 2010 09:32:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932135Ab0FUJbj (ORCPT ); Mon, 21 Jun 2010 05:31:39 -0400 Received: from mga11.intel.com ([192.55.52.93]:9000 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088Ab0FUJbf (ORCPT ); Mon, 21 Jun 2010 05:31:35 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 21 Jun 2010 02:31:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,452,1272870000"; d="scan'208";a="809869421" Received: from ymzhang.sh.intel.com (HELO [10.239.13.128]) ([10.239.13.128]) by fmsmga001.fm.intel.com with ESMTP; 21 Jun 2010 02:31:29 -0700 Subject: [PATCH V2 5/5] ara virt interface of perf to support kvm guest os statistics collection in guest os From: "Zhang, Yanmin" To: LKML , kvm@vger.kernel.org, Avi Kivity Cc: Ingo Molnar , Fr??d??ric Weisbecker , Arnaldo Carvalho de Melo , Cyrill Gorcunov , Lin Ming , Sheng Yang , Marcelo Tosatti , oerg Roedel , Jes Sorensen , Gleb Natapov , Zachary Amsden , zhiteng.huang@intel.com, tim.c.chen@intel.com Date: Mon, 21 Jun 2010 17:31:49 +0800 Message-Id: <1277112709.2096.513.camel@ymzhang.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 (2.28.0-2.fc12) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 09:32:14 +0000 (UTC) diff -Nraup qemu-kvm_0621/kvm/include/linux/kvm.h qemu-kvm_0621_perf/kvm/include/linux/kvm.h --- qemu-kvm_0621/kvm/include/linux/kvm.h 2010-06-21 11:00:28.000000000 +0800 +++ qemu-kvm_0621_perf/kvm/include/linux/kvm.h 2010-06-21 13:23:51.537999849 +0800 @@ -530,6 +530,7 @@ struct kvm_enable_cap { #ifdef __KVM_HAVE_XCRS #define KVM_CAP_XCRS 56 #endif +#define KVM_CAP_PV_PERF 57 #ifdef KVM_CAP_IRQ_ROUTING diff -Nraup qemu-kvm_0621/kvm/include/x86/asm/kvm_para.h qemu-kvm_0621_perf/kvm/include/x86/asm/kvm_para.h --- qemu-kvm_0621/kvm/include/x86/asm/kvm_para.h 2010-06-21 11:00:28.000000000 +0800 +++ qemu-kvm_0621_perf/kvm/include/x86/asm/kvm_para.h 2010-06-21 13:27:04.375999849 +0800 @@ -15,6 +15,7 @@ #define KVM_FEATURE_CLOCKSOURCE 0 #define KVM_FEATURE_NOP_IO_DELAY 1 #define KVM_FEATURE_MMU_OP 2 +#define KVM_FEATURE_PV_PERF 4 #define MSR_KVM_WALL_CLOCK 0x11 #define MSR_KVM_SYSTEM_TIME 0x12 diff -Nraup qemu-kvm_0621/target-i386/kvm.c qemu-kvm_0621_perf/target-i386/kvm.c --- qemu-kvm_0621/target-i386/kvm.c 2010-06-21 11:00:29.000000000 +0800 +++ qemu-kvm_0621_perf/target-i386/kvm.c 2010-06-21 13:00:14.136999850 +0800 @@ -150,6 +150,9 @@ struct kvm_para_features { #ifdef KVM_CAP_PV_MMU { KVM_CAP_PV_MMU, KVM_FEATURE_MMU_OP }, #endif +#ifdef KVM_CAP_PV_PERF + { KVM_CAP_PV_PERF, KVM_FEATURE_PV_PERF }, +#endif { -1, -1 } };