lkml.org 
[lkml]   [2006]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 27/38] KVM: Move the vmx segment field definitions to vmx.c
From
Date
Signed-off-by: Avi Kivity <avi@qumranet.com>

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-11-27 13:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site