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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 1E256C05027 for ; Fri, 17 Feb 2023 09:01:25 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4PJ5QW4KyBz3f37 for ; Fri, 17 Feb 2023 20:01:23 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=UrRRzjSW; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=maz@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=UrRRzjSW; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4PJ5PQ37Qnz3cfl for ; Fri, 17 Feb 2023 20:00:26 +1100 (AEDT) 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 A1D8E61775; Fri, 17 Feb 2023 09:00:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DF3BC433EF; Fri, 17 Feb 2023 09:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676624423; bh=/M8E6UXtog3I9+Nq+vepn1BAbm221JZaB3zuaIOAfBw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UrRRzjSW5RZSxjE7udCaDppBAjGA8QElTfkm44pDXR6YTn4hTq5XhgI6TGnvDV8Zx QlwQxJzDx7hETqpkGqOMj9h1+d0ku5KcynkLk9Xos3ESU0+U4aapl57MgaTjde/Nm9 1FAilIeTN0wVKBXAlkoOGeu3SJ4D30fghRNCSK8UGW8fiPmwvAvKB2Odzhfl88BkWD msDP74Fyk8lUq1UB2OgRDz8ZLhTwlt8IuEIk97BzkRk/cZk3LSZE7zrtJuJgdI+N0Y 5oUG0tJboW+MHfBM9Zn6y49rSdQRyOkQpbSp6X46PtXx2cY/TSuRs2NNN8ARrqf3M6 ldIBWr7kdvzxA== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.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 1pSwbM-00B8pV-Lt; Fri, 17 Feb 2023 09:00:20 +0000 Date: Fri, 17 Feb 2023 09:00:20 +0000 Message-ID: <86lekwy8d7.wl-maz@kernel.org> From: Marc Zyngier To: Yu Zhao Subject: Re: [PATCH mm-unstable v1 3/5] kvm/arm64: add kvm_arch_test_clear_young() In-Reply-To: References: <20230217041230.2417228-1-yuzhao@google.com> <20230217041230.2417228-4-yuzhao@google.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/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: yuzhao@google.com, will@kernel.org, corbet@lwn.net, michael@michaellarabel.com, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-mm@google.com, akpm@linux-foundation.org, pbonzini@redhat.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mm@google.com, kvm@vger.kernel.org, Jonathan Corbet , Michael Larabel , linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kvmarm@lists.linux.dev, Paolo Bonzini , Andrew Morton , Will Deacon , linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, 17 Feb 2023 04:21:28 +0000, Yu Zhao wrote: > > On Thu, Feb 16, 2023 at 9:12 PM Yu Zhao wrote: > > > > This patch adds kvm_arch_test_clear_young() for the vast majority of > > VMs that are not pKVM and run on hardware that sets the accessed bit > > in KVM page tables. I'm really interested in how you can back this statement. 90% of the HW I have access to is not FEAT_HWAFDB capable, either because it predates the feature or because the feature is too buggy to be useful. Do you have numbers? > > > > It relies on two techniques, RCU and cmpxchg, to safely test and clear > > the accessed bit without taking the MMU lock. The former protects KVM > > page tables from being freed while the latter clears the accessed bit > > atomically against both the hardware and other software page table > > walkers. > > > > Signed-off-by: Yu Zhao > > --- > > arch/arm64/include/asm/kvm_host.h | 7 +++ > > arch/arm64/include/asm/kvm_pgtable.h | 8 +++ > > arch/arm64/include/asm/stage2_pgtable.h | 43 ++++++++++++++ > > arch/arm64/kvm/arm.c | 1 + > > arch/arm64/kvm/hyp/pgtable.c | 51 ++-------------- > > arch/arm64/kvm/mmu.c | 77 ++++++++++++++++++++++++- > > 6 files changed, 141 insertions(+), 46 deletions(-) > > Adding Marc and Will. > > Can you please add other interested parties that I've missed? The MAINTAINERS file has it all: KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64) M: Marc Zyngier M: Oliver Upton R: James Morse R: Suzuki K Poulose R: Zenghui Yu L: kvmarm@lists.linux.dev May I suggest that you repost your patch and Cc the interested parties yourself? I guess most folks will want to see this in context, and not as a random, isolated change with no rationale. M. -- Without deviation from the norm, progress is not possible.