From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756691Ab2IDDxl (ORCPT ); Mon, 3 Sep 2012 23:53:41 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:42137 "EHLO e28smtp05.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756639Ab2IDDxj (ORCPT ); Mon, 3 Sep 2012 23:53:39 -0400 Message-ID: <50457B34.6040107@linux.vnet.ibm.com> Date: Tue, 04 Sep 2012 11:53:24 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Avi Kivity CC: Dong Hao , acme@infradead.org, mtosatti@redhat.com, mingo@elte.hu, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v7 1/3] KVM: x86: export svm/vmx exit code and vector code to userspace References: <1346061106-5364-1-git-send-email-haodong@linux.vnet.ibm.com> <1346061106-5364-2-git-send-email-haodong@linux.vnet.ibm.com> <504490CE.5060507@redhat.com> In-Reply-To: <504490CE.5060507@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit x-cbid: 12090403-8256-0000-0000-00000404039B Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/03/2012 07:13 PM, Avi Kivity wrote: > On 08/27/2012 12:51 PM, Dong Hao wrote: >> From: Xiao Guangrong >> >> Exporting KVM exit information to userspace to be consumed by perf. >> >> [ Dong Hao : rebase it on acme's git tree ] >> Signed-off-by: Xiao Guangrong >> Signed-off-by: Dong Hao >> --- >> arch/x86/include/asm/kvm_host.h | 36 ++++--- > > Please put ABIs in kvm.h. But see below. > >> arch/x86/include/asm/svm.h | 205 +++++++++++++++++++++++++-------------- >> arch/x86/include/asm/vmx.h | 126 ++++++++++++++++-------- >> arch/x86/kvm/trace.h | 89 ----------------- >> 4 files changed, 234 insertions(+), 222 deletions(-) >> >> >> +#define DE_VECTOR 0 >> +#define DB_VECTOR 1 >> +#define BP_VECTOR 3 >> +#define OF_VECTOR 4 >> +#define BR_VECTOR 5 >> +#define UD_VECTOR 6 >> +#define NM_VECTOR 7 >> +#define DF_VECTOR 8 >> +#define TS_VECTOR 10 >> +#define NP_VECTOR 11 >> +#define SS_VECTOR 12 >> +#define GP_VECTOR 13 >> +#define PF_VECTOR 14 >> +#define MF_VECTOR 16 >> +#define MC_VECTOR 18 > > This is not a kvm ABI, but an x86 architecture constants. It should be > put into an existing x86 header. Okay, i will move them into asm/kvm.h > >> + >> #endif /* _ASM_X86_KVM_HOST_H */ >> diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h >> index f2b83bc..cdf5674 100644 >> --- a/arch/x86/include/asm/svm.h >> +++ b/arch/x86/include/asm/svm.h >> @@ -1,6 +1,135 @@ >> #ifndef __SVM_H >> #define __SVM_H >> >> + >> +#ifdef __KERNEL__ >> + > > The entire file can be exported; nothing in there is implementation > specific. Unfortunately, i have tied this but failed: ../../arch/x86/include/asm/svm.h:262:1: error: packed attribute is unnecessary for ‘vmcb_seg’ [-Werror=packed] ../../arch/x86/include/asm/svm.h:307:1: error: packed attribute is unnecessary for ‘vmcb_save_area’ [-Werror=packed] ../../arch/x86/include/asm/svm.h:312:1: error: packed attribute is unnecessary for ‘vmcb’ [-Werror=packed] ...... > >> diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h >> index 74fcb96..61e04e9 100644 >> --- a/arch/x86/include/asm/vmx.h >> +++ b/arch/x86/include/asm/vmx.h >> + >> +#ifdef __KERNEL__ >> + > > Ditto. Or: ../../arch/x86/include/asm/vmx.h:376:0: error: "REG_R8" redefined [-Werror] /usr/include/sys/ucontext.h:46:0: note: this is the location of the previous definition ../../arch/x86/include/asm/vmx.h:377:0: error: "REG_R9" redefined [-Werror] /usr/include/sys/ucontext.h:48:0: note: this is the location of the previous definition ......