Messages in this thread | | | From | Denys Vlasenko <> | Date | Sun, 29 Mar 2015 23:46:11 +0200 | Subject | Re: [PATCH] x86/asm/entry/64: better check for canonical address |
| |
On Sun, Mar 29, 2015 at 11:12 PM, Andy Lutomirski <luto@amacapital.net> wrote: > On Sun, Mar 29, 2015 at 12:36 PM, Denys Vlasenko > <vda.linux@googlemail.com> wrote: >> The instruction would need a differentiator whether returned-to code >> is 64-bit or 32-bit. >> Then it probably can use the same approach SYSRET{O,L} uses: >> with REX.W, return is to 64-bit; without it, return is to 32-bit. >> >> Interrupt return then can check pt_regs->cs and use >> IRETL_FAST if it is USER32_CS; use IRETQ_FAST if it is USER_CS >> or KERNEL_CS; otherwise, fall back to slow but "universal" IRETQ.
Hmm. In fact since we'd need such checks, then instructions can be even simpler: they don't even need to check CPL, it can be hardcoded too. We'd need four instructions then: return to 64 and to 32 bits, to CPL0 and to CPL3.
>> Do we have contacts at Intel to petition for this? :D > > Some of us do and have petitioned :)
And what did Intel say?
If there's any interest in doing this, Intel better *do* talk to us before they commit to implementing it. Their track record in implementing "fast syscalls" is nothing to write home about. SYSENTER is a design disaster; SYSRET is buggy.
| |