From: David Daney <ddaney.cavm@gmail.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Joshua Kinard <kumba@gentoo.org>,
Linux MIPS List <linux-mips@linux-mips.org>
Subject: Re: [PATCH] MIPS: Display CPU byteorder in /proc/cpuinfo
Date: Thu, 05 Feb 2015 08:27:33 -0800 [thread overview]
Message-ID: <54D399F5.5030402@gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1501272231190.28301@eddie.linux-mips.org>
On 02/05/2015 05:46 AM, Maciej W. Rozycki wrote:
> On Tue, 27 Jan 2015, David Daney wrote:
>
>>>> It is bizarre, and perhaps almost mind bending, but that seems to be how
>>>> it is
>>>> specified. Certainly the OCTEON implementation works this way.
>>>
>>> Well, I think this observation:
>>>
>>> "2.2.2.2 Memory Operation Functions
>>>
>>> "Regardless of byte ordering (big- or little-endian), the address of a
>>> halfword, word, or doubleword is the smallest byte address of the bytes
>>> that form the object. For big-endian ordering this is the
>>> most-significant byte; for a little-endian ordering this is the
>>> least-significant byte."
>>>
>>> contradicts your claim [...]
>>
>> One can argue about the meaning of the text in the reference manual. But in
>> the end, the behavior of real processors is what we are forced to deal with.
>>
>> In the case of all existing OCTEON processors, there is no Status[RE] bit, but
>> you can switch the endianess of the entire CPU under software control. I am
>> really making statements based on how they actually work, not assertions about
>> the meaning of the specification. However, I do believe that this is what is
>> specified.
>>
>> If you have access to processors with a working Status[RE] bit, you could
>> empirically determine how they work.
>
> Well, I do actually, I have a working machine driven by an R4000
> processor. It was the original implementation of the Status.RE feature
> and therefore it can be used as the reference. I don't feel tempted to
> use my time to actually make any checks though.
>
> What I did instead, I checked the R4000 manual ...
You are still relying on your interpretation of the text, rather than
actual behavior of the device. It is not all surprising that your
interpretation of the manual hasn't changed, but it doesn't persuade me.
I am sticking to my belief that OCTEON faithfully implements the
specification with respect to the in-memory byte ordering of the various
load and store instructions. Switching the endianess of the processor
results in byte arrays being scrambled such that the low-order 3 bits
are XOR 7. This implies that aligned 64-bit loads and stores (LD, SD,
LLC, SCD) result in identical in-memory and in-register layout for
either endianess. This is quite handy when writing driver code for
devices that have 64-bit registers.
[...]
David Daney
next prev parent reply other threads:[~2015-02-05 16:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 9:02 [PATCH] MIPS: Display CPU byteorder in /proc/cpuinfo Joshua Kinard
2015-01-20 23:05 ` David Daney
2015-01-21 2:45 ` Joshua Kinard
2015-01-21 2:54 ` Joshua Kinard
2015-01-21 10:22 ` Markos Chandras
2015-01-21 11:26 ` Joshua Kinard
2015-01-21 13:49 ` Ralf Baechle
2015-01-21 18:18 ` David Daney
2015-01-21 18:38 ` Aaro Koskinen
2015-01-21 18:42 ` David Daney
2015-01-26 8:06 ` Maciej W. Rozycki
2015-01-26 13:16 ` Ralf Baechle
2015-01-26 14:53 ` Maciej W. Rozycki
2015-01-26 18:15 ` David Daney
2015-01-26 19:39 ` Maciej W. Rozycki
2015-01-26 20:13 ` David Daney
2015-01-27 16:15 ` Maciej W. Rozycki
2015-01-27 19:57 ` David Daney
2015-02-05 13:46 ` Maciej W. Rozycki
2015-02-05 15:28 ` Måns Rullgård
2015-02-05 16:12 ` Maciej W. Rozycki
2015-02-05 19:36 ` Måns Rullgård
2015-02-05 16:27 ` David Daney [this message]
2015-02-05 21:02 ` Maciej W. Rozycki
2015-01-21 6:50 ` Antony Pavlov
2015-02-12 4:16 ` Joshua Kinard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D399F5.5030402@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=kumba@gentoo.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.