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

TOMOYO Linux Cross Reference
Linux/arch/arm64/kernel/hibernate-asm.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arm64/kernel/hibernate-asm.S (Version linux-6.12-rc7) and /arch/sparc/kernel/hibernate-asm.S (Version linux-4.19.323)


  1 /* SPDX-License-Identifier: GPL-2.0-only */       
  2 /*                                                
  3  * Hibernate low-level support                    
  4  *                                                
  5  * Copyright (C) 2016 ARM Ltd.                    
  6  * Author:      James Morse <james.morse@arm.co    
  7  */                                               
  8 #include <linux/linkage.h>                        
  9 #include <linux/errno.h>                          
 10                                                   
 11 #include <asm/asm-offsets.h>                      
 12 #include <asm/assembler.h>                        
 13 #include <asm/cputype.h>                          
 14 #include <asm/memory.h>                           
 15 #include <asm/page.h>                             
 16 #include <asm/virt.h>                             
 17                                                   
 18 /*                                                
 19  * Resume from hibernate                          
 20  *                                                
 21  * Loads temporary page tables then restores t    
 22  * Finally branches to cpu_resume() to restore    
 23  * swsusp_arch_suspend().                         
 24  *                                                
 25  * Because this code has to be copied to a 'sa    
 26  * other functions by PC-relative address. Als    
 27  * mid-way through over-writing other function    
 28  * code from caches_clean_inval_pou() and uses    
 29  *                                                
 30  * This 'safe' page is mapped via ttbr0, and e    
 31  * switches to a copy of the linear map in ttb    
 32  * switches ttbr1 to the original kernel's swa    
 33  *                                                
 34  * All of memory gets written to, including co    
 35  * text to the Point of Coherence (PoC) before    
 36  * Because the kernel modules and executable p    
 37  * also written as data, we clean all pages we    
 38  * Unification (PoU).                             
 39  *                                                
 40  * x0: physical address of temporary page tabl    
 41  * x1: physical address of swapper page tables    
 42  * x2: address of cpu_resume                      
 43  * x3: linear map address of restore_pblist in    
 44  * x4: physical address of __hyp_stub_vectors,    
 45  * x5: physical address of a  zero page that r    
 46  */                                               
 47 .pushsection    ".hibernate_exit.text", "ax"      
 48 SYM_CODE_START(swsusp_arch_suspend_exit)          
 49         /*                                        
 50          * We execute from ttbr0, change ttbr1    
 51          * with a break-before-make via the ze    
 52          */                                       
 53         break_before_make_ttbr_switch   x5, x0    
 54                                                   
 55         mov     x21, x1                           
 56         mov     x30, x2                           
 57         mov     x24, x4                           
 58         mov     x25, x5                           
 59                                                   
 60         /* walk the restore_pblist and use cop    
 61         mov     x19, x3                           
 62                                                   
 63 1:      ldr     x10, [x19, #HIBERN_PBE_ORIG]      
 64         mov     x0, x10                           
 65         ldr     x1, [x19, #HIBERN_PBE_ADDR]       
 66                                                   
 67         copy_page       x0, x1, x2, x3, x4, x5    
 68                                                   
 69         add     x1, x10, #PAGE_SIZE               
 70         /* Clean the copied page to PoU - base    
 71         raw_dcache_line_size x2, x3               
 72         sub     x3, x2, #1                        
 73         bic     x4, x10, x3                       
 74 2:      /* clean D line / unified line */         
 75 alternative_insn "dc cvau, x4",  "dc civac, x4    
 76         add     x4, x4, x2                        
 77         cmp     x4, x1                            
 78         b.lo    2b                                
 79                                                   
 80         ldr     x19, [x19, #HIBERN_PBE_NEXT]      
 81         cbnz    x19, 1b                           
 82         dsb     ish             /* wait for Po    
 83                                                   
 84         /* switch to the restored kernels page    
 85         break_before_make_ttbr_switch   x25, x    
 86                                                   
 87         ic      ialluis                           
 88         dsb     ish                               
 89         isb                                       
 90                                                   
 91         cbz     x24, 3f         /* Do we need     
 92         hvc     #0                                
 93 3:      ret                                       
 94 SYM_CODE_END(swsusp_arch_suspend_exit)            
 95 .popsection                                       
                                                      

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