From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933370AbcINVqy (ORCPT ); Wed, 14 Sep 2016 17:46:54 -0400 Received: from mga14.intel.com ([192.55.52.115]:28406 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933168AbcINVqx (ORCPT ); Wed, 14 Sep 2016 17:46:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,335,1470726000"; d="scan'208";a="8654414" Subject: Re: [PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32. To: Kyle Huey References: <1473886902-17902-1-git-send-email-khuey@kylehuey.com> <1473886902-17902-2-git-send-email-khuey@kylehuey.com> <57D9C139.1000601@linux.intel.com> Cc: "Robert O'Callahan" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Al Viro , Anna Schumaker , David Howells , "Dmitry V. Levin" , Eric B Munson , Andy Lutomirski , Peter Zijlstra , "Michael S. Tsirkin" , Jiri Slaby , Andrey Ryabinin , Paul Gortmaker , Borislav Petkov , Dmitry Vyukov , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" From: Dave Hansen Message-ID: <57D9C54B.3010105@linux.intel.com> Date: Wed, 14 Sep 2016 14:46:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/14/2016 02:35 PM, Kyle Huey wrote: > It's not quite a plain move. To leave the existing arch_prctls only > accessible to 64 bit callers, I added the is_32 bit and the four early > returns for each existing ARCH_BLAH. These cases are now > conditionally compiled out in a 32 bit kernel, so we only have to > handle the 32 bit process on a 64 bit kernel case at runtime. I think it would make a lot of sense to do the move and the modification in two patches. Oh, and arch_prctl() really *is* 64-bit only. I didn't realize that. That would have been nice to call out in the changelog, too. It's totally non-obvious. You're going to owe some manpage updates after this too, I guess. It says: "arch_prctl() is supported only on Linux/x86-64 for 64-bit programs currently." FWIW, I don't think it would be horrible to leave the existing do_arch_prctl() code in process_64.h and call it do_64_bit_only_something_arch_prctl(), and only call in to it from the generic do_arch_prctl(). You really have one reason for all the "if (is_32)"'s and it would be nice to document why in one single place.