Page MenuHomeFreeBSD

amd64: move gdt into pcpu
ClosedPublic

Authored by kib on Sun, Nov 10, 10:56 AM.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kib created this revision.Sun, Nov 10, 10:56 AM
markj added inline comments.Sun, Nov 10, 3:37 PM
sys/amd64/amd64/pmap.c
1782 ↗(On Diff #64144)

Why does GSBASE need to be set again?

kib added inline comments.Sun, Nov 10, 4:00 PM
sys/amd64/amd64/pmap.c
1782 ↗(On Diff #64144)

Because lgdt() != LGDT, it reloads %gs. I could have used bare_lgdt(), but think that we better reload there segment cache as well, actually.

markj accepted this revision as: markj.Sun, Nov 10, 7:10 PM
pho added a comment.Mon, Nov 11, 7:41 AM

Just an update: I'm at test number 534 out of 677 with an uptime of 20 hours (tests are sorted by increasing run time).
No problems so far.

jhb accepted this revision.Mon, Nov 11, 4:28 PM

I wish one could use PCPU_GET(gdt) instead of *PCPU_PTR(gdt) to look more readable, but I understand why we can't do that.

pho added a comment.Tue, Nov 12, 12:28 PM

I ran the full stress2 test using 64144. No problems seen.

This revision was not accepted when it landed; it landed in state Needs Review.Tue, Nov 12, 3:47 PM
This revision was automatically updated to reflect the committed changes.
kib reopened this revision.Tue, Nov 12, 3:50 PM
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Nov 12, 3:51 PM
Closed by commit rS354646: amd64: move GDT into PCPU area. (authored by kib). · Explain Why
This revision was automatically updated to reflect the committed changes.