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

TOMOYO Linux Cross Reference
Linux/arch/arm64/include/asm/mmu.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 ] ~

Diff markup

Differences between /arch/arm64/include/asm/mmu.h (Architecture ppc) and /arch/sparc/include/asm-sparc/mmu.h (Architecture sparc)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 
  2 /*                                                
  3  * Copyright (C) 2012 ARM Ltd.                    
  4  */                                               
  5 #ifndef __ASM_MMU_H                               
  6 #define __ASM_MMU_H                               
  7                                                   
  8 #include <asm/cputype.h>                          
  9                                                   
 10 #define MMCF_AARCH32    0x1     /* mm context     
 11 #define USER_ASID_BIT   48                        
 12 #define USER_ASID_FLAG  (UL(1) << USER_ASID_BI    
 13 #define TTBR_ASID_MASK  (UL(0xffff) << 48)        
 14                                                   
 15 #ifndef __ASSEMBLY__                              
 16                                                   
 17 #include <linux/refcount.h>                       
 18 #include <asm/cpufeature.h>                       
 19                                                   
 20 typedef struct {                                  
 21         atomic64_t      id;                       
 22 #ifdef CONFIG_COMPAT                              
 23         void            *sigpage;                 
 24 #endif                                            
 25         refcount_t      pinned;                   
 26         void            *vdso;                    
 27         unsigned long   flags;                    
 28 } mm_context_t;                                   
 29                                                   
 30 /*                                                
 31  * We use atomic64_read() here because the ASI    
 32  * be reallocated when scheduling one of its t    
 33  * rollover event (see new_context() and flush    
 34  * a concurrent TLBI (e.g. via try_to_unmap_on    
 35  * may use a stale ASID. This is fine in princ    
 36  * guaranteed to be clean in the TLB, but the     
 37  * care to handle the following race:             
 38  *                                                
 39  *    CPU 0                    CPU 1              
 40  *                                                
 41  *    // ptep_clear_flush(mm)                     
 42  *    xchg_relaxed(pte, 0)                        
 43  *    DSB ISHST                                   
 44  *    old = ASID(mm)                              
 45  *         |                                      
 46  *         |                   new = new_conte    
 47  *         \-----------------> atomic_set(mm->    
 48  *                             cpu_switch_mm(m    
 49  *                             // Hardware wal    
 50  *    TLBI(old)                                   
 51  *                                                
 52  * In this scenario, the barrier on CPU 0 and     
 53  * ensure that the page-table walker on CPU 1     
 54  * written by CPU 0.                              
 55  */                                               
 56 #define ASID(mm)        (atomic64_read(&(mm)->    
 57                                                   
 58 static inline bool arm64_kernel_unmapped_at_el    
 59 {                                                 
 60         return alternative_has_cap_unlikely(AR    
 61 }                                                 
 62                                                   
 63 extern void arm64_memblock_init(void);            
 64 extern void paging_init(void);                    
 65 extern void bootmem_init(void);                   
 66 extern void __iomem *early_io_map(phys_addr_t     
 67 extern void create_mapping_noalloc(phys_addr_t    
 68                                    phys_addr_t    
 69 extern void create_pgd_mapping(struct mm_struc    
 70                                unsigned long v    
 71                                pgprot_t prot,     
 72 extern void *fixmap_remap_fdt(phys_addr_t dt_p    
 73 extern void mark_linear_text_alias_ro(void);      
 74                                                   
 75 /*                                                
 76  * This check is triggered during the early bo    
 77  * is initialised. Checking the status on the     
 78  * CPU to detect the need for non-global mappi    
 79  * pagetable re-write after all the CPUs are b    
 80  * anyway run on individual CPUs, allowing us     
 81  * state once the SMP CPUs are up and thus mak    
 82  * mappings if required.                          
 83  */                                               
 84 static inline bool kaslr_requires_kpti(void)      
 85 {                                                 
 86         /*                                        
 87          * E0PD does a similar job to KPTI so     
 88          * where available.                       
 89          */                                       
 90         if (IS_ENABLED(CONFIG_ARM64_E0PD)) {      
 91                 u64 mmfr2 = read_sysreg_s(SYS_    
 92                 if (cpuid_feature_extract_unsi    
 93                                                   
 94                         return false;             
 95         }                                         
 96                                                   
 97         /*                                        
 98          * Systems affected by Cavium erratum     
 99          * with KPTI.                             
100          */                                       
101         if (IS_ENABLED(CONFIG_CAVIUM_ERRATUM_2    
102                 extern const struct midr_range    
103                                                   
104                 if (is_midr_in_range_list(read    
105                                           cavi    
106                         return false;             
107         }                                         
108                                                   
109         return true;                              
110 }                                                 
111                                                   
112 #define INIT_MM_CONTEXT(name)   \                 
113         .pgd = swapper_pg_dir,                    
114                                                   
115 #endif  /* !__ASSEMBLY__ */                       
116 #endif                                            
117                                                   

~ [ 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