Page MenuHomeFreeBSD

amd64: do not handle fs/gs bases conditionally on the selector
ClosedPublic

Authored by kib on May 19 2025, 6:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 15, 5:50 AM
Unknown Object (File)
Fri, Oct 10, 11:02 AM
Unknown Object (File)
Tue, Oct 7, 11:28 PM
Unknown Object (File)
Mon, Sep 22, 11:55 PM
Unknown Object (File)
Fri, Sep 19, 9:33 PM
Unknown Object (File)
Thu, Sep 18, 7:00 PM
Unknown Object (File)
Sep 14 2025, 12:34 AM
Unknown Object (File)
Sep 13 2025, 6:55 AM
Subscribers

Details

Summary
For machines with RDFSBASE support, we only saved and restored fs and gs
base registers when corresponding segment register contained the
predefined value.  This breaks some valid uses of the LDT together with
WR{F,G}SBASE.

Unconditionally save bases, and restore them on return to usermode.  The
PCB_FULL_IRET optimization is still in place.

Diff Detail

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

Event Timeline

kib requested review of this revision.May 19 2025, 6:10 AM
This revision is now accepted and ready to land.May 22 2025, 2:39 PM
olce added a subscriber: olce.

Some now unused code could be suppressed.

sys/amd64/amd64/exception.S
1169–1170

Now unused label, could be removed.

1181–1182

Now unused code?

1193–1194

Now unused label and code, could be removed.

kib marked 3 inline comments as done.May 23 2025, 3:30 AM
kib added inline comments.
sys/amd64/amd64/exception.S
1193–1194

Yes, and the jmp above it as well.

This revision was automatically updated to reflect the committed changes.
kib marked an inline comment as done.