aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.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/svm.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/svm.c')
-rw-r--r--drivers/kvm/svm.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index d6042eed7a78..73a022c1f7b6 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -287,7 +287,7 @@ static void svm_hardware_enable(void *garbage)
287 287
288 struct svm_cpu_data *svm_data; 288 struct svm_cpu_data *svm_data;
289 uint64_t efer; 289 uint64_t efer;
290#ifdef __x86_64__ 290#ifdef CONFIG_X86_64
291 struct desc_ptr gdt_descr; 291 struct desc_ptr gdt_descr;
292#else 292#else
293 struct Xgt_desc_struct gdt_descr; 293 struct Xgt_desc_struct gdt_descr;
@@ -397,7 +397,7 @@ static __init int svm_hardware_setup(void)
397 memset(msrpm_va, 0xff, PAGE_SIZE * (1 << MSRPM_ALLOC_ORDER)); 397 memset(msrpm_va, 0xff, PAGE_SIZE * (1 << MSRPM_ALLOC_ORDER));
398 msrpm_base = page_to_pfn(msrpm_pages) << PAGE_SHIFT; 398 msrpm_base = page_to_pfn(msrpm_pages) << PAGE_SHIFT;
399 399
400#ifdef __x86_64__ 400#ifdef CONFIG_X86_64
401 set_msr_interception(msrpm_va, MSR_GS_BASE, 1, 1); 401 set_msr_interception(msrpm_va, MSR_GS_BASE, 1, 1);
402 set_msr_interception(msrpm_va, MSR_FS_BASE, 1, 1); 402 set_msr_interception(msrpm_va, MSR_FS_BASE, 1, 1);
403 set_msr_interception(msrpm_va, MSR_KERNEL_GS_BASE, 1, 1); 403 set_msr_interception(msrpm_va, MSR_KERNEL_GS_BASE, 1, 1);
@@ -704,7 +704,7 @@ static void svm_set_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt)
704 704
705static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) 705static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
706{ 706{
707#ifdef __x86_64__ 707#ifdef CONFIG_X86_64
708 if (vcpu->shadow_efer & KVM_EFER_LME) { 708 if (vcpu->shadow_efer & KVM_EFER_LME) {
709 if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) { 709 if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) {
710 vcpu->shadow_efer |= KVM_EFER_LMA; 710 vcpu->shadow_efer |= KVM_EFER_LMA;
@@ -1097,7 +1097,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data)
1097 case MSR_IA32_APICBASE: 1097 case MSR_IA32_APICBASE:
1098 *data = vcpu->apic_base; 1098 *data = vcpu->apic_base;
1099 break; 1099 break;
1100#ifdef __x86_64__ 1100#ifdef CONFIG_X86_64
1101 case MSR_STAR: 1101 case MSR_STAR:
1102 *data = vcpu->svm->vmcb->save.star; 1102 *data = vcpu->svm->vmcb->save.star;
1103 break; 1103 break;
@@ -1149,7 +1149,7 @@ static int rdmsr_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
1149static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) 1149static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
1150{ 1150{
1151 switch (ecx) { 1151 switch (ecx) {
1152#ifdef __x86_64__ 1152#ifdef CONFIG_X86_64
1153 case MSR_EFER: 1153 case MSR_EFER:
1154 set_efer(vcpu, data); 1154 set_efer(vcpu, data);
1155 break; 1155 break;
@@ -1172,7 +1172,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data)
1172 case MSR_IA32_APICBASE: 1172 case MSR_IA32_APICBASE:
1173 vcpu->apic_base = data; 1173 vcpu->apic_base = data;
1174 break; 1174 break;
1175#ifdef __x86_64___ 1175#ifdef CONFIG_X86_64_
1176 case MSR_STAR: 1176 case MSR_STAR:
1177 vcpu->svm->vmcb->save.star = data; 1177 vcpu->svm->vmcb->save.star = data;
1178 break; 1178 break;
@@ -1387,7 +1387,7 @@ again:
1387 load_db_regs(vcpu->svm->db_regs); 1387 load_db_regs(vcpu->svm->db_regs);
1388 } 1388 }
1389 asm volatile ( 1389 asm volatile (
1390#ifdef __x86_64__ 1390#ifdef CONFIG_X86_64
1391 "push %%rbx; push %%rcx; push %%rdx;" 1391 "push %%rbx; push %%rcx; push %%rdx;"
1392 "push %%rsi; push %%rdi; push %%rbp;" 1392 "push %%rsi; push %%rdi; push %%rbp;"
1393 "push %%r8; push %%r9; push %%r10; push %%r11;" 1393 "push %%r8; push %%r9; push %%r10; push %%r11;"
@@ -1397,7 +1397,7 @@ again:
1397 "push %%esi; push %%edi; push %%ebp;" 1397 "push %%esi; push %%edi; push %%ebp;"
1398#endif 1398#endif
1399 1399
1400#ifdef __x86_64__ 1400#ifdef CONFIG_X86_64
1401 "mov %c[rbx](%[vcpu]), %%rbx \n\t" 1401 "mov %c[rbx](%[vcpu]), %%rbx \n\t"
1402 "mov %c[rcx](%[vcpu]), %%rcx \n\t" 1402 "mov %c[rcx](%[vcpu]), %%rcx \n\t"
1403 "mov %c[rdx](%[vcpu]), %%rdx \n\t" 1403 "mov %c[rdx](%[vcpu]), %%rdx \n\t"
@@ -1421,7 +1421,7 @@ again:
1421 "mov %c[rbp](%[vcpu]), %%ebp \n\t" 1421 "mov %c[rbp](%[vcpu]), %%ebp \n\t"
1422#endif 1422#endif
1423 1423
1424#ifdef __x86_64__ 1424#ifdef CONFIG_X86_64
1425 /* Enter guest mode */ 1425 /* Enter guest mode */
1426 "push %%rax \n\t" 1426 "push %%rax \n\t"
1427 "mov %c[svm](%[vcpu]), %%rax \n\t" 1427 "mov %c[svm](%[vcpu]), %%rax \n\t"
@@ -1442,7 +1442,7 @@ again:
1442#endif 1442#endif
1443 1443
1444 /* Save guest registers, load host registers */ 1444 /* Save guest registers, load host registers */
1445#ifdef __x86_64__ 1445#ifdef CONFIG_X86_64
1446 "mov %%rbx, %c[rbx](%[vcpu]) \n\t" 1446 "mov %%rbx, %c[rbx](%[vcpu]) \n\t"
1447 "mov %%rcx, %c[rcx](%[vcpu]) \n\t" 1447 "mov %%rcx, %c[rcx](%[vcpu]) \n\t"
1448 "mov %%rdx, %c[rdx](%[vcpu]) \n\t" 1448 "mov %%rdx, %c[rdx](%[vcpu]) \n\t"
@@ -1483,7 +1483,7 @@ again:
1483 [rsi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RSI])), 1483 [rsi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RSI])),
1484 [rdi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDI])), 1484 [rdi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDI])),
1485 [rbp]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBP])) 1485 [rbp]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBP]))
1486#ifdef __x86_64__ 1486#ifdef CONFIG_X86_64
1487 ,[r8 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R8 ])), 1487 ,[r8 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R8 ])),
1488 [r9 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R9 ])), 1488 [r9 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R9 ])),
1489 [r10]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R10])), 1489 [r10]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R10])),