From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751735AbdBENPw (ORCPT ); Sun, 5 Feb 2017 08:15:52 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:43640 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751101AbdBENPu (ORCPT ); Sun, 5 Feb 2017 08:15:50 -0500 Date: Sun, 5 Feb 2017 13:15:48 +0000 (GMT) From: "Maciej W. Rozycki" To: Matt Turner cc: James Bottomley , Andrew Morton , Helge Deller , LKML , "linux-parisc@vger.kernel.org" , Michael Kerrisk , linux-api@vger.kernel.org Subject: Re: [PATCH] prctl: implement PR_GET_ENDIAN for all architectures In-Reply-To: Message-ID: References: <20170128111310.GA13389@ls3530.fritz.box> <20170131162624.5a85ec47c6ee22e5cc03c4eb@linux-foundation.org> <1485990732.2322.40.camel@HansenPartnership.com> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) 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 On Sun, 5 Feb 2017, Matt Turner wrote: > > I don't think it is other than for PPC. If you're not variable endian > > (which is only PPC to date), then you should know a priori what endian > > you are from the #defines in userspace. > > MIPS as well, but it seems strange to require the kernel to tell you > your endianness, when you can easily determine it yourself. Unless > there's something about this I don't understand. Many MIPS processors do have a reverse-endian control bit, which allows a user process to execute in the endianness opposite to the endianness the kernel runs in. The feature has been around since 1991 and the R4000 CPU, however support is unlikely to be ever added to the MIPS/Linux port, due to the complexity required for byte-swapping all the data structures passed in memory between the kernel and the userland. Does the PPC/Linux port actually implement this swapping? Maciej