Page MenuHomeFreeBSD

Don't call treat stack garbage as a valid FPU/SIMD save area.
ClosedPublic

Authored by jhb on Sep 28 2015, 10:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 17, 7:15 PM
Unknown Object (File)
Fri, May 17, 7:14 PM
Unknown Object (File)
Mon, May 6, 12:37 AM
Unknown Object (File)
Sun, May 5, 3:51 PM
Unknown Object (File)
Tue, Apr 30, 7:54 PM
Unknown Object (File)
Apr 17 2024, 8:10 AM
Unknown Object (File)
Apr 17 2024, 8:08 AM
Unknown Object (File)
Jan 21 2024, 7:50 PM
Subscribers

Details

Summary

When XSAVE support was added on amd64, the FPU save area was moved
out of 'struct pcb' and into a variable-sized region after the
structure. The kgdb code currently only reads the pcb. It does not
read in the FPU save area but instead passes stack garbage as the
FPU's saved context. Fixing this would mean determining the proper
size of the area and fetching it. However, this state is not saved
for running CPUs in stoppcbs[], so the callback would also have to
know to ignore those pcbs. Instead, just remove the call since it is
of limited usefulness. It results in kgdb reporting the state of the
FPU/SIMD registers in userland, not their current values in the kernel.
In particular, it does not report the correct state for any code in
the kernel which does use the FPU and would report incorrect values
in that case.

Note that I dropped this in my port of kgdb to 7.10. I think if we
ever bring this back it should only return any truly kernel state saved
via fpu_kern_*() and not userland state.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Don't call fxsave() on stack garbage..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.
jhb retitled this revision from Don't call fxsave() on stack garbage. to Don't call treat stack garbage as a valid FPU/SIMD save area..Sep 28 2015, 10:11 PM
kib edited edge metadata.
This revision is now accepted and ready to land.Sep 29 2015, 6:08 AM
This revision was automatically updated to reflect the committed changes.