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 DABEAC54EE9 for ; Fri, 2 Sep 2022 14:49:39 +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:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NtUcNNeBThMLGjQGhf0CmQx3JHJ36NBxQR+pP+ub2+E=; b=PBC6WN2QoZf/EH DEBx8Cbl7gRcNeKmuSsAjTlC6IhoegmTJygcl7Xwdyc/drclb6XQO2j2itmod1SK95k9qIUigx2nS TmLzxyxUHqkP0K7B0ndl1kVM7dvpYl6qiQT80k+YBMxctsxtmLJv5MNuO3HQ3o5St+0co2j5FGra5 yI8mSGbpNK2tbtsANudRVU3mKOXLxW7ooDrb/ue0kZvZuoWd16HLO7Q8WtP3t+4KNoj8lVGhZ3EP5 E8UqZGy/GZjTLGziFFv+2Jd6hYL8O3xl2+wqORXoscHnAXTpxUzfxlUnYRQScLmN9HBzXThCRoZtN 3+MipDKjkBGlIoVryWdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU7yK-005kv5-Cm; Fri, 02 Sep 2022 14:48:40 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU7xR-005k83-Il for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 14:47:47 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1342FED1; Fri, 2 Sep 2022 07:47:50 -0700 (PDT) Received: from [10.57.45.3] (unknown [10.57.45.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D383F3FA27; Fri, 2 Sep 2022 07:47:41 -0700 (PDT) Message-ID: <5413e00f-251f-9d48-9cbb-07742feec87f@arm.com> Date: Fri, 2 Sep 2022 15:47:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 6/7] KVM: arm64: permit all VM_MTE_ALLOWED mappings with MTE enabled Content-Language: en-GB To: Catalin Marinas , 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, Vincenzo Frascino References: <20220810193033.1090251-1-pcc@google.com> <20220810193033.1090251-7-pcc@google.com> From: Steven Price In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_074745_711582_6AB06867 X-CRM114-Status: GOOD ( 20.27 ) 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 02/09/2022 14:45, Catalin Marinas wrote: > 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 Looks fine to me, and thanks for doing the work: I was never very pleased with the !VM_SHARED restriction, but I couldn't figure a good way of getting the locking to work. Reviewed-by: Steven Price _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel