The patch titled KVM: Cosmetics has been added to the -mm tree. Its filename is kvm-cosmetics.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: KVM: Cosmetics From: Avi Kivity <avi@xxxxxxxxxxxx> Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/kvm/kvm_main.c | 21 ++++++++------------- drivers/kvm/paging_tmpl.h | 3 +-- drivers/kvm/svm.c | 10 +++++----- drivers/kvm/vmx.c | 4 +--- 4 files changed, 15 insertions(+), 23 deletions(-) diff -puN drivers/kvm/kvm_main.c~kvm-cosmetics drivers/kvm/kvm_main.c --- a/drivers/kvm/kvm_main.c~kvm-cosmetics +++ a/drivers/kvm/kvm_main.c @@ -126,10 +126,8 @@ static inline int valid_vcpu(int n) return likely(n >= 0 && n < KVM_MAX_VCPUS); } -int kvm_read_guest(struct kvm_vcpu *vcpu, - gva_t addr, - unsigned long size, - void *dest) +int kvm_read_guest(struct kvm_vcpu *vcpu, gva_t addr, unsigned long size, + void *dest) { unsigned char *host_buf = dest; unsigned long req_size = size; @@ -161,10 +159,8 @@ int kvm_read_guest(struct kvm_vcpu *vcpu } EXPORT_SYMBOL_GPL(kvm_read_guest); -int kvm_write_guest(struct kvm_vcpu *vcpu, - gva_t addr, - unsigned long size, - void *data) +int kvm_write_guest(struct kvm_vcpu *vcpu, gva_t addr, unsigned long size, + void *data) { unsigned char *host_buf = data; unsigned long req_size = size; @@ -457,7 +453,7 @@ EXPORT_SYMBOL_GPL(set_cr4); void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) { if (is_long_mode(vcpu)) { - if ( cr3 & CR3_L_MODE_RESEVED_BITS) { + if (cr3 & CR3_L_MODE_RESEVED_BITS) { printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n"); inject_gp(vcpu); return; @@ -774,7 +770,6 @@ static int kvm_dev_ioctl_get_dirty_log(s if (copy_to_user(log->dirty_bitmap, memslot->dirty_bitmap, n)) goto out; - if (any) { cleared = 0; for (i = 0; i < KVM_MAX_VCPUS; ++i) { @@ -903,8 +898,9 @@ static int emulator_read_emulated(unsign return X86EMUL_CONTINUE; else { gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, addr); + if (gpa == UNMAPPED_GVA) - return vcpu_printf(vcpu, "not present\n"), X86EMUL_PROPAGATE_FAULT; + return X86EMUL_PROPAGATE_FAULT; vcpu->mmio_needed = 1; vcpu->mmio_phys_addr = gpa; vcpu->mmio_size = bytes; @@ -1801,12 +1797,11 @@ static long kvm_dev_ioctl(struct file *f case KVM_GET_API_VERSION: r = KVM_API_VERSION; break; - case KVM_CREATE_VCPU: { + case KVM_CREATE_VCPU: r = kvm_dev_ioctl_create_vcpu(kvm, arg); if (r) goto out; break; - } case KVM_RUN: { struct kvm_run kvm_run; diff -puN drivers/kvm/paging_tmpl.h~kvm-cosmetics drivers/kvm/paging_tmpl.h --- a/drivers/kvm/paging_tmpl.h~kvm-cosmetics +++ a/drivers/kvm/paging_tmpl.h @@ -441,9 +441,8 @@ static int FNAME(page_fault)(struct kvm_ /* * mmio: emulate if accessible, otherwise its a guest fault. */ - if (is_io_pte(*shadow_pte)) { + if (is_io_pte(*shadow_pte)) return 1; - } ++kvm_stat.pf_fixed; kvm_mmu_audit(vcpu, "post page fault (fixed)"); diff -puN drivers/kvm/svm.c~kvm-cosmetics drivers/kvm/svm.c --- a/drivers/kvm/svm.c~kvm-cosmetics +++ a/drivers/kvm/svm.c @@ -1042,22 +1042,22 @@ static int io_interception(struct kvm_vc addr_mask = io_adress(vcpu, _in, &kvm_run->io.address); if (!addr_mask) { - printk(KERN_DEBUG "%s: get io address failed\n", __FUNCTION__); + printk(KERN_DEBUG "%s: get io address failed\n", + __FUNCTION__); return 1; } if (kvm_run->io.rep) { - kvm_run->io.count = vcpu->regs[VCPU_REGS_RCX] & addr_mask; + kvm_run->io.count + = vcpu->regs[VCPU_REGS_RCX] & addr_mask; kvm_run->io.string_down = (vcpu->svm->vmcb->save.rflags & X86_EFLAGS_DF) != 0; } - } else { + } else kvm_run->io.value = vcpu->svm->vmcb->save.rax; - } return 0; } - static int nop_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) { return 1; diff -puN drivers/kvm/vmx.c~kvm-cosmetics drivers/kvm/vmx.c --- a/drivers/kvm/vmx.c~kvm-cosmetics +++ a/drivers/kvm/vmx.c @@ -27,7 +27,6 @@ #include "segment_descriptor.h" - MODULE_AUTHOR("Qumranet"); MODULE_LICENSE("GPL"); @@ -418,10 +417,9 @@ static int vmx_set_msr(struct kvm_vcpu * case MSR_IA32_SYSENTER_ESP: vmcs_write32(GUEST_SYSENTER_ESP, data); break; - case MSR_IA32_TIME_STAMP_COUNTER: { + case MSR_IA32_TIME_STAMP_COUNTER: guest_write_tsc(data); break; - } default: msr = find_msr_entry(vcpu, msr_index); if (msr) { _ Patches currently in -mm which might be from avi@xxxxxxxxxxxx are kvm-mmu-add-missing-dirty-page-tracking-cases.patch kvm-move-virtualization-deactivation-from-cpu_dead.patch kvm-cosmetics.patch kvm-vmx-hack-set_cr0_no_modeswitch-to-actually-do.patch kvm-use-array_size-macro-instead-of-manual-calculation.patch kvm-use-page_private-set_page_private-apis.patch kvm-add-msr-based-hypercall-api.patch kvm-add-host-hypercall-support-for-vmx.patch kvm-add-hypercall-host-support-for-svm.patch kvm-wire-up-hypercall-handlers-to-a-central.patch kvm-svm-init-cr0-with-the-wp-bit-set.patch kvm-svm-intercept-smi-to-handle-it-at-host-level.patch kvm-more-0-null-conversions.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html