linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jason Baron <jbaron@akamai.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>,
	Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Subject: Re: [PATCH] ARC: ARCv2: jump label: implement jump label patching
Date: Thu, 20 Jun 2019 13:49:48 -0700	[thread overview]
Message-ID: <9192bd26-5f34-dcbf-8552-2f474866a31e@synopsys.com> (raw)
In-Reply-To: <20190620075224.GT3419@hirez.programming.kicks-ass.net>

On 6/20/19 12:52 AM, Peter Zijlstra wrote:
> 
> With everything little endian, everything seems just fine. If you load
> the first 2 byte at offset 0, you get the first 2 bytes of the
> instruction.

It has to do with the instruction encoding scheme and what part of instruction has
the major opcode/subopcode etc. For a canonical 4 byte instruction they happen to
be in the upper 16 bits (for some hardware efficiency reasons unknown to me). So
when a 2 byte insn follows a 4 byte, a 4 byte fetch already tells it what the 2nd
instruction opcode is and whether it is a 2, 4, 6 or 8 byte insn.


> 
> If OTOH your arch big endian, and you were to load the first two bytes
> at offset 0, you get the top two.
> 
> So this middle endian scheme, only seems to make sense if you're
> otherwise big endian.

Insn encoding is always middl eendina - irrespective of endianness.

> But AFAICT ARC is bi-endian and the jump-label
> patch under condsideration is explicitly !CPU_ENDIAN_BE32 -- which
> suggests the instruction stream is sensitive to the endian selection.

Nope they are not directly related. Likely the difference is when we patch the
instruction to memory it is written as data so might need some endian swap. Not
really rocket science. Perhaps it saves some testing effort etc.
Also we don't seem to have any customers interested in BE these days.

> Anyway, I was just 'surprised' at seeing middle endian mentioned,
> curiosity killed the cat and all that :-)

Curiosity may certainly kill cats, but on lkml curiosity is almost always a good
thing both for the enquirer and enquiree ;-)




  reply	other threads:[~2019-06-20 20:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 16:40 [PATCH] ARC: ARCv2: jump label: implement jump label patching Eugeniy Paltsev
2019-06-18 16:16 ` Vineet Gupta
2019-06-19  8:12   ` Peter Zijlstra
2019-06-19 23:55     ` Vineet Gupta
2019-06-20  7:01       ` Peter Zijlstra
2019-06-20 18:34         ` Eugeniy Paltsev
2019-06-20 21:30           ` Peter Zijlstra
2019-06-20 18:48         ` Vineet Gupta
2019-06-20 21:22           ` Peter Zijlstra
2019-06-21 12:09             ` Peter Zijlstra
2019-06-21 12:12               ` Peter Zijlstra
2019-06-21 18:37                 ` Nadav Amit
2019-06-20  7:15       ` Peter Zijlstra
2019-06-20  7:21       ` Peter Zijlstra
2019-06-20  7:52       ` Peter Zijlstra
2019-06-20 20:49         ` Vineet Gupta [this message]
2019-06-21 15:39           ` Alexey Brodkin
2019-06-20 18:34     ` Eugeniy Paltsev
2019-06-20 21:12       ` Peter Zijlstra
2019-06-28 22:59   ` Vineet Gupta
2019-07-03 16:15   ` Vineet Gupta
2019-07-17 15:09   ` Eugeniy Paltsev
2019-07-17 17:45     ` Vineet Gupta
2019-07-17 18:54       ` Eugeniy Paltsev

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=9192bd26-5f34-dcbf-8552-2f474866a31e@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=jbaron@akamai.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).