aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-04-30 11:56:03 -0400
committerAvi Kivity <avi@qumranet.com>2008-07-20 05:40:48 -0400
commitaf9ca2d703f4cefbf6441bfe127c4191092ad394 (patch)
treed822a6b64c35e1a94fb04e33cf729c976b9f8912 /arch/x86/kvm/svm.c
parent54e445ca8411ec892f986d9f8c11b8c1806ecde4 (diff)
KVM: SVM: add missing kvmtrace markers
This patch adds the missing kvmtrace markers to the svm module of kvm. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 0eac1a5060a6..8953292acfd9 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -949,7 +949,9 @@ static void new_asid(struct vcpu_svm *svm, struct svm_cpu_data *svm_data)
949 949
950static unsigned long svm_get_dr(struct kvm_vcpu *vcpu, int dr) 950static unsigned long svm_get_dr(struct kvm_vcpu *vcpu, int dr)
951{ 951{
952 return to_svm(vcpu)->db_regs[dr]; 952 unsigned long val = to_svm(vcpu)->db_regs[dr];
953 KVMTRACE_2D(DR_READ, vcpu, (u32)dr, (u32)val, handler);
954 return val;
953} 955}
954 956
955static void svm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long value, 957static void svm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long value,
@@ -1004,6 +1006,12 @@ static int pf_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1004 1006
1005 fault_address = svm->vmcb->control.exit_info_2; 1007 fault_address = svm->vmcb->control.exit_info_2;
1006 error_code = svm->vmcb->control.exit_info_1; 1008 error_code = svm->vmcb->control.exit_info_1;
1009
1010 if (!npt_enabled)
1011 KVMTRACE_3D(PAGE_FAULT, &svm->vcpu, error_code,
1012 (u32)fault_address, (u32)(fault_address >> 32),
1013 handler);
1014
1007 return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code); 1015 return kvm_mmu_page_fault(&svm->vcpu, fault_address, error_code);
1008} 1016}
1009 1017
@@ -1083,12 +1091,14 @@ static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1083 1091
1084static int nmi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1092static int nmi_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1085{ 1093{
1094 KVMTRACE_0D(NMI, &svm->vcpu, handler);
1086 return 1; 1095 return 1;
1087} 1096}
1088 1097
1089static int intr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) 1098static int intr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1090{ 1099{
1091 ++svm->vcpu.stat.irq_exits; 1100 ++svm->vcpu.stat.irq_exits;
1101 KVMTRACE_0D(INTR, &svm->vcpu, handler);
1092 return 1; 1102 return 1;
1093} 1103}
1094 1104
@@ -1230,6 +1240,9 @@ static int rdmsr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1230 if (svm_get_msr(&svm->vcpu, ecx, &data)) 1240 if (svm_get_msr(&svm->vcpu, ecx, &data))
1231 kvm_inject_gp(&svm->vcpu, 0); 1241 kvm_inject_gp(&svm->vcpu, 0);
1232 else { 1242 else {
1243 KVMTRACE_3D(MSR_READ, &svm->vcpu, ecx, (u32)data,
1244 (u32)(data >> 32), handler);
1245
1233 svm->vmcb->save.rax = data & 0xffffffff; 1246 svm->vmcb->save.rax = data & 0xffffffff;
1234 svm->vcpu.arch.regs[VCPU_REGS_RDX] = data >> 32; 1247 svm->vcpu.arch.regs[VCPU_REGS_RDX] = data >> 32;
1235 svm->next_rip = svm->vmcb->save.rip + 2; 1248 svm->next_rip = svm->vmcb->save.rip + 2;
@@ -1315,6 +1328,10 @@ static int wrmsr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1315 u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX]; 1328 u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX];
1316 u64 data = (svm->vmcb->save.rax & -1u) 1329 u64 data = (svm->vmcb->save.rax & -1u)
1317 | ((u64)(svm->vcpu.arch.regs[VCPU_REGS_RDX] & -1u) << 32); 1330 | ((u64)(svm->vcpu.arch.regs[VCPU_REGS_RDX] & -1u) << 32);
1331
1332 KVMTRACE_3D(MSR_WRITE, &svm->vcpu, ecx, (u32)data, (u32)(data >> 32),
1333 handler);
1334
1318 svm->next_rip = svm->vmcb->save.rip + 2; 1335 svm->next_rip = svm->vmcb->save.rip + 2;
1319 if (svm_set_msr(&svm->vcpu, ecx, data)) 1336 if (svm_set_msr(&svm->vcpu, ecx, data))
1320 kvm_inject_gp(&svm->vcpu, 0); 1337 kvm_inject_gp(&svm->vcpu, 0);
@@ -1334,6 +1351,8 @@ static int msr_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1334static int interrupt_window_interception(struct vcpu_svm *svm, 1351static int interrupt_window_interception(struct vcpu_svm *svm,
1335 struct kvm_run *kvm_run) 1352 struct kvm_run *kvm_run)
1336{ 1353{
1354 KVMTRACE_0D(PEND_INTR, &svm->vcpu, handler);
1355
1337 svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_VINTR); 1356 svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_VINTR);
1338 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK; 1357 svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
1339 /* 1358 /*
@@ -1408,6 +1427,9 @@ static int handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
1408 struct vcpu_svm *svm = to_svm(vcpu); 1427 struct vcpu_svm *svm = to_svm(vcpu);
1409 u32 exit_code = svm->vmcb->control.exit_code; 1428 u32 exit_code = svm->vmcb->control.exit_code;
1410 1429
1430 KVMTRACE_3D(VMEXIT, vcpu, exit_code, (u32)svm->vmcb->save.rip,
1431 (u32)((u64)svm->vmcb->save.rip >> 32), entryexit);
1432
1411 if (npt_enabled) { 1433 if (npt_enabled) {
1412 int mmu_reload = 0; 1434 int mmu_reload = 0;
1413 if ((vcpu->arch.cr0 ^ svm->vmcb->save.cr0) & X86_CR0_PG) { 1435 if ((vcpu->arch.cr0 ^ svm->vmcb->save.cr0) & X86_CR0_PG) {
@@ -1481,6 +1503,8 @@ static inline void svm_inject_irq(struct vcpu_svm *svm, int irq)
1481{ 1503{
1482 struct vmcb_control_area *control; 1504 struct vmcb_control_area *control;
1483 1505
1506 KVMTRACE_1D(INJ_VIRQ, &svm->vcpu, (u32)irq, handler);
1507
1484 control = &svm->vmcb->control; 1508 control = &svm->vmcb->control;
1485 control->int_vector = irq; 1509 control->int_vector = irq;
1486 control->int_ctl &= ~V_INTR_PRIO_MASK; 1510 control->int_ctl &= ~V_INTR_PRIO_MASK;