Showing error 827

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: arch/x86/kvm/vmx.c
Line in file: 2949
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

2919                                struct kvm_run *kvm_run)
2920{
2921        struct vcpu_vmx *vmx = to_vmx(vcpu);
2922        int err;
2923
2924        preempt_enable();
2925        local_irq_enable();
2926
2927        while (!guest_state_valid(vcpu)) {
2928                err = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
2929
2930                switch (err) {
2931                        case EMULATE_DONE:
2932                                break;
2933                        case EMULATE_DO_MMIO:
2934                                kvm_report_emulation_failure(vcpu, "mmio");
2935                                /* TODO: Handle MMIO */
2936                                return;
2937                        default:
2938                                kvm_report_emulation_failure(vcpu, "emulation failure");
2939                                return;
2940                }
2941
2942                if (signal_pending(current))
2943                        break;
2944                if (need_resched())
2945                        schedule();
2946        }
2947
2948        local_irq_disable();
2949        preempt_disable();
2950
2951        /* Guest state should be valid now, no more emulation should be needed */
2952        vmx->emulation_required = 0;
2953}
2954
2955/*
2956 * The exit handlers return 1 if the exit was handled fully and guest execution
2957 * may resume.  Otherwise they set the kvm_run parameter to indicate what needs
2958 * to be done to userspace and return 0.
2959 */
Show full sources