Page MenuHomeFreeBSD

D62035.1796287972.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D62035.1796287972.diff

diff --git a/sys/powerpc/powerpc/ptrace_machdep.c b/sys/powerpc/powerpc/ptrace_machdep.c
--- a/sys/powerpc/powerpc/ptrace_machdep.c
+++ b/sys/powerpc/powerpc/ptrace_machdep.c
@@ -60,10 +60,8 @@
if (!(cpu_features & PPC_FEATURE_VECTOR))
break;
- if (pcb->pcb_flags & PCB_VEC) {
- save_vec_nodrop(td);
+ if (pcb->pcb_flags & PCB_VECREGS)
memcpy(&vec, &pcb->pcb_vec, sizeof(vec));
- }
error = copyout(&vec, addr, sizeof(vec));
break;
case PT_SETVRREGS:
@@ -71,7 +69,13 @@
break;
error = copyin(addr, &vec, sizeof(vec));
if (error == 0) {
- pcb->pcb_flags |= PCB_VEC;
+ /*
+ * The thread is stopped, so the PCB is authoritative.
+ * Mark the registers valid; ownership (PCB_VEC) is
+ * only ever granted by the unavailable trap or by
+ * cpu_switchin(), and the trap asserts it is clear.
+ */
+ pcb->pcb_flags |= PCB_VECREGS;
memcpy(&pcb->pcb_vec, &vec, sizeof(vec));
}
break;
@@ -79,9 +83,7 @@
if (!(cpu_features & PPC_FEATURE_HAS_VSX))
break;
- if (pcb->pcb_flags & PCB_VSX) {
- save_fpu_nodrop(td);
-
+ if (pcb->pcb_flags & PCB_FPREGS) {
/*
* Doubleword 0 of VSR0-VSR31 overlap with FPR0-FPR31 and
* VSR32-VSR63 overlap with VR0-VR31, so we only copy
@@ -99,7 +101,7 @@
break;
error = copyin(addr, &vsr, sizeof(vsr));
if (error == 0) {
- pcb->pcb_flags |= PCB_VSX;
+ pcb->pcb_flags |= PCB_FPREGS;
/*
* Doubleword 0 of VSR0-VSR31 overlap with FPR0-FPR31 and

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 3, 8:52 AM (23 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42007849
Default Alt Text
D62035.1796287972.diff (1 KB)

Event Timeline