qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: read_sysreg(TTBR_EL2) not work in linux, but read_sysreg(CurrentEL)


From: Chan Kim
Subject: RE: read_sysreg(TTBR_EL2) not work in linux, but read_sysreg(CurrentEL) works. (arm64)
Date: Wed, 23 Feb 2022 19:00:32 +0900

 

I’m using qemu-6.2.0. using gdb, after I executed ‘msr ttbr1_el1, x1’ (when x1 = 0x80737000), when I examine TTBR1_EL1 register by  ‘info reg TTBR1_EL1’, the value is 0. Is it gdb problem? Or qemu problem?

Chan Kim

 

From: Chan Kim <ckim@etri.re.kr>
Sent: Wednesday, February 23, 2022 6:45 PM
To: 'qemu-discuss@nongnu.org' <qemu-discuss@nongnu.org>
Subject: RE: read_sysreg(TTBR_EL2) not work in linux, but read_sysreg(CurrentEL) works. (arm64)

 

 

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>
Sent: Tuesday, February 22, 2022 3:15 PM
To: 'qemu-discuss@nongnu.org' <qemu-discuss@nongnu.org>
Subject: read_sysreg(TTBR_EL2) not work in linux, but read_sysreg(CurrentEL) works. (arm64)

 

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]