From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 030C9C64EC7 for ; Tue, 28 Feb 2023 19:20:30 +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: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OLdKOCnk+S9ugJnRNuFsuAFlWPyW0LzJVZrn5yy0UxQ=; b=tjyenPWl4EXw+l hpcdTne3rJ0iMkZIgKIQopUu8MkptZxAZyQ9tV1Bb7ghz9kpwyCyyHshjeCwLsiztXUxktCtcXBs3 SH1Wuz2ZqNxxqZ+Op8P85UXFAwaqkv8ImKH5YdwozdcTEDV0CR184SEeQm2Vq1Wx5uyJcVffaWCUx lDaur+n6a/TX7jk1sFg6pApDJag2yeqr7tSVbb6HW/VieSUcMcGv5FvXwqjkOmWFUgVMtcS59u5s/ w5WcYrIalhGgreE4FKd18AB1LZLNd0LTzriG9HSI9xbvLg6mqb0Z1TrCHu5cAU0ilR93YUXqfbaIt Vuq6Vp58Je2J15WqlYQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX5VG-00E4MT-1y; Tue, 28 Feb 2023 19:19:10 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX5VD-00E4Kq-3i for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 19:19:08 +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 D64BE61169; Tue, 28 Feb 2023 19:19:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45626C433EF; Tue, 28 Feb 2023 19:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677611942; bh=Bb3h4fAacNfgLwkZc3yB/rJ+a+mFCa2BBHKn4BZOmAs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cK8bH9wQf6AY1Hvk2d2/33/uUdNhTf+B91Qtd5z00nW4y+Vs6xaxfBq8/jFKIvX2Z uacv2cnFcclvpDGvcJCq0t/dqcQm5Sq8TYrYgcdlvLW/F6aGYoQnutuu0wYTp2UijT 7Hr9mNvJG9P4GKSKi1a6/0CKmbPrUVzo7lKrWmVtUlPs4+UVaB8Fk2Jra3PqJjWvve HRdm0oWpSEUaU+moPhBixErhXMRcSQ6KQsEV8MI3aL46R5fXs/l0ptg8FwII1P1gYq R3X/Mki+h3a0/H6rFejB032EUqL/Wh3TJml88DrQKY7/gktv8ynppjjZj8ue6/24yZ FTjQ4fF45M4PA== Received: from [47.176.216.2] (helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pX5V5-00Dutc-HM; Tue, 28 Feb 2023 19:19:00 +0000 Date: Tue, 28 Feb 2023 19:18:38 +0000 Message-ID: <87sfepha41.wl-maz@kernel.org> From: Marc Zyngier To: Joey Gouly Cc: , , , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Reiji Watanabe , Subject: Re: [PATCH v2] KVM: arm64: timers: Convert per-vcpu virtual offset to a global value In-Reply-To: <20230228112607.GA18683@e124191.cambridge.arm.com> References: <20230224191640.3396734-1-maz@kernel.org> <20230228112607.GA18683@e124191.cambridge.arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 47.176.216.2 X-SA-Exim-Rcpt-To: joey.gouly@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, reijiw@google.com, nd@arm.com 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-20230228_111907_269006_E0EB5550 X-CRM114-Status: GOOD ( 22.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 28 Feb 2023 11:26:07 +0000, Joey Gouly wrote: > > Hi Marc, > > On Fri, Feb 24, 2023 at 07:16:40PM +0000, Marc Zyngier wrote: > > Having a per-vcpu virtual offset is a pain. It needs to be synchronized > > on each update, and expands badly to a setup where different timers can > > have different offsets, or have composite offsets (as with NV). > > > > So let's start by replacing the use of the CNTVOFF_EL2 shadow register > > (which we want to reclaim for NV anyway), and make the virtual timer > > carry a pointer to a VM-wide offset. > > > > This simplifies the code significantly. It also addresses two terrible bugs: > > > > - The use of CNTVOFF_EL2 leads to some nice offset corruption > > when the sysreg gets reset, as reported by Joey. > > > > - The kvm mutex is taken from a vcpu ioctl, which goes against > > the locking rules... > > > > Reported-by: Joey Gouly > > Reviewed-by: Reiji Watanabe > > Signed-off-by: Marc Zyngier > > Link: https://lore.kernel.org/r/20230224173915.GA17407@e124191.cambridge.arm.com > > Fixes my mismatched timer offset issues. > > Tested-by: Joey Gouly Thanks for having given it a go. Hopefully Oliver will be able to send this to as a fix shortly. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel