Re: [PATCH v5 4/4] KVM: x86: Add support for local interrupt requests from userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 28/07/2015 01:17, Steve Rutherford wrote:
> +
> +	if (irqchip_in_kernel(vcpu->kvm) && !pic_in_kernel(vcpu->kvm) &&
> +	    vcpu->arch.pending_external_vector == -1) {
> +		vcpu->arch.pending_external_vector = irq->irq;
> +		return 0;
> +	} else if (irqchip_in_kernel(vcpu->kvm) && !pic_in_kernel(vcpu->kvm))
> +		return -EEXIST;
> +	else if (irqchip_in_kernel(vcpu->kvm))
>  		return -ENXIO;

This is better written as:

	if (!irqchip_in_kernel(vcpu->kvm)) {
	        kvm_queue_interrupt(vcpu, irq->irq, false);
	        kvm_make_request(KVM_REQ_EVENT, vcpu);
		return 0;
	}

	/*
	 * With in-kernel LAPIC, we only use this to inject EXTINT, so
	 * fail for in-kernel 8259.
	 */
	if (pic_in_kernel(vcpu->kvm)) {
		return -ENXIO;

	if (vcpu->arch.pending_external_vector != -1)
		return -EEXIST;

	vcpu->arch.pending_external_vector = irq->irq;
	return 0;

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux