summaryrefslogtreecommitdiff
path: root/kvm_cache_regs.h
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-06-03 13:53:12 -0700
committerRobert Mustacchi <rm@joyent.com>2011-06-03 13:53:12 -0700
commit0e20210cdbb940ca91007d08ff1984c4286776a1 (patch)
treeb235b8dbc7c0129395288266a6f626a77a7f774c /kvm_cache_regs.h
parent45ba741822f49e8a3d8e871429559deb15478647 (diff)
downloadillumos-kvm-0e20210cdbb940ca91007d08ff1984c4286776a1.tar.gz
HVM-286 Move code into kvm_cache_regs.[ch]
Diffstat (limited to 'kvm_cache_regs.h')
-rw-r--r--kvm_cache_regs.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/kvm_cache_regs.h b/kvm_cache_regs.h
new file mode 100644
index 0000000..b8ea86f
--- /dev/null
+++ b/kvm_cache_regs.h
@@ -0,0 +1,22 @@
+#ifndef ASM_KVM_CACHE_REGS_H
+#define ASM_KVM_CACHE_REGS_H
+
+#include "processor-flags.h"
+#include <sys/types.h>
+
+#define KVM_POSSIBLE_CR0_GUEST_BITS X86_CR0_TS
+#define KVM_POSSIBLE_CR4_GUEST_BITS \
+ (X86_CR4_PVI | X86_CR4_DE | X86_CR4_PCE | X86_CR4_OSFXSR \
+ | X86_CR4_OSXMMEXCPT | X86_CR4_PGE)
+
+extern unsigned long kvm_register_read(struct kvm_vcpu *, enum kvm_reg);
+extern void kvm_register_write(struct kvm_vcpu *, enum kvm_reg, unsigned long);
+extern unsigned long kvm_rip_read(struct kvm_vcpu *vcpu);
+extern void kvm_rip_write(struct kvm_vcpu *vcpu, unsigned long val);
+extern uint64_t kvm_pdptr_read(struct kvm_vcpu *vcpu, int index);
+extern ulong kvm_read_cr0_bits(struct kvm_vcpu *vcpu, ulong mask);
+extern ulong kvm_read_cr0(struct kvm_vcpu *vcpu);
+extern ulong kvm_read_cr4_bits(struct kvm_vcpu *vcpu, ulong mask);
+extern ulong kvm_read_cr4(struct kvm_vcpu *vcpu);
+
+#endif