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 6F5F6C76196 for ; Tue, 28 Mar 2023 19:23:16 +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=etVgksZBheaTmdF2ZJsQ/gHi4NbIeiSIAiIV3FPJ1tQ=; b=AJoWYeR3BcoS+U ofxuANkY3tqvxQdiLGJBW609A9JiJYmMfFbJu/NCLJpSnR68jCidEWhvp5quIJB4EV5+RJ4Ns3/Qj sVBCprNqSCen6aujPtt8v3d1feVQQYJdsBojV9cd0RMLyAaefN6uDb8mmub857NjKxd2WToUOCzGo b42M72q7OvespuSQGsMEwa/74TqK9ndhiSJJeSVZ7O5+J/wpnz+s9/PizFlAhk76bt/U45D7HSK+/ pyxDzi5lsD92FIRR0ZOgwQl8tUWxiWaodNDPRLAVeRzyptnhPCu+B50gtS2keBBs9NZM2m5Qi2E1q KQqFLToexiOrLL+Pos5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phEtk-00FbTV-1k; Tue, 28 Mar 2023 19:22:24 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phEth-00FbSC-0z for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2023 19:22:22 +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 ams.source.kernel.org (Postfix) with ESMTPS id 11F46B81E11; Tue, 28 Mar 2023 19:22:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2896C433EF; Tue, 28 Mar 2023 19:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680031336; bh=SdUXX1XZF8JxcW5RB4HlvxCisNkczpZsVbh7glZ9bpo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sOFxorl0CO5XLg/s6ZsFZjbFyQMnjsUlw8F5j4iFju9IPCunmRPFffE4CvNKpA7Mg ThRVIyrGf5Q4uilyfzg/QYkY44BXSqU2uVLO77PoyQOwkalVY2cbU3qlOw27pi2gl/ 1cv2vrBmvbDn6SeX0AwNlPHAp/EZVFrvqFZnaWTjtni5FEDKQ6x49mHmTIRHm4t6za qBZ4xmlZmd85ehmAbs8tVvG8VfuWhPqiz9BN28PStejc5eZg7X7vClfGU7yetdCNFl aiwgDXxfTa5f2d5NlP5VtbgBfilnuF98k8rtTb2QEtgPF7s0qbSnP8qjwEMPSxKpaL szjuY5Y+GsIwA== Received: from sofa.misterjones.org ([185.219.108.64] 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 1phEta-003rPf-AZ; Tue, 28 Mar 2023 20:22:14 +0100 Date: Tue, 28 Mar 2023 20:22:09 +0100 Message-ID: <87y1ngr89q.wl-maz@kernel.org> From: Marc Zyngier To: Jing Zhang Cc: KVM , KVMARM , ARMLinux , Oliver Upton , Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Ricardo Koller , Raghavendra Rao Ananta Subject: Re: [PATCH v4 2/6] KVM: arm64: Save ID registers' sanitized value per guest In-Reply-To: References: <20230317050637.766317-1-jingzhangos@google.com> <20230317050637.766317-3-jingzhangos@google.com> <861qlaxzyw.wl-maz@kernel.org> 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: 185.219.108.64 X-SA-Exim-Rcpt-To: jingzhangos@google.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, oupton@google.com, will@kernel.org, pbonzini@redhat.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, tabba@google.com, reijiw@google.com, ricarkol@google.com, rananta@google.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-20230328_122221_639329_302CE255 X-CRM114-Status: GOOD ( 19.31 ) 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 Mar 2023 18:36:58 +0100, Jing Zhang wrote: > > Hi Marc, [...] > IIUC, usually we don't need a specific locking to update idregs here. > All idregs are 64 bit and can be read/written atomically. The only > case that may need a locking is to keep the consistency for PMUVer in > AA64DFR0_EL1 and PerfMon in DFR0_EL1. If there is no use case for two > VCPU threads in a VM to update PMUVer and PerfMon concurrently, then > we don't need the locking as in later patch by using the kvm lock. > WDTY? I think we generally need locking for any writable id-reg, the goal being that they will ultimately *all* be writable. As you found out, there is this need for the PMU fields, and I'm willing to bet that there will be more of those. And given that the locking you have used in some of the later patches violates the locking order (don't worry, you're not alone!), we need to use something else. Which is where Oliver's series comes into play. 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