diff options
author | bde <bde@FreeBSD.org> | 2001-05-20 16:51:08 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2001-05-20 16:51:08 +0000 |
commit | 20d39ffc04278fc10ff2ca16a7de8f2ad3597130 (patch) | |
tree | 3f5d991cdb3924eace11ec523000195ab169e2f8 /sys/amd64 | |
parent | f07e923e1b1275aadabaf2cf31e22d9a36864feb (diff) | |
download | FreeBSD-src-20d39ffc04278fc10ff2ca16a7de8f2ad3597130.zip FreeBSD-src-20d39ffc04278fc10ff2ca16a7de8f2ad3597130.tar.gz |
Use a critical region to protect saving of the npx state in savectx().
Not doing this was fairly harmless because savectx() is only called
for panic dumps and the bug could at worse reset the state.
savectx() is still missing saving of (volatile) debug registers, and
still isn't called for core dumps.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/cpu_switch.S | 5 | ||||
-rw-r--r-- | sys/amd64/amd64/swtch.s | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S index ed4525f..180b87b 100644 --- a/sys/amd64/amd64/cpu_switch.S +++ b/sys/amd64/amd64/cpu_switch.S @@ -327,6 +327,8 @@ ENTRY(savectx) * have to handle h/w bugs for reloading. We used to lose the * parent's npx state for forks by forgetting to reload. */ + pushfl + cli movl PCPU(NPXPROC),%eax testl %eax,%eax je 1f @@ -347,7 +349,8 @@ ENTRY(savectx) pushl %eax call bcopy addl $12,%esp +1: + popfl #endif /* DEV_NPX */ -1: ret diff --git a/sys/amd64/amd64/swtch.s b/sys/amd64/amd64/swtch.s index ed4525f..180b87b 100644 --- a/sys/amd64/amd64/swtch.s +++ b/sys/amd64/amd64/swtch.s @@ -327,6 +327,8 @@ ENTRY(savectx) * have to handle h/w bugs for reloading. We used to lose the * parent's npx state for forks by forgetting to reload. */ + pushfl + cli movl PCPU(NPXPROC),%eax testl %eax,%eax je 1f @@ -347,7 +349,8 @@ ENTRY(savectx) pushl %eax call bcopy addl $12,%esp +1: + popfl #endif /* DEV_NPX */ -1: ret |