aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-07-22 07:46:53 -0400
committerAvi Kivity <avi@redhat.com>2011-09-25 12:17:59 -0400
commit0d460ffc0956d2dbe12ca9f5f6aa0f8701ea9d73 (patch)
tree043ba67b92ac023b36bde109f15f5cff9d1c0091 /arch/x86/kvm/svm.c
parente097e5ffd69cbd7be61466e2d54c145468d48073 (diff)
KVM: Use __print_symbolic() for vmexit tracepoints
The vmexit tracepoints format the exit_reason to make it human-readable. Since the exit_reason depends on the instruction set (vmx or svm), formatting is handled with ftrace_print_symbols_seq() by referring to the appropriate exit reason table. However, the ftrace_print_symbols_seq() function is not meant to be used directly in tracepoints since it does not export the formatting table which userspace tools like trace-cmd and perf use to format traces. In practice perf dies when formatting vmexit-related events and trace-cmd falls back to printing the numeric value (with extra formatting code in the kvm plugin to paper over this limitation). Other userspace consumers of vmexit-related tracepoints would be in similar trouble. To avoid significant changes to the kvm_exit tracepoint, this patch moves the vmx and svm exit reason tables into arch/x86/kvm/trace.h and selects the right table with __print_symbolic() depending on the instruction set. Note that __print_symbolic() is designed for exporting the formatting table to userspace and allows trace-cmd and perf to work. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 6adb7ba13a4a..2b24a88f2c67 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3899,60 +3899,6 @@ static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
3899 } 3899 }
3900} 3900}
3901 3901
3902static const struct trace_print_flags svm_exit_reasons_str[] = {
3903 { SVM_EXIT_READ_CR0, "read_cr0" },
3904 { SVM_EXIT_READ_CR3, "read_cr3" },
3905 { SVM_EXIT_READ_CR4, "read_cr4" },
3906 { SVM_EXIT_READ_CR8, "read_cr8" },
3907 { SVM_EXIT_WRITE_CR0, "write_cr0" },
3908 { SVM_EXIT_WRITE_CR3, "write_cr3" },
3909 { SVM_EXIT_WRITE_CR4, "write_cr4" },
3910 { SVM_EXIT_WRITE_CR8, "write_cr8" },
3911 { SVM_EXIT_READ_DR0, "read_dr0" },
3912 { SVM_EXIT_READ_DR1, "read_dr1" },
3913 { SVM_EXIT_READ_DR2, "read_dr2" },
3914 { SVM_EXIT_READ_DR3, "read_dr3" },
3915 { SVM_EXIT_WRITE_DR0, "write_dr0" },
3916 { SVM_EXIT_WRITE_DR1, "write_dr1" },
3917 { SVM_EXIT_WRITE_DR2, "write_dr2" },
3918 { SVM_EXIT_WRITE_DR3, "write_dr3" },
3919 { SVM_EXIT_WRITE_DR5, "write_dr5" },
3920 { SVM_EXIT_WRITE_DR7, "write_dr7" },
3921 { SVM_EXIT_EXCP_BASE + DB_VECTOR, "DB excp" },
3922 { SVM_EXIT_EXCP_BASE + BP_VECTOR, "BP excp" },
3923 { SVM_EXIT_EXCP_BASE + UD_VECTOR, "UD excp" },
3924 { SVM_EXIT_EXCP_BASE + PF_VECTOR, "PF excp" },
3925 { SVM_EXIT_EXCP_BASE + NM_VECTOR, "NM excp" },
3926 { SVM_EXIT_EXCP_BASE + MC_VECTOR, "MC excp" },
3927 { SVM_EXIT_INTR, "interrupt" },
3928 { SVM_EXIT_NMI, "nmi" },
3929 { SVM_EXIT_SMI, "smi" },
3930 { SVM_EXIT_INIT, "init" },
3931 { SVM_EXIT_VINTR, "vintr" },
3932 { SVM_EXIT_CPUID, "cpuid" },
3933 { SVM_EXIT_INVD, "invd" },
3934 { SVM_EXIT_HLT, "hlt" },
3935 { SVM_EXIT_INVLPG, "invlpg" },
3936 { SVM_EXIT_INVLPGA, "invlpga" },
3937 { SVM_EXIT_IOIO, "io" },
3938 { SVM_EXIT_MSR, "msr" },
3939 { SVM_EXIT_TASK_SWITCH, "task_switch" },
3940 { SVM_EXIT_SHUTDOWN, "shutdown" },
3941 { SVM_EXIT_VMRUN, "vmrun" },
3942 { SVM_EXIT_VMMCALL, "hypercall" },
3943 { SVM_EXIT_VMLOAD, "vmload" },
3944 { SVM_EXIT_VMSAVE, "vmsave" },
3945 { SVM_EXIT_STGI, "stgi" },
3946 { SVM_EXIT_CLGI, "clgi" },
3947 { SVM_EXIT_SKINIT, "skinit" },
3948 { SVM_EXIT_WBINVD, "wbinvd" },
3949 { SVM_EXIT_MONITOR, "monitor" },
3950 { SVM_EXIT_MWAIT, "mwait" },
3951 { SVM_EXIT_XSETBV, "xsetbv" },
3952 { SVM_EXIT_NPF, "npf" },
3953 { -1, NULL }
3954};
3955
3956static int svm_get_lpage_level(void) 3902static int svm_get_lpage_level(void)
3957{ 3903{
3958 return PT_PDPE_LEVEL; 3904 return PT_PDPE_LEVEL;
@@ -4225,7 +4171,6 @@ static struct kvm_x86_ops svm_x86_ops = {
4225 .get_mt_mask = svm_get_mt_mask, 4171 .get_mt_mask = svm_get_mt_mask,
4226 4172
4227 .get_exit_info = svm_get_exit_info, 4173 .get_exit_info = svm_get_exit_info,
4228 .exit_reasons_str = svm_exit_reasons_str,
4229 4174
4230 .get_lpage_level = svm_get_lpage_level, 4175 .get_lpage_level = svm_get_lpage_level,
4231 4176