diff --git a/include/linux/mm.h b/include/linux/mm.h index a4996e11cda689b133c354a5e248e39baea780e1..e2eb3ea63d6afbd673644b2d688fd8023fe56c53 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -378,6 +378,12 @@ extern unsigned int kobjsize(const void *objp); # define VM_MTE_ALLOWED VM_NONE #endif +#if defined(CONFIG_ASCEND_SHARE_POOL) +# define VM_SHARE_POOL VM_HIGH_ARCH_4 +#else +# define VM_SHARE_POOL VM_NONE +#endif + #ifndef VM_GROWSUP # define VM_GROWSUP VM_NONE #endif diff --git a/include/linux/share_pool.h b/include/linux/share_pool.h index 3a56238c8a4d145b043d370afefaf2fd35b40dd7..c39780ab5a87a0738315268089d551c62f6060f5 100644 --- a/include/linux/share_pool.h +++ b/include/linux/share_pool.h @@ -272,6 +272,14 @@ static inline void sp_area_work_around(struct vm_unmapped_area_info *info, info->high_limit = min(info->high_limit, MMAP_SHARE_POOL_START); } +static inline bool sp_check_vm_share_pool(unsigned long vm_flags) +{ + if (sp_is_enabled() && (vm_flags & VM_SHARE_POOL)) + return true; + + return false; +} + #else /* CONFIG_ASCEND_SHARE_POOL */ static inline int mg_sp_group_add_task(int pid, unsigned long prot, int spg_id)