From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbdBOFUb (ORCPT ); Wed, 15 Feb 2017 00:20:31 -0500 Received: from ozlabs.org ([103.22.144.67]:57955 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbdBOFU3 (ORCPT ); Wed, 15 Feb 2017 00:20:29 -0500 From: Michael Ellerman To: "Maciej W. Rozycki" , 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: References: <20170128111310.GA13389@ls3530.fritz.box> <20170131162624.5a85ec47c6ee22e5cc03c4eb@linux-foundation.org> <1485990732.2322.40.camel@HansenPartnership.com> User-Agent: Notmuch/0.21 (https://notmuchmail.org) Date: Wed, 15 Feb 2017 16:20:23 +1100 Message-ID: <87bmu4kp2g.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Maciej W. Rozycki" writes: > 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? No. Userspace can change endian, but it has to cope with the kernel being in the original endian. cheers