On 4/9/26 05:21, Jan Beulich wrote:
> With an expiry value on the order of 20 hours, and with a bus scale value
If I did my math correctly, I believe 10 hours is sufficient to trigger signed
multiplication overflow. 20 hours would result in unsigned multiplication
overflow.
> of 256k (as supplied by qemu), the (signed) multiplication will be UB. As
> we've checked that the value is positive, we mean unsigned multiplication
> anyway. Yet let's play safe against even larger expiry and bus scale
> values, leveraging the compiler builtin that there is for this purpose.
>
> While there also drop the stray cast from the actual TMICT write.
>
> Fixes: 9062553a0dc1 ("added time and accurate timer support")
> Fixes: b95beb185810 ("x86: Clean up APIC local timer handling")
> Reported-by: Stewart Hildebrand <[email protected]>
> Signed-off-by: Jan Beulich <[email protected]>
Tested-by: Stewart Hildebrand <[email protected]>
Thanks!