There are two things:
First of all, the segment registers are still used in 64-bit long mode. As stated in Intel's architectural manuals (System Programming Guide; Section 3.2.4, "Segmentation in IA-32e Mode"):
In 64-bit mode, segmentation is generally (but not completely) disabled, creating a flat 64-bit linear-address space. The processor treats the segment base of CS, DS, ES, SS as zero, creating a linear address that is equal to the effective address. The FS and GS segments are exceptions. These segment registers (which hold the segment base) can be used as additional base registers in linear address calculations. They facilitate addressing local data and certain operating system data structures.
fs
and gs
provide a base address; the other segment registers are only used to look up access rights. So if cs
contains the value 0x20
, you are in ring 0 privilege mode; if it contains 0x33
, you are in ring 3 mode.
The second thing is that sysenter
was originally designed for 32-bit mode. The instruction is not even supported on all CPUs in 64-bit mode (in particular, AMD chips do not support it). For maximum compatibility, a kernel running in 64-bit long-mode would use syscall
and sysret
instructions.