~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/task_size_64.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASM_POWERPC_TASK_SIZE_64_H
  3 #define _ASM_POWERPC_TASK_SIZE_64_H
  4 
  5 /*
  6  * 64-bit user address space can have multiple limits
  7  * For now supported values are:
  8  */
  9 #define TASK_SIZE_64TB  (0x0000400000000000UL)
 10 #define TASK_SIZE_128TB (0x0000800000000000UL)
 11 #define TASK_SIZE_512TB (0x0002000000000000UL)
 12 #define TASK_SIZE_1PB   (0x0004000000000000UL)
 13 #define TASK_SIZE_2PB   (0x0008000000000000UL)
 14 
 15 /*
 16  * With 52 bits in the address we can support up to 4PB of range.
 17  */
 18 #define TASK_SIZE_4PB   (0x0010000000000000UL)
 19 
 20 /*
 21  * For now 512TB is only supported with book3s and 64K linux page size.
 22  */
 23 #ifdef CONFIG_PPC_64K_PAGES
 24 /*
 25  * Max value currently used:
 26  */
 27 #define TASK_SIZE_USER64                TASK_SIZE_4PB
 28 #define DEFAULT_MAP_WINDOW_USER64       TASK_SIZE_128TB
 29 #define TASK_CONTEXT_SIZE               TASK_SIZE_512TB
 30 #else
 31 #define TASK_SIZE_USER64                TASK_SIZE_64TB
 32 #define DEFAULT_MAP_WINDOW_USER64       TASK_SIZE_64TB
 33 
 34 /*
 35  * We don't need to allocate extended context ids for 4K page size, because we
 36  * limit the max effective address on this config to 64TB.
 37  */
 38 #define TASK_CONTEXT_SIZE TASK_SIZE_64TB
 39 #endif
 40 
 41 /*
 42  * 32-bit user address space is 4GB - 1 page
 43  * (this 1 page is needed so referencing of 0xFFFFFFFF generates EFAULT
 44  */
 45 #define TASK_SIZE_USER32 (0x0000000100000000UL - (1 * PAGE_SIZE))
 46 
 47 #define TASK_SIZE (is_32bit_task() ? TASK_SIZE_USER32 : TASK_SIZE_USER64)
 48 
 49 #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4))
 50 #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(DEFAULT_MAP_WINDOW_USER64 / 4))
 51 
 52 /*
 53  * This decides where the kernel will search for a free chunk of vm space during
 54  * mmap's.
 55  */
 56 #define TASK_UNMAPPED_BASE      \
 57         ((is_32bit_task()) ? TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64)
 58 
 59 /*
 60  * Initial task size value for user applications. For book3s 64 we start
 61  * with 128TB and conditionally enable upto 512TB
 62  */
 63 #ifdef CONFIG_PPC_BOOK3S_64
 64 #define DEFAULT_MAP_WINDOW      \
 65         ((is_32bit_task()) ? TASK_SIZE_USER32 : DEFAULT_MAP_WINDOW_USER64)
 66 #else
 67 #define DEFAULT_MAP_WINDOW      TASK_SIZE
 68 #endif
 69 
 70 #define STACK_TOP_USER64 DEFAULT_MAP_WINDOW_USER64
 71 #define STACK_TOP_USER32 TASK_SIZE_USER32
 72 #define STACK_TOP_MAX TASK_SIZE_USER64
 73 #define STACK_TOP (is_32bit_task() ? STACK_TOP_USER32 : STACK_TOP_USER64)
 74 
 75 #define arch_get_mmap_base(addr, base) \
 76         (((addr) > DEFAULT_MAP_WINDOW) ? (base) + TASK_SIZE - DEFAULT_MAP_WINDOW : (base))
 77 
 78 #define arch_get_mmap_end(addr, len, flags) \
 79         (((addr) > DEFAULT_MAP_WINDOW) || \
 80          (((flags) & MAP_FIXED) && ((addr) + (len) > DEFAULT_MAP_WINDOW)) ? TASK_SIZE : \
 81                                                                             DEFAULT_MAP_WINDOW)
 82 
 83 #endif /* _ASM_POWERPC_TASK_SIZE_64_H */
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php