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 2B0BAC6FA83 for ; Mon, 12 Sep 2022 16:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbiILQXX (ORCPT ); Mon, 12 Sep 2022 12:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiILQXV (ORCPT ); Mon, 12 Sep 2022 12:23:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F36FE2A71C for ; Mon, 12 Sep 2022 09:23:19 -0700 (PDT) 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 8F9EE61245 for ; Mon, 12 Sep 2022 16:23:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA7FCC433D7; Mon, 12 Sep 2022 16:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662999799; bh=o3jfMSYPsHBf02GW8HpL7oTc7aWyP2dWAFlZ2veTMAI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ArJjPk+PiwuISkUCIFWaXESVSehuqwM8SewbPgyP1KYfHZzzehpRfs1ZosfvNv4Vg 5Kou3HtjPujVo6e+aiZDSF2gu34MjuIitjz5vodcaqexuLFpvbTMSxK4YooDZXHiNf IcELAwetaf1mtsFIrgG8VKPyS2xD2T1CE46V2MD1xQtAVXtNBmGvkiy6QqK2DSMAL6 45Dr2Zr8Jgy3TA8zbZyiNfOeBoK/1rqX33tGUFTQbheQ5zuOGcLFknej32heKKtoGq Ahpvr4CL4qrxRKcR27fmPNIRjFr1+Yi4DbMPKtQgIQHhxi3n8Mp0MemRlucK7gew6r BBngY0wUh7ppw== Received: from sofa.misterjones.org ([185.219.108.64] helo=why.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 1oXmDM-009jjJ-LQ; Mon, 12 Sep 2022 17:23:16 +0100 Date: Mon, 12 Sep 2022 17:23:16 +0100 Message-ID: <874jxcv9xn.wl-maz@kernel.org> From: Marc Zyngier To: Peter Collingbourne Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Cornelia Huck , Catalin Marinas , Will Deacon , Evgenii Stepanov , kvm@vger.kernel.org, Steven Price , Vincenzo Frascino Subject: Re: [PATCH v3 6/7] KVM: arm64: permit all VM_MTE_ALLOWED mappings with MTE enabled In-Reply-To: <20220810193033.1090251-7-pcc@google.com> References: <20220810193033.1090251-1-pcc@google.com> <20220810193033.1090251-7-pcc@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/27.1 (x86_64-pc-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: pcc@google.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, cohuck@redhat.com, catalin.marinas@arm.com, will@kernel.org, eugenis@google.com, kvm@vger.kernel.org, steven.price@arm.com, vincenzo.frascino@arm.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 Wed, 10 Aug 2022 20:30:32 +0100, Peter Collingbourne wrote: > > Certain VMMs such as crosvm have features (e.g. sandboxing) that depend > on being able to map guest memory as MAP_SHARED. The current restriction > on sharing MAP_SHARED pages with the guest is preventing the use of > those features with MTE. Now that the races between tasks concurrently > clearing tags on the same page have been fixed, remove this restriction. > > Signed-off-by: Peter Collingbourne > --- > arch/arm64/kvm/mmu.c | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index d54be80e31dd..fc65dc20655d 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -1075,14 +1075,6 @@ static void sanitise_mte_tags(struct kvm *kvm, kvm_pfn_t pfn, > > static bool kvm_vma_mte_allowed(struct vm_area_struct *vma) > { > - /* > - * VM_SHARED mappings are not allowed with MTE to avoid races > - * when updating the PG_mte_tagged page flag, see > - * sanitise_mte_tags for more details. > - */ > - if (vma->vm_flags & VM_SHARED) > - return false; > - > return vma->vm_flags & VM_MTE_ALLOWED; > } > Can you provide a pointer to some VMM making use of this functionality and enabling MTE? A set of crosvm patches (for example) would be useful to evaluate this series. Thanks, M. -- Without deviation from the norm, progress is not possible.