On 25.11.2025 17:52, Tu Dinh wrote:
> When setting a timer's config register, timer_sanitize_int_route will
> always reset the IRQ route value to what's valid corresponding to the
> !HPET_CFG_LEGACY case. This is applied even if the HPET is set to
> HPET_CFG_LEGACY.
> 
> When some operating systems (e.g. Windows) try to write to a timer
> config, they will verify and rewrite the register if the values don't
> match what they expect. This causes an unnecessary write to HPET_Tn_CFG.
> 
> Note, the HPET specification states that for the Tn_INT_ROUTE_CNF field:
> 
> "If the value is not supported by this prarticular timer, then the value
> read back will not match what is written. [...] If the LegacyReplacement
> Route bit is set, then Timers 0 and 1 will have a different routing, and
> this bit field has no effect for those two timers."
> 
> Therefore, Xen should not reset timer_int_route if legacy mode is
> enabled, regardless of what's in there.
> 
> Fixes: ec40d3fe2147 ("x86/vhpet: check that the set interrupt route is valid")
> Signed-off-by: Tu Dinh <[email protected]>

Reviewed-by: Jan Beulich <[email protected]>


Reply via email to