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 3EF98ECAAD5 for ; Fri, 2 Sep 2022 13:46:34 +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=DQt/CEGqmgsjWIVafcum0bF7/F9H15HwkqKoFRbAFxc=; b=QTDX0Ln2cc/sHZ LF0U4CK8kgJv5BjoNpwF1KYAko8AlWU8u/RJHdRnUxF7Sdm40BpJKOA0TOlnrd4LmT3qWmLfBESfN 7L2D8ESZRdV7vvuHhC28KvGLOOjCTNTurQA+SGEHhmLSnDOupHLF1LYoHVsMRSPZC5mOBBllkDpmx cFWaFoYHpdisHJPd9ADoA/HIhezq6KZIajff9WIqUo8taW4g/ApXCfdBd0WIEPkTpHttgc9BSgRC/ BN4sfw1tIVCBURBDzdnLcuU4oo9AwjMHP3GCCn6JL00o45KTBZi2Vlc7SYcggBWt3VaEHj6dUWUBW KesDBrBHKukoxnrC4Qxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU6zK-005DuV-HO; Fri, 02 Sep 2022 13:45:38 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU6zF-005DrI-Mo for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 13:45:35 +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 dfw.source.kernel.org (Postfix) with ESMTPS id 13FD26211B; Fri, 2 Sep 2022 13:45:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1852C433D6; Fri, 2 Sep 2022 13:45:30 +0000 (UTC) Date: Fri, 2 Sep 2022 14:45:27 +0100 From: Catalin Marinas To: Peter Collingbourne Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Cornelia Huck , Will Deacon , Marc Zyngier , 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 Message-ID: References: <20220810193033.1090251-1-pcc@google.com> <20220810193033.1090251-7-pcc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220810193033.1090251-7-pcc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_064534_107907_A08D62C2 X-CRM114-Status: GOOD ( 22.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 Wed, Aug 10, 2022 at 12:30:32PM -0700, 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; I think this is fine with the locking in place (BTW, it may be worth mentioning in the commit message that it's a relaxation of the ABI). I'd like Steven to have a look as well when he gets the time, in case we missed anything on the KVM+MTE side. Reviewed-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel