Message ID | 20200226180526.3272848-16-catalin.marinas@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=ZbOS=4O=kvack.org=owner-linux-mm@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D902514B4 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 26 Feb 2020 18:06:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A7D7620732 for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 26 Feb 2020 18:06:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7D7620732 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B07816B008A; Wed, 26 Feb 2020 13:06:02 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9CDDB6B008C; Wed, 26 Feb 2020 13:06:02 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 840336B0092; Wed, 26 Feb 2020 13:06:02 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 654216B008A for <linux-mm@kvack.org>; Wed, 26 Feb 2020 13:06:02 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 379EC246E for <linux-mm@kvack.org>; Wed, 26 Feb 2020 18:06:02 +0000 (UTC) X-FDA: 76533056964.11.cord17_34ad34e2e1d57 X-Spam-Summary: 2,0,0,df4486fc4b319ec0,d41d8cd98f00b204,catalin.marinas@arm.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1534:1540:1711:1730:1747:1777:1792:2393:2559:2562:2895:3138:3139:3140:3141:3142:3352:3865:3870:3871:5007:6261:7875:7903:8634:10004:11026:11473:11658:11914:12043:12296:12297:12438:12555:13069:13184:13229:13311:13357:13894:14181:14384:14394:14664:14721:21080:21230:21451:21627:30054:30070,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: cord17_34ad34e2e1d57 X-Filterd-Recvd-Size: 2250 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Wed, 26 Feb 2020 18:06:01 +0000 (UTC) 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 6F4E04B2; Wed, 26 Feb 2020 10:06:01 -0800 (PST) Received: from arrakis.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F18A83F881; Wed, 26 Feb 2020 10:05:59 -0800 (PST) From: Catalin Marinas <catalin.marinas@arm.com> To: linux-arm-kernel@lists.infradead.org Cc: Will Deacon <will@kernel.org>, Vincenzo Frascino <vincenzo.frascino@arm.com>, Szabolcs Nagy <szabolcs.nagy@arm.com>, Richard Earnshaw <Richard.Earnshaw@arm.com>, Kevin Brodsky <kevin.brodsky@arm.com>, Andrey Konovalov <andreyknvl@google.com>, Peter Collingbourne <pcc@google.com>, linux-mm@kvack.org, linux-arch@vger.kernel.org Subject: [PATCH v2 15/19] mm: Allow arm64 mmap(PROT_MTE) on RAM-based files Date: Wed, 26 Feb 2020 18:05:22 +0000 Message-Id: <20200226180526.3272848-16-catalin.marinas@arm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200226180526.3272848-1-catalin.marinas@arm.com> References: <20200226180526.3272848-1-catalin.marinas@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
arm64: Memory Tagging Extension user-space support
|
expand
|
diff --git a/mm/shmem.c b/mm/shmem.c index c8f7540ef048..afd050ac7f8d 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2226,6 +2226,9 @@ static int shmem_mmap(struct file *file, struct vm_area_struct *vma) vma->vm_flags &= ~(VM_MAYWRITE); } + /* arm64 - allow memory tagging on RAM-based files */ + vma->vm_flags |= VM_MTE_ALLOWED; + file_accessed(file); vma->vm_ops = &shmem_vm_ops; if (IS_ENABLED(CONFIG_TRANSPARENT_HUGE_PAGECACHE) &&
Since arm64 memory (allocation) tags can only be stored in RAM, mapping files with PROT_MTE is not allowed by default. RAM-based files like those in a tmpfs mount or memfd_create() can support memory tagging, so update the vm_flags accordingly in shmem_mmap(). Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> --- mm/shmem.c | 3 +++ 1 file changed, 3 insertions(+)