[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] Bug fix - Integer overflow when cpu frequency > u32 max value.
- To: Neowutran <xen@xxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 19 Dec 2022 09:00:17 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=NMyndYZUnLTMLkva3quh8ckMGWLs72XD/+H1dEL/45I=; b=VoFfsWNYKhn5ijZcvnmHEJzQSO2lXSv8Jf0W+IwYyvRp8Qlg2Zk4zempat2s3P8fwna82ReXU7MXWkTsKJ+eUkOX97Unr4DyJgpgxmXXd329nRtgIHkA8JBi9nUlMVIW26mCHsSvSyxkq4pTpNEUFCN6zJODAe4qht3Ja5fe8O3WCl9DENTKz6MpUyLvHmXQNzWWhp93KMu8r8/4EcNNXIXhJk2HB0cEIJwYxd/qp0w4UNC0kblF6bIui366bozsbGTU7zeAU2veRzppYGOd/KoCvDgQaCWI9x8dcwfWArQJKOsmfXpkbPl9I9BMnq7POsITdIWSyEAlI6elFRMZGw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fPAJY1BftHgqd0VbtBD8tiXacW0eErBDEitRjxZHiA4DPWmT07wLYq7QtXidjB3Z6e0gcmOHV4hrJ+gQfot7pbjWLlyk23QDPzokSpbFptM6gKMeVukVkhS23moVBtnuMt5WsG6WeQYb2KJU4mu1XiNDsbqucuHZngkoG1lxNrv0kfgvtAq2dd3JfLSmJFTxoYp9sVHAnpfN9HSh7yNh/ZUfOmTzfeQkbkGSb+4bapxUDNkJyKgnpfUwFyzpJezQNrPjpYfU05zb7HngYwtdaANW6Br4Has4RCRIq771fdRo183/aV6XE0ab+qd3i9C9RnlHQ89M+V/ckFwJb747rQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Elliott Mitchell <ehem+xen@xxxxxxx>
- Delivery-date: Mon, 19 Dec 2022 08:00:27 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 18.12.2022 22:47, Elliott Mitchell wrote:
> On Sun, Dec 18, 2022 at 01:14:07PM +0100, Neowutran wrote:
>> xen/x86: prevent overflow with high frequency TSCs
>>
>> Promote tsc_khz to a 64-bit type before multiplying by 1000 to avoid a
>> 'overflow before widen' bug.
>> Otherwise just above 4.294GHz the value will overflow.
>> Processors with clocks this high are now in production and require this to
>> work
>> correctly.
>>
>> Signed-off-by: Neowutran <xen@xxxxxxxxxxxxx>
>
> Needing a bit of word-wrapping, but that can be adjusted during commit to
> the Xen tree.
Right - also the first line of the body really wants to be the title.
I'd be happy to make edits while committing, but as said in reply to
v1 I also would prefer to suffix the literal "1000" instead of adding
a cast. I'd also be happy to make that adjustment (including to the
description), but I'd prefer to do so with your agreement.
Jan
|