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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E658C05027 for ; Fri, 17 Feb 2023 09:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229980AbjBQJAd (ORCPT ); Fri, 17 Feb 2023 04:00:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbjBQJAc (ORCPT ); Fri, 17 Feb 2023 04:00:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03D1B60A6F; Fri, 17 Feb 2023 01:00:25 -0800 (PST) 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 529F2B82AE2; Fri, 17 Feb 2023 09:00:24 +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 Cc: Will Deacon , Jonathan Corbet , Michael Larabel , 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, Andrew Morton , Paolo Bonzini 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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.