From: Iain Nicol <[email protected]>

entInt stores nineteen registers, not eighteen.

The corruption would sometimes manifest as a memory fault. The
STACK_FRAME macro saves the internal PS register to 0($sp). The same
location would later be overwritten by entInt storing $at. Later, the
wrong PS register value would be restored. This would sometimes cause
a switch from kernel to user mode, which can cause memory permission
checks to fail.

Closes: https://github.com/rth7680/qemu-palcode/pull/1
Signed-off-by: Matt Turner <[email protected]>
---
 console-low.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/console-low.S b/console-low.S
index a03f4ed..1f61cbc 100644
--- a/console-low.S
+++ b/console-low.S
@@ -23,7 +23,7 @@
        .text
        .cfi_sections .debug_frame
 
-#define SAVE_ALL_SIZE  (18*8)
+#define SAVE_ALL_SIZE  ((18+1)*8)
 
        .globl  entInt
        .type   entInt, @function
-- 
2.54.0


Reply via email to