From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754165Ab1HWAHl (ORCPT ); Mon, 22 Aug 2011 20:07:41 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:34880 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204Ab1HWAHi (ORCPT ); Mon, 22 Aug 2011 20:07:38 -0400 Date: Tue, 23 Aug 2011 01:07:05 +0100 From: Al Viro To: Linus Torvalds Cc: "H. Peter Anvin" , Andrew Lutomirski , Borislav Petkov , Ingo Molnar , "user-mode-linux-devel@lists.sourceforge.net" , Richard Weinberger , "linux-kernel@vger.kernel.org" , "mingo@redhat.com" Subject: Re: [uml-devel] SYSCALL, ptrace and syscall restart breakages (Re: [RFC] weird crap with vdso on uml/i386) Message-ID: <20110823000705.GX2203@ZenIV.linux.org.uk> References: <20110822095336.GB25949@kernel.org> <20110822144051.GD2946@aftab> <20110822151305.GV2203@ZenIV.linux.org.uk> <4E52B7F8.3050002@zytor.com> <4E52D280.3010107@zytor.com> <20110823000314.GW2203@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110823000314.GW2203@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 23, 2011 at 01:03:14AM +0100, Al Viro wrote: > On Mon, Aug 22, 2011 at 04:27:51PM -0700, Linus Torvalds wrote: > > > So I think the "let's fix the vdso case for sysenter" + "let's remove > > the 32-bit syscall vdso" is the right solution. If somebody has > > hardcoded syscall instructions, or generates them dynamically with > > some JIT, that's their problem. We'll continue to support it as well > > as we ever have (read: "almost nobody will ever notice"). > > Umm... Maybe, but I really wonder if it would be better to do this: > * check if %ecx is the right one for vdso32 entry. If it isn't, > act as we act now (and possibly warn). If it is, increment it by 4. > * slap 0x90, 0x90, 0xcd, 0x80 right after that syscall insn - > i.e. nop/nop/int 0x80. Followed by what we currently do there. > > Those who do syscall insn in 32bit mode outside of vdso will get > what they currently get. __kernel_vsyscall() will keep working and do > that without restart problems. And the price is comparison + branch not > taken + addition for that path... s/whine/set your "don't restart that one" flag/, even...