/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_X86_PAGE_DEFS_H #define _ASM_X86_PAGE_DEFS_H #include <linux/const.h> #include <linux/types.h> #include <linux/mem_encrypt.h> /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 12 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) #define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT) #define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1)) #define __PHYSICAL_MASK ((phys_addr_t)(__sme_clr((1ULL << __PHYSICAL_MASK_SHIFT) - 1))) #define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1) /* Cast *PAGE_MASK to a signed type so that it is sign-extended if virtual addresses are 32-bits but physical addresses are larger (ie, 32-bit PAE). */ #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK) #define PHYSICAL_PMD_PAGE_MASK (((signed long)PMD_PAGE_MASK) & __PHYSICAL_MASK) #define PHYSICAL_PUD_PAGE_MASK (((signed long)PUD_PAGE_MASK) & __PHYSICAL_MASK) #define HPAGE_SHIFT PMD_SHIFT #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) #define HUGE_MAX_HSTATE 2 #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) #define VM_DATA_DEFAULT_FLAGS \ (((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \ VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #define __PHYSICAL_START ALIGN(CONFIG_PHYSICAL_START, \ CONFIG_PHYSICAL_ALIGN) #define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START) #ifdef CONFIG_X86_64 #include <asm/page_64_types.h> #define IOREMAP_MAX_ORDER (PUD_SHIFT) #else #include <asm/page_32_types.h> #define IOREMAP_MAX_ORDER (PMD_SHIFT) #endif /* CONFIG_X86_64 */ #ifndef __ASSEMBLY__ extern int devmem_is_allowed(unsigned long pagenr); extern unsigned long max_low_pfn_mapped; extern unsigned long max_pfn_mapped;
static inline phys_addr_t get_max_mapped(void) { return (phys_addr_t)max_pfn_mapped << PAGE_SHIFT; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yinghai Lu | 17 | 100.00% | 2 | 100.00% |
Total | 17 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Jeremy Fitzhardinge | 108 | 53.20% | 1 | 8.33% |
Kirill A. Shutemov | 21 | 10.34% | 1 | 8.33% |
Jaswinder Singh Rajput | 20 | 9.85% | 1 | 8.33% |
Yinghai Lu | 20 | 9.85% | 2 | 16.67% |
Jacob Shin | 12 | 5.91% | 2 | 16.67% |
Kees Cook | 8 | 3.94% | 1 | 8.33% |
Toshi Kani | 8 | 3.94% | 1 | 8.33% |
Tom Lendacky | 4 | 1.97% | 1 | 8.33% |
Greg Kroah-Hartman | 1 | 0.49% | 1 | 8.33% |
Tejun Heo | 1 | 0.49% | 1 | 8.33% |
Total | 203 | 100.00% | 12 | 100.00% |