Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ... Volume 3: General-Purpose and System Instructions - Stanford ...

scs.stanford.edu
from scs.stanford.edu More from this publisher
13.07.2015 Views

AMD64 Technology 24594 Rev. 3.10 February 2005ExceptionsExceptionInvalid opcode, #UDRealXVirtual8086 Protected Cause of ExceptionXXThe SYSCALL and SYSRET instructions are not supported,as indicated by EDX bit 11 returned by CPUID extendedfunction 8000_0001h.XXXThe system call extension bit (SCE) of the extendedfeature enable register (EFER) is set to 0. (The EFERregister is MSR C000_0080h.)358 SYSCALL

24594 Rev. 3.10 February 2005 AMD64 TechnologySYSENTERSystem CallTransfers control to a fixed entry point in an operating system. It is designed for useby system and application software implementing a flat-segment memory model. Thisinstruction is valid only in legacy mode.Three model-specific registers (MSRs) are used to specify the target address and stackpointers for the SYSENTER instruction, as well as the CS and SS selectors of thecalled and returned procedures:• MSR_SYSENTER_CS: Contains the CS selector of the called procedure. The SSselector is set to MSR_SYSENTER_CS + 8.• MSR_SYSENTER_ESP: Contains the called procedure’s stack pointer.• MSR_SYSENTER_EIP: Contains the offset into the CS of the called procedure.The hidden portions of the CS and SS segment registers are not loaded from thedescriptor table as they would be using a legacy x86 CALL instruction. Instead, thehidden portions are forced by the processor to the following values:• The CS and SS base values are forced to 0.• The CS and SS limit values are forced to 4 Gbytes.• The CS segment attributes are set to execute/read 32-bit code with a CPL of zero.• The SS segment attributes are set to read/write and expand-up with a 32-bit stackreferenced by ESP.System software must create corresponding descriptor-table entries referenced by thenew CS and SS selectors that match the values described above.The return EIP and application stack are not saved by this instruction. Systemsoftware must explicitly save that information.An invalid-opcode exception occurs if this instruction is used in long mode. Softwareshould use the SYSCALL (and SYSRET) instructions in long mode. If SYSENTER isused in real mode, a #GP is raised.For additional information on this instruction, see “SYSENTER and SYSEXIT(Legacy Mode Only)” in Volume 2.Mnemonic Opcode DescriptionSYSENTER 0F 34 Call operating system.SYSENTER 359

AMD64 Technology 24594 Rev. 3.10 February 2005ExceptionsExceptionInvalid opcode, #UDRealXVirtual8086 Protected Cause of ExceptionXXThe SYSCALL <strong>and</strong> SYSRET instructions are not supported,as indicated by EDX bit 11 returned by CPUID extendedfunction 8000_0001h.XXXThe system call extension bit (SCE) of the extendedfeature enable register (EFER) is set to 0. (The EFERregister is MSR C000_0080h.)358 SYSCALL

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!