Message ID | 20230216142123.2638675-5-maz@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 238C4C61DA4 for <linux-arm-kernel@archiver.kernel.org>; Thu, 16 Feb 2023 14:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SXaLi2RwRocHoSmCVbwKYN83G9cdP5jxf+Ia1SKsXYE=; b=FkHxBLhPGyI0aB 7erMJo6AIzmeZtAfjfOeuYhotoH2/rwbVWilhm9Z8tp041y0MXMEcKAKyCmhEog804C7xJ5Cev64S l/ObTthMi1ldxEVwfY8y2FVoMwKmkZBt70WFlOmqxwv8cCzKbCeafLLkRuTWSYhIXNtxHcDpx5H4A K7ssPZV7xMG6vSZd8S86Q76LXko/1HtgNzJarVSMxBmAfY7ZVrA4M3njIHB3nopKLxTPaX/ZReMUK f+IMlKDViF32guH8ZxQjtsHhGKF06nyv8wYlOtFZ+66y7HqGQtL7TjkoDTNX2O7x4cJDL9h2wi0SE Ov6M4IeeswhLq7Mm01Pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSf9B-00AZZQ-IQ; Thu, 16 Feb 2023 14:22:05 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSf96-00AZXB-2u for linux-arm-kernel@bombadil.infradead.org; Thu, 16 Feb 2023 14:22:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=F5wMYO4X5IUt8Rg9+AD+RvMT6Txnhy4ZH9yF9OrQ9QA=; b=DAiRICX92+WI/EvDu6bj6El2V7 iCDrq27O98aCG0xChciHS7EjnrF01/gqJhQDwge5AP4UrXhsI+JI3/dcDsAgaF0cnIk/hN7Dx8p01 Muij0gTFpoRzs5mlE25yYz9cClEeCQaE1onITIXnSH0xprCtaPBJX/jpdPybyninkkZjvTtTc4UQS wxwyMCELD84sMELfSEj/isMY+AQMmVDG7RoOU2R48oaidBBMDy75iABQW82e/KjwZw1HegmcdAkFI DDaTnXydauz0FQCgAPd0c30pz5gN3/qyLvJyUo8et1qVCC/k3/zkEDBPPiTPiH5OTOx+YqXKsyZCd NDmyaW8g==; Received: from dfw.source.kernel.org ([139.178.84.217]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pSf8K-00AItP-10 for linux-arm-kernel@lists.infradead.org; Thu, 16 Feb 2023 14:21:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9C88161492; Thu, 16 Feb 2023 14:21:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07D2BC4339E; Thu, 16 Feb 2023 14:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676557310; bh=IlGnWmN4+SnhfJAhFgF0swTA2meOHEWZPD5/uHn6VNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XMMT2rwP6YMWbaOYLUYC8phZQU8N6QcmB4kq1MLj1lNLodXnGhp/yL2Wn+EwiPNpn Se+ILK8XR1v1kTHNLXaxsMadkq93IM4tL5HhCY+K7aXYZCpQhwi4MFhdhfymzQYgTN JWYjKIZLUN7fiRCwFlYjPj7Gem9ScuxtSx7zTvGpCo3AP6k3vqviuZ09O6TD6Xsqy+ Ti2Ndyt4c5hl7r6/WS8h92yu6X5ELKJVrB42nsLHyQDUoRFqM64rWl0Nx32r93VQUr Hzr6EJV+tP4kG+BERjbNGcc4QqMrJIthWl6gyvVij3lAeBZvrWzmv2ncU06qFXE4ii hHTGfuSXWbrPg== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <maz@kernel.org>) id 1pSf8u-00AuwB-33; Thu, 16 Feb 2023 14:21:48 +0000 From: Marc Zyngier <maz@kernel.org> To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: James Morse <james.morse@arm.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Oliver Upton <oliver.upton@linux.dev>, Zenghui Yu <yuzenghui@huawei.com>, Ricardo Koller <ricarkol@google.com>, Simon Veith <sveith@amazon.de>, dwmw2@infradead.org Subject: [PATCH 04/16] KVM: arm64: timers: Use a per-vcpu, per-timer accumulator for fractional ns Date: Thu, 16 Feb 2023 14:21:11 +0000 Message-Id: <20230216142123.2638675-5-maz@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216142123.2638675-1-maz@kernel.org> References: <20230216142123.2638675-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, ricarkol@google.com, sveith@amazon.de, dwmw2@infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230216_142155_014299_7246CA85 X-CRM114-Status: GOOD ( 14.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: arm64: Rework timer offsetting for fun and profit
|
expand
|
diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c index 00610477ec7b..329a8444724f 100644 --- a/arch/arm64/kvm/arch_timer.c +++ b/arch/arm64/kvm/arch_timer.c @@ -219,7 +219,7 @@ static u64 kvm_counter_compute_delta(struct arch_timer_context *timer_ctx, ns = cyclecounter_cyc2ns(timecounter->cc, val - now, timecounter->mask, - &timecounter->frac); + &timer_ctx->ns_frac); return ns; } diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h index 71916de7c6c4..76174f4fb646 100644 --- a/include/kvm/arm_arch_timer.h +++ b/include/kvm/arm_arch_timer.h @@ -31,6 +31,7 @@ struct arch_timer_context { /* Emulated Timer (may be unused) */ struct hrtimer hrtimer; + u64 ns_frac; /* * We have multiple paths which can save/restore the timer state onto
Instead of accumulating the fractionnal ns value generated everytime we compute a ns delta in a global variable, use a per-vcpu, per-timer variable. This keeps the fractional ns local to the timer instead of contributing to any odd, unrelated timer. Signed-off-by: Marc Zyngier <maz@kernel.org> --- arch/arm64/kvm/arch_timer.c | 2 +- include/kvm/arm_arch_timer.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)