Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933698AbcCIS1R (ORCPT ); Wed, 9 Mar 2016 13:27:17 -0500 Received: from kanga.kvack.org ([205.233.56.17]:52781 "EHLO kanga.kvack.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254AbcCIS1L (ORCPT ); Wed, 9 Mar 2016 13:27:11 -0500 Date: Wed, 9 Mar 2016 13:27:10 -0500 From: Benjamin LaHaise To: "H. Peter Anvin" Cc: Ingo Molnar , Russell King , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86_32: add support for 64 bit __get_user() Message-ID: <20160309182710.GR12913@kvack.org> References: <20160309172225.GN12913@kvack.org> <20160309175016.GO12913@kvack.org> <56E069FA.7070700@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E069FA.7070700@zytor.com> User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1854 Lines: 42 On Wed, Mar 09, 2016 at 10:22:50AM -0800, H. Peter Anvin wrote: > On 03/09/2016 09:50 AM, Benjamin LaHaise wrote: > > On Wed, Mar 09, 2016 at 09:36:30AM -0800, H. Peter Anvin wrote: > >> On March 9, 2016 9:22:25 AM PST, Benjamin LaHaise wrote: > >>> The existing __get_user() implementation does not support fetching > >>> 64 bit values on 32 bit x86. Implement this in a way that does not > >>> generate any incorrect warnings as cautioned by Russell King. Test > >>> code available at http://www.kvack.org/~bcrl/x86_32-get_user.tar . > > ... > >> Weird. I could swear we had already fixed this a few years ago. > > > > That surprised me as well, but Russell raised the fact that the approaches > > previously tried on 32 bit architectures had caused various incorrect > > compiler warnings for certain obscure cases -- see the code in test_module.c > > in that URL that Russell provided to demonstrate the problem across all the > > corner cases. > > Oh, I see... I implemented it for put but not get... weird. You may > want to look at the __inttype() macro defined earlier in this file; it > might be useful. Ah, interesting. I'll look at that. > I presume you have already seen: > > >> fs/select.c:710: Error: operand type mismatch for `movq' > >> fs/select.c:714: Error: incorrect register `%cx' used with `q' suffix > fs/select.c:711: Error: operand type mismatch for `movq' > >> fs/select.c:715: Error: incorrect register `%si' used with `q' suffix > -- > fs/aio.c: Assembler messages: > >> fs/aio.c:1606: Error: operand type mismatch for `movq' > >> fs/aio.c:1610: Error: incorrect register `%si' used with `q' suffix > > ... which implies it used 16-bit registers for 64-bit operations when > compiling for 64 bits. Yup, will respin shortly. -ben -- "Thought is the essence of where you are now."