From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752694AbdBAWD0 (ORCPT ); Wed, 1 Feb 2017 17:03:26 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39256 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbdBAWDY (ORCPT ); Wed, 1 Feb 2017 17:03:24 -0500 Date: Wed, 1 Feb 2017 14:03:22 -0800 From: Andrew Morton To: Helge Deller Cc: linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, Michael Kerrisk , linux-api@vger.kernel.org Subject: Re: [PATCH] prctl: implement PR_GET_ENDIAN for all architectures Message-Id: <20170201140322.b469641861861caf8cf6da48@linux-foundation.org> In-Reply-To: <7c60f97a-4b63-5eff-e837-186f9a31c5a2@gmx.de> References: <20170128111310.GA13389@ls3530.fritz.box> <20170131162624.5a85ec47c6ee22e5cc03c4eb@linux-foundation.org> <7c60f97a-4b63-5eff-e837-186f9a31c5a2@gmx.de> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Feb 2017 20:47:06 +0100 Helge Deller wrote: > Hi Andrew, > > On 01.02.2017 01:26, Andrew Morton wrote: > > On Sat, 28 Jan 2017 12:13:10 +0100 Helge Deller wrote: > > > >> The prctl(PR_GET_ENDIAN) syscall was added to Kernel 2.6.18, but > >> implemented for PowerPC only. > >> This trivial patch adds support for this syscall for all other architectures. > > > > Seems reasonable. I guess. > > Heck, I did forgot but I submitted a similar patch 8 years ago: > http://www.serverphorums.com/read.php?12,51902 > > > Why is this needed? > > It's not actually needed beside the trivial reason of providing an interface > not just for one single architecture. > > After reading the discussion from 2009 again, I'm fine if > you would simply drop the patch. The decision up to you. Can't decide. I guess that moving it into the kernel will, over time, eliminate some irritating ifdefs from userspace code. The implementation itself is a bit half-assed. The put_user() in arch/powerpc/kernel/process.c:get_endian() should be moved into kernel/sys.c. So the arch code only does the "what endianness am I" function and common code copies that out to userspace.