public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Arnaldo Carvalho de Melo <acme@infradead.org>,
	Avi Kivity <avi@redhat.com>
Cc: Dong Hao <haodong@linux.vnet.ibm.com>,
	dsahern@gmail.com, avi@redhat.com, mingo@kernel.org,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	xiaoguangrong@linux.vnet.ibm.com, runzhen@linux.vnet.ibm.com
Subject: Re: [PATCH v8 1/3] KVM: x86: export svm/vmx exit code and vector code to userspace
Date: Thu, 20 Sep 2012 09:51:21 -0300	[thread overview]
Message-ID: <20120920125121.GD15092@amt.cnet> (raw)
In-Reply-To: <20120917145857.GA31375@ghostprotocols.net>

On Mon, Sep 17, 2012 at 07:58:57AM -0700, Arnaldo Carvalho de Melo wrote:
> Em Mon, Sep 17, 2012 at 04:31:13PM +0800, Dong Hao escreveu:
> > From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
> > 
> > Exporting KVM exit information to userspace to be consumed by perf.
> > 
> > [ Dong Hao <haodong@linux.vnet.ibm.com>: rebase it on acme's git tree ]
> > Signed-off-by: Dong Hao <haodong@linux.vnet.ibm.com>
> > Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
> 
> Do we have acked/reviewed-by for this parth? Marcelo? Avi?

Code move... ACK.

> 
> >  arch/x86/include/asm/kvm.h      |   16 +++
> >  arch/x86/include/asm/kvm_host.h |   16 ---
> >  arch/x86/include/asm/svm.h      |  205 +++++++++++++++++++++++++--------------
> >  arch/x86/include/asm/vmx.h      |  127 ++++++++++++++++--------
> >  arch/x86/kvm/trace.h            |   89 -----------------
> >  5 files changed, 230 insertions(+), 223 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
> > index 246617e..41e08cb 100644
> > --- a/arch/x86/include/asm/kvm.h
> > +++ b/arch/x86/include/asm/kvm.h
> > @@ -9,6 +9,22 @@
> >  #include <linux/types.h>
> >  #include <linux/ioctl.h>
> >  
> > +#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
> > +
> >  /* Select x86 specific features in <linux/kvm.h> */
> >  #define __KVM_HAVE_PIT
> >  #define __KVM_HAVE_IOAPIC
> > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> > index 09155d6..1eaa6b0 100644
> > --- a/arch/x86/include/asm/kvm_host.h
> > +++ b/arch/x86/include/asm/kvm_host.h
> > @@ -75,22 +75,6 @@
> >  #define KVM_HPAGE_MASK(x)	(~(KVM_HPAGE_SIZE(x) - 1))
> >  #define KVM_PAGES_PER_HPAGE(x)	(KVM_HPAGE_SIZE(x) / PAGE_SIZE)
> >  
> > -#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
> > -
> >  #define SELECTOR_TI_MASK (1 << 2)
> >  #define SELECTOR_RPL_MASK 0x03
> >  
> > 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
> >  
> > +#define SVM_EXIT_READ_CR0      0x000
> > +#define SVM_EXIT_READ_CR3      0x003
> > +#define SVM_EXIT_READ_CR4      0x004
> > +#define SVM_EXIT_READ_CR8      0x008
> > +#define SVM_EXIT_WRITE_CR0     0x010
> > +#define SVM_EXIT_WRITE_CR3     0x013
> > +#define SVM_EXIT_WRITE_CR4     0x014
> > +#define SVM_EXIT_WRITE_CR8     0x018
> > +#define SVM_EXIT_READ_DR0      0x020
> > +#define SVM_EXIT_READ_DR1      0x021
> > +#define SVM_EXIT_READ_DR2      0x022
> > +#define SVM_EXIT_READ_DR3      0x023
> > +#define SVM_EXIT_READ_DR4      0x024
> > +#define SVM_EXIT_READ_DR5      0x025
> > +#define SVM_EXIT_READ_DR6      0x026
> > +#define SVM_EXIT_READ_DR7      0x027
> > +#define SVM_EXIT_WRITE_DR0     0x030
> > +#define SVM_EXIT_WRITE_DR1     0x031
> > +#define SVM_EXIT_WRITE_DR2     0x032
> > +#define SVM_EXIT_WRITE_DR3     0x033
> > +#define SVM_EXIT_WRITE_DR4     0x034
> > +#define SVM_EXIT_WRITE_DR5     0x035
> > +#define SVM_EXIT_WRITE_DR6     0x036
> > +#define SVM_EXIT_WRITE_DR7     0x037
> > +#define SVM_EXIT_EXCP_BASE     0x040
> > +#define SVM_EXIT_INTR          0x060
> > +#define SVM_EXIT_NMI           0x061
> > +#define SVM_EXIT_SMI           0x062
> > +#define SVM_EXIT_INIT          0x063
> > +#define SVM_EXIT_VINTR         0x064
> > +#define SVM_EXIT_CR0_SEL_WRITE 0x065
> > +#define SVM_EXIT_IDTR_READ     0x066
> > +#define SVM_EXIT_GDTR_READ     0x067
> > +#define SVM_EXIT_LDTR_READ     0x068
> > +#define SVM_EXIT_TR_READ       0x069
> > +#define SVM_EXIT_IDTR_WRITE    0x06a
> > +#define SVM_EXIT_GDTR_WRITE    0x06b
> > +#define SVM_EXIT_LDTR_WRITE    0x06c
> > +#define SVM_EXIT_TR_WRITE      0x06d
> > +#define SVM_EXIT_RDTSC         0x06e
> > +#define SVM_EXIT_RDPMC         0x06f
> > +#define SVM_EXIT_PUSHF         0x070
> > +#define SVM_EXIT_POPF          0x071
> > +#define SVM_EXIT_CPUID         0x072
> > +#define SVM_EXIT_RSM           0x073
> > +#define SVM_EXIT_IRET          0x074
> > +#define SVM_EXIT_SWINT         0x075
> > +#define SVM_EXIT_INVD          0x076
> > +#define SVM_EXIT_PAUSE         0x077
> > +#define SVM_EXIT_HLT           0x078
> > +#define SVM_EXIT_INVLPG        0x079
> > +#define SVM_EXIT_INVLPGA       0x07a
> > +#define SVM_EXIT_IOIO          0x07b
> > +#define SVM_EXIT_MSR           0x07c
> > +#define SVM_EXIT_TASK_SWITCH   0x07d
> > +#define SVM_EXIT_FERR_FREEZE   0x07e
> > +#define SVM_EXIT_SHUTDOWN      0x07f
> > +#define SVM_EXIT_VMRUN         0x080
> > +#define SVM_EXIT_VMMCALL       0x081
> > +#define SVM_EXIT_VMLOAD        0x082
> > +#define SVM_EXIT_VMSAVE        0x083
> > +#define SVM_EXIT_STGI          0x084
> > +#define SVM_EXIT_CLGI          0x085
> > +#define SVM_EXIT_SKINIT        0x086
> > +#define SVM_EXIT_RDTSCP        0x087
> > +#define SVM_EXIT_ICEBP         0x088
> > +#define SVM_EXIT_WBINVD        0x089
> > +#define SVM_EXIT_MONITOR       0x08a
> > +#define SVM_EXIT_MWAIT         0x08b
> > +#define SVM_EXIT_MWAIT_COND    0x08c
> > +#define SVM_EXIT_XSETBV        0x08d
> > +#define SVM_EXIT_NPF           0x400
> > +
> > +#define SVM_EXIT_ERR           -1
> > +
> > +#define SVM_EXIT_REASONS \
> > +	{ SVM_EXIT_READ_CR0,    "read_cr0" }, \
> > +	{ SVM_EXIT_READ_CR3,    "read_cr3" }, \
> > +	{ SVM_EXIT_READ_CR4,    "read_cr4" }, \
> > +	{ SVM_EXIT_READ_CR8,    "read_cr8" }, \
> > +	{ SVM_EXIT_WRITE_CR0,   "write_cr0" }, \
> > +	{ SVM_EXIT_WRITE_CR3,   "write_cr3" }, \
> > +	{ SVM_EXIT_WRITE_CR4,   "write_cr4" }, \
> > +	{ SVM_EXIT_WRITE_CR8,   "write_cr8" }, \
> > +	{ SVM_EXIT_READ_DR0,    "read_dr0" }, \
> > +	{ SVM_EXIT_READ_DR1,    "read_dr1" }, \
> > +	{ SVM_EXIT_READ_DR2,    "read_dr2" }, \
> > +	{ SVM_EXIT_READ_DR3,    "read_dr3" }, \
> > +	{ SVM_EXIT_WRITE_DR0,   "write_dr0" }, \
> > +	{ SVM_EXIT_WRITE_DR1,   "write_dr1" }, \
> > +	{ SVM_EXIT_WRITE_DR2,   "write_dr2" }, \
> > +	{ SVM_EXIT_WRITE_DR3,   "write_dr3" }, \
> > +	{ SVM_EXIT_WRITE_DR5,   "write_dr5" }, \
> > +	{ SVM_EXIT_WRITE_DR7,   "write_dr7" }, \
> > +	{ SVM_EXIT_EXCP_BASE + DB_VECTOR,       "DB excp" }, \
> > +	{ SVM_EXIT_EXCP_BASE + BP_VECTOR,       "BP excp" }, \
> > +	{ SVM_EXIT_EXCP_BASE + UD_VECTOR,       "UD excp" }, \
> > +	{ SVM_EXIT_EXCP_BASE + PF_VECTOR,       "PF excp" }, \
> > +	{ SVM_EXIT_EXCP_BASE + NM_VECTOR,       "NM excp" }, \
> > +	{ SVM_EXIT_EXCP_BASE + MC_VECTOR,       "MC excp" }, \
> > +	{ SVM_EXIT_INTR,        "interrupt" }, \
> > +	{ SVM_EXIT_NMI,         "nmi" }, \
> > +	{ SVM_EXIT_SMI,         "smi" }, \
> > +	{ SVM_EXIT_INIT,        "init" }, \
> > +	{ SVM_EXIT_VINTR,       "vintr" }, \
> > +	{ SVM_EXIT_CPUID,       "cpuid" }, \
> > +	{ SVM_EXIT_INVD,        "invd" }, \
> > +	{ SVM_EXIT_HLT,         "hlt" }, \
> > +	{ SVM_EXIT_INVLPG,      "invlpg" }, \
> > +	{ SVM_EXIT_INVLPGA,     "invlpga" }, \
> > +	{ SVM_EXIT_IOIO,        "io" }, \
> > +	{ SVM_EXIT_MSR,         "msr" }, \
> > +	{ SVM_EXIT_TASK_SWITCH, "task_switch" }, \
> > +	{ SVM_EXIT_SHUTDOWN,    "shutdown" }, \
> > +	{ SVM_EXIT_VMRUN,       "vmrun" }, \
> > +	{ SVM_EXIT_VMMCALL,     "hypercall" }, \
> > +	{ SVM_EXIT_VMLOAD,      "vmload" }, \
> > +	{ SVM_EXIT_VMSAVE,      "vmsave" }, \
> > +	{ SVM_EXIT_STGI,        "stgi" }, \
> > +	{ SVM_EXIT_CLGI,        "clgi" }, \
> > +	{ SVM_EXIT_SKINIT,      "skinit" }, \
> > +	{ SVM_EXIT_WBINVD,      "wbinvd" }, \
> > +	{ SVM_EXIT_MONITOR,     "monitor" }, \
> > +	{ SVM_EXIT_MWAIT,       "mwait" }, \
> > +	{ SVM_EXIT_XSETBV,      "xsetbv" }, \
> > +	{ SVM_EXIT_NPF,         "npf" }
> > +
> > +#ifdef __KERNEL__
> > +
> >  enum {
> >  	INTERCEPT_INTR,
> >  	INTERCEPT_NMI,
> > @@ -264,81 +393,6 @@ struct __attribute__ ((__packed__)) vmcb {
> >  
> >  #define SVM_EXITINFO_REG_MASK 0x0F
> >  
> > -#define	SVM_EXIT_READ_CR0 	0x000
> > -#define	SVM_EXIT_READ_CR3 	0x003
> > -#define	SVM_EXIT_READ_CR4 	0x004
> > -#define	SVM_EXIT_READ_CR8 	0x008
> > -#define	SVM_EXIT_WRITE_CR0 	0x010
> > -#define	SVM_EXIT_WRITE_CR3 	0x013
> > -#define	SVM_EXIT_WRITE_CR4 	0x014
> > -#define	SVM_EXIT_WRITE_CR8 	0x018
> > -#define	SVM_EXIT_READ_DR0 	0x020
> > -#define	SVM_EXIT_READ_DR1 	0x021
> > -#define	SVM_EXIT_READ_DR2 	0x022
> > -#define	SVM_EXIT_READ_DR3 	0x023
> > -#define	SVM_EXIT_READ_DR4 	0x024
> > -#define	SVM_EXIT_READ_DR5 	0x025
> > -#define	SVM_EXIT_READ_DR6 	0x026
> > -#define	SVM_EXIT_READ_DR7 	0x027
> > -#define	SVM_EXIT_WRITE_DR0 	0x030
> > -#define	SVM_EXIT_WRITE_DR1 	0x031
> > -#define	SVM_EXIT_WRITE_DR2 	0x032
> > -#define	SVM_EXIT_WRITE_DR3 	0x033
> > -#define	SVM_EXIT_WRITE_DR4 	0x034
> > -#define	SVM_EXIT_WRITE_DR5 	0x035
> > -#define	SVM_EXIT_WRITE_DR6 	0x036
> > -#define	SVM_EXIT_WRITE_DR7 	0x037
> > -#define SVM_EXIT_EXCP_BASE      0x040
> > -#define SVM_EXIT_INTR		0x060
> > -#define SVM_EXIT_NMI		0x061
> > -#define SVM_EXIT_SMI		0x062
> > -#define SVM_EXIT_INIT		0x063
> > -#define SVM_EXIT_VINTR		0x064
> > -#define SVM_EXIT_CR0_SEL_WRITE	0x065
> > -#define SVM_EXIT_IDTR_READ	0x066
> > -#define SVM_EXIT_GDTR_READ	0x067
> > -#define SVM_EXIT_LDTR_READ	0x068
> > -#define SVM_EXIT_TR_READ	0x069
> > -#define SVM_EXIT_IDTR_WRITE	0x06a
> > -#define SVM_EXIT_GDTR_WRITE	0x06b
> > -#define SVM_EXIT_LDTR_WRITE	0x06c
> > -#define SVM_EXIT_TR_WRITE	0x06d
> > -#define SVM_EXIT_RDTSC		0x06e
> > -#define SVM_EXIT_RDPMC		0x06f
> > -#define SVM_EXIT_PUSHF		0x070
> > -#define SVM_EXIT_POPF		0x071
> > -#define SVM_EXIT_CPUID		0x072
> > -#define SVM_EXIT_RSM		0x073
> > -#define SVM_EXIT_IRET		0x074
> > -#define SVM_EXIT_SWINT		0x075
> > -#define SVM_EXIT_INVD		0x076
> > -#define SVM_EXIT_PAUSE		0x077
> > -#define SVM_EXIT_HLT		0x078
> > -#define SVM_EXIT_INVLPG		0x079
> > -#define SVM_EXIT_INVLPGA	0x07a
> > -#define SVM_EXIT_IOIO		0x07b
> > -#define SVM_EXIT_MSR		0x07c
> > -#define SVM_EXIT_TASK_SWITCH	0x07d
> > -#define SVM_EXIT_FERR_FREEZE	0x07e
> > -#define SVM_EXIT_SHUTDOWN	0x07f
> > -#define SVM_EXIT_VMRUN		0x080
> > -#define SVM_EXIT_VMMCALL	0x081
> > -#define SVM_EXIT_VMLOAD		0x082
> > -#define SVM_EXIT_VMSAVE		0x083
> > -#define SVM_EXIT_STGI		0x084
> > -#define SVM_EXIT_CLGI		0x085
> > -#define SVM_EXIT_SKINIT		0x086
> > -#define SVM_EXIT_RDTSCP		0x087
> > -#define SVM_EXIT_ICEBP		0x088
> > -#define SVM_EXIT_WBINVD		0x089
> > -#define SVM_EXIT_MONITOR	0x08a
> > -#define SVM_EXIT_MWAIT		0x08b
> > -#define SVM_EXIT_MWAIT_COND	0x08c
> > -#define SVM_EXIT_XSETBV		0x08d
> > -#define SVM_EXIT_NPF  		0x400
> > -
> > -#define SVM_EXIT_ERR		-1
> > -
> >  #define SVM_CR0_SELECTIVE_MASK (X86_CR0_TS | X86_CR0_MP)
> >  
> >  #define SVM_VMLOAD ".byte 0x0f, 0x01, 0xda"
> > @@ -350,3 +404,4 @@ struct __attribute__ ((__packed__)) vmcb {
> >  
> >  #endif
> >  
> > +#endif
> > diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
> > index 74fcb96..36ec21c 100644
> > --- a/arch/x86/include/asm/vmx.h
> > +++ b/arch/x86/include/asm/vmx.h
> > @@ -25,6 +25,88 @@
> >   *
> >   */
> >  
> > +#define VMX_EXIT_REASONS_FAILED_VMENTRY         0x80000000
> > +
> > +#define EXIT_REASON_EXCEPTION_NMI       0
> > +#define EXIT_REASON_EXTERNAL_INTERRUPT  1
> > +#define EXIT_REASON_TRIPLE_FAULT        2
> > +
> > +#define EXIT_REASON_PENDING_INTERRUPT   7
> > +#define EXIT_REASON_NMI_WINDOW          8
> > +#define EXIT_REASON_TASK_SWITCH         9
> > +#define EXIT_REASON_CPUID               10
> > +#define EXIT_REASON_HLT                 12
> > +#define EXIT_REASON_INVD                13
> > +#define EXIT_REASON_INVLPG              14
> > +#define EXIT_REASON_RDPMC               15
> > +#define EXIT_REASON_RDTSC               16
> > +#define EXIT_REASON_VMCALL              18
> > +#define EXIT_REASON_VMCLEAR             19
> > +#define EXIT_REASON_VMLAUNCH            20
> > +#define EXIT_REASON_VMPTRLD             21
> > +#define EXIT_REASON_VMPTRST             22
> > +#define EXIT_REASON_VMREAD              23
> > +#define EXIT_REASON_VMRESUME            24
> > +#define EXIT_REASON_VMWRITE             25
> > +#define EXIT_REASON_VMOFF               26
> > +#define EXIT_REASON_VMON                27
> > +#define EXIT_REASON_CR_ACCESS           28
> > +#define EXIT_REASON_DR_ACCESS           29
> > +#define EXIT_REASON_IO_INSTRUCTION      30
> > +#define EXIT_REASON_MSR_READ            31
> > +#define EXIT_REASON_MSR_WRITE           32
> > +#define EXIT_REASON_INVALID_STATE       33
> > +#define EXIT_REASON_MWAIT_INSTRUCTION   36
> > +#define EXIT_REASON_MONITOR_INSTRUCTION 39
> > +#define EXIT_REASON_PAUSE_INSTRUCTION   40
> > +#define EXIT_REASON_MCE_DURING_VMENTRY  41
> > +#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
> > +#define EXIT_REASON_APIC_ACCESS         44
> > +#define EXIT_REASON_EPT_VIOLATION       48
> > +#define EXIT_REASON_EPT_MISCONFIG       49
> > +#define EXIT_REASON_WBINVD              54
> > +#define EXIT_REASON_XSETBV              55
> > +#define EXIT_REASON_INVPCID             58
> > +
> > +#define VMX_EXIT_REASONS \
> > +	{ EXIT_REASON_EXCEPTION_NMI,         "EXCEPTION_NMI" }, \
> > +	{ EXIT_REASON_EXTERNAL_INTERRUPT,    "EXTERNAL_INTERRUPT" }, \
> > +	{ EXIT_REASON_TRIPLE_FAULT,          "TRIPLE_FAULT" }, \
> > +	{ EXIT_REASON_PENDING_INTERRUPT,     "PENDING_INTERRUPT" }, \
> > +	{ EXIT_REASON_NMI_WINDOW,            "NMI_WINDOW" }, \
> > +	{ EXIT_REASON_TASK_SWITCH,           "TASK_SWITCH" }, \
> > +	{ EXIT_REASON_CPUID,                 "CPUID" }, \
> > +	{ EXIT_REASON_HLT,                   "HLT" }, \
> > +	{ EXIT_REASON_INVLPG,                "INVLPG" }, \
> > +	{ EXIT_REASON_RDPMC,                 "RDPMC" }, \
> > +	{ EXIT_REASON_RDTSC,                 "RDTSC" }, \
> > +	{ EXIT_REASON_VMCALL,                "VMCALL" }, \
> > +	{ EXIT_REASON_VMCLEAR,               "VMCLEAR" }, \
> > +	{ EXIT_REASON_VMLAUNCH,              "VMLAUNCH" }, \
> > +	{ EXIT_REASON_VMPTRLD,               "VMPTRLD" }, \
> > +	{ EXIT_REASON_VMPTRST,               "VMPTRST" }, \
> > +	{ EXIT_REASON_VMREAD,                "VMREAD" }, \
> > +	{ EXIT_REASON_VMRESUME,              "VMRESUME" }, \
> > +	{ EXIT_REASON_VMWRITE,               "VMWRITE" }, \
> > +	{ EXIT_REASON_VMOFF,                 "VMOFF" }, \
> > +	{ EXIT_REASON_VMON,                  "VMON" }, \
> > +	{ EXIT_REASON_CR_ACCESS,             "CR_ACCESS" }, \
> > +	{ EXIT_REASON_DR_ACCESS,             "DR_ACCESS" }, \
> > +	{ EXIT_REASON_IO_INSTRUCTION,        "IO_INSTRUCTION" }, \
> > +	{ EXIT_REASON_MSR_READ,              "MSR_READ" }, \
> > +	{ EXIT_REASON_MSR_WRITE,             "MSR_WRITE" }, \
> > +	{ EXIT_REASON_MWAIT_INSTRUCTION,     "MWAIT_INSTRUCTION" }, \
> > +	{ EXIT_REASON_MONITOR_INSTRUCTION,   "MONITOR_INSTRUCTION" }, \
> > +	{ EXIT_REASON_PAUSE_INSTRUCTION,     "PAUSE_INSTRUCTION" }, \
> > +	{ EXIT_REASON_MCE_DURING_VMENTRY,    "MCE_DURING_VMENTRY" }, \
> > +	{ EXIT_REASON_TPR_BELOW_THRESHOLD,   "TPR_BELOW_THRESHOLD" }, \
> > +	{ EXIT_REASON_APIC_ACCESS,           "APIC_ACCESS" }, \
> > +	{ EXIT_REASON_EPT_VIOLATION,         "EPT_VIOLATION" }, \
> > +	{ EXIT_REASON_EPT_MISCONFIG,         "EPT_MISCONFIG" }, \
> > +	{ EXIT_REASON_WBINVD,                "WBINVD" }
> > +
> > +#ifdef __KERNEL__
> > +
> >  #include <linux/types.h>
> >  
> >  /*
> > @@ -241,49 +323,6 @@ enum vmcs_field {
> >  	HOST_RIP                        = 0x00006c16,
> >  };
> >  
> > -#define VMX_EXIT_REASONS_FAILED_VMENTRY         0x80000000
> > -
> > -#define EXIT_REASON_EXCEPTION_NMI       0
> > -#define EXIT_REASON_EXTERNAL_INTERRUPT  1
> > -#define EXIT_REASON_TRIPLE_FAULT        2
> > -
> > -#define EXIT_REASON_PENDING_INTERRUPT   7
> > -#define EXIT_REASON_NMI_WINDOW		8
> > -#define EXIT_REASON_TASK_SWITCH         9
> > -#define EXIT_REASON_CPUID               10
> > -#define EXIT_REASON_HLT                 12
> > -#define EXIT_REASON_INVD                13
> > -#define EXIT_REASON_INVLPG              14
> > -#define EXIT_REASON_RDPMC               15
> > -#define EXIT_REASON_RDTSC               16
> > -#define EXIT_REASON_VMCALL              18
> > -#define EXIT_REASON_VMCLEAR             19
> > -#define EXIT_REASON_VMLAUNCH            20
> > -#define EXIT_REASON_VMPTRLD             21
> > -#define EXIT_REASON_VMPTRST             22
> > -#define EXIT_REASON_VMREAD              23
> > -#define EXIT_REASON_VMRESUME            24
> > -#define EXIT_REASON_VMWRITE             25
> > -#define EXIT_REASON_VMOFF               26
> > -#define EXIT_REASON_VMON                27
> > -#define EXIT_REASON_CR_ACCESS           28
> > -#define EXIT_REASON_DR_ACCESS           29
> > -#define EXIT_REASON_IO_INSTRUCTION      30
> > -#define EXIT_REASON_MSR_READ            31
> > -#define EXIT_REASON_MSR_WRITE           32
> > -#define EXIT_REASON_INVALID_STATE	33
> > -#define EXIT_REASON_MWAIT_INSTRUCTION   36
> > -#define EXIT_REASON_MONITOR_INSTRUCTION 39
> > -#define EXIT_REASON_PAUSE_INSTRUCTION   40
> > -#define EXIT_REASON_MCE_DURING_VMENTRY	 41
> > -#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
> > -#define EXIT_REASON_APIC_ACCESS         44
> > -#define EXIT_REASON_EPT_VIOLATION       48
> > -#define EXIT_REASON_EPT_MISCONFIG       49
> > -#define EXIT_REASON_WBINVD		54
> > -#define EXIT_REASON_XSETBV		55
> > -#define EXIT_REASON_INVPCID		58
> > -
> >  /*
> >   * Interruption-information format
> >   */
> > @@ -488,3 +527,5 @@ enum vm_instruction_error_number {
> >  };
> >  
> >  #endif
> > +
> > +#endif
> > diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> > index a71faf7..bca63f0 100644
> > --- a/arch/x86/kvm/trace.h
> > +++ b/arch/x86/kvm/trace.h
> > @@ -183,95 +183,6 @@ TRACE_EVENT(kvm_apic,
> >  #define KVM_ISA_VMX   1
> >  #define KVM_ISA_SVM   2
> >  
> > -#define VMX_EXIT_REASONS \
> > -	{ EXIT_REASON_EXCEPTION_NMI,		"EXCEPTION_NMI" }, \
> > -	{ EXIT_REASON_EXTERNAL_INTERRUPT,	"EXTERNAL_INTERRUPT" }, \
> > -	{ EXIT_REASON_TRIPLE_FAULT,		"TRIPLE_FAULT" }, \
> > -	{ EXIT_REASON_PENDING_INTERRUPT,	"PENDING_INTERRUPT" }, \
> > -	{ EXIT_REASON_NMI_WINDOW,		"NMI_WINDOW" }, \
> > -	{ EXIT_REASON_TASK_SWITCH,		"TASK_SWITCH" }, \
> > -	{ EXIT_REASON_CPUID,			"CPUID" }, \
> > -	{ EXIT_REASON_HLT,			"HLT" }, \
> > -	{ EXIT_REASON_INVLPG,			"INVLPG" }, \
> > -	{ EXIT_REASON_RDPMC,			"RDPMC" }, \
> > -	{ EXIT_REASON_RDTSC,			"RDTSC" }, \
> > -	{ EXIT_REASON_VMCALL,			"VMCALL" }, \
> > -	{ EXIT_REASON_VMCLEAR,			"VMCLEAR" }, \
> > -	{ EXIT_REASON_VMLAUNCH,			"VMLAUNCH" }, \
> > -	{ EXIT_REASON_VMPTRLD,			"VMPTRLD" }, \
> > -	{ EXIT_REASON_VMPTRST,			"VMPTRST" }, \
> > -	{ EXIT_REASON_VMREAD,			"VMREAD" }, \
> > -	{ EXIT_REASON_VMRESUME,			"VMRESUME" }, \
> > -	{ EXIT_REASON_VMWRITE,			"VMWRITE" }, \
> > -	{ EXIT_REASON_VMOFF,			"VMOFF" }, \
> > -	{ EXIT_REASON_VMON,			"VMON" }, \
> > -	{ EXIT_REASON_CR_ACCESS,		"CR_ACCESS" }, \
> > -	{ EXIT_REASON_DR_ACCESS,		"DR_ACCESS" }, \
> > -	{ EXIT_REASON_IO_INSTRUCTION,		"IO_INSTRUCTION" }, \
> > -	{ EXIT_REASON_MSR_READ,			"MSR_READ" }, \
> > -	{ EXIT_REASON_MSR_WRITE,		"MSR_WRITE" }, \
> > -	{ EXIT_REASON_MWAIT_INSTRUCTION,	"MWAIT_INSTRUCTION" }, \
> > -	{ EXIT_REASON_MONITOR_INSTRUCTION,	"MONITOR_INSTRUCTION" }, \
> > -	{ EXIT_REASON_PAUSE_INSTRUCTION,	"PAUSE_INSTRUCTION" }, \
> > -	{ EXIT_REASON_MCE_DURING_VMENTRY,	"MCE_DURING_VMENTRY" }, \
> > -	{ EXIT_REASON_TPR_BELOW_THRESHOLD,	"TPR_BELOW_THRESHOLD" },	\
> > -	{ EXIT_REASON_APIC_ACCESS,		"APIC_ACCESS" }, \
> > -	{ EXIT_REASON_EPT_VIOLATION,		"EPT_VIOLATION" }, \
> > -	{ EXIT_REASON_EPT_MISCONFIG,		"EPT_MISCONFIG" }, \
> > -	{ EXIT_REASON_WBINVD,			"WBINVD" }
> > -
> > -#define SVM_EXIT_REASONS \
> > -	{ SVM_EXIT_READ_CR0,			"read_cr0" }, \
> > -	{ SVM_EXIT_READ_CR3,			"read_cr3" }, \
> > -	{ SVM_EXIT_READ_CR4,			"read_cr4" }, \
> > -	{ SVM_EXIT_READ_CR8,			"read_cr8" }, \
> > -	{ SVM_EXIT_WRITE_CR0,			"write_cr0" }, \
> > -	{ SVM_EXIT_WRITE_CR3,			"write_cr3" }, \
> > -	{ SVM_EXIT_WRITE_CR4,			"write_cr4" }, \
> > -	{ SVM_EXIT_WRITE_CR8,			"write_cr8" }, \
> > -	{ SVM_EXIT_READ_DR0,			"read_dr0" }, \
> > -	{ SVM_EXIT_READ_DR1,			"read_dr1" }, \
> > -	{ SVM_EXIT_READ_DR2,			"read_dr2" }, \
> > -	{ SVM_EXIT_READ_DR3,			"read_dr3" }, \
> > -	{ SVM_EXIT_WRITE_DR0,			"write_dr0" }, \
> > -	{ SVM_EXIT_WRITE_DR1,			"write_dr1" }, \
> > -	{ SVM_EXIT_WRITE_DR2,			"write_dr2" }, \
> > -	{ SVM_EXIT_WRITE_DR3,			"write_dr3" }, \
> > -	{ SVM_EXIT_WRITE_DR5,			"write_dr5" }, \
> > -	{ SVM_EXIT_WRITE_DR7,			"write_dr7" }, \
> > -	{ SVM_EXIT_EXCP_BASE + DB_VECTOR,	"DB excp" }, \
> > -	{ SVM_EXIT_EXCP_BASE + BP_VECTOR,	"BP excp" }, \
> > -	{ SVM_EXIT_EXCP_BASE + UD_VECTOR,	"UD excp" }, \
> > -	{ SVM_EXIT_EXCP_BASE + PF_VECTOR,	"PF excp" }, \
> > -	{ SVM_EXIT_EXCP_BASE + NM_VECTOR,	"NM excp" }, \
> > -	{ SVM_EXIT_EXCP_BASE + MC_VECTOR,	"MC excp" }, \
> > -	{ SVM_EXIT_INTR,			"interrupt" }, \
> > -	{ SVM_EXIT_NMI,				"nmi" }, \
> > -	{ SVM_EXIT_SMI,				"smi" }, \
> > -	{ SVM_EXIT_INIT,			"init" }, \
> > -	{ SVM_EXIT_VINTR,			"vintr" }, \
> > -	{ SVM_EXIT_CPUID,			"cpuid" }, \
> > -	{ SVM_EXIT_INVD,			"invd" }, \
> > -	{ SVM_EXIT_HLT,				"hlt" }, \
> > -	{ SVM_EXIT_INVLPG,			"invlpg" }, \
> > -	{ SVM_EXIT_INVLPGA,			"invlpga" }, \
> > -	{ SVM_EXIT_IOIO,			"io" }, \
> > -	{ SVM_EXIT_MSR,				"msr" }, \
> > -	{ SVM_EXIT_TASK_SWITCH,			"task_switch" }, \
> > -	{ SVM_EXIT_SHUTDOWN,			"shutdown" }, \
> > -	{ SVM_EXIT_VMRUN,			"vmrun" }, \
> > -	{ SVM_EXIT_VMMCALL,			"hypercall" }, \
> > -	{ SVM_EXIT_VMLOAD,			"vmload" }, \
> > -	{ SVM_EXIT_VMSAVE,			"vmsave" }, \
> > -	{ SVM_EXIT_STGI,			"stgi" }, \
> > -	{ SVM_EXIT_CLGI,			"clgi" }, \
> > -	{ SVM_EXIT_SKINIT,			"skinit" }, \
> > -	{ SVM_EXIT_WBINVD,			"wbinvd" }, \
> > -	{ SVM_EXIT_MONITOR,			"monitor" }, \
> > -	{ SVM_EXIT_MWAIT,			"mwait" }, \
> > -	{ SVM_EXIT_XSETBV,			"xsetbv" }, \
> > -	{ SVM_EXIT_NPF,				"npf" }
> > -
> >  /*
> >   * Tracepoint for kvm guest exit:
> >   */
> > -- 
> > 1.7.2.5

  reply	other threads:[~2012-09-20 12:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17  8:31 [PATCH v8 0/3] KVM: perf: kvm events analysis tool Dong Hao
2012-09-17  8:31 ` [PATCH v8 1/3] KVM: x86: export svm/vmx exit code and vector code to userspace Dong Hao
2012-09-17 14:58   ` Arnaldo Carvalho de Melo
2012-09-20 12:51     ` Marcelo Tosatti [this message]
2012-09-27  4:26   ` [tip:perf/core] KVM: x86: Export svm/ vmx " tip-bot for Xiao Guangrong
2012-09-17  8:31 ` [PATCH v8 2/3] perf: move stat related code to util/stat.c Dong Hao
2012-09-18 14:01   ` David Ahern
2012-09-18 19:18   ` David Ahern
2012-09-19  1:53     ` Xiao Guangrong
2012-09-19  4:00       ` David Ahern
2012-09-19 15:18   ` [tip:perf/core] perf stat: Move stats " tip-bot for Xiao Guangrong
2012-09-17  8:31 ` [PATCH v8 3/3] KVM: perf: kvm events analysis tool Dong Hao
2012-09-20 13:34   ` David Ahern
2012-09-27  4:27   ` [tip:perf/core] perf kvm: Events " tip-bot for Xiao Guangrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120920125121.GD15092@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=acme@infradead.org \
    --cc=avi@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=haodong@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=runzhen@linux.vnet.ibm.com \
    --cc=xiaoguangrong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox