diff options
author | Bryan Cantrill <bryan@joyent.com> | 2011-11-29 06:23:47 +0000 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2011-11-29 06:23:47 +0000 |
commit | 3b2aaad2c0647aa661548ee3add64f1aa590100c (patch) | |
tree | f496dae87ac9db7c36d9aaf7d897297340d50d93 /kvm_host.h | |
parent | a131c2d183ff020f325c894f2d5d20a8c93ea3d9 (diff) | |
download | illumos-kvm-3b2aaad2c0647aa661548ee3add64f1aa590100c.tar.gz |
HVM-701 need static instrumentation in kvm_ctx_save()/kvm_ctx_restore()
Diffstat (limited to 'kvm_host.h')
-rw-r--r-- | kvm_host.h | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -100,6 +100,29 @@ extern int kvm_io_bus_unregister_dev(struct kvm *, enum kvm_bus, #define KVM_MAX_IRQ_ROUTES 1024 +#define KVM_RINGBUF_NENTRIES 512 + +#define KVM_RINGBUF_TAG_CTXSAVE 1 +#define KVM_RINGBUF_TAG_CTXRESTORE 2 +#define KVM_RINGBUF_TAG_VMPTRLD 3 +#define KVM_RINGBUF_TAG_VCPUMIGRATE 4 +#define KVM_RINGBUF_TAG_VCPUCLEAR 5 + +typedef struct kvm_ringbuf_entry { + uint32_t kvmre_tag; /* tag for this entry */ + uint32_t kvmre_cpuid; /* CPU of entry */ + uint64_t kvmre_thread; /* thread for entry */ + uint64_t kvmre_tsc; /* TSC at time of entry */ + uint64_t kvmre_payload; /* payload for this entry */ +} kvm_ringbuf_entry_t; + +typedef struct kvm_ringbuf { + kvm_ringbuf_entry_t kvmr_buf[KVM_RINGBUF_NENTRIES]; /* ring buffer */ + uint32_t kvmr_ent; /* current entry */ +} kvm_ringbuf_t; + +extern void kvm_ringbuf_record(kvm_ringbuf_t *, uint32_t, uint64_t); + typedef struct kvm_vcpu { struct kvm *kvm; int vcpu_id; @@ -117,7 +140,7 @@ typedef struct kvm_vcpu { kcondvar_t kvcpu_kick_cv; kvm_vcpu_stats_t kvcpu_stats; kstat_t *kvcpu_kstat; - + kvm_ringbuf_t kvcpu_ringbuf; int sigset_active; sigset_t sigset; int mmio_needed; |