File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1786,6 +1786,15 @@ def remove_oslog(node):
17861786 continue
17871787 addr , size = cpu .cpu_impl_reg
17881788 print (f" { cpu .name } : [0x{ addr :x} ] = 0x{ rvbar :x} " )
1789+ # On some platforms (M4) iBoot already sets this
1790+ # to the m1n1 entrypoint and locks the register.
1791+ # Skip the write if the value is already correct.
1792+ val = self .p .read64 (addr )
1793+ if val & 0xfffffffff000 == rvbar :
1794+ continue
1795+ if val & 1 :
1796+ print (f"{ hex (val & 0xfffffffff000 )} != { hex (rvbar )} " )
1797+ print ("The cpu_impl_reg is already locked, this might fail..." )
17891798 self .p .write64 (addr , rvbar )
17901799
17911800 def _load_macho_symbols (self ):
Original file line number Diff line number Diff line change @@ -100,6 +100,15 @@ def remove_oslog(node):
100100 continue
101101 addr , size = cpu .cpu_impl_reg
102102 print (f" { cpu .name } : [0x{ addr :x} ] = 0x{ rvbar :x} " )
103+ # On some platforms (M4) iBoot already sets this
104+ # to the m1n1 entrypoint and locks the register.
105+ # Skip the write if the value is already correct.
106+ val = p .read64 (addr )
107+ if val & 0xfffffffff000 == rvbar :
108+ continue
109+ if val & 1 :
110+ print (f"{ hex (val & 0xfffffffff000 )} != { hex (rvbar )} " )
111+ print ("The cpu_impl_reg is already locked, this might fail..." )
103112 p .write64 (addr , rvbar )
104113
105114u .push_adt ()
You can’t perform that action at this time.
0 commit comments