Re: [PATCH] mm: Add is_migrate_cma_page
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Laura Abbott <labbott@xxxxxxxxxx>
- Subject: Re: [PATCH] mm: Add is_migrate_cma_page
- From: Kees Cook <keescook@xxxxxxxxxxxx>
- Date: Tue, 19 Jul 2016 15:40:46 -0700
- Cc: LKML <linux-kernel@xxxxxxxxxxxxxxx>, Rik van Riel <riel@xxxxxxxxxx>, Casey Schaufler <casey@xxxxxxxxxxxxxxxx>, PaX Team <pageexec@xxxxxxxxxxx>, Brad Spengler <spender@xxxxxxxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>, Christoph Lameter <cl@xxxxxxxxx>, Pekka Enberg <penberg@xxxxxxxxxx>, David Rientjes <rientjes@xxxxxxxxxx>, Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxx>, Mathias Krause <minipli@xxxxxxxxxxxxxx>, Jan Kara <jack@xxxxxxx>, Vitaly Wool <vitalywool@xxxxxxxxx>, Andrea Arcangeli <aarcange@xxxxxxxxxx>, Dmitry Vyukov <dvyukov@xxxxxxxxxx>, Laura Abbott <labbott@xxxxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, "linuxppc-dev@xxxxxxxxxxxxxxxx" <linuxppc-dev@xxxxxxxxxxxxxxxx>, sparclinux <sparclinux@xxxxxxxxxxxxxxx>, linux-arch <linux-arch@xxxxxxxxxxxxxxx>, Linux-MM <linux-mm@xxxxxxxxx>, "kernel-hardening@xxxxxxxxxxxxxxxxxx" <kernel-hardening@xxxxxxxxxxxxxxxxxx>
- In-reply-to: <1468965604-25023-1-git-send-email-labbott@redhat.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <CAGXu5j+nHpHcYT8FyHNe6AFQCdakoSMW=UWDatyxhRK7CB7_=g@mail.gmail.com> <1468965604-25023-1-git-send-email-labbott@redhat.com>
On Tue, Jul 19, 2016 at 3:00 PM, Laura Abbott <labbott@xxxxxxxxxx> 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 <labbott@xxxxxxxxxx>
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 from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]