From nobody Tue Aug 12 11:34:18 2025 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4c1TtL5zGdz64Z3b for ; Tue, 12 Aug 2025 11:34:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c1TtL5D8Tz44cG for ; Tue, 12 Aug 2025 11:34:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754998458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LqN3qOwpt+AoukN+Cr8aUKQI7SilnUp7gm6UtK4NDic=; b=RoDsOn1l9d31pGE1VUzqs9j2l9MV+dT3ZctnaSueBnbswgm/pJsYRLVRePeGu1KT4MChz/ XtloWc/o9sjW8YiVF0MHnyLUgD1ss+mg1k4lW1d8b872xO07yvjbAUoOuCJZJbwulze51Z hqpckcE6Ky8M7Pry3ZtsbZBYEacWteQ1G78wa6Z+BWbEuUijltqqglUXO8B61CpCUlLkQu SLvMlzXsRkuKhbqgbnKh/+tmRO2OvWtwOypr24e0bQ3SIFIsAvkNevUTWkJYt/GXkyrqDe PPIFxN6bqIVirGCs87oXodiw20x3iYrVgPBFzVICwZrAbn9kBLo3rGwuyiHcrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754998458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LqN3qOwpt+AoukN+Cr8aUKQI7SilnUp7gm6UtK4NDic=; b=kma/0iNfJ5u1Rgd+MDhg+W+nHYgPhiioedlfAiyHcF1QZRMghAEhXiWrkf/yQF1j2LF1VY 8EuKTZGoG6JwjdAUWRL/RYGKnXYZ+PLzbrz+AaEYDk+LaUtoJQzw/ePx1wMLa4f7gwj30/ qP6lyRh9iQKjsIDaebvqgn/Sz46YNw16zkOPfA+1Gg7qaxrfr5kW/Ew5lDVQTY0y9PvVlG AFfC7u7IO1JTkG3eNHm3rmcCoRH9TnLfCILtZiIQrD98c528Iz37ZzK7j3e3CZ5Y1LjYcH 5xuXNQlFdZomyLRgKghm9Z0pkI2cMIpHS98KPShW3LjvD4vVZ1t7CF2CxkpfYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754998458; a=rsa-sha256; cv=none; b=g/dYNtu/uPBuS8qzHdfYNpKjqSvE+rptCUQ8/TtTp7/hgQDBvjHJvKB4aOYha2l9C3uG+I hRKgWTb6pfu3QGMRx7WyKe76B8tuhr3bwcpk61j7NuMWLSu039S8n8zhl4rjr1dXcMpj9r mWNeiAAv50+s9ee2VUxRXu+B3Q/soE9uyuUAufXh4GwtkFq9ZgaWh//zk/FE7C0bXcz4nD gn9ewRfb/n4eMS17J1KQtWMaqWzcJMrybY8BYUb2IxHyduucak/0ejjHzkmeI/YVYaF8zl F3M5T1D2mSB8CYFG7XMprHrSeK4qc6V5LQ8eK6/Bd+6D1ZlaQudXaXoKCVoc/A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4c1TtL4XRJzcLR for ; Tue, 12 Aug 2025 11:34:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 57CBYItk079639 for ; Tue, 12 Aug 2025 11:34:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 57CBYI39079638 for virtualization@FreeBSD.org; Tue, 12 Aug 2025 11:34:18 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 256781] EC2 Nitro: TSC-low timecounter lags Date: Tue, 12 Aug 2025 11:34:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: needs-patch, needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dwmw2@infradead.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Overcome By Events X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256781 --- Comment #40 from dwmw2@infradead.org --- Apologies for not confirming sooner. Yes, this was due to a bug in the PIT implementation. The PIT counter counts down, and the interrupt was supposed= to fire when it reaches zero and wraps back to its start value (often 65535). In some circumstances the timer interrupt could be delivered slightly too s= oon, and the guest could read a counter value which hasn't quite reached zero ye= t =E2=80=94 which the guest would take to mean that a whole extra countdown has occurre= d in the interim! This would overestimate the amount of actual time taken, as measured by the PIT, and thus underestimate the frequency of the TSC which = was being calibrated. I hereby rescind the advice to use the KVM clock. Use the TSC instead. It's much more reliable. The KVM clock has... problems: https://lore.kernel.org/all/20240522001817.619072-1-dwmw2@infradead.org/ The TSC on modern hardware has none of the issues which made the KVM clock = make sense in the first place. And now the KVM clock is the buggy one. --=20 You are receiving this mail because: You are the assignee for the bug.=