diff options
author | Mike Day <ncmike@ncultra.org> | 2007-10-08 09:02:08 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:50 -0500 |
commit | d77c26fce93d07802db97498959587eb9347b31d (patch) | |
tree | ed49397152d9a8c2ce3dda751a235283f07ef220 /drivers/kvm/svm.c | |
parent | 7e620d16b8838bc0ad5b27d2dd55796270cd588c (diff) |
KVM: CodingStyle cleanup
Signed-off-by: Mike D. Day <ncmike@ncultra.org>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index fb2e591d5397..7b21576b62bc 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -229,12 +229,11 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) | |||
229 | printk(KERN_DEBUG "%s: NOP\n", __FUNCTION__); | 229 | printk(KERN_DEBUG "%s: NOP\n", __FUNCTION__); |
230 | return; | 230 | return; |
231 | } | 231 | } |
232 | if (svm->next_rip - svm->vmcb->save.rip > MAX_INST_SIZE) { | 232 | if (svm->next_rip - svm->vmcb->save.rip > MAX_INST_SIZE) |
233 | printk(KERN_ERR "%s: ip 0x%llx next 0x%llx\n", | 233 | printk(KERN_ERR "%s: ip 0x%llx next 0x%llx\n", |
234 | __FUNCTION__, | 234 | __FUNCTION__, |
235 | svm->vmcb->save.rip, | 235 | svm->vmcb->save.rip, |
236 | svm->next_rip); | 236 | svm->next_rip); |
237 | } | ||
238 | 237 | ||
239 | vcpu->rip = svm->vmcb->save.rip = svm->next_rip; | 238 | vcpu->rip = svm->vmcb->save.rip = svm->next_rip; |
240 | svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; | 239 | svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; |
@@ -312,7 +311,7 @@ static void svm_hardware_enable(void *garbage) | |||
312 | svm_data->next_asid = svm_data->max_asid + 1; | 311 | svm_data->next_asid = svm_data->max_asid + 1; |
313 | svm_features = cpuid_edx(SVM_CPUID_FUNC); | 312 | svm_features = cpuid_edx(SVM_CPUID_FUNC); |
314 | 313 | ||
315 | asm volatile ( "sgdt %0" : "=m"(gdt_descr) ); | 314 | asm volatile ("sgdt %0" : "=m"(gdt_descr)); |
316 | gdt = (struct desc_struct *)gdt_descr.address; | 315 | gdt = (struct desc_struct *)gdt_descr.address; |
317 | svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); | 316 | svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); |
318 | 317 | ||
@@ -544,8 +543,7 @@ static void init_vmcb(struct vmcb *vmcb) | |||
544 | init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); | 543 | init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); |
545 | 544 | ||
546 | save->efer = MSR_EFER_SVME_MASK; | 545 | save->efer = MSR_EFER_SVME_MASK; |
547 | 546 | save->dr6 = 0xffff0ff0; | |
548 | save->dr6 = 0xffff0ff0; | ||
549 | save->dr7 = 0x400; | 547 | save->dr7 = 0x400; |
550 | save->rflags = 2; | 548 | save->rflags = 2; |
551 | save->rip = 0x0000fff0; | 549 | save->rip = 0x0000fff0; |
@@ -783,7 +781,7 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) | |||
783 | svm->vmcb->save.efer |= KVM_EFER_LMA | KVM_EFER_LME; | 781 | svm->vmcb->save.efer |= KVM_EFER_LMA | KVM_EFER_LME; |
784 | } | 782 | } |
785 | 783 | ||
786 | if (is_paging(vcpu) && !(cr0 & X86_CR0_PG) ) { | 784 | if (is_paging(vcpu) && !(cr0 & X86_CR0_PG)) { |
787 | vcpu->shadow_efer &= ~KVM_EFER_LMA; | 785 | vcpu->shadow_efer &= ~KVM_EFER_LMA; |
788 | svm->vmcb->save.efer &= ~(KVM_EFER_LMA | KVM_EFER_LME); | 786 | svm->vmcb->save.efer &= ~(KVM_EFER_LMA | KVM_EFER_LME); |
789 | } | 787 | } |
@@ -1010,7 +1008,7 @@ static int shutdown_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) | |||
1010 | 1008 | ||
1011 | static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) | 1009 | static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) |
1012 | { | 1010 | { |
1013 | u32 io_info = svm->vmcb->control.exit_info_1; //address size bug? | 1011 | u32 io_info = svm->vmcb->control.exit_info_1; /* address size bug? */ |
1014 | int size, down, in, string, rep; | 1012 | int size, down, in, string, rep; |
1015 | unsigned port; | 1013 | unsigned port; |
1016 | 1014 | ||
@@ -1316,7 +1314,7 @@ static void reload_tss(struct kvm_vcpu *vcpu) | |||
1316 | int cpu = raw_smp_processor_id(); | 1314 | int cpu = raw_smp_processor_id(); |
1317 | 1315 | ||
1318 | struct svm_cpu_data *svm_data = per_cpu(svm_data, cpu); | 1316 | struct svm_cpu_data *svm_data = per_cpu(svm_data, cpu); |
1319 | svm_data->tss_desc->type = 9; //available 32/64-bit TSS | 1317 | svm_data->tss_desc->type = 9; /* available 32/64-bit TSS */ |
1320 | load_TR_desc(); | 1318 | load_TR_desc(); |
1321 | } | 1319 | } |
1322 | 1320 | ||
@@ -1434,9 +1432,9 @@ static void do_interrupt_requests(struct kvm_vcpu *vcpu, | |||
1434 | * Interrupts blocked. Wait for unblock. | 1432 | * Interrupts blocked. Wait for unblock. |
1435 | */ | 1433 | */ |
1436 | if (!svm->vcpu.interrupt_window_open && | 1434 | if (!svm->vcpu.interrupt_window_open && |
1437 | (svm->vcpu.irq_summary || kvm_run->request_interrupt_window)) { | 1435 | (svm->vcpu.irq_summary || kvm_run->request_interrupt_window)) |
1438 | control->intercept |= 1ULL << INTERCEPT_VINTR; | 1436 | control->intercept |= 1ULL << INTERCEPT_VINTR; |
1439 | } else | 1437 | else |
1440 | control->intercept &= ~(1ULL << INTERCEPT_VINTR); | 1438 | control->intercept &= ~(1ULL << INTERCEPT_VINTR); |
1441 | } | 1439 | } |
1442 | 1440 | ||
@@ -1581,23 +1579,23 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
1581 | : | 1579 | : |
1582 | : [svm]"a"(svm), | 1580 | : [svm]"a"(svm), |
1583 | [vmcb]"i"(offsetof(struct vcpu_svm, vmcb_pa)), | 1581 | [vmcb]"i"(offsetof(struct vcpu_svm, vmcb_pa)), |
1584 | [rbx]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_RBX])), | 1582 | [rbx]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_RBX])), |
1585 | [rcx]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_RCX])), | 1583 | [rcx]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_RCX])), |
1586 | [rdx]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_RDX])), | 1584 | [rdx]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_RDX])), |
1587 | [rsi]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_RSI])), | 1585 | [rsi]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_RSI])), |
1588 | [rdi]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_RDI])), | 1586 | [rdi]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_RDI])), |
1589 | [rbp]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_RBP])) | 1587 | [rbp]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_RBP])) |
1590 | #ifdef CONFIG_X86_64 | 1588 | #ifdef CONFIG_X86_64 |
1591 | ,[r8 ]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R8])), | 1589 | , [r8]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R8])), |
1592 | [r9 ]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R9 ])), | 1590 | [r9]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R9])), |
1593 | [r10]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R10])), | 1591 | [r10]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R10])), |
1594 | [r11]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R11])), | 1592 | [r11]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R11])), |
1595 | [r12]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R12])), | 1593 | [r12]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R12])), |
1596 | [r13]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R13])), | 1594 | [r13]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R13])), |
1597 | [r14]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R14])), | 1595 | [r14]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R14])), |
1598 | [r15]"i"(offsetof(struct vcpu_svm,vcpu.regs[VCPU_REGS_R15])) | 1596 | [r15]"i"(offsetof(struct vcpu_svm, vcpu.regs[VCPU_REGS_R15])) |
1599 | #endif | 1597 | #endif |
1600 | : "cc", "memory" ); | 1598 | : "cc", "memory"); |
1601 | 1599 | ||
1602 | if ((svm->vmcb->save.dr7 & 0xff)) | 1600 | if ((svm->vmcb->save.dr7 & 0xff)) |
1603 | load_db_regs(svm->host_db_regs); | 1601 | load_db_regs(svm->host_db_regs); |