summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2011-12-02 01:04:30 +0000
committerBryan Cantrill <bryan@joyent.com>2011-12-02 01:04:30 +0000
commitcfe5813f8247c5492e51c7f072b85a4d0e13483b (patch)
treeb00d3543a9a955e6582e911117068428d836d127
parent3b2aaad2c0647aa661548ee3add64f1aa590100c (diff)
downloadillumos-kvm-cfe5813f8247c5492e51c7f072b85a4d0e13483b.tar.gz
HVM-706 need static instrumentation in vcpu_load()/vcpu_put()
-rw-r--r--kvm.c4
-rw-r--r--kvm_host.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/kvm.c b/kvm.c
index a7a9998..2383b1d 100644
--- a/kvm.c
+++ b/kvm.c
@@ -484,6 +484,8 @@ vcpu_load(struct kvm_vcpu *vcpu)
installctx(curthread, vcpu, kvm_ctx_save, kvm_ctx_restore, NULL,
NULL, NULL, NULL);
kvm_arch_vcpu_load(vcpu, cpu);
+ kvm_ringbuf_record(&vcpu->kvcpu_ringbuf,
+ KVM_RINGBUF_TAG_VCPULOAD, vcpu->cpu);
kpreempt_enable();
}
@@ -502,6 +504,8 @@ vcpu_put(struct kvm_vcpu *vcpu)
kvm_fire_urn(vcpu);
removectx(curthread, vcpu, kvm_ctx_save, kvm_ctx_restore, NULL,
NULL, NULL, NULL);
+ kvm_ringbuf_record(&vcpu->kvcpu_ringbuf,
+ KVM_RINGBUF_TAG_VCPUPUT, vcpu->cpu);
kpreempt_enable();
mutex_exit(&vcpu->mutex);
}
diff --git a/kvm_host.h b/kvm_host.h
index b520ea7..6d8b3da 100644
--- a/kvm_host.h
+++ b/kvm_host.h
@@ -107,6 +107,8 @@ extern int kvm_io_bus_unregister_dev(struct kvm *, enum kvm_bus,
#define KVM_RINGBUF_TAG_VMPTRLD 3
#define KVM_RINGBUF_TAG_VCPUMIGRATE 4
#define KVM_RINGBUF_TAG_VCPUCLEAR 5
+#define KVM_RINGBUF_TAG_VCPULOAD 6
+#define KVM_RINGBUF_TAG_VCPUPUT 7
typedef struct kvm_ringbuf_entry {
uint32_t kvmre_tag; /* tag for this entry */