summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-06-08 09:01:28 -0700
committerRobert Mustacchi <rm@joyent.com>2011-06-08 09:01:28 -0700
commit36fc5f95d308e5c4bda3ed797c2fdd38c36fea19 (patch)
treebc3026c013cb1ebb15034ec91e71bf4911919234
parent5aad745325c6c384437e499c2cde0fb57931abaf (diff)
downloadillumos-kvm-36fc5f95d308e5c4bda3ed797c2fdd38c36fea19.tar.gz
HVM-325 vmx_io_bitmap stuff should all be in kvm_vmx.c
-rw-r--r--kvm_vmx.c30
-rw-r--r--kvm_x86.c18
2 files changed, 17 insertions, 31 deletions
diff --git a/kvm_vmx.c b/kvm_vmx.c
index 5edb0d7..8e5797c 100644
--- a/kvm_vmx.c
+++ b/kvm_vmx.c
@@ -53,13 +53,23 @@ static int enable_unrestricted_guest = 1;
static int emulate_invalid_guest_state = 0;
static kmem_cache_t *kvm_vcpu_cache;
-/*
- * In linux, there is a separate vmx kernel module from the kvm driver.
- * That may be a good idea, but we're going to do everything in
- * the kvm driver, for now.
- * The call to vmx_init() in _init() is done when the vmx module
- * is loaded on linux.
- */
+#ifdef XXX_KVM_DECLARATION
+static unsigned long *vmx_io_bitmap_a;
+static unsigned long *vmx_io_bitmap_b;
+static unsigned long *vmx_msr_bitmap_legacy;
+static unsigned long *vmx_msr_bitmap_longmode;
+#else
+/* make these arrays to try to force into low 4GB memory... */
+/* also need to be aligned... */
+__attribute__((__aligned__(PAGESIZE)))static unsigned long
+ vmx_io_bitmap_a[PAGESIZE / sizeof (unsigned long)];
+__attribute__((__aligned__(PAGESIZE)))static unsigned long
+ vmx_io_bitmap_b[PAGESIZE / sizeof (unsigned long)];
+__attribute__((__aligned__(PAGESIZE)))static unsigned long
+ vmx_msr_bitmap_legacy[PAGESIZE / sizeof (unsigned long)];
+__attribute__((__aligned__(PAGESIZE)))static unsigned long
+ vmx_msr_bitmap_longmode[PAGESIZE / sizeof (unsigned long)];
+#endif
static struct vmcs **vmxarea; /* 1 per cpu */
static struct vmcs **current_vmcs;
@@ -177,12 +187,6 @@ to_vmx(struct kvm_vcpu *vcpu)
#endif
}
-/* XXX Should be pointers, not arrays of unknown length! */
-static unsigned long vmx_io_bitmap_a[];
-static unsigned long vmx_io_bitmap_b[];
-static unsigned long vmx_msr_bitmap_legacy[];
-static unsigned long vmx_msr_bitmap_longmode[];
-
typedef struct vmcs_config {
int size;
int order;
diff --git a/kvm_x86.c b/kvm_x86.c
index e6cbf00..f5a3f9c 100644
--- a/kvm_x86.c
+++ b/kvm_x86.c
@@ -40,24 +40,6 @@
extern caddr_t smmap64(caddr_t addr, size_t len, int prot, int flags,
int fd, off_t pos);
-#ifdef XXX_KVM_DECLARATION
-unsigned long *vmx_io_bitmap_a;
-unsigned long *vmx_io_bitmap_b;
-unsigned long *vmx_msr_bitmap_legacy;
-unsigned long *vmx_msr_bitmap_longmode;
-#else
-/* make these arrays to try to force into low 4GB memory... */
-/* also need to be aligned... */
-__attribute__((__aligned__(PAGESIZE)))unsigned long
- vmx_io_bitmap_a[PAGESIZE / sizeof (unsigned long)];
-__attribute__((__aligned__(PAGESIZE)))unsigned long
- vmx_io_bitmap_b[PAGESIZE / sizeof (unsigned long)];
-__attribute__((__aligned__(PAGESIZE)))unsigned long
- vmx_msr_bitmap_legacy[PAGESIZE / sizeof (unsigned long)];
-__attribute__((__aligned__(PAGESIZE)))unsigned long
- vmx_msr_bitmap_longmode[PAGESIZE / sizeof (unsigned long)];
-#endif
-
static unsigned long empty_zero_page[PAGESIZE / sizeof (unsigned long)];
#define MAX_IO_MSRS 256