diff options
author | Bryan Cantrill <bryan@joyent.com> | 2011-07-19 16:32:47 -0700 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2011-07-19 16:32:47 -0700 |
commit | 42a9c3816a926987b47358bb26b3959d411968ac (patch) | |
tree | 02f2bfc56e3dccc1c7656ef653d9709c69191e15 /kvm_vmx.c | |
parent | 5fb9de066aa85583cc403dab8a2bae53aa0f925f (diff) | |
download | illumos-kvm-42a9c3816a926987b47358bb26b3959d411968ac.tar.gz |
HVM-495 need DTrace probes around instructions that operate on VMCS state
Diffstat (limited to 'kvm_vmx.c')
-rw-r--r-- | kvm_vmx.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -434,6 +434,8 @@ __invvpid(int ext, uint16_t vpid, gva_t gva) uint64_t gva; } operand = { vpid, 0, gva }; + DTRACE_PROBE2(kvm__vmx__invvpid, int, vpid, uint64_t, gva); + /* BEGIN CSTYLED */ __asm__ volatile (ASM_VMX_INVVPID /* CF==1 or ZF==1 --> rc = -1 */ @@ -449,6 +451,8 @@ __invept(int ext, uint64_t eptp, gpa_t gpa) uint64_t eptp, gpa; } operand = {eptp, gpa}; + DTRACE_PROBE2(kvm__vmx__invept, uint64_t, eptp, uint64_t, gpa); + /* BEGIN CSTYLED */ __asm__ volatile (ASM_VMX_INVEPT /* CF==1 or ZF==1 --> rc = -1 */ @@ -474,6 +478,8 @@ vmcs_clear(uint64_t vmcs_pa) { unsigned char error; + DTRACE_PROBE1(kvm__vmx__vmclear, uint64_t, vmcs_pa); + /*CSTYLED*/ __asm__ volatile (__ex(ASM_VMX_VMCLEAR_RAX) "\n\tsetna %0\n" : "=g"(error) : "a"(&vmcs_pa), "m"(vmcs_pa) @@ -555,6 +561,8 @@ vmcs_readl(unsigned long field) __asm__ volatile (ASM_VMX_VMREAD_RDX_RAX : "=a"(value) : "d"(field) : "cc"); + DTRACE_PROBE2(kvm__vmx__vmread, long, field, long, value); + return (value); } @@ -588,6 +596,8 @@ __vmwrite(unsigned long field, unsigned long value) { uint8_t err = 0; + DTRACE_PROBE2(kvm__vmx__vmwrite, long, field, long, value); + /*CSTYLED*/ __asm__ volatile ( ASM_VMX_VMWRITE_RAX_RDX "\n\t" "setna %0" /* XXX: CF==1 or ZF==1 --> crash (ud2) */ @@ -831,6 +841,8 @@ vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) current_vmcs[cpu] = vmx->vmcs; + DTRACE_PROBE1(kvm__vmx__vmptrld, uint64_t, phys_addr); + /*CSTYLED*/ __asm__ volatile (ASM_VMX_VMPTRLD_RAX "; setna %0" : "=g"(error) : "a"(&phys_addr), "m"(phys_addr) @@ -1300,6 +1312,8 @@ vmx_hardware_enable(void *garbage) FEATURE_CONTROL_VMXON_ENABLED); } + DTRACE_PROBE1(kvm__vmx__vmxon, uint64_t, phys_addr); + setcr4(getcr4() | X86_CR4_VMXE); /* FIXME: not cpu hotplug safe */ /* BEGIN CSTYLED */ __asm__ volatile (ASM_VMX_VMXON_RAX @@ -1341,6 +1355,8 @@ vmclear_local_vcpus(void) static void kvm_cpu_vmxoff(void) { + DTRACE_PROBE(kvm__vmx__vmxoff); + /* BEGIN CSTYLED */ __asm__ volatile ((ASM_VMX_VMXOFF) : : : "cc"); /* END CSTYLED */ @@ -4163,6 +4179,12 @@ vmx_vcpu_run(struct kvm_vcpu *vcpu) */ vmcs_writel(HOST_CR0, read_cr0()); + if (vmx->launched) { + DTRACE_PROBE1(kvm__vmx__vmresume, struct vcpu_vmx *, vmx); + } else { + DTRACE_PROBE1(kvm__vmx__vmlaunch, struct vcpu_vmx *, vmx); + } + __asm__( /* Store host registers */ "push %%"R"dx; push %%"R"bp;" |