|
From: | Chan Kim |
Subject: | RE: read_sysreg(TTBR_EL2) not work in linux, but read_sysreg(CurrentEL) works. (arm64) |
Date: | Wed, 23 Feb 2022 18:45:07 +0900 |
I used an old kernel (5.4.21) and I missed during the kernel build, the compiler complained that “selected processor does not support system register name ‘ttbr1_el2’”. So this reading of ttbr1_el2 seemed to have been ignored. Switching to kernel 5.10.0rc, this error is not coming. Thank you. Chan Kim From: Chan Kim <ckim@etri.re.kr> When running u-boot starting linux on qemu and using gdb to debug the program, (on a modified arm64 virt machine), I see this strange things. Right after I enter linux start_kernel( ), I added these two lines, datax = read_sysreg(CurrentEL); -- line 1 datax = read_sysreg(TTBR1_EL2); -- line 2 after line 1 and before line 2, the value of datax is seen as 8. (bit [3:2] is current EL, so it's EL2). after line 2, the value of datax is still 8, but the result of `info reg TTBR1_EL2` is 0x8065a000. The disassembled assembly code shows no reading of TTBR1_EL2 register. How can this happen? Should I set something in the kernel configuration? Any help will be really appreciated. Thank you! Chan Kim |
[Prev in Thread] | Current Thread | [Next in Thread] |