summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-09-14 19:04:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-09-14 19:04:31 +0000
commit7b84e9299b2701dc1ae06c10b131162908ff9139 (patch)
tree20187b25cc5b76e8a9f4e4f9efbf88b29f290a21
parent0351b94d7f3611e633f179d69d49f472e5788416 (diff)
When emulating reading from cr26 and cr27 on PCXS, simply set cr26 to zero
and take the cr27 value that was saved in the trap frame. This matches what process_read_regs() does and prevents returning the wrong values if the uvm_map_inentry() checks sleeps trying to grab the vm_map read lock. ok miod@, deraadt@
-rw-r--r--sys/arch/hppa/hppa/trap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index 6ad34750b51..7ddb02b15ab 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.147 2020/08/19 10:10:58 mpi Exp $ */
+/* $OpenBSD: trap.c,v 1.148 2020/09/14 19:04:30 kettenis Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -369,9 +369,9 @@ trap(int type, struct trapframe *frame)
register_t cr;
if (((opcode >> 21) & 0x1f) == 27)
- mfctl(CR_TR3, cr); /* cr27 */
+ cr = frame->tf_cr27; /* cr27 */
else
- mfctl(CR_TR2, cr); /* cr26 */
+ cr = 0; /* cr26 */
frame_regmap(frame, opcode & 0x1f) = cr;
frame->tf_ipsw |= PSL_N;
} else {