|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH 17/49] ARM: timer: Handle level triggered IRQs correctly
Hi Andre, On 09/02/18 14:39, Andre Przywara wrote: The ARM Generic Timer uses a level-sensitive interrupt semantic. We easily catch when the line goes high, as this triggers the hardware IRQ. However we have to sync the state of the interrupt condition at certain points to catch when the line goes low and we can remove the vtimer vIRQ from the vGIC (and the LR). The VGIC in Xen so far only implemented edge triggered vIRQs, really, so we need to add new functionality to re-sample the interrupt state. You might want to make a summary of the discussion we had with Marc Z. today here. This would help the other to understand why sample the interrupt state is necessary :). Also do we need to do that for the emulated physical timer? One * is enough. Why do you need to save cval? + + /* + * Technically we should mask with 0x7 here, to catch if the timer + * interrupt is masked. However Xen always masks the timer upon entering + * the hypervisor, leaving it up to the guest to un-mask it. + * So we would always read a "low" level, despite the condition being + * actually "high". Igoring the mask bit solves this (for now). s/Igoring/Ignoring/ + * Another possible check would be to compare the value of CNTVCT_EL0 + * against vtimer->cval and derive the interrupt state from that. + * + * TODO: The proper fix for this is to make vtimer vIRQ hardware mapped, + * but this requires reworking the arch timer to implement this. That something we should look at it once the vGIC is done :). + */ + level = (vtimer->ctl & 0x5) == (CNTx_CTL_ENABLE | CNTx_CTL_PENDING); Can you please use the proper define rather than plain value? You need to sample the virtual timer before clearing the LRs, right? If so, you likely want to add a comment here to avoid reshuffling the code. + vtimer_sync(current); I am a bit worry about re-sampling the virtual interrupt state at every traps. It might be worth thinking to do the re-sample when syncing the LRs (as you do for HW level interrupt in patch #25). Probably once we get the new vGIC merged.
Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |