|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] x86/vhpet: fix RTC special casing
On 04.05.2021 10:42, Roger Pau Monne wrote:
> Restore setting the virtual timer callback private data to NULL if the
> timer is not level triggered. This fixes the special casing done in
> pt_update_irq so that the RTC interrupt when originating from the HPET
> is suspended if the interrupt source is masked.
>
> Note the RTC special casing done in pt_update_irq should only apply to
> the RTC interrupt originating from the emulated RTC device (which does
> set the callback private data), as in that case the callback itself
> will destroy the virtual timer if the interrupt is ignored.
>
> While there also use RTC_IRQ instead of 8 when the HPET is configured
> in LegacyReplacement Mode.
>
> Fixes: be07023be115 ("x86/vhpet: add support for level triggered interrupts")
> Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> @@ -318,7 +319,8 @@ static void hpet_set_timer(HPETState *h, unsigned int tn,
> hpet_tick_to_ns(h, diff),
> oneshot ? 0 : hpet_tick_to_ns(h,
> h->hpet.period[tn]),
> irq, timer_level(h, tn) ? hpet_timer_fired : NULL,
> - (void *)(unsigned long)tn, timer_level(h, tn));
> + timer_level(h, tn) ? (void *)(unsigned long)tn :
> NULL,
> + timer_level(h, tn));
Depending on what further changes to this call may be planned, it
may help readability if we split the call into a level and an edge
one.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |