From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id AAC866B0253 for ; Tue, 19 Jul 2016 18:40:49 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id p129so19735560wmp.3 for ; Tue, 19 Jul 2016 15:40:49 -0700 (PDT) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com. [2a00:1450:400c:c09::22f]) by mx.google.com with ESMTPS id u186si23021579wmg.3.2016.07.19.15.40.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 15:40:48 -0700 (PDT) Received: by mail-wm0-x22f.google.com with SMTP id o80so43934882wme.1 for ; Tue, 19 Jul 2016 15:40:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1468965604-25023-1-git-send-email-labbott@redhat.com> References: <1468965604-25023-1-git-send-email-labbott@redhat.com> From: Kees Cook Date: Tue, 19 Jul 2016 15:40:46 -0700 Message-ID: Subject: Re: [PATCH] mm: Add is_migrate_cma_page Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Laura Abbott Cc: LKML , Rik van Riel , Casey Schaufler , PaX Team , Brad Spengler , Russell King , Catalin Marinas , Will Deacon , Ard Biesheuvel , Benjamin Herrenschmidt , Michael Ellerman , Tony Luck , Fenghua Yu , "David S. Miller" , "x86@kernel.org" , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Andy Lutomirski , Borislav Petkov , Mathias Krause , Jan Kara , Vitaly Wool , Andrea Arcangeli , Dmitry Vyukov , Laura Abbott , "linux-arm-kernel@lists.infradead.org" , linux-ia64@vger.kernel.org, "linuxppc-dev@lists.ozlabs.org" , sparclinux , linux-arch , Linux-MM , "kernel-hardening@lists.openwall.com" On Tue, Jul 19, 2016 at 3:00 PM, Laura Abbott wrote: > Code such as hardened user copy[1] needs a way to tell if a > page is CMA or not. Add is_migrate_cma_page in a similar way > to is_migrate_isolate_page. > > [1]http://article.gmane.org/gmane.linux.kernel.mm/155238 > > Signed-off-by: Laura Abbott Great, thanks! > --- > Here's an explicit patch, slightly different than what I posted before. It can > be kept separate or folded in as needed. Assuming there's no objection, I'll add it to my tree and use the new macro. -Kees > --- > include/linux/mmzone.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 02069c2..c8478b2 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -68,8 +68,10 @@ extern char * const migratetype_names[MIGRATE_TYPES]; > > #ifdef CONFIG_CMA > # define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) > +# define is_migrate_cma_page(_page) (get_pageblock_migratetype(_page) == MIGRATE_CMA) > #else > # define is_migrate_cma(migratetype) false > +# define is_migrate_cma_page(_page) false > #endif > > #define for_each_migratetype_order(order, type) \ > -- > 2.7.4 > -- Kees Cook Chrome OS & Brillo Security -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org