2024.04.13

UEFI 中的TPIDR_EL0

实验环境:

如果只看PrePeiSetHobList,读不出进程或线程的信息,一看到TPIDR_EL0,就明白了HOB将要大概用来干什么。

直接上NDB Log吧,PrePiMain中的第一块HOB被这样用了:

u .
ArmPlatformPrePiUniCore!PrePiMain+104:
206984 aa1303e0 mov    x0, x19
206988 940008c3 bl    #0x208c94
20698c 97ffeab9 bl    #0x201470
206990 72001c13 ands    w19, w0, #0xff
206994 540000e0 b.eq    #0x2069b0
206998 1001b342 adr    x2, #0x20a000
20699c 10013321 adr    x1, #0x209000
2069a0 9128c042 add    x2, x2, #0xa30
r x19
x19=0000000038000000
ln 0`208c94
(00000000`002086e8)   ArmPlatformPrePiUniCore!_entry+0x5ac   
u 0`208c94
ArmPlatformPrePiUniCore!_entry+5ac:
208c94 d51bd040 msr    tpidr_el0, x0
208c98 d65f03c0 ret    
208c9c d2800020 mov    x0, #1
208ca0 d65f03c0 ret    
208ca4 d51c1100 msr    hcr_el2, x0
208ca8 d65f03c0 ret    
208cac d5384240 mrs    x0, currentel
208cb0 d65f03c0 ret    
r x0
x0=0000000038000038
t
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Opcode 0xd53e4020, DSCR.ERR=1, DSCR.EL=2
Failed to read ELR_EL3 register
Couldn't get register ELR_EL3.
Opcode 0xd53e5200, DSCR.ERR=1, DSCR.EL=2
Failed to read ESR_EL3 register
Couldn't get register ESR_EL3.
Opcode 0xd53e4000, DSCR.ERR=1, DSCR.EL=2
Failed to read SPSR_EL3 register
Couldn't get register SPSR_EL3.
bp[108] was removed, count 1
bp[105] was removed, count 1
ArmPlatformPrePiUniCore!PrePiMain+108:
206988 940008c3 bl    #0x208c94
rdmsr tpidr_el0
Read system version block failed 1
msr[1bd040] = 00000000`00000000

Bit[63]-[0] is 0b0000000000000000000000000000000000000000000000000000000000000000[0x0]:
Field Name: 
Field Description: Thread ID. Thread identifying information stored by software running at this Exception level.


----------------------------------------------
[ndb]!echo "rdmsr seems not working here yet"
rdmsr seems not working here yet
t
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Opcode 0xd53e4020, DSCR.ERR=1, DSCR.EL=2
Failed to read ELR_EL3 register
Couldn't get register ELR_EL3.
Opcode 0xd53e5200, DSCR.ERR=1, DSCR.EL=2
Failed to read ESR_EL3 register
Couldn't get register ESR_EL3.
Opcode 0xd53e4000, DSCR.ERR=1, DSCR.EL=2
Failed to read SPSR_EL3 register
Couldn't get register SPSR_EL3.
bp[114] was removed, count 1
bp[111] was removed, count 1
ArmPlatformPrePiUniCore!_entry+5ac:
208c94 d51bd040 msr    tpidr_el0, x0
t
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Opcode 0xd53e4020, DSCR.ERR=1, DSCR.EL=2
Failed to read ELR_EL3 register
Couldn't get register ELR_EL3.
Opcode 0xd53e5200, DSCR.ERR=1, DSCR.EL=2
Failed to read ESR_EL3 register
Couldn't get register ESR_EL3.
Opcode 0xd53e4000, DSCR.ERR=1, DSCR.EL=2
Failed to read SPSR_EL3 register
Couldn't get register SPSR_EL3.
bp[120] was removed, count 1
bp[117] was removed, count 1
ArmPlatformPrePiUniCore!_entry+5b0:
208c98 d65f03c0 ret    
rdmsr tpidr_el0
Read system version block failed 1
msr[1bd040] = 00000000`00000000

Bit[63]-[0] is 0b0000000000000000000000000000000000000000000000000000000000000000[0x0]:
Field Name: 
Field Description: Thread ID. Thread identifying information stored by software running at this Exception level.


----------------------------------------------
t
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Adding BP for [cpu0]
no hardware breakpoint available
can't add breakpoint: resource not available
Opcode 0xd53e4020, DSCR.ERR=1, DSCR.EL=2
Failed to read ELR_EL3 register
Couldn't get register ELR_EL3.
Opcode 0xd53e5200, DSCR.ERR=1, DSCR.EL=2
Failed to read ESR_EL3 register
Couldn't get register ESR_EL3.
Opcode 0xd53e4000, DSCR.ERR=1, DSCR.EL=2
Failed to read SPSR_EL3 register
Couldn't get register SPSR_EL3.
bp[126] was removed, count 1
bp[123] was removed, count 1
ArmPlatformPrePiUniCore!PrePiMain+10c:
20698c 97ffeab9 bl    #0x201470
ln 0`201470
Read system version block failed 1
Read system version block failed 1
abort occurred - dscr = 0x0304725b
Opcode 0x38401401, DSCR.ERR=1, DSCR.EL=2
Opcode 0x38401401, DSCR.ERR=1, DSCR.EL=2
abort occurred - dscr = 0x0304725b
abort occurred - dscr = 0x0304725b
abort occurred - dscr = 0x0304725b
abort occurred - dscr = 0x0304725b
abort occurred - dscr = 0x0304725b
(00000000`00201470)   ArmPlatformPrePiUniCore!DebugPrintEnabled   
Exact matches:

作者:朱博渊  创建时间:2024-04-13 17:33
最后编辑:朱博渊  更新时间:2024-11-15 17:44