From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753394AbbCXOIu (ORCPT ); Tue, 24 Mar 2015 10:08:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56348 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbbCXOIi (ORCPT ); Tue, 24 Mar 2015 10:08:38 -0400 Message-ID: <55116FC1.1020400@redhat.com> Date: Tue, 24 Mar 2015 15:08:01 +0100 From: Denys Vlasenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Ingo Molnar , Denys Vlasenko CC: 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 References: <1427129240-15543-1-git-send-email-dvlasenk@redhat.com> <20150324063430.GB26302@gmail.com> In-Reply-To: <20150324063430.GB26302@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). 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?