[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150324155025.GA7856@gmail.com>
Date: Tue, 24 Mar 2015 16:50:26 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Denys Vlasenko <vda.linux@...glemail.com>,
Andy Lutomirski <luto@...capital.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, Oleg Nesterov <oleg@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Alexei Starovoitov <ast@...mgrid.com>,
Will Drewry <wad@...omium.org>,
Kees Cook <keescook@...omium.org>, X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss
* Denys Vlasenko <dvlasenk@...hat.com> wrote:
> On 03/24/2015 07:34 AM, Ingo Molnar wrote:
> >
> > * Denys Vlasenko <vda.linux@...glemail.com> wrote:
> >
> >> On Mon, Mar 23, 2015 at 9:38 PM, Andy Lutomirski <luto@...capital.net> 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 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 convention:
>
> syscall# in eax,
> params in ebx/ecx/edx/esi/edi/ebp,
> all registers are preserved by the syscall.
>
> (I think we don't guarantee that all flags are preserved:
> I have a testcase where DF gets cleared).
I think the fact that the people developing this code are unsure about
exactly what gets saved/restored is justification enough to document
the circumstances a bit better.
> Each flavor of fast kernel call does necessary massaging to conform
> to the ABI. E.g. SYSCALL-based fast call clobbers ecx, so its vDSO
> saves/restores ecx on stack.
>
> Do you want a patch which adds such comment into every vDSO?
Well, maybe it's better to extend the already existing descriptions at
the syscall entry points to be a full description of all details, and
put a reference to that description into the vDSOs?
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists