From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH v5 11/25] mm: Introduce arch_calc_vm_flag_bits() Date: Thu, 25 Jun 2020 18:34:02 +0100 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 Return-path: Received: from mail.kernel.org ([198.145.29.99]:52676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404938AbgFYReG (ORCPT ); Thu, 25 Jun 2020 13:34:06 -0400 Content-Disposition: inline In-Reply-To: <20200624113611.2cf12da3a325d03a862c0adf@linux-foundation.org> Sender: linux-arch-owner@vger.kernel.org List-ID: 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 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