X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..527f99514973766e9c0382a4d8550dfb00f54939:/osfmk/mach/i386/vm_param.h diff --git a/osfmk/mach/i386/vm_param.h b/osfmk/mach/i386/vm_param.h index 02bef271f..040472dfe 100644 --- a/osfmk/mach/i386/vm_param.h +++ b/osfmk/mach/i386/vm_param.h @@ -95,16 +95,18 @@ #define I386_PGBYTES 4096 /* bytes per 80386 page */ #define I386_PGSHIFT 12 /* bitshift for pages */ -#ifdef PRIVATE -#define KERNEL_PAGE_SIZE I386_PGBYTES -#define KERNEL_PAGE_SHIFT I386_PGSHIFT -#define KERNEL_PAGE_MASK (KERNEL_PAGE_SIZE-1) -#endif - #define PAGE_SIZE I386_PGBYTES #define PAGE_SHIFT I386_PGSHIFT #define PAGE_MASK (PAGE_SIZE - 1) +#define PAGE_MAX_SHIFT PAGE_SHIFT +#define PAGE_MAX_SIZE PAGE_SIZE +#define PAGE_MAX_MASK PAGE_MASK + +#define PAGE_MIN_SHIFT PAGE_SHIFT +#define PAGE_MIN_SIZE PAGE_SIZE +#define PAGE_MIN_MASK PAGE_MASK + #define I386_LPGBYTES 2*1024*1024 /* bytes per large page */ #define I386_LPGSHIFT 21 /* bitshift for large pages */ #define I386_LPGMASK (I386_LPGBYTES-1) @@ -135,7 +137,11 @@ /* * default top of user stack... it grows down from here */ -#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL) +#define VM_USRSTACK64 ((user_addr_t) 0x00007FFEEFC00000ULL) + +/* + * XXX TODO: Obsolete? + */ #define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL) #define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL) #define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL) @@ -162,6 +168,9 @@ #ifdef KERNEL_PRIVATE +#define TEST_PAGE_SIZE_16K FALSE +#define TEST_PAGE_SIZE_4K TRUE + /* Kernel-wide values */ #define KB (1024ULL) @@ -172,7 +181,7 @@ * Maximum physical memory supported. */ #define K32_MAXMEM (32*GB) -#define K64_MAXMEM (128*GB) +#define K64_MAXMEM (252*GB) #define KERNEL_MAXMEM K64_MAXMEM /* @@ -194,14 +203,22 @@ #define KEXT_ALLOC_BASE(x) ((x) - KEXT_ALLOC_MAX_OFFSET) #define KEXT_ALLOC_SIZE(x) (KEXT_ALLOC_MAX_OFFSET - (x)) - -#define KERNEL_STACK_SIZE (I386_PGBYTES*4) +#define VM_KERNEL_ADDRESS(va) ((((vm_address_t)(va))>=VM_MIN_KERNEL_AND_KEXT_ADDRESS) && \ + (((vm_address_t)(va))<=VM_MAX_KERNEL_ADDRESS)) #define VM_MAP_MIN_ADDRESS MACH_VM_MIN_ADDRESS #define VM_MAP_MAX_ADDRESS MACH_VM_MAX_ADDRESS /* FIXME - always leave like this? */ -#define INTSTACK_SIZE (I386_PGBYTES*4) +#if KASAN +/* Increase the stack sizes to account for the redzones that get added to every + * stack object. */ +# define INTSTACK_SIZE (I386_PGBYTES*4*4) +# define KERNEL_STACK_SIZE (I386_PGBYTES*4*4) +#else +# define INTSTACK_SIZE (I386_PGBYTES*4) +# define KERNEL_STACK_SIZE (I386_PGBYTES*4) +#endif #ifdef MACH_KERNEL_PRIVATE @@ -247,7 +264,7 @@ #define PMAP_SET_CACHE_ATTR(mem, object, cache_attr, batch_pmap_op) \ MACRO_BEGIN \ - pmap_set_cache_attributes((mem)->phys_page, (cache_attr)); \ + pmap_set_cache_attributes(VM_PAGE_GET_PHYS_PAGE(mem), (cache_attr)); \ (object)->set_cache_attr = TRUE; \ (void) batch_pmap_op; \ MACRO_END