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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 AEBB4C433DF for ; Wed, 24 Jun 2020 18:38:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 834C120724 for ; Wed, 24 Jun 2020 18:38:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ouMDHgWt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="FIZjTg4x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 834C120724 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To:Message-Id: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cvIVe80oyJECKdyhaXVh6KmaS0OWd4I2IJjvr0dj97A=; b=ouMDHgWtcJbr54WDWIHKtmQeH X2FVdFJA4W8fvL0FjDcJSN9TsJxpTEi9/8HN/RHkcePMOSUKmxu/StwLrYXMEZGwbNmpG8q7u96oo Mjl8qLbECi8Vc/tkAxbDxeHG3l4s9MI36Qf2exAA0CX3I5S0K//IMD2o8gMBUSL+mlRrLIn4jxe0I tFRyLr3h9VT/VT2EVq9PRr/NQH6vT7+tYmkgLEJNvo0Ul/Q0D7O59IVwwJDzFnz4e32VBCV+q9Zqp 7dh7dmkmXFb5SZ/895UNd5uMh3YXJLPPHAoOh6EgVu8OZXH1zEvEhqpcdXF/UJumrz8IXN/8D7Fc3 W4pWgThwg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joAFt-0006tL-Pe; Wed, 24 Jun 2020 18:36:17 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joAFp-0006rQ-Ef for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2020 18:36:14 +0000 Received: from X1 (nat-ab2241.sltdut.senawave.net [162.218.216.4]) (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 5297720724; Wed, 24 Jun 2020 18:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593023772; bh=zAbzYru4IJFdsh6i/w0jgIRKlV0+glNcrScr56cweUQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FIZjTg4xAP6gEpo+5IWjKs1ow+z2InHOF9UTIBNoPSzTzUfUFAIaiwUfJkpzYl+aO 6PtyELdCLPPtvzhPLRlyIOSj34pSKn6In4jxiceWXZcvDamteov8bkke9ulDMUnm9Y SIhx3UTboYA83kFYZHVSplO4gwHp8a2NZcgxIxc4= Date: Wed, 24 Jun 2020 11:36:11 -0700 From: Andrew Morton To: Catalin Marinas Subject: Re: [PATCH v5 11/25] mm: Introduce arch_calc_vm_flag_bits() Message-Id: <20200624113611.2cf12da3a325d03a862c0adf@linux-foundation.org> In-Reply-To: <20200624175244.25837-12-catalin.marinas@arm.com> References: <20200624175244.25837-1-catalin.marinas@arm.com> <20200624175244.25837-12-catalin.marinas@arm.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Szabolcs Nagy , Andrey Konovalov , Kevin Brodsky , Peter Collingbourne , linux-mm@kvack.org, Vincenzo Frascino , Will Deacon , Dave P Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > #ifndef arch_vm_get_page_prot > #define arch_vm_get_page_prot(vm_flags) __pgprot(0) > #endif > @@ -131,7 +135,8 @@ calc_vm_flag_bits(unsigned long flags) > return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | > _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | > _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ) | > - _calc_vm_trans(flags, MAP_SYNC, VM_SYNC ); > + _calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) | > + arch_calc_vm_flag_bits(flags); > } > > unsigned long vm_commit_limit(void); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel