summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGordon Willem Klok <gwk@cvs.openbsd.org>2006-12-11 23:45:14 +0000
committerGordon Willem Klok <gwk@cvs.openbsd.org>2006-12-11 23:45:14 +0000
commitf04168c480f134c1923cf8f1b9eb7613880b49b6 (patch)
tree595829b7ed0da68f4547b6b57edb89a4c44cbba1 /sys
parentcf929c02811af8d243e0c74b977fa23bef9c0449 (diff)
Ensure kvm86_call actually saves the curpcb instead of junk. Error
introduced by myself at h2k6, thanks mickey@ and toby@ for turning me in the direction of a corrupt PCB.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/kvm86call.S10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/kvm86call.S b/sys/arch/i386/i386/kvm86call.S
index 0f022e852e5..de48f15ef8a 100644
--- a/sys/arch/i386/i386/kvm86call.S
+++ b/sys/arch/i386/i386/kvm86call.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm86call.S,v 1.3 2006/11/30 00:05:40 gwk Exp $ */
+/* $OpenBSD: kvm86call.S,v 1.4 2006/12/11 23:45:13 gwk Exp $ */
/* $NetBSD: kvm86call.S,v 1.7 2006/04/11 17:14:07 drochner Exp $ */
/*-
@@ -88,9 +88,11 @@ ENTRY(kvm86_call)
leal _C_LABEL(cpu_info_primary),%ecx
#endif
- pushl %eax
- movl vm86pcb,%eax
- movl %eax,CPU_INFO_CURPCB(%ecx)
+ movl CPU_INFO_CURPCB(%ecx),%eax
+ pushl %eax /* save curpcb */
+
+ movl vm86pcb,%eax
+ movl %eax,CPU_INFO_CURPCB(%ecx) /* set curpcb to vm86pcb */
movl CPU_INFO_CURPROC(%ecx),%ecx
movl P_MD_TSS_SEL(%ecx),%edi