Gregory Haskins wrote:
> +/**
> + * kvm_irqdevice_ack - read and ack the highest priority vector from the
> device
> + * @dev: The device
> + * @vector: Retrieves the highest priority pending vector
> + * [ NULL = Dont ack a vector, just check pending status]
> + * [ non-NULL = Pointer to recieve vector data (out only)]
> + *
> + * Description: Read the highest priority pending vector from the device,
> + * potentially invoking auto-EOI depending on device policy
> + *
> + * Returns: (int)
> + * [ -1 = failure]
> + * [>=0 = bitmap as follows: ]
> + * [ KVM_IRQACK_VALID = vector is valid]
> + * [ KVM_IRQACK_AGAIN = more unmasked vectors are available]
> + * [ KVM_IRQACK_TPRMASK = TPR masked vectors are blocked]
> + */
> +static inline int kvm_irqdevice_ack(struct kvm_irqdevice *dev,
> + int *vector)
> +{
> + return dev->ack(dev, vector);
> +}
>
I still don't like this, but have nothing better to offer.
> +static void do_interrupt_requests(struct kvm_vcpu *vcpu,
> + struct kvm_run *kvm_run)
> +{
> + int pending = __kvm_vcpu_irq_all_pending(vcpu);
> + int handled = 0;
> +
> + while (pending && !handled) {
> + kvm_irqpin_t pin = __fls(pending);
> +
> + switch (pin) {
> + case kvm_irqpin_localint:
> + case kvm_irqpin_extint:
> + case kvm_irqpin_nmi:
> + handled = do_intr_requests(vcpu, kvm_run, pin);
> + break;
> + case kvm_irqpin_smi:
> + /* ignored (for now) */
> + printk(KERN_WARNING
> + "KVM: dropping unhandled SMI\n");
> + __clear_bit(pin, &vcpu->irq.pending);
> + break;
> + case kvm_irqpin_invalid:
> + /* drop */
> + break;
> + default:
> + panic("KVM: unknown interrupt pin raised: %d\n", pin);
> + break;
> + }
> +
> + __clear_bit(pin, &pending);
> + }
> }
>
This code can be shared with the svm function of the same name and moved
to kvm_main, no? You'll need a new arch op for do_inter_requests().
Otherwise ok.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel