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 7B2C3C64ED6 for ; Tue, 28 Feb 2023 19:23:20 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5UnbOC34zPwqXMgYt5ucLvPIFk44iUaEDFGhevp6cGM=; b=Ed3+QqYbXL8J8Y 6LIYi+RFcwTYlDENOgU6nzjmhDT0ch13glhJlvsj/JFRSTvZq8c6O1SPsdBeHIKcxdnkvcq+hzWlA x8qNJ2bk2uRQ0wJBU8cz26asfwdLs7aZ4VnnawqauKmQsR1tWK5RJb7USdnoL4IspLusSic5Xi10x haHxe9ulg3nZngXZnNpKEKHO8/+v2KSq1EtKXeRIdz0TG6fgNArmE+pRSZ+sPOcIgFxT3p+CumfMq XP5opN+nXmQhVy6neJb/B7vSdkATWHoAKnYtM8M92vo1m12rzxwlLzFf/E+RM+TmtjGNW8gJeBhcm 1x6ETGQ4tooqCyAmR4Cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX5YJ-00E4xj-QM; Tue, 28 Feb 2023 19:22:19 +0000 Received: from out-1.mta0.migadu.com ([2001:41d0:1004:224b::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pX5YG-00E4wd-QK for linux-arm-kernel@lists.infradead.org; Tue, 28 Feb 2023 19:22:18 +0000 Date: Tue, 28 Feb 2023 19:22:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1677612128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LbYuqfCuY3T1CvXJk+av0g4V2EXiiWFsKxVBORVL9FY=; b=W7Ugjs4PVgdnEmIQg8Hu9a+sy1r8G/aQDSGCJyZXds0p9QGUPsQ+IeRSQxkZl12yaK1rgv VMquNdhCIBv7TWGYoGA9LbdVhhUz9LbKOfgJadT/dUOV6kvMzegUjIGsUVL6FBGdyIVjKO HUVhx/1ae9JBSrM8t7WbdShqBYoJH2E= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier Cc: Joey Gouly , kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu , Reiji Watanabe , nd@arm.com Subject: Re: [PATCH v2] KVM: arm64: timers: Convert per-vcpu virtual offset to a global value Message-ID: References: <20230224191640.3396734-1-maz@kernel.org> <20230228112607.GA18683@e124191.cambridge.arm.com> <87sfepha41.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87sfepha41.wl-maz@kernel.org> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_112217_421652_CACD5D51 X-CRM114-Status: GOOD ( 20.42 ) 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, Feb 28, 2023 at 07:18:38PM +0000, Marc Zyngier wrote: > 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. Absolutely, I have this queued up. Thanks for testing the patch Joey. Want to see if I can get push access to the kvmarm repository in time, otherwise I'll send a pull to you Marc. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel