File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
//! Provides functions to read and write segment registers.
2
2
3
3
#[ cfg( docsrs) ]
4
- use crate :: { registers:: control:: Cr4Flags , structures:: gdt:: GlobalDescriptorTable } ;
4
+ use crate :: {
5
+ registers:: control:: Cr4Flags ,
6
+ structures:: gdt:: { Descriptor , GlobalDescriptorTable } ,
7
+ } ;
5
8
use crate :: {
6
9
registers:: model_specific:: { FsBase , GsBase , Msr } ,
7
10
structures:: gdt:: SegmentSelector ,
@@ -152,7 +155,11 @@ impl Segment for CS {
152
155
/// Stack Segment
153
156
///
154
157
/// Entirely unused in 64-bit mode; setting the segment register does nothing.
155
- /// However, this register is often set by the `syscall`/`sysret` and
158
+ /// However, in ring 3, the SS register still has to point to a valid
159
+ /// [`Descriptor`] (it cannot be zero). This means a user-mode read/write
160
+ /// segment descriptor must be present in the GDT.
161
+ ///
162
+ /// This register is also set by the `syscall`/`sysret` and
156
163
/// `sysenter`/`sysexit` instructions (even on 64-bit transitions). This is to
157
164
/// maintain symmetry with 32-bit transitions where setting SS actually will
158
165
/// actually have an effect.
You can’t perform that action at this time.
0 commit comments