[PATCH 27/38] KVM: Move the vmx segment field definitions to vmx.c

From: Avi Kivity
Date: Mon Nov 27 2006 - 07:37:59 EST


Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx>

Index: linux-2.6/drivers/kvm/kvm_main.c
===================================================================
--- linux-2.6.orig/drivers/kvm/kvm_main.c
+++ linux-2.6/drivers/kvm/kvm_main.c
@@ -65,31 +65,6 @@ static struct kvm_stats_debugfs_item {

static struct dentry *debugfs_dir;

-#define VMX_SEGMENT_FIELD(seg) \
- [VCPU_SREG_##seg] { \
- GUEST_##seg##_SELECTOR, \
- GUEST_##seg##_BASE, \
- GUEST_##seg##_LIMIT, \
- GUEST_##seg##_AR_BYTES, \
- }
-
-struct kvm_vmx_segment_field {
- unsigned selector;
- unsigned base;
- unsigned limit;
- unsigned ar_bytes;
-} kvm_vmx_segment_fields[] = {
- VMX_SEGMENT_FIELD(CS),
- VMX_SEGMENT_FIELD(DS),
- VMX_SEGMENT_FIELD(ES),
- VMX_SEGMENT_FIELD(FS),
- VMX_SEGMENT_FIELD(GS),
- VMX_SEGMENT_FIELD(SS),
- VMX_SEGMENT_FIELD(TR),
- VMX_SEGMENT_FIELD(LDTR),
-};
-EXPORT_SYMBOL_GPL(kvm_vmx_segment_fields);
-
#define MAX_IO_MSRS 256

#define CR0_RESEVED_BITS 0xffffffff1ffaffc0ULL
Index: linux-2.6/drivers/kvm/vmx.c
===================================================================
--- linux-2.6.orig/drivers/kvm/vmx.c
+++ linux-2.6/drivers/kvm/vmx.c
@@ -42,12 +42,29 @@ extern struct vmcs_descriptor {
u32 revision_id;
} vmcs_descriptor;

-extern struct kvm_vmx_segment_field {
+#define VMX_SEGMENT_FIELD(seg) \
+ [VCPU_SREG_##seg] { \
+ GUEST_##seg##_SELECTOR, \
+ GUEST_##seg##_BASE, \
+ GUEST_##seg##_LIMIT, \
+ GUEST_##seg##_AR_BYTES, \
+ }
+
+static struct kvm_vmx_segment_field {
unsigned selector;
unsigned base;
unsigned limit;
unsigned ar_bytes;
-} kvm_vmx_segment_fields[];
+} kvm_vmx_segment_fields[] = {
+ VMX_SEGMENT_FIELD(CS),
+ VMX_SEGMENT_FIELD(DS),
+ VMX_SEGMENT_FIELD(ES),
+ VMX_SEGMENT_FIELD(FS),
+ VMX_SEGMENT_FIELD(GS),
+ VMX_SEGMENT_FIELD(SS),
+ VMX_SEGMENT_FIELD(TR),
+ VMX_SEGMENT_FIELD(LDTR),
+};

static const u32 vmx_msr_index[] = {
#ifdef __x86_64__
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/