Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-25 Thread Andy Lutomirski
On Wed, Mar 25, 2015 at 8:03 AM, Denys Vlasenko wrote: > On 03/25/2015 10:28 AM, Ingo Molnar wrote: >> >> * Andy Lutomirski wrote: >> >>> Now we can do a fun hack on top. On Intel, we have >>> sysenter/sysexitl and, on AMD, we have syscall/sysretl. But, if I >>> read the docs right, Intel has s

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-25 Thread Andy Lutomirski
On Wed, Mar 25, 2015 at 7:55 AM, Denys Vlasenko wrote: > On 03/24/2015 10:40 PM, Andy Lutomirski wrote: >> The syscall and sysenter stuff is IMO really nasty. Here's how I'd >> like it to work: >> >> When you do "call __kernel_vsyscall", I want the net effect to be that >> your eax, ebx, ecx, edx

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-25 Thread Denys Vlasenko
On 03/25/2015 10:28 AM, Ingo Molnar wrote: > > * Andy Lutomirski wrote: > >> Now we can do a fun hack on top. On Intel, we have >> sysenter/sysexitl and, on AMD, we have syscall/sysretl. But, if I >> read the docs right, Intel has sysretl, too. So we can ditch >> sysexit entirely, since th

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-25 Thread Denys Vlasenko
On 03/24/2015 10:40 PM, Andy Lutomirski wrote: > The syscall and sysenter stuff is IMO really nasty. Here's how I'd > like it to work: > > When you do "call __kernel_vsyscall", I want the net effect to be that > your eax, ebx, ecx, edx, esi, edi, and ebp at the time of the call end > up *verbatim

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-25 Thread Ingo Molnar
* Andy Lutomirski wrote: > Now we can do a fun hack on top. On Intel, we have > sysenter/sysexitl and, on AMD, we have syscall/sysretl. But, if I > read the docs right, Intel has sysretl, too. So we can ditch > sysexit entirely, since this mechanism no longer has any need to > keep the en

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-24 Thread Brian Gerst
On Tue, Mar 24, 2015 at 4:17 PM, Denys Vlasenko wrote: > On 03/24/2015 05:55 PM, Brian Gerst wrote: Might be nice to place a more generic description there, which registers are expected to be saved by user-space calling in here, etc. >>> >>> __kernel_vsyscall entry point has the same ABI

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-24 Thread Andy Lutomirski
On Tue, Mar 24, 2015 at 1:17 PM, Denys Vlasenko wrote: > On 03/24/2015 05:55 PM, Brian Gerst wrote: Might be nice to place a more generic description there, which registers are expected to be saved by user-space calling in here, etc. >>> >>> __kernel_vsyscall entry point has the same ABI

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-24 Thread Denys Vlasenko
On 03/24/2015 05:55 PM, Brian Gerst wrote: >>> Might be nice to place a more generic description there, which >>> registers are expected to be saved by user-space calling in here, etc. >> >> __kernel_vsyscall entry point has the same ABI in any 32-bit vDSO, >> the good old int 0x80 calling conventi

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-24 Thread Brian Gerst
On Tue, Mar 24, 2015 at 10:08 AM, Denys Vlasenko wrote: > On 03/24/2015 07:34 AM, Ingo Molnar wrote: >> >> * Denys Vlasenko wrote: >> >>> On Mon, Mar 23, 2015 at 9:38 PM, Andy Lutomirski >>> wrote: Actually, I want to remove the added comment in the code. I don't see why we should ha

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-24 Thread Ingo Molnar
* Denys Vlasenko wrote: > On 03/24/2015 07:34 AM, Ingo Molnar wrote: > > > > * Denys Vlasenko wrote: > > > >> On Mon, Mar 23, 2015 at 9:38 PM, Andy Lutomirski > >> wrote: > >>> Actually, I want to remove the added comment in the code. I don't see > >>> why we should have a specific comment

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-24 Thread Denys Vlasenko
On 03/24/2015 07:34 AM, Ingo Molnar wrote: > > * Denys Vlasenko wrote: > >> On Mon, Mar 23, 2015 at 9:38 PM, Andy Lutomirski wrote: >>> Actually, I want to remove the added comment in the code. I don't see >>> why we should have a specific comment about SS and not about, say, CS, >>> ESP, or a

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-23 Thread Ingo Molnar
* Denys Vlasenko wrote: > On Mon, Mar 23, 2015 at 9:38 PM, Andy Lutomirski wrote: > > Actually, I want to remove the added comment in the code. I don't see > > why we should have a specific comment about SS and not about, say, CS, > > ESP, or anything else. OK? > > Ok. Might be nice to plac

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-23 Thread Denys Vlasenko
On Mon, Mar 23, 2015 at 9:38 PM, Andy Lutomirski wrote: > Actually, I want to remove the added comment in the code. I don't see > why we should have a specific comment about SS and not about, say, CS, > ESP, or anything else. OK? Ok. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-23 Thread Andy Lutomirski
On Mon, Mar 23, 2015 at 12:37 PM, Andy Lutomirski wrote: > On Mon, Mar 23, 2015 at 9:47 AM, Denys Vlasenko wrote: >> This vDSO code only gets used by 64-bit kernel, >> not 32-bit. In 64-bit kernels, data segment is the same >> for 32-bit and 64-bit userspace, and SYSRET insn does load %ss >> with

Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss

2015-03-23 Thread Andy Lutomirski
On Mon, Mar 23, 2015 at 9:47 AM, Denys Vlasenko wrote: > This vDSO code only gets used by 64-bit kernel, > not 32-bit. In 64-bit kernels, data segment is the same > for 32-bit and 64-bit userspace, and SYSRET insn does load %ss > with its selector. No need to repeat it by hand. Segment loads > are