On 05/03/09 16:34 +0200, Gleb Natapov wrote:
> ioapic_deliver() and kvm_set_msi() have code duplication. Move
> the code into ioapic_deliver_entry() function and call it from
> both places.
>
> +static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq)
> +{
> + union kvm_ioapic_redirect_entry entry = ioapic->redirtbl[irq];
> +
> + ioapic_debug("dest=%x dest_mode=%x delivery_mode=%x "
> + "vector=%x trig_mode=%x\n",
> + entry.fields.dest, entry.fields.dest_mode,
> + entry.fields.delivery_mode, entry.fields.vector,
> + entry.fields.trig_mode);
> +
> +#ifdef CONFIG_X86
> + /* Always delivery PIT interrupt to vcpu 0 */
> + if (irq == 0) {
> + entry.fields.dest_mode = 0; /* Physical mode. */
> + entry.fields.dest_id = ioapic->kvm->vcpus[0]->vcpu_id;
> + }
> +#endif
> + return ioapic_deliver_entry(ioapic->kvm, &entry);
> +}
> +
Why is the PIT always handled by vcpu 0?
thanks,
Mike
--
Mike Day
http://www.ncultra.org
AIM: ncmikeday | Yahoo IM: ultra.runner
PGP key: http://www.ncultra.org/ncmike/pubkey.asc
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html