| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * PGD allocation/freeing |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012 ARM Ltd. |
|---|
| 5 | 6 | * Author: Catalin Marinas <catalin.marinas@arm.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 18 | 7 | */ |
|---|
| 19 | 8 | |
|---|
| 20 | 9 | #include <linux/mm.h> |
|---|
| .. | .. |
|---|
| 30 | 19 | |
|---|
| 31 | 20 | pgd_t *pgd_alloc(struct mm_struct *mm) |
|---|
| 32 | 21 | { |
|---|
| 22 | + gfp_t gfp = GFP_PGTABLE_USER; |
|---|
| 23 | + |
|---|
| 33 | 24 | if (PGD_SIZE == PAGE_SIZE) |
|---|
| 34 | | - return (pgd_t *)__get_free_page(PGALLOC_GFP); |
|---|
| 25 | + return (pgd_t *)__get_free_page(gfp); |
|---|
| 35 | 26 | else |
|---|
| 36 | | - return kmem_cache_alloc(pgd_cache, PGALLOC_GFP); |
|---|
| 27 | + return kmem_cache_alloc(pgd_cache, gfp); |
|---|
| 37 | 28 | } |
|---|
| 38 | 29 | |
|---|
| 39 | 30 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
|---|
| .. | .. |
|---|
| 44 | 35 | kmem_cache_free(pgd_cache, pgd); |
|---|
| 45 | 36 | } |
|---|
| 46 | 37 | |
|---|
| 47 | | -void __init pgd_cache_init(void) |
|---|
| 38 | +void __init pgtable_cache_init(void) |
|---|
| 48 | 39 | { |
|---|
| 49 | 40 | if (PGD_SIZE == PAGE_SIZE) |
|---|
| 50 | 41 | return; |
|---|