x86/vhpet: fix RTC special casing
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 7 May 2021 08:43:29 +0000 (10:43 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 May 2021 08:43:29 +0000 (10:43 +0200)
commit472a13988a051e5ae84b95815c6caf4378062abe
treec596c4b8cc04ef26a6e102b10786b28239190d7f
parent09fc903c5ac042e2e1eb54e58ea7f207ed12ee16
x86/vhpet: fix RTC special casing

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@suse.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hpet.c