On Fri, Mar 15, 2013 at 04:04:59PM +0800, Yang Zhang wrote:
> From: Yang Zhang <[email protected]>
> 
> when virtual interrupt delivery avaliable, register a rtc eoi notifier
> to force vmexit when writing eoi for rtc interupt
> 
> Signed-off-by: Yang Zhang <[email protected]>
> ---
>  virt/kvm/ioapic.c |   26 ++++++++++++++++++++++++++
>  1 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
> index ed6f111..2c6235c 100644
> --- a/virt/kvm/ioapic.c
> +++ b/virt/kvm/ioapic.c
> @@ -87,6 +87,30 @@ static unsigned long ioapic_read_indirect(struct 
> kvm_ioapic *ioapic,
>       return result;
>  }
>  
> +#ifdef CONFIG_X86
> +static void kvm_rtc_ack_irq(struct kvm_irq_ack_notifier *kian)
> +{
> +     return;
> +}
No need to register fake ack notifier to request EOI exit from APICv.
IOAPIC can do it directly.

> +
> +static void rtc_register_notifier(struct kvm_ioapic *ioapic)
> +{
> +     if (!kvm_apic_vid_enabled(ioapic->kvm))
> +             return;
> +
> +     ioapic->rtc_status.irq_ack_notifier.gsi = 8;
> +     ioapic->rtc_status.irq_ack_notifier.irq_acked = kvm_rtc_ack_irq;
> +     kvm_register_irq_ack_notifier(ioapic->kvm,
> +                             &ioapic->rtc_status.irq_ack_notifier);
> +}
> +#else
> +
> +static void rtc_register_notifier(struct kvm_ioapic *ioapic)
> +{
> +     return;
> +}
> +#endif
> +
>  static int ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx)
>  {
>       union kvm_ioapic_redirect_entry *pent;
> @@ -458,6 +482,8 @@ int kvm_ioapic_init(struct kvm *kvm)
>               kfree(ioapic);
>       }
>  
> +     rtc_register_notifier(ioapic);
> +
>       return ret;
>  }
>  
> -- 
> 1.7.1

--
                        Gleb.
--
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

Reply via email to