[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/APIC: handle overflow in TMICT calculation


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Thu, 9 Apr 2026 21:29:10 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O0bsIzui3PGykH5KUbAbBQrHCdLJrm/BZtqbBEc7Y18=; b=bROVlgGwh2XqbYHivaHVyuNU6WMmKmQaEvX31EhB9XZOr2+K/B73y77llm1XqOtI9dTBu+UviyBRtQ+kJYhDrVVUY0YDzqXSukmx0iUtlYVjKaFxXLSW56b1QPbxZjqMht9kKx9Ff4LgmMxa4fCiVqALO9TAinj1BqWzx+ZNCTh2+yGcZndPhEeYLS016le3Q9d/1kxCFxIfhl6YMrgF6KTUQA0OsUs8KC6RG1TVuHyyYLGzCVqkiJMefUuUCSRminogzmYhNKnS7Nv5gE2cdj79zH3zl43YCJaZxG/aoa8/OID/w0/BuygynVfHyxkyCPVtidpd7lt+H+M9OzTA7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kNdilBASwPDpbrJ3VCwijnbakOUkwxM0DfSgwIr+lLDbyFaZ2uwNGzn20O8u5Qc7YQR1WcWuLvUg9OiNcAhBhRiJiSW0pxGMw/WddfEZQUx8m4nNj+H6NyVHSAaqbqbydven9oaG8pK5SMKqtWxVrb/iMDKXKbfJkbMJtYsmz5bI+VtbTsuTUrNQxYKOJRUSDzcQ7RdmiR2oByZahbHTEvwABMnUwKWFiOnCt/TJ7BzE+ttZu5JfilA2thdEVQazUfJvARWGkjT55C5+EBvPonAFL4ZKC1vqbl0P+gfOfmmEUOGb2atEuRGjy44gBxjrW2T7XoelJLqWPCHBrH+bSQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Fri, 10 Apr 2026 01:29:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <stewart.hildebrand@xxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Tested-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>

Thanks!



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.