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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFBEBC433EF for ; Mon, 14 Feb 2022 09:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 568896B0072; Mon, 14 Feb 2022 04:59:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 518D16B0073; Mon, 14 Feb 2022 04:59:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 406EC6B0078; Mon, 14 Feb 2022 04:59:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 2ECC46B0072 for ; Mon, 14 Feb 2022 04:59:04 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id EAB119CD77 for ; Mon, 14 Feb 2022 09:59:03 +0000 (UTC) X-FDA: 79140936966.14.D6457CF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP id 6952F14000D for ; Mon, 14 Feb 2022 09:59:03 +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 C50BB1396; Mon, 14 Feb 2022 01:59:02 -0800 (PST) Received: from [10.163.47.15] (unknown [10.163.47.15]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 06C2E3F718; Mon, 14 Feb 2022 01:59:00 -0800 (PST) Subject: Re: [PATCH 30/30] mm/mmap: Drop ARCH_HAS_VM_GET_PAGE_PROT To: Geert Uytterhoeven Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Andrew Morton , linux-arch@vger.kernel.org References: <1644805853-21338-1-git-send-email-anshuman.khandual@arm.com> <1644805853-21338-31-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: Date: Mon, 14 Feb 2022 15:29:01 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 6952F14000D X-Stat-Signature: azoszprw3ubxt69wz3gktswj6ufr5gpk X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf23.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-HE-Tag: 1644832743-783024 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: On 2/14/22 3:18 PM, Geert Uytterhoeven wrote: > Hi Anshuman, > > On Mon, Feb 14, 2022 at 7:54 AM Anshuman Khandual > wrote: >> All platforms now define their own vm_get_page_prot() and also there is no >> generic version left to fallback on. Hence drop ARCH_HAS_GET_PAGE_PROT. >> >> Cc: Andrew Morton >> Cc: linux-mm@kvack.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual > > Thanks for your patch! > >> - select ARCH_HAS_VM_GET_PAGE_PROT > > So before, all architectures selected ARCH_HAS_VM_GET_PAGE_PROT... Right. ARCH_HAS_VM_GET_PAGE_PROT construct is required until all platforms define their own vm_get_page_prot(). But once defined, this can be dropped off, as a generic MM fallback is no longer available otherwise. > >> --- a/mm/mmap.c >> +++ b/mm/mmap.c >> @@ -81,7 +81,6 @@ 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 > > ... hence the block below was not included. > >> /* 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: >> @@ -102,8 +101,6 @@ static void unmap_region(struct mm_struct *mm, >> * w: (no) no >> * x: (yes) yes >> */ >> -#endif /* CONFIG_ARCH_HAS_VM_GET_PAGE_PROT */ >> - > > So shouldn't the whole block be removed instead? You are right, will remove the entire comment block here. > Do I need more coffee?? > >> static pgprot_t vm_pgprot_modify(pgprot_t oldprot, unsigned long vm_flags) >> { >> return pgprot_modify(oldprot, vm_get_page_prot(vm_flags)); > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds >