From nobody Tue Feb 10 11:33:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1578673100; cv=none; d=zohomail.com; s=zohoarc; b=UJ4h/bnV9GnZj+L8UvMaof2f2LGQnk+HQNOLAfK58YCzE02ComQamKYPUQg340n9rOvK7/PVkGgaed/notLV6M9NSf9ziBx7GWkz+qxVe/SOmlOGjaVvObge9zJBgC5yEoXapCRGpYbkV/KhANXB4/scvOhKlOwRhc0w3TCwEyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578673100; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sH1vHww7VcOtks3y+ZrcP6gPfRazqmJe6Ac+pRXoMAs=; b=laGnOv893exo/BI32AeZH8Rb04lmO3pTVQBiq61R5Ld/T3iUB8WJdIgwI8WzXjhUd1ISKKBWTHDG1twFeoci9onWG0kXDJQ5RdrN6HEjTLOYn7G+YrO8GgL7zOp369h31fCYrptkyjiLrbO9OL+kRBl8tJ6Pny9UQ+t3w4BP5SI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578673100047787.8627860295142; Fri, 10 Jan 2020 08:18:20 -0800 (PST) Received: from localhost ([::1]:48662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipwzK-0003Wk-Ld for importer@patchew.org; Fri, 10 Jan 2020 11:18:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipwxb-0002Ma-Fy for qemu-devel@nongnu.org; Fri, 10 Jan 2020 11:16:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipwxa-0007Yu-Ah for qemu-devel@nongnu.org; Fri, 10 Jan 2020 11:16:31 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:39596) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipwxa-0007Vf-48 for qemu-devel@nongnu.org; Fri, 10 Jan 2020 11:16:30 -0500 Received: by mail-wr1-x441.google.com with SMTP id y11so2357028wrt.6 for ; Fri, 10 Jan 2020 08:16:30 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d14sm2826056wru.9.2020.01.10.08.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 08:16:27 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5DC421FF8C; Fri, 10 Jan 2020 16:16:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sH1vHww7VcOtks3y+ZrcP6gPfRazqmJe6Ac+pRXoMAs=; b=v68t3ki4ejQvRt4C0La+V1Fgz4LWFtZzi6/nBc6Pa14wdFP5ctr6kPq9HOCs+aFCa5 IqthzQMFPMJtzW31N8g6rk9rhcKXSzpgwdB3FFyBRWqkOOsCi8vgjZCcUM8Vmyzc6cVt youK3jY9YVymMFynlCPqSnLw6uRBsk+9IerDQ5XuXCCpM/1dYa1uESDQODlM3YSS1y5W G+EjVbcRjkc2bcrVPKN8WPfCv/51Y0//6g2Mki1ZKX711EA0oyx0HhWd+C7ihnZNhlMi Ca34FiP+sEa7xHXpQnldl0/93avm29/i6NPSAwIlg2oBY3PkhI5C5J33dkDmcnyOvG3u Q4Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sH1vHww7VcOtks3y+ZrcP6gPfRazqmJe6Ac+pRXoMAs=; b=CC4d6w9nlz9D4RtTX8Im2PevPoVssWUjYRnVjFdL4rQQ7Y6Z7EgeUUKSrZdWQQdGZv C7u7JTWy83IRplGJ/TlcnWYSXY/UrRpRx97LVyMvVA7hHT3r6ns2n93uL98HIiKjmASK VEQEIV31LKJa79wIvIbVSaDfho7nGTVIv+6bS+ojHlSn8R9a7q0iNTDTAmbAWjgrpxfy Wu9hQYXIcVCmLgaGUSI0Q/iVlGBlG4DxQoXUwzd8GctLiDFNAvhN+EVwnVH1gdCfvciq HNIXsSjItHqEBZRdVEQD4Ivk47vzZDyi4Yf7JqjiiENJOiIfJe0//CttvZnPs2xuSsMG VVgw== X-Gm-Message-State: APjAAAX46J5kZQw7fL8/o+ZAhBBiu+8GSZ2JL//O43Lj+bsFOJFDgIGl v+nS6J/SMR3ABB5URT1MYI2kqA== X-Google-Smtp-Source: APXvYqx1RFo+DRbavUS8IOkjJ8AzAYnRiAqaqiHiSibBMorJpn5zJgZApcAruVZhByDQ0Lyvha8x7Q== X-Received: by 2002:a5d:6802:: with SMTP id w2mr4283925wru.353.1578672989119; Fri, 10 Jan 2020 08:16:29 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 1/2] target/arm: detect 64 bit overflow caused by high cval + voff Date: Fri, 10 Jan 2020 16:16:25 +0000 Message-Id: <20200110161626.31943-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200110161626.31943-1-alex.bennee@linaro.org> References: <20200110161626.31943-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , 1859021@bugs.launchpad.net, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) If we don't detect this we will be stuck in a busy loop as we schedule a timer for before now which will continually trigger gt_recalc_timer even though we haven't reached the state required to trigger the IRQ. Bug: https://bugs.launchpad.net/bugs/1859021 Cc: 1859021@bugs.launchpad.net Signed-off-by: Alex Benn=C3=A9e --- target/arm/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 19a57a17da5..eb17106f7bd 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -2481,6 +2481,9 @@ static void gt_recalc_timer(ARMCPU *cpu, int timeridx) } else { /* Next transition is when we hit cval */ nexttick =3D gt->cval + offset; + if (nexttick < gt->cval) { + nexttick =3D UINT64_MAX; + } } /* Note that the desired next expiry time might be beyond the * signed-64-bit range of a QEMUTimer -- in this case we just --=20 2.20.1