pavia писал(а):
Цитата:
Ошибка в инструкции sysret. Псевдокод для возврата в 64-битный режим:
У Intel и AMD эти инструкции видут себя по разному. Перепроверь вдруг не ошибка а просто проц AMD эмулируется?
Еще веселее. Интелу что, больше делать было нечего? У них и так своя пара sysenter/sysexit есть, так они еще и криво AMD-овскую скопировали.
Чуть позже приложу образ, у кого есть реальный амд - проверьте, пожалуйста. На интелах пашет.
UPD: не, не в этом дело.
AMD SYSCALL and SYSRET Instruction Specification писал(а):
New selectors are loaded without any checking performed as follows:
n Bits [63–48] of the STAR register specify the selector that is copied into the CS
register.
n Bits [63–48]+1000b of the STAR register specify the selector that is copied into
the SS register.
Note: This effectively increments the index field of the CS selector such that the
resultant SS selector points to the next descriptor in a descriptor table, after the
CS descriptor.
n Bits [1–0] of the SS register are set to 11b (RPL of 3) regardless of the value of bits
[49–48] of the STAR register.
The CS and SS registers must not be modified by the operating system between the
execution of the SYSCALL instruction and its corresponding SYSRET instruction.
The CPL is set to 3 regardless of the value of bits [49–48] of the STAR register. If the
CPL is not equal to 0 when the SYSRET instruction is executed, a general protection
fault exception is generated with an error code of 0.
Тут, так же как и у интела, PL CS и SS должны загружаться в 3 на выходе.