Page MenuHomeFreeBSD

amd64: Zero-fill AP PCPU pages
ClosedPublic

Authored by markj on Oct 16 2023, 10:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 27, 2:41 AM
Unknown Object (File)
Feb 8 2025, 8:48 AM
Unknown Object (File)
Jan 27 2025, 12:35 PM
Unknown Object (File)
Jan 26 2025, 8:55 PM
Unknown Object (File)
Jan 11 2025, 1:51 PM
Unknown Object (File)
Dec 16 2024, 12:57 PM
Unknown Object (File)
Nov 21 2024, 6:39 AM
Unknown Object (File)
Nov 13 2024, 8:52 PM
Subscribers

Details

Summary

At least KMSAN relies on zero-initialization of AP PCPU regions, see
commit 4b136ef259ce ("amd64: Set GS.base before calling init_secondary() on APs").
Prior to commit af1c6d3f3013 these were allocated with allocpages() in
the amd64 pmap, which always returns zero-initialized memory.

Fixes: af1c6d3f3013 ("amd64: do not leak pcpu pages")
MFC after: 3 days

Diff Detail

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

Event Timeline

kib added inline comments.
sys/amd64/amd64/mp_machdep.c
297

Why do you need a local var?

This revision is now accepted and ready to land.Oct 17 2023, 9:06 AM
sys/amd64/amd64/mp_machdep.c
297

I just disliked the duplication.

This revision was automatically updated to reflect the committed changes.