mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-12-19 10:13:10 +00:00
m1n1.fw.asc.{crash, ioreporting}: Do not align prealloc buffer sizes
On SMC on t602x, this is a small SRAM and we can run off the edge. Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
55ca08d482
commit
93a6daa337
2 changed files with 5 additions and 3 deletions
|
@ -210,12 +210,13 @@ class ASCCrashLogEndpoint(ASCBaseEndpoint):
|
|||
return self.handle_getbuf(msg)
|
||||
|
||||
def handle_getbuf(self, msg):
|
||||
size = align(0x1000 * msg.SIZE, 0x4000)
|
||||
|
||||
if msg.DVA:
|
||||
size = 0x1000 * msg.SIZE
|
||||
self.iobuffer_dva = msg.DVA
|
||||
self.log(f"buf prealloc at dva {self.iobuffer_dva:#x}")
|
||||
else:
|
||||
size = align(0x1000 * msg.SIZE, 0x4000)
|
||||
self.iobuffer, self.iobuffer_dva = self.asc.ioalloc(size)
|
||||
self.log(f"buf {self.iobuffer:#x} / {self.iobuffer_dva:#x}")
|
||||
self.send(CrashLogMessage(TYPE=1, SIZE=size // 0x1000, DVA=self.iobuffer_dva))
|
||||
|
|
|
@ -30,12 +30,13 @@ class ASCIOReportingEndpoint(ASCBaseEndpoint):
|
|||
if self.iobuffer:
|
||||
self.log("WARNING: trying to reset iobuffer!")
|
||||
|
||||
self.bufsize = align(0x1000 * msg.SIZE, 0x4000)
|
||||
|
||||
if msg.DVA != 0:
|
||||
self.bufsize = 0x1000 * msg.SIZE
|
||||
self.iobuffer = self.iobuffer_dva = msg.DVA
|
||||
self.log(f"buf {self.iobuffer:#x} / {self.iobuffer_dva:#x}")
|
||||
self.log(f"buf prealloc {self.iobuffer:#x} / {self.iobuffer_dva:#x}")
|
||||
else:
|
||||
self.bufsize = align(0x1000 * msg.SIZE, 0x4000)
|
||||
self.iobuffer, self.iobuffer_dva = self.asc.ioalloc(self.bufsize)
|
||||
self.log(f"buf {self.iobuffer:#x} / {self.iobuffer_dva:#x}")
|
||||
self.send(IOReporting_GetBuf(DVA=self.iobuffer_dva, SIZE=self.bufsize // 0x1000))
|
||||
|
|
Loading…
Reference in a new issue