Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755811AbZJ1VFF (ORCPT ); Wed, 28 Oct 2009 17:05:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754901AbZJ1VFF (ORCPT ); Wed, 28 Oct 2009 17:05:05 -0400 Received: from eddie.linux-mips.org ([78.24.191.182]:36459 "EHLO eddie.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754787AbZJ1VFE (ORCPT ); Wed, 28 Oct 2009 17:05:04 -0400 Date: Wed, 28 Oct 2009 21:05:08 +0000 (GMT) From: "Maciej W. Rozycki" To: Andi Kleen cc: Dave Airlie , LKML , DRI Development Mailing List , Arnd Bergmann , David Miller Subject: Re: is avoiding compat ioctls possible? In-Reply-To: <20091028031904.GA7744@basil.fritz.box> Message-ID: References: <21d7e9970910271822p3751b2fdnd78e1bc3326b9b0b@mail.gmail.com> <87hbtkjkki.fsf@basil.nowhere.org> <21d7e9970910272005mbb268r7b16493a22ca275a@mail.gmail.com> <20091028031904.GA7744@basil.fritz.box> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 782 Lines: 23 On Wed, 28 Oct 2009, Andi Kleen wrote: > > I'm just amazed that compat_ioctl should be required for all new code. > > > > DrNick on irc suggested just doing: > > if (is_compat_task()) ptr &= 0x00000000FFFFFFFF; > > Such hacks often have problems on BE. And then some platforms (i.e. MIPS) require sign-extension rather than zero-extension, that is: if (is_compat_task()) ptr = ((ptr & 0xffffffff) ^ 0x80000000) - 0x80000000; if doing this explicitly (with compat stuff hardware will do the right thing automagically). Maciej -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/