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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFB6DC433DF for ; Thu, 25 Jun 2020 17:34:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 71F4520789 for ; Thu, 25 Jun 2020 17:34:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71F4520789 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 F1AAE6B009F; Thu, 25 Jun 2020 13:34:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECB8F8D000D; Thu, 25 Jun 2020 13:34:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E08448D000C; Thu, 25 Jun 2020 13:34:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id C876F6B009F for ; Thu, 25 Jun 2020 13:34:10 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8830D181AC9BF for ; Thu, 25 Jun 2020 17:34:10 +0000 (UTC) X-FDA: 76968432660.19.sugar46_09144e126e4e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id CCA2214D11 for ; Thu, 25 Jun 2020 17:34:07 +0000 (UTC) X-HE-Tag: sugar46_09144e126e4e X-Filterd-Recvd-Size: 2875 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Thu, 25 Jun 2020 17:34:07 +0000 (UTC) Received: from gaia (unknown [2.26.170.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B952320789; Thu, 25 Jun 2020 17:34:04 +0000 (UTC) Date: Thu, 25 Jun 2020 18:34:02 +0100 From: Catalin Marinas To: Andrew Morton Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Will Deacon , Dave P Martin , Vincenzo Frascino , Szabolcs Nagy , Kevin Brodsky , Andrey Konovalov , Peter Collingbourne Subject: Re: [PATCH v5 11/25] mm: Introduce arch_calc_vm_flag_bits() Message-ID: <20200625173344.GF14812@gaia> References: <20200624175244.25837-1-catalin.marinas@arm.com> <20200624175244.25837-12-catalin.marinas@arm.com> <20200624113611.2cf12da3a325d03a862c0adf@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200624113611.2cf12da3a325d03a862c0adf@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: CCA2214D11 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 Wed, Jun 24, 2020 at 11:36:11AM -0700, Andrew Morton wrote: > On Wed, 24 Jun 2020 18:52:30 +0100 Catalin Marinas wrote: > > From: Kevin Brodsky > > Similarly to arch_calc_vm_prot_bits(), introduce a dummy > > arch_calc_vm_flag_bits() invoked from calc_vm_flag_bits(). This macro > > can be overridden by architectures to insert specific VM_* flags derived > > from the mmap() MAP_* flags. > > > > ... > > > > --- a/include/linux/mman.h > > +++ b/include/linux/mman.h > > @@ -74,13 +74,17 @@ static inline void vm_unacct_memory(long pages) > > } > > > > /* > > - * Allow architectures to handle additional protection bits > > + * Allow architectures to handle additional protection and flag bits > > */ > > > > #ifndef arch_calc_vm_prot_bits > > #define arch_calc_vm_prot_bits(prot, pkey) 0 > > #endif > > > > +#ifndef arch_calc_vm_flag_bits > > +#define arch_calc_vm_flag_bits(flags) 0 > > +#endif > > It would be helpful to add a comment specifying which arch header file > is responsible for defining arch_calc_vm_flag_bits. Because in the > past we've messed this sort of thing up and had different architectures > define things in different header files, resulting in build issues as > code evolves. I'll add a comment that the overriding definitions need to go in the arch asm/mman.h file. Thanks. -- Catalin