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)
Tue, Sep 29, 4:06 PM
Unknown Object (File)
Sat, Sep 26, 10:28 PM
Unknown Object (File)
Sat, Sep 26, 12:21 PM
Unknown Object (File)
Fri, Sep 25, 11:51 PM
Unknown Object (File)
Sat, Sep 19, 7:24 PM
Unknown Object (File)
Sep 4 2026, 1:37 PM
Unknown Object (File)
Sep 2 2026, 9:30 PM
Unknown Object (File)
Sep 2 2026, 5:27 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 54019
Build 50909: arc lint + arc unit

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.