__clear_user function
SYM_FUNC_START(__clear_user)
/* Enable access to user memory */
li t6, SR_SUM
csrs CSR_STATUS, t6
add a3, a0, a1
addi t0, a0, SZREG-1
andi t1, a3, ~(SZREG-1)
andi t0, t0, ~(SZREG-1)
'csrs sstatus,t6' instruction turns on sstatus.sum = 1.
This makes kernel space access user space memory
SP:FFFFFFFF803062F4|__clear_user: lui t6,0x40 ; t6,64
SP:FFFFFFFF803062F8| csrs sstatus,t6
SP:FFFFFFFF803062FC| add a3,a0,a1
comment said 'Enable access to user memory'
Similar code is here:
SYM_FUNC_START(fallback_scalar_usercopy)
/* Enable access to user memory */
li t6, SR_SUM
csrs CSR_STATUS, t6
'리눅스 커널의 구조와 원리 > 메모리 관리' 카테고리의 다른 글
| [Debug] Simple slub configuration (0) | 2024.06.14 |
|---|---|
| [Linux kernel] Quick Review over OOM(Out of Memory) Killer routine (0) | 2023.09.09 |
| [mm] 'vm_flags' of 'struct vm_area_struct' (2) | 2023.09.07 |
| [mm] anon page debugging (0) | 2023.08.06 |
| [mm] OOM Killer log and kernel code review (0) | 2023.08.06 |
