Page MenuHomeFreeBSD

Rework how shared page related data is stored
ClosedPublic

Authored by kd on Jun 3 2022, 9:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 7:03 AM
Unknown Object (File)
Wed, Oct 16, 8:34 AM
Unknown Object (File)
Tue, Oct 15, 3:35 AM
Unknown Object (File)
Oct 13 2024, 4:01 PM
Unknown Object (File)
Oct 13 2024, 5:40 AM
Unknown Object (File)
Oct 12 2024, 9:11 AM
Unknown Object (File)
Oct 9 2024, 6:10 PM
Unknown Object (File)
Oct 8 2024, 9:29 PM

Details

Summary

Store the shared page address in struct vmspace.
Instead of storing base addresses of various shared page segments, save their offsets with respect to the shared page base address.
This will be more useful when the shared page address is randomized.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Copy offsets unconditionally in exec_sysvec_init_secondary (as suggested by kib in D35349).

sys/arm/arm/exec_machdep.c
349

I wonder if it is better to check for sv_shared_obj != NULL there and everywhere this kind of test is done. It is done so in kern_exec.c.

Might be, even add some macro like PROC_HAS_SHP() ?

sys/sys/exec.h
94–95

I would remove mention of a.out from the comment, not trying to enumerate all cases where shared page is present or not.

sys/vm/vm_map.h
298

'sp' sounds to much as a 'stack pointer' to me. I used 'shp' elsewere.

  • Rename vm_sp_base to vm_shp_base
  • Introduce the PROC_HAS_SHP macro
  • Don't mention a.out in a comment.
kib added inline comments.
sys/kern/kern_sharedpage.c
323–324

Perhaps change this instance of 'sigtramp' to 'vdso', since you reused the same string below.

This revision is now accepted and ready to land.Jun 7 2022, 2:45 AM
This revision was automatically updated to reflect the committed changes.