mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
m1n1.proxyutils: Print and clear L2C regs on SErrors
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
e08457aaa9
commit
04668b370a
1 changed files with 19 additions and 0 deletions
|
@ -203,6 +203,18 @@ class ProxyUtils(Reloadable):
|
|||
for i in lines:
|
||||
print(" " + i)
|
||||
|
||||
def print_l2c_regs(self):
|
||||
print()
|
||||
print(" == L2C Registers ==")
|
||||
l2c_err_sts = self.mrs(L2C_ERR_STS_EL1)
|
||||
|
||||
print(f" L2C_ERR_STS: {l2c_err_sts:#x}")
|
||||
print(f" L2C_ERR_ADR: {self.mrs(L2C_ERR_ADR_EL1):#x}");
|
||||
print(f" L2C_ERR_INF: {self.mrs(L2C_ERR_INF_EL1):#x}");
|
||||
|
||||
self.msr(L2C_ERR_STS_EL1, l2c_err_sts) # Clear the flag bits
|
||||
self.msr(DAIF, self.mrs(DAIF) | 0x100) # Re-enable SError exceptions
|
||||
|
||||
def print_exception(self, code, ctx, addr=lambda a: f"0x{a:x}"):
|
||||
print(f" == Exception taken from {ctx.spsr.M.name} ==")
|
||||
el = ctx.spsr.M >> 2
|
||||
|
@ -249,6 +261,13 @@ class ProxyUtils(Reloadable):
|
|||
else:
|
||||
print(" No instruction syndrome available")
|
||||
|
||||
if iss.DFSC == DABORT_DFSC.ECC_ERROR:
|
||||
self.print_l2c_regs()
|
||||
|
||||
elif code == EXC.SERROR:
|
||||
if ctx.esr.EC == ESR_EC.SERROR and ctx.esr.ISS == 0:
|
||||
self.print_l2c_regs()
|
||||
|
||||
print()
|
||||
|
||||
@contextmanager
|
||||
|
|
Loading…
Reference in a new issue