From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754308AbbCXPuk (ORCPT ); Tue, 24 Mar 2015 11:50:40 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38797 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752586AbbCXPub (ORCPT ); Tue, 24 Mar 2015 11:50:31 -0400 Date: Tue, 24 Mar 2015 16:50:26 +0100 From: Ingo Molnar To: Denys Vlasenko Cc: Denys Vlasenko , Andy Lutomirski , Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , X86 ML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] x86: vdso32/syscall.S: do not load __USER32_DS to %ss Message-ID: <20150324155025.GA7856@gmail.com> References: <1427129240-15543-1-git-send-email-dvlasenk@redhat.com> <20150324063430.GB26302@gmail.com> <55116FC1.1020400@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55116FC1.1020400@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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 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