HomeFreeBSD

Set md_ldt (pointer to the LDT) after md_ldt_sd (system segment
rS201890Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Set md_ldt (pointer to the LDT) after md_ldt_sd (system segment
descriptor for the LDT) is populated. md_ldt is used by context-switch
code as indicator that LDT segment register shall be loaded with
GUSERLDT segment instead of 0, so context switch at the wrong time may
cause attempt to load non-populated descriptor.

Use store with the barrier to prevent other CPUs from seeing updated
md_ldt but not seeing updated md_ldt_sd. Multithreaded process may
context-switch to another thread of the process on another CPU and read
md_ldt.

MFC after: 1 week

Details

Provenance
kibAuthored on
Parents
rS201889: Various language fixes. Also fixed the URL to totd, obtained from NetBSD.
Branches
Unknown
Tags
Unknown

Event Timeline