|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v8 2/2] xen/arm: trap guest WFI
On Mon, 2013-04-22 at 18:42 +0100, Stefano Stabellini wrote:
> +static inline int _local_events_need_delivery(void)
Can we call this local_events_need_delivery_nomask or something to make
it clear why it is special (which the leading _ doesn't really do).
> +{
> + struct pending_irq *p = irq_to_pending(current,
> VGIC_IRQ_EVTCHN_CALLBACK);
> +
> + /* XXX: if the first interrupt has already been delivered, we should
> + * check whether any higher priority interrupts are in the
> + * lr_pending queue or in the LR registers and return 1 only in that
> + * case.
> + * In practice the guest interrupt handler should run with
> + * interrupts disabled so this shouldn't be a problem in the general
> + * case.
> + */
> + if ( gic_events_need_delivery() )
> + return 1;
> +
> + if ( vcpu_info(current, evtchn_upcall_pending) &&
> + !vcpu_info(current, evtchn_upcall_mask) &&
I don't think you need this upcall_mask check.
> + list_empty(&p->inflight) )
> + return 1;
> +
> + return 0;
> +}
> +
> static inline int local_events_need_delivery(void)
> {
> - /* TODO
> - * return (vcpu_info(v, evtchn_upcall_pending) &&
> - !vcpu_info(v, evtchn_upcall_mask)); */
> + struct cpu_user_regs *regs = guest_cpu_user_regs();
> +
> + /* guest IRQs are masked */
> + if ( (regs->cpsr & PSR_IRQ_MASK) )
> return 0;
> + return _local_events_need_delivery();
> }
>
> int local_event_delivery_is_enabled(void);
>
> -static inline void local_event_delivery_disable(void)
> -{
> - /* TODO current->vcpu_info->evtchn_upcall_mask = 1; */
> -}
> -
> static inline void local_event_delivery_enable(void)
> {
> /* TODO current->vcpu_info->evtchn_upcall_mask = 0; */
No reason to leave this TODO IMHO.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |