aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2006-12-13 03:33:45 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:46 -0500
commit05b3e0c2c791a70bf0735aaec53cdf6d340eef85 (patch)
treecfdc46f216e5a7996972ff88681dd03bed9b0022 /drivers/kvm/kvm_main.c
parent5aff458e9c90df55d6badabd89a1a063a80d9768 (diff)
[PATCH] KVM: Replace __x86_64__ with CONFIG_X86_64
As per akpm's request. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index b6b8a41b5ec8..f8f11c75ecbd 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -83,7 +83,7 @@ struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr)
83} 83}
84EXPORT_SYMBOL_GPL(find_msr_entry); 84EXPORT_SYMBOL_GPL(find_msr_entry);
85 85
86#ifdef __x86_64__ 86#ifdef CONFIG_X86_64
87// LDT or TSS descriptor in the GDT. 16 bytes. 87// LDT or TSS descriptor in the GDT. 16 bytes.
88struct segment_descriptor_64 { 88struct segment_descriptor_64 {
89 struct segment_descriptor s; 89 struct segment_descriptor s;
@@ -115,7 +115,7 @@ unsigned long segment_base(u16 selector)
115 } 115 }
116 d = (struct segment_descriptor *)(table_base + (selector & ~7)); 116 d = (struct segment_descriptor *)(table_base + (selector & ~7));
117 v = d->base_low | ((ul)d->base_mid << 16) | ((ul)d->base_high << 24); 117 v = d->base_low | ((ul)d->base_mid << 16) | ((ul)d->base_high << 24);
118#ifdef __x86_64__ 118#ifdef CONFIG_X86_64
119 if (d->system == 0 119 if (d->system == 0
120 && (d->type == 2 || d->type == 9 || d->type == 11)) 120 && (d->type == 2 || d->type == 9 || d->type == 11))
121 v |= ((ul)((struct segment_descriptor_64 *)d)->base_higher) << 32; 121 v |= ((ul)((struct segment_descriptor_64 *)d)->base_higher) << 32;
@@ -351,7 +351,7 @@ void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
351 } 351 }
352 352
353 if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) { 353 if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) {
354#ifdef __x86_64__ 354#ifdef CONFIG_X86_64
355 if ((vcpu->shadow_efer & EFER_LME)) { 355 if ((vcpu->shadow_efer & EFER_LME)) {
356 int cs_db, cs_l; 356 int cs_db, cs_l;
357 357
@@ -1120,7 +1120,7 @@ static int get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
1120 return kvm_arch_ops->get_msr(vcpu, msr_index, pdata); 1120 return kvm_arch_ops->get_msr(vcpu, msr_index, pdata);
1121} 1121}
1122 1122
1123#ifdef __x86_64__ 1123#ifdef CONFIG_X86_64
1124 1124
1125void set_efer(struct kvm_vcpu *vcpu, u64 efer) 1125void set_efer(struct kvm_vcpu *vcpu, u64 efer)
1126{ 1126{
@@ -1243,7 +1243,7 @@ static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs)
1243 regs->rdi = vcpu->regs[VCPU_REGS_RDI]; 1243 regs->rdi = vcpu->regs[VCPU_REGS_RDI];
1244 regs->rsp = vcpu->regs[VCPU_REGS_RSP]; 1244 regs->rsp = vcpu->regs[VCPU_REGS_RSP];
1245 regs->rbp = vcpu->regs[VCPU_REGS_RBP]; 1245 regs->rbp = vcpu->regs[VCPU_REGS_RBP];
1246#ifdef __x86_64__ 1246#ifdef CONFIG_X86_64
1247 regs->r8 = vcpu->regs[VCPU_REGS_R8]; 1247 regs->r8 = vcpu->regs[VCPU_REGS_R8];
1248 regs->r9 = vcpu->regs[VCPU_REGS_R9]; 1248 regs->r9 = vcpu->regs[VCPU_REGS_R9];
1249 regs->r10 = vcpu->regs[VCPU_REGS_R10]; 1249 regs->r10 = vcpu->regs[VCPU_REGS_R10];
@@ -1287,7 +1287,7 @@ static int kvm_dev_ioctl_set_regs(struct kvm *kvm, struct kvm_regs *regs)
1287 vcpu->regs[VCPU_REGS_RDI] = regs->rdi; 1287 vcpu->regs[VCPU_REGS_RDI] = regs->rdi;
1288 vcpu->regs[VCPU_REGS_RSP] = regs->rsp; 1288 vcpu->regs[VCPU_REGS_RSP] = regs->rsp;
1289 vcpu->regs[VCPU_REGS_RBP] = regs->rbp; 1289 vcpu->regs[VCPU_REGS_RBP] = regs->rbp;
1290#ifdef __x86_64__ 1290#ifdef CONFIG_X86_64
1291 vcpu->regs[VCPU_REGS_R8] = regs->r8; 1291 vcpu->regs[VCPU_REGS_R8] = regs->r8;
1292 vcpu->regs[VCPU_REGS_R9] = regs->r9; 1292 vcpu->regs[VCPU_REGS_R9] = regs->r9;
1293 vcpu->regs[VCPU_REGS_R10] = regs->r10; 1293 vcpu->regs[VCPU_REGS_R10] = regs->r10;
@@ -1401,7 +1401,7 @@ static int kvm_dev_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs)
1401 vcpu->cr8 = sregs->cr8; 1401 vcpu->cr8 = sregs->cr8;
1402 1402
1403 mmu_reset_needed |= vcpu->shadow_efer != sregs->efer; 1403 mmu_reset_needed |= vcpu->shadow_efer != sregs->efer;
1404#ifdef __x86_64__ 1404#ifdef CONFIG_X86_64
1405 kvm_arch_ops->set_efer(vcpu, sregs->efer); 1405 kvm_arch_ops->set_efer(vcpu, sregs->efer);
1406#endif 1406#endif
1407 vcpu->apic_base = sregs->apic_base; 1407 vcpu->apic_base = sregs->apic_base;
@@ -1434,7 +1434,7 @@ static int kvm_dev_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs)
1434static u32 msrs_to_save[] = { 1434static u32 msrs_to_save[] = {
1435 MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, 1435 MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP,
1436 MSR_K6_STAR, 1436 MSR_K6_STAR,
1437#ifdef __x86_64__ 1437#ifdef CONFIG_X86_64
1438 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, 1438 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
1439#endif 1439#endif
1440 MSR_IA32_TIME_STAMP_COUNTER, 1440 MSR_IA32_TIME_STAMP_COUNTER,