summaryrefslogtreecommitdiff
path: root/mm/util.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2022-05-11 20:22:22 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2022-05-11 20:22:22 +0200
commitb7c15a3ce6fea5da3aa836c897a78ac628467d54 (patch)
tree0e941036165a7d6261e77a756693f5d0b13bbbe4 /mm/util.c
parentef3a6b70507a2add2cd2e01f5eb9b54d561bacb9 (diff)
parentc5eb0a61238dd6faf37f58c9ce61c9980aaffd7a (diff)
Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes
Requested by Zack for vmwgfx fixes. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mm/util.c b/mm/util.c
index 54e5e761a9a9..3492a9e81aa3 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -592,8 +592,15 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
return NULL;
}
- return __vmalloc_node(size, 1, flags, node,
- __builtin_return_address(0));
+ /*
+ * kvmalloc() can always use VM_ALLOW_HUGE_VMAP,
+ * since the callers already cannot assume anything
+ * about the resulting pointer, and cannot play
+ * protection games.
+ */
+ return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
+ flags, PAGE_KERNEL, VM_ALLOW_HUGE_VMAP,
+ node, __builtin_return_address(0));
}
EXPORT_SYMBOL(kvmalloc_node);