flat assembler
Message board for the users of flat assembler.
Index
> Windows > sysret in legacy mode? |
Author |
|
Feryno 24 Aug 2010, 05:18
syscall / sysret are valid only in long mode in its 64-bit submode (EFER.LMA must be 1, CS.L must be 1)
EFER.SCE bit must be set to 1 CPL must be 0 for the sysret if you want to make transition in long mode from 64-bit ring0 to ring3 compatibility mode (32 bit subsystem, WOW), then use the sysret instruction (db 0Fh, 07h) if you want to make transition in long mode from 64-bit ring0 to ring3 64-bit mode then use the sysretq instruction - it is with the REX.W prefix (db 48h, 0Fh, 07h) |
|||
24 Aug 2010, 05:18 |
|
b1528932 24 Aug 2010, 07:24
Quote: syscall / sysret are valid only in long mode in its 64-bit submode (EFER.LMA must be 1, CS.L must be 1) not according to amd manual. star msr hold EIP for legacy mode. and syscall is working under bochs |
|||
24 Aug 2010, 07:24 |
|
Feryno 24 Aug 2010, 08:56
you are right - another incompatibility between AMD and Intel (my post was related to Intel manual)
Intel 253666.pdf says: IF (CS.L=0 ) or (IA32_EFER.LMA = 0) or (IA32_EFER.SCE = 0) (* Not in 64-Bit Mode or SYSCALL/SYSRET not enabled in IA32_EFER *) THEN #UD; FI; seems you don't need to worry about flags register, the only one modification of flags register when executing sysret at AMD in compatibility or legacy mode is forcing flags.IF=1 which is usually set to 1 when running in ring0 (interrupts are disabled only for as much short time as possible) How do you play with the sysret instruction - do you have a win driver? Sysret must be executed at CPL=0 (syscall is executed at CPL=3) + driver task is also necessary to set some MSRs. |
|||
24 Aug 2010, 08:56 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.