Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3518194pxb; Mon, 24 Jan 2022 11:14:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwPz6Un1p44BXmK6sTUfnQGtAcJpf/rHzYRUE/dvuDJIdS8M+X0WA4FuwdrGa0HRayl7gg X-Received: by 2002:a63:2220:: with SMTP id i32mr12698444pgi.320.1643051651226; Mon, 24 Jan 2022 11:14:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051651; cv=none; d=google.com; s=arc-20160816; b=MiShQdBnjgk9ejdIZBhF6MgrKiLVuBMGW+Nk6B60Wi0+6fmneQaHEyAE8F6THPco5J vePQZfVCJhdD4rAFReR03sbmtcMbJX79/p7id6biQQqq0AC1mOU7i3+2nAxSX5ys8kUK WqAdzzlAdowOOQbYVwnel0ymHPxI380AXMycPNMEmMp7onszdJ4Ks9Rt1aEUJyGLa6Q9 jhdeVoyFMFHuQ3y6nCu2KGhdFiJk92HvIO6XSkcHQUS2jPz8hx/d+hNolyqUS+2ZDh1h eO5fnKE2dWvDyLaU+djafBbmJmUUco8zh7ANS1iZMWFPTFqXt3DD/6FsUEobgWR39QTa 8uWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=NlqTZo8gniFppSandkKK/4q5ZmEsIzXOl3aC9bNtxXc=; b=ldH1U9IsGO4er7Mg9vn1h8x1xokhdPuzEVAOUuOEg03+JrPKX9jMVJE185JxetFlxn WOu8Ji5u76sbk9km13Jb69kDBdDMONqTYlhKBmKJGLRCSj0YhRyrWGY7H0XqVmEOmwW1 aruhH9kaJ8+1fFbduBDDjUhrVPxgt2gxyxuDAaUgDXjEyuI1ROrpL7Vob012/FEgfXsz 1wEKT1BCvlQHG3X5nsveHLIt8JgU+ETuqtTBsLGEQ+1nMwqa7H2gjlK1NyKaeAtb0PNU +tnI+sCz3X2TzNXKK7FqEBJhlhqYvL+DutJ1wiKHrqpmf5l1Sfj580F/tSCNwVD2z9vH p+Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si13008447plo.113.2022.01.24.11.13.59; Mon, 24 Jan 2022 11:14:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242735AbiAXM52 (ORCPT + 99 others); Mon, 24 Jan 2022 07:57:28 -0500 Received: from foss.arm.com ([217.140.110.172]:32858 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242678AbiAXM5U (ORCPT ); Mon, 24 Jan 2022 07:57:20 -0500 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 8C867D6E; Mon, 24 Jan 2022 04:57:20 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.43.190]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BD12B3F774; Mon, 24 Jan 2022 04:57:17 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, hch@infradead.org, akpm@linux-foundation.org, Anshuman Khandual Subject: [RFC V1 03/31] mm/mmap: Add new config ARCH_HAS_VM_GET_PAGE_PROT Date: Mon, 24 Jan 2022 18:26:40 +0530 Message-Id: <1643029028-12710-4-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1643029028-12710-1-git-send-email-anshuman.khandual@arm.com> References: <1643029028-12710-1-git-send-email-anshuman.khandual@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a new config ARCH_HAS_VM_GET_PAGE_PROT, which when subscribed enables a given platform to define its own vm_get_page_prot(). This framework will help remove protection_map[] dependency going forward. Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Suggested-by: Christoph Hellwig Signed-off-by: Anshuman Khandual --- mm/Kconfig | 3 +++ mm/mmap.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/mm/Kconfig b/mm/Kconfig index 257ed9c86de3..fa436478a94c 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -747,6 +747,9 @@ config ARCH_HAS_CACHE_LINE_SIZE config ARCH_HAS_FILTER_PGPROT bool +config ARCH_HAS_VM_GET_PAGE_PROT + bool + config ARCH_HAS_PTE_DEVMAP bool diff --git a/mm/mmap.c b/mm/mmap.c index 254d716220df..ec403de32dcb 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -81,6 +81,7 @@ static void unmap_region(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev, unsigned long start, unsigned long end); +#ifndef CONFIG_ARCH_HAS_VM_GET_PAGE_PROT /* description of effects of mapping type and prot in current implementation. * this is due to the limited x86 page protection hardware. The expected * behavior is in parens: @@ -136,6 +137,7 @@ pgprot_t vm_get_page_prot(unsigned long vm_flags) return arch_filter_pgprot(ret); } EXPORT_SYMBOL(vm_get_page_prot); +#endif /* CONFIG_ARCH_HAS_VM_GET_PAGE_PROT */ static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags) { -- 2.25.1